3d-force-graph 1.73.6 → 1.74.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.
Files changed (38) hide show
  1. package/README.md +2 -3
  2. package/dist/3d-force-graph.d.ts +8 -5
  3. package/dist/3d-force-graph.js +25528 -38304
  4. package/dist/3d-force-graph.js.map +1 -1
  5. package/dist/3d-force-graph.min.js +3 -3
  6. package/example/async-load/index.html +1 -2
  7. package/example/auto-colored/index.html +1 -2
  8. package/example/basic/index.html +1 -2
  9. package/example/bloom-effect/index.html +1 -2
  10. package/example/camera-auto-orbit/index.html +1 -2
  11. package/example/click-to-focus/index.html +1 -2
  12. package/example/collision-detection/index.html +1 -2
  13. package/example/controls-fly/index.html +1 -2
  14. package/example/controls-orbit/index.html +1 -2
  15. package/example/curved-links/index.html +1 -2
  16. package/example/custom-node-geometry/index.html +1 -2
  17. package/example/dag-yarn/index.html +2 -3
  18. package/example/directional-links-arrows/index.html +1 -2
  19. package/example/directional-links-particles/index.html +1 -2
  20. package/example/dynamic/index.html +1 -1
  21. package/example/emit-particles/index.html +1 -2
  22. package/example/expandable-nodes/index.html +1 -1
  23. package/example/fit-to-canvas/index.html +1 -2
  24. package/example/fix-dragged-nodes/index.html +1 -2
  25. package/example/gradient-links/index.html +1 -2
  26. package/example/highlight/index.html +1 -2
  27. package/example/html-nodes/index.html +1 -2
  28. package/example/img-nodes/index.html +1 -2
  29. package/example/large-graph/index.html +1 -1
  30. package/example/manipulate-link-force/index.html +1 -2
  31. package/example/multi-selection/index.html +1 -2
  32. package/example/pause-resume/index.html +1 -2
  33. package/example/responsive/index.html +1 -2
  34. package/example/scene/index.html +1 -2
  35. package/example/text-links/index.html +1 -2
  36. package/example/text-nodes/index.html +1 -2
  37. package/example/tree/index.html +2 -3
  38. package/package.json +6 -6
package/README.md CHANGED
@@ -65,8 +65,7 @@ or using a *script* tag
65
65
  then
66
66
 
67
67
  ```js
68
- const myGraph = ForceGraph3D();
69
- myGraph(<myDOMElement>)
68
+ const myGraph = new ForceGraph3D(<myDOMElement>)
70
69
  .graphData(<myData>);
71
70
  ```
72
71
 
@@ -74,7 +73,7 @@ myGraph(<myDOMElement>)
74
73
 
75
74
  ### Initialisation
76
75
  ```js
77
- ForceGraph3d({ configOptions })(<domElement>)
76
+ new ForceGraph3d(<domElement>, { configOptions })
78
77
  ```
79
78
 
80
79
  | Config options | Description | Default |
@@ -17,8 +17,8 @@ type Coords = { x: number; y: number; z: number; };
17
17
  type ExcludedInnerProps = 'onLoading' | 'onFinishLoading' | 'onUpdate' | 'onFinishUpdate' | 'tickFrame' | 'd3AlphaTarget' | 'resetCountdown';
18
18
 
19
19
  interface ForceGraph3DGenericInstance<ChainableInstance, N extends NodeObject = NodeObject, L extends LinkObject<N> = LinkObject<N>>
20
- extends Omit<ThreeForceGraphGeneric<ChainableInstance, N, L>, ExcludedInnerProps> {
21
- (element: HTMLElement): ChainableInstance;
20
+ extends Omit<ThreeForceGraphGeneric<ChainableInstance, N, L>, ExcludedInnerProps> {
21
+
22
22
  _destructor(): void;
23
23
 
24
24
  // Container layout
@@ -76,8 +76,11 @@ interface ForceGraph3DGenericInstance<ChainableInstance, N extends NodeObject =
76
76
  screen2GraphCoords(screenX: number, screenY: number, distance: number): Coords;
77
77
  }
78
78
 
79
- type ForceGraph3DInstance<NodeType = NodeObject, LinkType = LinkObject<NodeType>> = ForceGraph3DGenericInstance<ForceGraph3DInstance<NodeType, LinkType>, NodeType, LinkType>;
79
+ type ForceGraph3DInstance<NodeType extends NodeObject = NodeObject, LinkType extends LinkObject<NodeType> = LinkObject<NodeType>>
80
+ = ForceGraph3DGenericInstance<ForceGraph3DInstance<NodeType, LinkType>, NodeType, LinkType>;
80
81
 
81
- declare function ForceGraph3D<NodeType = NodeObject, LinkType = LinkObject<NodeType>>(configOptions?: ConfigOptions): ForceGraph3DInstance<NodeType, LinkType>;
82
+ interface ForceGraph3D<NodeType extends NodeObject = NodeObject, LinkType extends LinkObject<NodeType> = LinkObject<NodeType>> {
83
+ new(element: HTMLElement, configOptions?: ConfigOptions): ForceGraph3DInstance<NodeType, LinkType>;
84
+ }
82
85
 
83
- export { type ConfigOptions, type ForceGraph3DGenericInstance, type ForceGraph3DInstance, ForceGraph3D as default };
86
+ export type { ConfigOptions, ForceGraph3DGenericInstance, ForceGraph3DInstance, ForceGraph3D as default };