From 90bdfebe95bb08fa5fa902ef04472e59e6b1d467 Mon Sep 17 00:00:00 2001 From: jcf94 Date: Tue, 26 Feb 2019 14:36:07 +0800 Subject: [PATCH] Bug Fix for Memory Limit --- main.js | 10 +++- package.json | 2 +- src/index.html | 3 +- src/script/graph.js | 117 ++++++++++++++++++++++++++++--------------- src/script/worker.js | 10 ++-- 5 files changed, 93 insertions(+), 49 deletions(-) diff --git a/main.js b/main.js index 592efdb..7d868fc 100644 --- a/main.js +++ b/main.js @@ -3,7 +3,6 @@ const electron = require('electron') const app = electron.app // Module to create native browser window. const BrowserWindow = electron.BrowserWindow -const Menu = electron.Menu; const ipcMain = electron.ipcMain; const path = require('path'); @@ -71,7 +70,14 @@ ipcMain.on('proxy_create_new_dot', (event, message) => { function createWindow() { // Create the browser window. - mainWindow = new BrowserWindow({width: mainWindow_width, height: mainWindow_height, icon: 'src/img/ico.png'}); + mainWindow = new BrowserWindow({ + width: mainWindow_width, + height: mainWindow_height, + icon: 'src/img/ico.png', + webPreferences: { + nodeIntegrationInWorker: true + } + }); // and load the index.html of the app. mainWindow.loadURL(url.format({ diff --git a/package.json b/package.json index 3cbc6bb..85c9ebb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vizgraph", - "version": "0.0.7", + "version": "0.0.8", "description": "A simple tool for Using Graphviz.", "main": "main.js", "scripts": { diff --git a/src/index.html b/src/index.html index 8980473..cce3822 100644 --- a/src/index.html +++ b/src/index.html @@ -28,7 +28,6 @@ Format: