@opendata-ai/openchart-vanilla 8.9.1 → 9.0.0-rc.2

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.
Files changed (51) hide show
  1. package/README.md +4 -4
  2. package/dist/{chunk-REH5UQCL.js → chunk-46E3QB6O.js} +6 -20
  3. package/dist/chunk-46E3QB6O.js.map +1 -0
  4. package/dist/{chunk-APMUBW72.js → chunk-5OQZRGUL.js} +1565 -294
  5. package/dist/chunk-5OQZRGUL.js.map +1 -0
  6. package/dist/{chunk-GX6BWMJD.js → chunk-5ZLSMZRM.js} +466 -330
  7. package/dist/chunk-5ZLSMZRM.js.map +1 -0
  8. package/dist/{chunk-SDJHUELU.js → chunk-A5C4VCUO.js} +26 -45
  9. package/dist/chunk-A5C4VCUO.js.map +1 -0
  10. package/dist/{chunk-MGFXAROR.js → chunk-CMIJA63X.js} +5 -3
  11. package/dist/chunk-CMIJA63X.js.map +1 -0
  12. package/dist/chunk-FFP5GXIP.js +45 -0
  13. package/dist/chunk-FFP5GXIP.js.map +1 -0
  14. package/dist/{chunk-Q7YEEF2X.js → chunk-LDSPJFOU.js} +16 -50
  15. package/dist/chunk-LDSPJFOU.js.map +1 -0
  16. package/dist/chunk-NLKQ5AOA.js +448 -0
  17. package/dist/chunk-NLKQ5AOA.js.map +1 -0
  18. package/dist/{chunk-R5TZHNTG.js → chunk-RBXIZJPE.js} +17 -5
  19. package/dist/chunk-RBXIZJPE.js.map +1 -0
  20. package/dist/{chunk-CCRFYGHU.js → chunk-RY5JEGFM.js} +2368 -2339
  21. package/dist/chunk-RY5JEGFM.js.map +1 -0
  22. package/dist/export-gif.d.ts +2 -2
  23. package/dist/export-gif.js +4 -3
  24. package/dist/graph-3d/index.d.ts +28 -1
  25. package/dist/graph-3d/index.js +26 -12
  26. package/dist/graph-3d/index.js.map +1 -1
  27. package/dist/index.d.ts +155 -29
  28. package/dist/index.js +1774 -186
  29. package/dist/index.js.map +1 -1
  30. package/dist/{mount-TEjIdF0m.d.ts → mount-types-DeUCa2hy.d.ts} +34 -21
  31. package/dist/{renderer-registry-Cng76n8F.d.ts → renderer-registry-Bu22Roek.d.ts} +5 -22
  32. package/dist/simulation-worker.js +27 -26
  33. package/dist/static.d.ts +4 -2
  34. package/dist/static.js +34 -10
  35. package/dist/static.js.map +1 -1
  36. package/dist/story/index.d.ts +8 -6
  37. package/dist/story/index.js +15 -12
  38. package/dist/story/index.js.map +1 -1
  39. package/dist/styles.css +1 -1
  40. package/dist/styles.css.map +1 -1
  41. package/package.json +3 -3
  42. package/dist/chunk-APMUBW72.js.map +0 -1
  43. package/dist/chunk-CCRFYGHU.js.map +0 -1
  44. package/dist/chunk-GX6BWMJD.js.map +0 -1
  45. package/dist/chunk-MGFXAROR.js.map +0 -1
  46. package/dist/chunk-Q7YEEF2X.js.map +0 -1
  47. package/dist/chunk-R5TZHNTG.js.map +0 -1
  48. package/dist/chunk-REH5UQCL.js.map +0 -1
  49. package/dist/chunk-SDJHUELU.js.map +0 -1
  50. package/dist/chunk-UC4IHEUO.js +0 -73
  51. package/dist/chunk-UC4IHEUO.js.map +0 -1
