@opendata-ai/openchart-core 8.4.1 → 8.5.1

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.
package/dist/index.d.ts CHANGED
@@ -4841,6 +4841,44 @@ interface GraphSpec {
4841
4841
  };
4842
4842
  /** Whether to show the OpenData watermark. Defaults to true. */
4843
4843
  watermark?: boolean;
4844
+ /**
4845
+ * Render in two or three dimensions. Defaults to `2` (the Canvas renderer).
4846
+ *
4847
+ * `3` renders with WebGL. The 3D renderer ships on its own subpath so
4848
+ * three.js never enters the default bundle, and it must be imported before
4849
+ * the graph mounts:
4850
+ *
4851
+ * ```ts
4852
+ * import '@opendata-ai/openchart-vanilla/graph-3d';
4853
+ * ```
4854
+ *
4855
+ * (Framework hosts import their own package's mirror of the subpath:
4856
+ * `@opendata-ai/openchart-react/graph-3d`,
4857
+ * `@opendata-ai/openchart-vue/graph-3d`,
4858
+ * `@opendata-ai/openchart-svelte/graph-3d`.) Mounting a `dimensions: 3` spec
4859
+ * without that import throws.
4860
+ *
4861
+ * 3D differs from 2D in these ways:
4862
+ * - Labels use a fixed budget re-ranked by camera distance, not the 2D
4863
+ * priority declutter, so distant labels drop out.
4864
+ * - The simulation runs on the main thread (no worker, no wall-clock warmup
4865
+ * budget).
4866
+ * - Keyboard navigation, SVG export, `interaction.cursorRepulsion` and
4867
+ * `interaction.springyDrag` are unsupported. Each warns and is ignored.
4868
+ * (`layout.type` of `'radial'` or `'hierarchical'` is rejected by spec
4869
+ * validation in both dimensions, so it never reaches either renderer.)
4870
+ * - `getCamera()` returns a pose rather than a zoom transform: `x`/`y` are
4871
+ * the look-at point in world units, alongside `position` and `target`. In
4872
+ * 2D they are the zoom transform's translate in pixels. `onCameraChange`
4873
+ * carries the same payload, so persisted camera state has to be keyed on
4874
+ * the dimension it came from. Both are typed `GraphCamera` (vanilla), whose
4875
+ * `position`/`target` are optional because only 3D sets them.
4876
+ * - A structural `update()` reheats the whole layout globally, so settled
4877
+ * nodes drift; 2D applies a local impulse instead.
4878
+ * - Above 2000 nodes the spec warns and falls back to 2D.
4879
+ * - `nodeOverrides[*].stroke` and `strokeWidth` are ignored (no ring).
4880
+ */
4881
+ dimensions?: 2 | 3;
4844
4882
  }
4845
4883
  /**
4846
4884
  * Resolution strategy for shared resources across layers.