vortx-gl 1.0.2 → 1.0.27

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 (55) hide show
  1. package/README.md +485 -35
  2. package/dist/components/DatasetSelector.d.ts +19 -0
  3. package/dist/components/FPSMonitor.d.ts +2 -0
  4. package/dist/components/GraphCanvas.d.ts +109 -0
  5. package/dist/components/LayoutControls.d.ts +18 -0
  6. package/dist/components/LucideIcon.d.ts +10 -0
  7. package/dist/components/PropertyPanel.d.ts +28 -0
  8. package/dist/components/RadialMenu.d.ts +33 -0
  9. package/dist/components/SearchBar.d.ts +12 -0
  10. package/dist/components/ViewControls.d.ts +18 -0
  11. package/dist/engine/Minimap.d.ts +25 -0
  12. package/dist/engine/api/adapter.d.ts +35 -0
  13. package/dist/engine/api/index.d.ts +2 -0
  14. package/dist/engine/api/types.d.ts +86 -0
  15. package/dist/engine/config.d.ts +117 -0
  16. package/dist/engine/core/Camera.d.ts +34 -0
  17. package/dist/engine/core/ComboStore.d.ts +23 -0
  18. package/dist/engine/core/EdgeStore.d.ts +37 -0
  19. package/dist/engine/core/NodeStore.d.ts +34 -0
  20. package/dist/engine/core/context.d.ts +20 -0
  21. package/dist/engine/events.d.ts +19 -0
  22. package/dist/engine/gpu/GpuBufferManager.d.ts +39 -0
  23. package/dist/engine/interaction/GroupInteraction.d.ts +40 -0
  24. package/dist/engine/interaction.d.ts +31 -0
  25. package/dist/engine/overlay/ComboRenderer.d.ts +25 -0
  26. package/dist/engine/overlay/EdgeRenderer.d.ts +32 -0
  27. package/dist/engine/overlay/NodeRenderer.d.ts +52 -0
  28. package/dist/engine/overlay/OverlayManager.d.ts +38 -0
  29. package/dist/engine/overlay/SharedOverlayState.d.ts +47 -0
  30. package/dist/engine/overlay/effects.d.ts +15 -0
  31. package/dist/engine/overlay/index.d.ts +2 -0
  32. package/dist/engine/overlay/shapes.d.ts +7 -0
  33. package/dist/engine/overlay/text.d.ts +15 -0
  34. package/dist/engine/picking.d.ts +51 -0
  35. package/dist/engine/renderConstants.d.ts +13 -0
  36. package/dist/engine/renderer.d.ts +222 -0
  37. package/dist/engine/shaders/edge.glsl.d.ts +2 -0
  38. package/dist/engine/shaders/node.glsl.d.ts +2 -0
  39. package/dist/engine/shaders.d.ts +2 -0
  40. package/dist/engine/spatialIndex.d.ts +32 -0
  41. package/dist/engine/types.d.ts +688 -0
  42. package/dist/engine/utils/pointSize.d.ts +23 -0
  43. package/dist/engine/utils/styleResolver.d.ts +163 -0
  44. package/dist/index.d.ts +14 -1
  45. package/dist/vortx-gl.css +1206 -1
  46. package/dist/vortx-gl.es.js +3718 -1
  47. package/dist/vortx-gl.umd.js +3706 -1
  48. package/package.json +7 -6
  49. package/dist/assets/layout.worker-CBxeMMC3.js +0 -1
  50. package/dist/favicon.ico +0 -0
  51. package/dist/logo.png +0 -0
  52. package/dist/vite.svg +0 -1
  53. package/dist/webgl-graph-library.css +0 -1
  54. package/dist/webgl-graph.es.js +0 -1
  55. package/dist/webgl-graph.umd.js +0 -1
