@fusion.dev/helix-graph 0.223.0 → 0.224.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { HelixGraphPanEvent, HelixGraphPartChangeEvent, HelixGraphSignalEvent, HelixGraphZoomEvent, isRtl, motionPaused, onMotionChange, reportRuntime, watchTheme, } from '@fusion.dev/helix-core';
1
+ import { isRtl, motionPaused, onMotionChange, reportRuntime, watchTheme, } from '@fusion.dev/helix-core';
2
2
  import { arrangeByGroup, hubsOf } from './arrange.js';
3
3
  import { diffGraph, isEmpty, linkKey, } from './diff.js';
4
4
  import { graphColorsFrom, looksOf, toneColor, } from './looks.js';
@@ -349,10 +349,10 @@ export const connectGraph = (frame, driver, options = {}) => {
349
349
  graph.moved?.();
350
350
  }
351
351
  };
352
- frame.addEventListener(HelixGraphPartChangeEvent.eventName, handlePartChange);
353
- frame.addEventListener(HelixGraphSignalEvent.eventName, handleSignal);
354
- frame.addEventListener(HelixGraphPanEvent.eventName, handlePan);
355
- frame.addEventListener(HelixGraphZoomEvent.eventName, handleZoom);
352
+ frame.addEventListener('helix-graph-part-change', handlePartChange);
353
+ frame.addEventListener('helix-graph-signal', handleSignal);
354
+ frame.addEventListener('helix-graph-pan', handlePan);
355
+ frame.addEventListener('helix-graph-zoom', handleZoom);
356
356
  const stopPress = driver.onPress?.((id) => {
357
357
  if (id === undefined) {
358
358
  pressed = undefined;
@@ -389,10 +389,10 @@ export const connectGraph = (frame, driver, options = {}) => {
389
389
  stopPaused();
390
390
  stopPress?.();
391
391
  stopTheme();
392
- frame.removeEventListener(HelixGraphPartChangeEvent.eventName, handlePartChange);
393
- frame.removeEventListener(HelixGraphSignalEvent.eventName, handleSignal);
394
- frame.removeEventListener(HelixGraphPanEvent.eventName, handlePan);
395
- frame.removeEventListener(HelixGraphZoomEvent.eventName, handleZoom);
392
+ frame.removeEventListener('helix-graph-part-change', handlePartChange);
393
+ frame.removeEventListener('helix-graph-signal', handleSignal);
394
+ frame.removeEventListener('helix-graph-pan', handlePan);
395
+ frame.removeEventListener('helix-graph-zoom', handleZoom);
396
396
  if (focusable) {
397
397
  if (tabIndex === null) {
398
398
  focusable.removeAttribute('tabindex');
@@ -67,8 +67,12 @@ export const sigmaDriver = (sigma, options = {}) => {
67
67
  const container = sigma.getContainer();
68
68
  const camera = sigma.getCamera();
69
69
  const before = new Map(SETTINGS.map((name) => [name, sigma.getSetting(name)]));
70
+ const boxed = () => container.isConnected && container.offsetWidth > 0 && container.offsetHeight > 0;
70
71
  const sized = typeof ResizeObserver === 'function'
71
72
  ? new ResizeObserver(() => {
73
+ if (!boxed()) {
74
+ return;
75
+ }
72
76
  sigma.resize(true);
73
77
  sigma.refresh();
74
78
  })
@@ -323,6 +327,7 @@ export const sigmaDriver = (sigma, options = {}) => {
323
327
  signals.signal(from, to, colors, animate);
324
328
  },
325
329
  stop: () => {
330
+ sized?.disconnect();
326
331
  sigma.off('afterRender', redraw);
327
332
  camera.off('updated', rezoomed);
328
333
  names.stop();
@@ -337,9 +342,10 @@ export const sigmaDriver = (sigma, options = {}) => {
337
342
  for (const [name, value] of before) {
338
343
  sigma.setSetting(name, value !== false);
339
344
  }
340
- sized?.disconnect();
341
345
  held.stop();
342
- sigma.refresh();
346
+ if (boxed()) {
347
+ sigma.refresh();
348
+ }
343
349
  },
344
350
  update: (changes, animate) => {
345
351
  for (const id of changes.removeNodes) {
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@fusion.dev/helix-graph",
3
3
  "description": "Connects the Helix Graph frame to a graph renderer: Sigma.js, cosmos.gl, three.js, or a driver of your own.",
4
- "version": "0.223.0",
4
+ "version": "0.224.0",
5
5
  "license": "MIT",
6
- "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
6
+ "author": "Fusion Development Group",
7
7
  "repository": {
8
8
  "directory": "helix/graph",
9
9
  "type": "git",
@@ -60,24 +60,24 @@
60
60
  },
61
61
  "bugs": "https://github.com/project-fusion/fusion/issues",
62
62
  "dependencies": {
63
- "@fusion.dev/helix-core": "0.223.0"
63
+ "@fusion.dev/helix-core": "0.224.0"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@cosmos.gl/graph": "^3.5.1",
67
- "@fusion.dev/helix-headless": "0.223.0",
68
- "@fusion.dev/helix-testing": "0.223.0",
67
+ "@fusion.dev/helix-headless": "0.224.0",
68
+ "@fusion.dev/helix-testing": "0.224.0",
69
69
  "@luma.gl/core": "~9.3.6",
70
70
  "@luma.gl/engine": "~9.3.6",
71
71
  "@luma.gl/shadertools": "~9.3.6",
72
72
  "@luma.gl/webgl": "~9.3.6",
73
- "@types/bun": "^1.4.3",
73
+ "@types/bun": "^1.4.4",
74
74
  "@types/three": "^0.186.0",
75
75
  "d3-force-3d": "^3.0.6",
76
76
  "graphology": "^0.26.0",
77
77
  "graphology-layout-forceatlas2": "^0.10.1",
78
78
  "graphology-types": "^0.24.8",
79
79
  "meshoptimizer": "^1.3.0",
80
- "sigma": "^4.0.0",
80
+ "sigma": "^4.0.4",
81
81
  "three": "^0.186.1"
82
82
  },
83
83
  "homepage": "https://fusion.dev",
@@ -94,7 +94,7 @@
94
94
  "peerDependencies": {
95
95
  "@cosmos.gl/graph": "^3.4.0",
96
96
  "d3-force-3d": "^3.0.0",
97
- "sigma": "^4.0.0",
97
+ "sigma": "^4.0.4",
98
98
  "three": ">=0.160.0 <0.200.0"
99
99
  },
100
100
  "peerDependenciesMeta": {
@@ -112,6 +112,6 @@
112
112
  }
113
113
  },
114
114
  "publishConfig": {
115
- "access": "restricted"
115
+ "access": "public"
116
116
  }
117
117
  }