@@ -68,9 +68,9 @@ interface AnimatedTarget {
68
68
  * `linear()` interpolates piecewise-linearly between evenly-spaced samples, so
69
69
  * we reproduce it exactly rather than approximating with a cubic-bezier.
70
70
  */
71
- declare const EASE_SMOOTH_SAMPLES: number[];
71
+ declare const EASE_SMOOTH_SAMPLES: readonly number[];
72
72
  /** Piecewise-linear evaluation of a CSS linear() sample array at t in [0,1]. */
73
- declare function evalLinearSamples(samples: number[], t: number): number;
73
+ declare function evalLinearSamples(samples: readonly number[], t: number): number;
74
74
  /**
75
75
  * Classify an animated element (identified by `data-animation-index`) into the
76
76
  * keyframe it plays, and return the element that should receive inline styles.
@@ -6,9 +6,10 @@ import {
6
6
  exportGIF,
7
7
  isModuleNotFound,
8
8
  resolveRepeat
9
- } from "./chunk-MGFXAROR.js";
10
- import "./chunk-R5TZHNTG.js";
11
- import "./chunk-SDJHUELU.js";
9
+ } from "./chunk-CMIJA63X.js";
10
+ import "./chunk-RBXIZJPE.js";
11
+ import "./chunk-A5C4VCUO.js";
12
+ import "./chunk-FFP5GXIP.js";
12
13
  export {
13
14
  EASE_SMOOTH_SAMPLES,
14
15
  applyFrameState,
@@ -1,5 +1,5 @@
1
1
  import { GraphSpec } from '@opendata-ai/openchart-core';
2
- import { a as GraphCamera, b as GraphFlyTarget, g as GraphRendererContext, d as GraphInstance, f as GraphMountOptions } from '../renderer-registry-Cng76n8F.js';
2
+ import { c as GraphCamera, d as GraphFlyTarget, g as GraphRendererContext, a as GraphInstance, G as GraphMountOptions } from '../renderer-registry-Bu22Roek.js';
3
3
  import '@opendata-ai/openchart-engine';
4
4
  import '@floating-ui/dom';
5
5
 
@@ -180,6 +180,33 @@ declare function resolveVisibleLabels(nodes: LabelCandidate[], forced: Set<strin
180
180
  /** Above this edge count `edgeWidth` maps to opacity steps, not cylinder radius. */
181
181
  declare const LINK_WIDTH_MAX_EDGES = 2000;
182
182
 
183
+ /**
184
+ * The 3D graph renderer: a `GraphInstance` backed by `3d-force-graph`.
185
+ *
186
+ * Registered against `dimensions: 3` by `./index`. `createGraph()` builds the
187
+ * shared shell (wrapper, chrome, legend slot, tooltip manager, resize wiring)
188
+ * and hands it here; this module owns the WebGL scene, the d3-force-3d
189
+ * simulation the library drives, the per-node and per-link three.js objects,
190
+ * emphasis state, the label budget, tooltip anchoring, and disposal.
191
+ *
192
+ * Three library facts shape almost everything below and are easy to get wrong:
193
+ *
194
+ * 1. `nodeOpacity` and `linkOpacity` are GLOBAL numbers, not accessors. Every
195
+ * per-object opacity (dim, highlight, entrance, search) therefore needs a
196
+ * custom object with its own material. See `nodes.ts` / `links.ts`.
197
+ * 2. `refresh()` rebuilds every node and link object. It must never run on
198
+ * hover; the hover path only writes `material.opacity`.
199
+ * 3. `rendererConfig` and `controlType` are CONSTRUCTOR options, not chained
200
+ * setters.
201
+ *
202
+ * Differences from 2D that are deliberate and documented in RFC 27: no
203
+ * keyboard navigation, no node drag, no cursor repulsion or springy drag, and
204
+ * no wall-clock warmup budget. A structural `update()` DOES animate like 2D
205
+ * (enter fade, exit ghosts, churn-scaled local reheat), but it reaches the
206
+ * impulse indirectly: `graphData()` forces alpha to 1 and the library exposes no
207
+ * alpha setter, so `beginUpdateReheat` damps it from outside instead.
208
+ */
209
+
183
210
  /**
184
211
  * The camera distance that `getCamera().k === 1` refers to. 3D has no zoom
185
212
  * scalar, so `k` is expressed as `FIT_DISTANCE / cameraDistance`: a `k` of 2 is
@@ -7,6 +7,7 @@ import {
7
7
  createGraphLegend,
8
8
  diffGraphUpdate,
9
9
  entranceOrder,
10
+ getContainerDimensions,
10
11
  layerHoverFocus,
11
12
  popAlpha,
12
13
  popScale,
@@ -14,20 +15,23 @@ import {
14
15
  reheatAlpha,
15
16
  resolveHighlightTarget,
16
17
  seedNodePositions
17
- } from "../chunk-GX6BWMJD.js";
18
+ } from "../chunk-5ZLSMZRM.js";
18
19
  import {
19
20
  AnimationScheduler,
20
21
  createTween,
21
- linear,
22
22
  prefersReducedMotion,
23
23
  resolveEase
24
- } from "../chunk-REH5UQCL.js";
24
+ } from "../chunk-46E3QB6O.js";
25
25
  import {
26
- resolvedSurface,
27
- warnDeprecated
28
- } from "../chunk-UC4IHEUO.js";
26
+ linear,
27
+ resolvedSurface
28
+ } from "../chunk-NLKQ5AOA.js";
29
+ import "../chunk-FFP5GXIP.js";
29
30
 
30
31
  // src/graph-3d/mount.ts
32
+ import {
33
+ computeChrome
34
+ } from "@opendata-ai/openchart-core";
31
35
  import { buildEdgeTooltip } from "@opendata-ai/openchart-engine";
32
36
  import ForceGraph3D from "3d-force-graph";
33
37
  import { Raycaster, Vector2 } from "three";
@@ -1385,6 +1389,21 @@ function createGraph3DRenderer(ctx) {
1385
1389
  const renderer = graph.renderer();
1386
1390
  const dpr = Math.min(MAX_PIXEL_RATIO, globalThis.devicePixelRatio || 1);
1387
1391
  if (renderer?.getPixelRatio?.() !== dpr) renderer?.setPixelRatio?.(dpr);
1392
+ const dimensions = getContainerDimensions(shell.container);
1393
+ compilation = {
1394
+ ...compilation,
1395
+ dimensions,
1396
+ chrome: computeChrome(
1397
+ currentSpec.chrome,
1398
+ compilation.theme,
1399
+ dimensions.width,
1400
+ void 0,
1401
+ "full",
1402
+ void 0,
1403
+ compilation.watermark
1404
+ )
1405
+ };
1406
+ shell.renderChrome(compilation);
1388
1407
  const { width: width2, height: height2 } = shell.getSize();
1389
1408
  graph.width(width2).height(height2);
1390
1409
  shell.syncChromeInset();
@@ -1422,6 +1441,7 @@ function createGraph3DRenderer(ctx) {
1422
1441
  );
1423
1442
  rebuildDerived();
1424
1443
  shell.renderChrome(compilation);
1444
+ graph.width(shell.getSize().width).height(shell.getSize().height);
1425
1445
  renderLegend();
1426
1446
  refreshTransientHighlight();
1427
1447
  recomputeHighlight();
@@ -1688,12 +1708,6 @@ function createGraph3DRenderer(ctx) {
1688
1708
  const disconnectResize = shell.observeResize(() => doResize());
1689
1709
  return {
1690
1710
  update,
1691
- // `update()` already routes an id-set-preserving change through the
1692
- // material-mutation path, which never touches `graphData()`.
1693
- updateVisuals: (spec) => {
1694
- warnDeprecated("updateVisuals is deprecated; use update.");
1695
- update(spec);
1696
- },
1697
1711
  search,
1698
1712
  clearSearch,
1699
1713
  zoomToFit,