From 1e89b4efefb554c57742b56959a58943dbb7917f Mon Sep 17 00:00:00 2001 From: salman Date: Thu, 12 Jan 2023 11:14:57 +0100 Subject: [PATCH] Code reorganization and fix regresion. --- TrimSP.html | 10 ++-------- TrimSPelec.js | 10 +++++++++- myplots.js | 4 ---- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/TrimSP.html b/TrimSP.html index 94e807a..f3f3f0f 100644 --- a/TrimSP.html +++ b/TrimSP.html @@ -1,18 +1,12 @@ - + - + - Trim.SP diff --git a/TrimSPelec.js b/TrimSPelec.js index 62dbc05..9b1aeae 100644 --- a/TrimSPelec.js +++ b/TrimSPelec.js @@ -1,4 +1,12 @@ -// This file contains function that are Electron/Node specific +// This file contains function that are Electron/Node.JS specific + +// Load required packages +const Plotly = require('plotly.js-dist'); +const ipcRenderer = require('electron').ipcRenderer; +const fs = require('fs'); +const exec = require('child_process').execSync; +const remote = require('electron').remote; + function getFiles(dir, filelist){ fileList = []; var files = fs.readdirSync(dir); diff --git a/myplots.js b/myplots.js index 8dea766..a0781dd 100644 --- a/myplots.js +++ b/myplots.js @@ -1,7 +1,3 @@ -if (!amIWeb()) { - const Plotly = require('plotly.js-dist'); -} - function Plot_xy(plotdiv,x,y,labels){ // Plot (x,y) scatter with x/ylabels // place generated plot in div named plotdiv