@fusion.dev/helix-graph 0.212.1 → 0.213.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.
@@ -458,9 +458,14 @@ export const isometricDriver = (container, options = {}) => {
458
458
  svg.addEventListener('pointerup', onUp);
459
459
  svg.addEventListener('pointerleave', onLeave);
460
460
  svg.addEventListener('wheel', onWheel, { passive: false });
461
- const resized = () => {
461
+ const reframe = () => {
462
462
  const next = sizeOfBox();
463
463
  const before = measured;
464
+ if (before &&
465
+ Math.abs(next.width - before.width) < 1 &&
466
+ Math.abs(next.height - before.height) < 1) {
467
+ return;
468
+ }
464
469
  measured = next;
465
470
  if (framed) {
466
471
  fitAll(false);
@@ -472,6 +477,16 @@ export const isometricDriver = (container, options = {}) => {
472
477
  }
473
478
  show();
474
479
  };
480
+ let resizing = 0;
481
+ const resized = () => {
482
+ if (resizing !== 0) {
483
+ return;
484
+ }
485
+ resizing = requestAnimationFrame(() => {
486
+ resizing = 0;
487
+ reframe();
488
+ });
489
+ };
475
490
  const sized = typeof ResizeObserver === 'function' ? new ResizeObserver(resized) : undefined;
476
491
  sized?.observe(svg);
477
492
  const set = (list) => {
@@ -554,6 +569,7 @@ export const isometricDriver = (container, options = {}) => {
554
569
  stop: () => {
555
570
  cancelAnimationFrame(gliding);
556
571
  cancelAnimationFrame(turning);
572
+ cancelAnimationFrame(resizing);
557
573
  sized?.disconnect();
558
574
  held.stop();
559
575
  svg.removeEventListener('pointerdown', onDown);
package/package.json CHANGED
@@ -1,7 +1,7 @@
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.212.1",
4
+ "version": "0.213.0",
5
5
  "license": "MIT",
6
6
  "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
7
7
  "repository": {
@@ -60,12 +60,12 @@
60
60
  },
61
61
  "bugs": "https://github.com/project-fusion/fusion/issues",
62
62
  "dependencies": {
63
- "@fusion.dev/helix-core": "0.212.1"
63
+ "@fusion.dev/helix-core": "0.213.0"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@cosmos.gl/graph": "^3.4.2",
67
- "@fusion.dev/helix-headless": "0.212.1",
68
- "@fusion.dev/helix-testing": "0.212.1",
67
+ "@fusion.dev/helix-headless": "0.213.0",
68
+ "@fusion.dev/helix-testing": "0.213.0",
69
69
  "@types/bun": "^1.4.2",
70
70
  "@types/three": "^0.186.0",
71
71
  "d3-force-3d": "^3.0.6",