@cosmos.gl/graph 2.7.0-beta.0 → 2.7.0-beta.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/config.d.ts +18 -5
- package/dist/{index-FUIgayhu.js → index-B1_1MjaX.js} +1909 -1819
- package/dist/index-B1_1MjaX.js.map +1 -0
- package/dist/index.d.ts +66 -6
- package/dist/index.js +1 -1
- package/dist/index.min.js +46 -34
- package/dist/index.min.js.map +1 -1
- package/dist/modules/Clusters/index.d.ts +0 -3
- package/dist/modules/GraphData/index.d.ts +1 -0
- package/dist/modules/Points/index.d.ts +2 -4
- package/dist/{webgl-device-B9ewDj5L.js → webgl-device-DzkMihDq.js} +2 -2
- package/dist/{webgl-device-B9ewDj5L.js.map → webgl-device-DzkMihDq.js.map} +1 -1
- package/package.json +5 -1
- package/.eslintrc +0 -147
- package/.github/SECURITY.md +0 -13
- package/.github/dco.yml +0 -4
- package/.github/workflows/github_pages.yml +0 -54
- package/.storybook/main.ts +0 -26
- package/.storybook/manager-head.html +0 -1
- package/.storybook/manager.ts +0 -14
- package/.storybook/preview.ts +0 -29
- package/.storybook/style.css +0 -3
- package/CHARTER.md +0 -69
- package/CODE_OF_CONDUCT.md +0 -178
- package/CONTRIBUTING.md +0 -22
- package/GOVERNANCE.md +0 -21
- package/cosmos-2-0-migration-notes.md +0 -98
- package/cosmos_awesome.md +0 -96
- package/dist/index-FUIgayhu.js.map +0 -1
- package/dist/stories/beginners/basic-set-up/data-gen.d.ts +0 -4
- package/dist/stories/beginners/basic-set-up/index.d.ts +0 -6
- package/dist/stories/beginners/link-hovering/data-generator.d.ts +0 -19
- package/dist/stories/beginners/link-hovering/index.d.ts +0 -6
- package/dist/stories/beginners/point-labels/data.d.ts +0 -13
- package/dist/stories/beginners/point-labels/index.d.ts +0 -10
- package/dist/stories/beginners/point-labels/labels.d.ts +0 -8
- package/dist/stories/beginners/quick-start.d.ts +0 -6
- package/dist/stories/beginners/remove-points/config.d.ts +0 -2
- package/dist/stories/beginners/remove-points/data-gen.d.ts +0 -4
- package/dist/stories/beginners/remove-points/index.d.ts +0 -6
- package/dist/stories/beginners.stories.d.ts +0 -10
- package/dist/stories/clusters/polygon-selection/index.d.ts +0 -6
- package/dist/stories/clusters/polygon-selection/polygon.d.ts +0 -20
- package/dist/stories/clusters/radial.d.ts +0 -6
- package/dist/stories/clusters/with-labels.d.ts +0 -6
- package/dist/stories/clusters/worm.d.ts +0 -6
- package/dist/stories/clusters.stories.d.ts +0 -9
- package/dist/stories/create-cluster-labels.d.ts +0 -4
- package/dist/stories/create-cosmos.d.ts +0 -17
- package/dist/stories/create-story.d.ts +0 -16
- package/dist/stories/experiments/full-mesh.d.ts +0 -6
- package/dist/stories/experiments/mesh-with-holes.d.ts +0 -6
- package/dist/stories/experiments.stories.d.ts +0 -7
- package/dist/stories/generate-mesh-data.d.ts +0 -12
- package/dist/stories/geospatial/moscow-metro-stations/index.d.ts +0 -16
- package/dist/stories/geospatial/moscow-metro-stations/moscow-metro-coords.d.ts +0 -1
- package/dist/stories/geospatial/moscow-metro-stations/point-colors.d.ts +0 -1
- package/dist/stories/geospatial.stories.d.ts +0 -6
- package/dist/stories/shapes/all-shapes/index.d.ts +0 -6
- package/dist/stories/shapes/image-example/index.d.ts +0 -6
- package/dist/stories/shapes.stories.d.ts +0 -7
- package/dist/stories/test-luma-migration.d.ts +0 -6
- package/dist/stories/test.stories.d.ts +0 -6
- package/logo.svg +0 -3
- package/rollup.config.js +0 -70
- package/src/config.ts +0 -728
- package/src/declaration.d.ts +0 -12
- package/src/graph/utils/error-message.ts +0 -23
- package/src/helper.ts +0 -113
- package/src/index.ts +0 -1769
- package/src/modules/Clusters/calculate-centermass.frag +0 -12
- package/src/modules/Clusters/calculate-centermass.vert +0 -38
- package/src/modules/Clusters/force-cluster.frag +0 -55
- package/src/modules/Clusters/index.ts +0 -578
- package/src/modules/Drag/index.ts +0 -33
- package/src/modules/FPSMonitor/css.ts +0 -53
- package/src/modules/FPSMonitor/index.ts +0 -28
- package/src/modules/ForceCenter/calculate-centermass.frag +0 -9
- package/src/modules/ForceCenter/calculate-centermass.vert +0 -26
- package/src/modules/ForceCenter/force-center.frag +0 -37
- package/src/modules/ForceCenter/index.ts +0 -284
- package/src/modules/ForceGravity/force-gravity.frag +0 -40
- package/src/modules/ForceGravity/index.ts +0 -107
- package/src/modules/ForceLink/force-spring.ts +0 -89
- package/src/modules/ForceLink/index.ts +0 -293
- package/src/modules/ForceManyBody/calculate-level.frag +0 -9
- package/src/modules/ForceManyBody/calculate-level.vert +0 -37
- package/src/modules/ForceManyBody/force-centermass.frag +0 -61
- package/src/modules/ForceManyBody/force-level.frag +0 -138
- package/src/modules/ForceManyBody/index.ts +0 -525
- package/src/modules/ForceManyBody/quadtree-frag-shader.ts +0 -89
- package/src/modules/ForceManyBodyQuadtree/calculate-level.frag +0 -9
- package/src/modules/ForceManyBodyQuadtree/calculate-level.vert +0 -25
- package/src/modules/ForceManyBodyQuadtree/index.ts +0 -157
- package/src/modules/ForceManyBodyQuadtree/quadtree-frag-shader.ts +0 -93
- package/src/modules/ForceMouse/force-mouse.frag +0 -35
- package/src/modules/ForceMouse/index.ts +0 -102
- package/src/modules/GraphData/index.ts +0 -383
- package/src/modules/Lines/draw-curve-line.frag +0 -59
- package/src/modules/Lines/draw-curve-line.vert +0 -248
- package/src/modules/Lines/geometry.ts +0 -18
- package/src/modules/Lines/hovered-line-index.frag +0 -43
- package/src/modules/Lines/hovered-line-index.vert +0 -13
- package/src/modules/Lines/index.ts +0 -661
- package/src/modules/Points/atlas-utils.ts +0 -137
- package/src/modules/Points/drag-point.frag +0 -34
- package/src/modules/Points/draw-highlighted.frag +0 -44
- package/src/modules/Points/draw-highlighted.vert +0 -145
- package/src/modules/Points/draw-points.frag +0 -259
- package/src/modules/Points/draw-points.vert +0 -203
- package/src/modules/Points/fill-sampled-points.frag +0 -12
- package/src/modules/Points/fill-sampled-points.vert +0 -51
- package/src/modules/Points/find-hovered-point.frag +0 -15
- package/src/modules/Points/find-hovered-point.vert +0 -90
- package/src/modules/Points/find-points-on-area-selection.frag +0 -88
- package/src/modules/Points/find-points-on-polygon-selection.frag +0 -89
- package/src/modules/Points/index.ts +0 -2292
- package/src/modules/Points/track-positions.frag +0 -30
- package/src/modules/Points/update-position.frag +0 -39
- package/src/modules/Shared/buffer.ts +0 -39
- package/src/modules/Shared/clear.frag +0 -10
- package/src/modules/Shared/quad.vert +0 -13
- package/src/modules/Store/index.ts +0 -283
- package/src/modules/Zoom/index.ts +0 -148
- package/src/modules/core-module.ts +0 -28
- package/src/stories/1. welcome.mdx +0 -75
- package/src/stories/2. configuration.mdx +0 -111
- package/src/stories/3. api-reference.mdx +0 -591
- package/src/stories/beginners/basic-set-up/data-gen.ts +0 -33
- package/src/stories/beginners/basic-set-up/index.ts +0 -167
- package/src/stories/beginners/basic-set-up/style.css +0 -35
- package/src/stories/beginners/link-hovering/data-generator.ts +0 -198
- package/src/stories/beginners/link-hovering/index.ts +0 -65
- package/src/stories/beginners/link-hovering/style.css +0 -73
- package/src/stories/beginners/point-labels/data.ts +0 -73
- package/src/stories/beginners/point-labels/index.ts +0 -69
- package/src/stories/beginners/point-labels/labels.ts +0 -46
- package/src/stories/beginners/point-labels/style.css +0 -16
- package/src/stories/beginners/quick-start.ts +0 -54
- package/src/stories/beginners/remove-points/config.ts +0 -25
- package/src/stories/beginners/remove-points/data-gen.ts +0 -30
- package/src/stories/beginners/remove-points/index.ts +0 -96
- package/src/stories/beginners/remove-points/style.css +0 -31
- package/src/stories/beginners.stories.ts +0 -130
- package/src/stories/clusters/polygon-selection/index.ts +0 -52
- package/src/stories/clusters/polygon-selection/polygon.ts +0 -143
- package/src/stories/clusters/polygon-selection/style.css +0 -8
- package/src/stories/clusters/radial.ts +0 -24
- package/src/stories/clusters/with-labels.ts +0 -54
- package/src/stories/clusters/worm.ts +0 -40
- package/src/stories/clusters.stories.ts +0 -77
- package/src/stories/create-cluster-labels.ts +0 -50
- package/src/stories/create-cosmos.ts +0 -72
- package/src/stories/create-story.ts +0 -51
- package/src/stories/experiments/full-mesh.ts +0 -13
- package/src/stories/experiments/mesh-with-holes.ts +0 -13
- package/src/stories/experiments.stories.ts +0 -43
- package/src/stories/generate-mesh-data.ts +0 -125
- package/src/stories/geospatial/moscow-metro-stations/index.ts +0 -66
- package/src/stories/geospatial/moscow-metro-stations/moscow-metro-coords.ts +0 -1
- package/src/stories/geospatial/moscow-metro-stations/point-colors.ts +0 -46
- package/src/stories/geospatial/moscow-metro-stations/style.css +0 -30
- package/src/stories/geospatial.stories.ts +0 -30
- package/src/stories/shapes/all-shapes/index.ts +0 -73
- package/src/stories/shapes/image-example/icons/box.png +0 -0
- package/src/stories/shapes/image-example/icons/lego.png +0 -0
- package/src/stories/shapes/image-example/icons/s.png +0 -0
- package/src/stories/shapes/image-example/icons/swift.png +0 -0
- package/src/stories/shapes/image-example/icons/toolbox.png +0 -0
- package/src/stories/shapes/image-example/index.ts +0 -246
- package/src/stories/shapes.stories.ts +0 -37
- package/src/stories/test-luma-migration.ts +0 -195
- package/src/stories/test.stories.ts +0 -25
- package/src/variables.ts +0 -68
- package/tsconfig.json +0 -41
- package/vite.config.ts +0 -52
package/dist/index.d.ts
CHANGED
|
@@ -239,11 +239,31 @@ export declare class Graph {
|
|
|
239
239
|
*/
|
|
240
240
|
setPointClusterStrength(clusterStrength: Float32Array): void;
|
|
241
241
|
/**
|
|
242
|
-
*
|
|
242
|
+
* Sets which points are pinned (fixed) in position.
|
|
243
243
|
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
244
|
+
* Pinned points:
|
|
245
|
+
* - Do not move due to physics forces (gravity, repulsion, link forces, etc.)
|
|
246
|
+
* - Still participate in force calculations (other nodes are attracted to/repelled by them)
|
|
247
|
+
* - Can still be dragged by the user if `enableDrag` is true
|
|
248
|
+
*
|
|
249
|
+
* @param {number[] | null} pinnedIndices - Array of point indices to pin. Set to `[]` or `null` to unpin all points.
|
|
250
|
+
* @example
|
|
251
|
+
* // Pin points 0 and 5
|
|
252
|
+
* graph.setPinnedPoints([0, 5])
|
|
253
|
+
*
|
|
254
|
+
* // Unpin all points
|
|
255
|
+
* graph.setPinnedPoints([])
|
|
256
|
+
* graph.setPinnedPoints(null)
|
|
257
|
+
*/
|
|
258
|
+
setPinnedPoints(pinnedIndices: number[] | null): void;
|
|
259
|
+
/**
|
|
260
|
+
* Renders the graph and starts rendering.
|
|
261
|
+
* Does NOT modify simulation state - use start(), stop(), pause(), unpause() to control simulation.
|
|
262
|
+
*
|
|
263
|
+
* @param {number} [simulationAlpha] - Optional alpha value to set.
|
|
264
|
+
* - If 0: Sets alpha to 0, simulation stops after one frame (graph becomes static).
|
|
265
|
+
* - If positive: Sets alpha to that value.
|
|
266
|
+
* - If undefined: Keeps current alpha value.
|
|
247
267
|
*/
|
|
248
268
|
render(simulationAlpha?: number): void;
|
|
249
269
|
/**
|
|
@@ -440,12 +460,19 @@ export declare class Graph {
|
|
|
440
460
|
getScaleY(): ((y: number) => number) | undefined;
|
|
441
461
|
/**
|
|
442
462
|
* Start the simulation.
|
|
463
|
+
* This only controls the simulation state, not rendering.
|
|
443
464
|
* @param alpha Value from 0 to 1. The higher the value, the more initial energy the simulation will get.
|
|
444
465
|
*/
|
|
445
466
|
start(alpha?: number): void;
|
|
467
|
+
/**
|
|
468
|
+
* Stop the simulation. This stops the simulation and resets its state.
|
|
469
|
+
* Use start() to begin a new simulation cycle.
|
|
470
|
+
*/
|
|
471
|
+
stop(): void;
|
|
446
472
|
/**
|
|
447
473
|
* Pause the simulation. When paused, the simulation stops running
|
|
448
|
-
*
|
|
474
|
+
* but preserves its current state (progress, alpha).
|
|
475
|
+
* Can be resumed using the unpause method.
|
|
449
476
|
*/
|
|
450
477
|
pause(): void;
|
|
451
478
|
/**
|
|
@@ -460,7 +487,8 @@ export declare class Graph {
|
|
|
460
487
|
*/
|
|
461
488
|
restart(): void;
|
|
462
489
|
/**
|
|
463
|
-
*
|
|
490
|
+
* Run one step of the simulation manually.
|
|
491
|
+
* Works even when the simulation is paused.
|
|
464
492
|
*/
|
|
465
493
|
step(): void;
|
|
466
494
|
/**
|
|
@@ -495,10 +523,42 @@ export declare class Graph {
|
|
|
495
523
|
* Graph class decides what device to create with sensible defaults
|
|
496
524
|
*/
|
|
497
525
|
private createDevice;
|
|
526
|
+
/**
|
|
527
|
+
* Updates and recreates the graph visualization based on pending changes.
|
|
528
|
+
*
|
|
529
|
+
* @param simulationAlpha - Optional alpha value to set. If not provided, keeps current alpha.
|
|
530
|
+
*/
|
|
498
531
|
private update;
|
|
532
|
+
/**
|
|
533
|
+
* Runs one step of the simulation (forces, position updates, alpha decay).
|
|
534
|
+
* This is the core simulation logic that can be called by step() or during rendering.
|
|
535
|
+
*
|
|
536
|
+
* @param forceExecution - Controls whether to run the simulation step when paused.
|
|
537
|
+
* - If true: Always runs the simulation step, even when isSimulationRunning is false.
|
|
538
|
+
* Used by step() to allow manual stepping while the simulation is paused.
|
|
539
|
+
* - If false: Only runs if isSimulationRunning is true. Used during rendering
|
|
540
|
+
* to respect pause/unpause state.
|
|
541
|
+
*/
|
|
542
|
+
private runSimulationStep;
|
|
499
543
|
private initPrograms;
|
|
544
|
+
/**
|
|
545
|
+
* The rendering loop - schedules itself to run continuously
|
|
546
|
+
*/
|
|
500
547
|
private frame;
|
|
548
|
+
/**
|
|
549
|
+
* Renders a single frame (the actual rendering logic).
|
|
550
|
+
* This does NOT schedule the next frame.
|
|
551
|
+
*/
|
|
552
|
+
private renderFrame;
|
|
501
553
|
private stopFrames;
|
|
554
|
+
/**
|
|
555
|
+
* Starts continuous rendering
|
|
556
|
+
*/
|
|
557
|
+
private startFrames;
|
|
558
|
+
/**
|
|
559
|
+
* Called automatically when simulation completes (alpha < ALPHA_MIN).
|
|
560
|
+
* Rendering continues after this is called (for rendering/interaction).
|
|
561
|
+
*/
|
|
502
562
|
private end;
|
|
503
563
|
private onClick;
|
|
504
564
|
private updateMousePosition;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as i, P as e, A as r, x as t, v as n, r as o, q as l, C as b, s as c, w as g, z as m, y as p, E as P } from "./index-
|
|
1
|
+
import { G as i, P as e, A as r, x as t, v as n, r as o, q as l, C as b, s as c, w as g, z as m, y as p, E as P } from "./index-B1_1MjaX.js";
|
|
2
2
|
export {
|
|
3
3
|
i as Graph,
|
|
4
4
|
e as PointShape,
|