@@ -0,0 +1,2 @@
1
+ export declare const EDGE_VS = "#version 300 es\nlayout(location = 0) in vec2 a_position;\nlayout(location = 3) in vec2 a_targetPosition;\n\nuniform mat3 u_matrix;\nuniform float u_transitionProgress;\n\nvoid main() {\n vec2 pos = mix(a_position, a_targetPosition, u_transitionProgress);\n vec3 position = u_matrix * vec3(pos, 1.0);\n gl_Position = vec4(position.xy, 0, 1);\n}\n";
2
+ export declare const EDGE_FS = "#version 300 es\nprecision highp float;\nuniform vec4 u_color;\nout vec4 outColor;\n\nvoid main() {\n outColor = u_color;\n}\n";
@@ -0,0 +1,2 @@
1
+ export declare const NODE_VS = "#version 300 es\nlayout(location = 0) in vec2 a_position;\nlayout(location = 1) in vec4 a_color;\nlayout(location = 2) in float a_id;\nlayout(location = 3) in vec2 a_targetPosition;\nlayout(location = 4) in float a_shape;\n// Per-node size multiplier. 1.0 = base size, 2.0 = 2x bigger, etc.\n// Sourced from (input.size || input.width || 50) / 50 at ingest.\nlayout(location = 5) in float a_size;\n\nuniform mat3 u_matrix;\nuniform float u_pointSize;\n// GPU's ALIASED_POINT_SIZE_RANGE upper bound, set once at init by the\n// renderer. Clamped here so a node with size > 1 never exceeds the GPU\n// limit and silently mismatches the overlay's idea of where the sprite\n// edge is. Overlay reads the same clamp via getMaxNodePointSize().\nuniform float u_pointSizeMax;\nuniform bool u_pickingMode;\nuniform float u_transitionProgress;\n\nout vec4 v_color;\nflat out uint v_id;\nflat out int v_shape;\n\nvoid main() {\n // Interpolate between current and target position on GPU\n vec2 pos = mix(a_position, a_targetPosition, u_transitionProgress);\n vec3 position = u_matrix * vec3(pos, 1.0);\n gl_Position = vec4(position.xy, 0, 1);\n gl_PointSize = min(u_pointSize * a_size, u_pointSizeMax);\n\n // Visible nodes are forced opaque so edges (drawn before) never leak\n // through the node body. Hidden nodes (alpha < 0.001) still vanish via\n // the discard branch in the fragment shader.\n float alpha = a_color.a < 0.001 ? 0.0 : 1.0;\n v_color = vec4(a_color.rgb, alpha);\n v_id = uint(a_id);\n v_shape = int(a_shape);\n}\n";
2
+ export declare const NODE_FS = "#version 300 es\nprecision highp float;\n\nin vec4 v_color;\nflat in uint v_id;\nflat in int v_shape;\n\nuniform bool u_pickingMode;\nout vec4 outColor;\n\nvoid main() {\n vec2 p = gl_PointCoord - vec2(0.5);\n\n // Every shape fills the full pointSize sprite (extent 0.5 from center)\n // so edges + overlay decorations, which assume node radius == pointSize/2,\n // actually reach the visible node border.\n if (v_shape == 0) { // Circle\n if (length(p) > 0.5) discard;\n } else if (v_shape == 1) { // Square\n if (abs(p.x) > 0.5 || abs(p.y) > 0.5) discard;\n } else if (v_shape == 2) { // Triangle\n if (p.y > 0.5 || p.y < -0.5 || abs(p.x) > (0.5 - (p.y + 0.5) * 0.5)) discard;\n } else if (v_shape == 3) { // Diamond\n if (abs(p.x) + abs(p.y) > 0.5) discard;\n } else if (v_shape == 4) { // Round Rectangle\n // Inner half-extent 0.4 + corner radius 0.1 \u2192 reaches 0.5 at edges.\n float dist = length(max(abs(p) - 0.4, 0.0));\n if (dist > 0.1) discard;\n } else if (v_shape == 5) { // Cut Rectangle\n if (abs(p.x) > 0.5 || abs(p.y) > 0.5 || abs(p.x) + abs(p.y) > 0.85) discard;\n }\n\n // Hidden nodes (alpha == 0): skip rendering AND picking.\n if (v_color.a < 0.001) discard;\n\n if (u_pickingMode) {\n uint id = v_id + 1u;\n float r = float((id >> 16) & 0xFFu) / 255.0;\n float g = float((id >> 8) & 0xFFu) / 255.0;\n float b = float(id & 0xFFu) / 255.0;\n outColor = vec4(r, g, b, 1.0);\n } else {\n outColor = v_color;\n }\n}\n";
@@ -0,0 +1,2 @@
1
+ export { NODE_VS, NODE_FS } from './shaders/node.glsl';
2
+ export { EDGE_VS, EDGE_FS } from './shaders/edge.glsl';
@@ -0,0 +1,32 @@
1
+ export declare class SpatialIndex {
2
+ private cellSize;
3
+ private cells;
4
+ private nodeCell;
5
+ ready: boolean;
6
+ /**
7
+ * Full rebuild from a position buffer. O(N). Sets `ready = true` on success.
8
+ * - `positions` is the same `[x0,y0,x1,y1,...]` Float32Array the engine owns.
9
+ * - `count` is the live node count (positions may be over-allocated).
10
+ * - Cells auto-size so each one holds ~1 node on average. Floor of `1` keeps
11
+ * degenerate (all-at-origin) inputs from producing NaN cell sizes.
12
+ */
13
+ rebuild(positions: Float32Array, count: number): void;
14
+ /**
15
+ * Incremental move for a single node — keeps the index coherent during
16
+ * drag. O(1) amortised: only touches the cell entry for this node when
17
+ * it crosses a cell boundary.
18
+ */
19
+ update(id: number, x: number, y: number): void;
20
+ /** Remove a node from the index (e.g. after removeNode). No-op if not present. */
21
+ remove(id: number): void;
22
+ /**
23
+ * Visit every node whose cell overlaps the world bbox `[minX..maxX] ×
24
+ * [minY..maxY]`. The visitor sees a superset of the bbox-intersecting
25
+ * nodes — the caller is expected to do precise containment checks
26
+ * (which it already does to write `projectedCache`).
27
+ *
28
+ * Yields no allocations beyond what the visitor itself does.
29
+ */
30
+ forEachInBbox(minX: number, maxX: number, minY: number, maxY: number, visit: (id: number) => void): void;
31
+ clear(): void;
32
+ }