jupyrdf / ipyelk

Jupyter Widgets for interactive graphs powered by the Eclipse Layout Kernel (ELK)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Signular Elk

dfreeman06 opened this issue · comments

Example attempt below:

+const Theelk = new ELK.default({
+  workerFactory: () => {
+    ELK_DEBUG && console.warn('ELK Worker created');
+    return new (Worker as any)();
+  }
+} as any);
+
 export class ELKModel extends DOMWidgetModel {
   static model_name = 'ELKModel';
 
@@ -91,24 +98,25 @@ export class ELKModel extends DOMWidgetModel {
   }
 
   protected cullElk() {
-    const elk: any = this._elk;
-    if (elk != null) {
-      ELK_DEBUG && console.warn('ELK worker culling for', this.cid);
-      elk.worker?.terminate();
-    } else {
-      ELK_DEBUG && console.warn('ELK was already culled for', this.cid);
-    }
-    this._elk = null;
+    // const elk: any = this._elk;
+    // if (elk != null) {
+    //   ELK_DEBUG && console.warn('ELK worker culling for', this.cid);
+    //   elk.worker?.terminate();
+    // } else {
+    //   ELK_DEBUG && console.warn('ELK was already culled for', this.cid);
+    // }
+    // this._elk = null;
   }
 
   protected ensureElk() {
     if (this._elk == null) {
-      this._elk = new ELK.default({
-        workerFactory: () => {
-          ELK_DEBUG && console.warn('ELK Worker created');
-          return new (Worker as any)();
-        }
-      } as any);
+      this._elk = Theelk;
+      // this._elk = new ELK.default({
+      //   workerFactory: () => {
+      //     ELK_DEBUG && console.warn('ELK Worker created');
+      //     return new (Worker as any)();
+      //   }