@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.
Files changed (176) hide show
  1. package/dist/config.d.ts +18 -5
  2. package/dist/{index-FUIgayhu.js → index-B1_1MjaX.js} +1909 -1819
  3. package/dist/index-B1_1MjaX.js.map +1 -0
  4. package/dist/index.d.ts +66 -6
  5. package/dist/index.js +1 -1
  6. package/dist/index.min.js +46 -34
  7. package/dist/index.min.js.map +1 -1
  8. package/dist/modules/Clusters/index.d.ts +0 -3
  9. package/dist/modules/GraphData/index.d.ts +1 -0
  10. package/dist/modules/Points/index.d.ts +2 -4
  11. package/dist/{webgl-device-B9ewDj5L.js → webgl-device-DzkMihDq.js} +2 -2
  12. package/dist/{webgl-device-B9ewDj5L.js.map → webgl-device-DzkMihDq.js.map} +1 -1
  13. package/package.json +5 -1
  14. package/.eslintrc +0 -147
  15. package/.github/SECURITY.md +0 -13
  16. package/.github/dco.yml +0 -4
  17. package/.github/workflows/github_pages.yml +0 -54
  18. package/.storybook/main.ts +0 -26
  19. package/.storybook/manager-head.html +0 -1
  20. package/.storybook/manager.ts +0 -14
  21. package/.storybook/preview.ts +0 -29
  22. package/.storybook/style.css +0 -3
  23. package/CHARTER.md +0 -69
  24. package/CODE_OF_CONDUCT.md +0 -178
  25. package/CONTRIBUTING.md +0 -22
  26. package/GOVERNANCE.md +0 -21
  27. package/cosmos-2-0-migration-notes.md +0 -98
  28. package/cosmos_awesome.md +0 -96
  29. package/dist/index-FUIgayhu.js.map +0 -1
  30. package/dist/stories/beginners/basic-set-up/data-gen.d.ts +0 -4
  31. package/dist/stories/beginners/basic-set-up/index.d.ts +0 -6
  32. package/dist/stories/beginners/link-hovering/data-generator.d.ts +0 -19
  33. package/dist/stories/beginners/link-hovering/index.d.ts +0 -6
  34. package/dist/stories/beginners/point-labels/data.d.ts +0 -13
  35. package/dist/stories/beginners/point-labels/index.d.ts +0 -10
  36. package/dist/stories/beginners/point-labels/labels.d.ts +0 -8
  37. package/dist/stories/beginners/quick-start.d.ts +0 -6
  38. package/dist/stories/beginners/remove-points/config.d.ts +0 -2
  39. package/dist/stories/beginners/remove-points/data-gen.d.ts +0 -4
  40. package/dist/stories/beginners/remove-points/index.d.ts +0 -6
  41. package/dist/stories/beginners.stories.d.ts +0 -10
  42. package/dist/stories/clusters/polygon-selection/index.d.ts +0 -6
  43. package/dist/stories/clusters/polygon-selection/polygon.d.ts +0 -20
  44. package/dist/stories/clusters/radial.d.ts +0 -6
  45. package/dist/stories/clusters/with-labels.d.ts +0 -6
  46. package/dist/stories/clusters/worm.d.ts +0 -6
  47. package/dist/stories/clusters.stories.d.ts +0 -9
  48. package/dist/stories/create-cluster-labels.d.ts +0 -4
  49. package/dist/stories/create-cosmos.d.ts +0 -17
  50. package/dist/stories/create-story.d.ts +0 -16
  51. package/dist/stories/experiments/full-mesh.d.ts +0 -6
  52. package/dist/stories/experiments/mesh-with-holes.d.ts +0 -6
  53. package/dist/stories/experiments.stories.d.ts +0 -7
  54. package/dist/stories/generate-mesh-data.d.ts +0 -12
  55. package/dist/stories/geospatial/moscow-metro-stations/index.d.ts +0 -16
  56. package/dist/stories/geospatial/moscow-metro-stations/moscow-metro-coords.d.ts +0 -1
  57. package/dist/stories/geospatial/moscow-metro-stations/point-colors.d.ts +0 -1
  58. package/dist/stories/geospatial.stories.d.ts +0 -6
  59. package/dist/stories/shapes/all-shapes/index.d.ts +0 -6
  60. package/dist/stories/shapes/image-example/index.d.ts +0 -6
  61. package/dist/stories/shapes.stories.d.ts +0 -7
  62. package/dist/stories/test-luma-migration.d.ts +0 -6
  63. package/dist/stories/test.stories.d.ts +0 -6
  64. package/logo.svg +0 -3
  65. package/rollup.config.js +0 -70
  66. package/src/config.ts +0 -728
  67. package/src/declaration.d.ts +0 -12
  68. package/src/graph/utils/error-message.ts +0 -23
  69. package/src/helper.ts +0 -113
  70. package/src/index.ts +0 -1769
  71. package/src/modules/Clusters/calculate-centermass.frag +0 -12
  72. package/src/modules/Clusters/calculate-centermass.vert +0 -38
  73. package/src/modules/Clusters/force-cluster.frag +0 -55
  74. package/src/modules/Clusters/index.ts +0 -578
  75. package/src/modules/Drag/index.ts +0 -33
  76. package/src/modules/FPSMonitor/css.ts +0 -53
  77. package/src/modules/FPSMonitor/index.ts +0 -28
  78. package/src/modules/ForceCenter/calculate-centermass.frag +0 -9
  79. package/src/modules/ForceCenter/calculate-centermass.vert +0 -26
  80. package/src/modules/ForceCenter/force-center.frag +0 -37
  81. package/src/modules/ForceCenter/index.ts +0 -284
  82. package/src/modules/ForceGravity/force-gravity.frag +0 -40
  83. package/src/modules/ForceGravity/index.ts +0 -107
  84. package/src/modules/ForceLink/force-spring.ts +0 -89
  85. package/src/modules/ForceLink/index.ts +0 -293
  86. package/src/modules/ForceManyBody/calculate-level.frag +0 -9
  87. package/src/modules/ForceManyBody/calculate-level.vert +0 -37
  88. package/src/modules/ForceManyBody/force-centermass.frag +0 -61
  89. package/src/modules/ForceManyBody/force-level.frag +0 -138
  90. package/src/modules/ForceManyBody/index.ts +0 -525
  91. package/src/modules/ForceManyBody/quadtree-frag-shader.ts +0 -89
  92. package/src/modules/ForceManyBodyQuadtree/calculate-level.frag +0 -9
  93. package/src/modules/ForceManyBodyQuadtree/calculate-level.vert +0 -25
  94. package/src/modules/ForceManyBodyQuadtree/index.ts +0 -157
  95. package/src/modules/ForceManyBodyQuadtree/quadtree-frag-shader.ts +0 -93
  96. package/src/modules/ForceMouse/force-mouse.frag +0 -35
  97. package/src/modules/ForceMouse/index.ts +0 -102
  98. package/src/modules/GraphData/index.ts +0 -383
  99. package/src/modules/Lines/draw-curve-line.frag +0 -59
  100. package/src/modules/Lines/draw-curve-line.vert +0 -248
  101. package/src/modules/Lines/geometry.ts +0 -18
  102. package/src/modules/Lines/hovered-line-index.frag +0 -43
  103. package/src/modules/Lines/hovered-line-index.vert +0 -13
  104. package/src/modules/Lines/index.ts +0 -661
  105. package/src/modules/Points/atlas-utils.ts +0 -137
  106. package/src/modules/Points/drag-point.frag +0 -34
  107. package/src/modules/Points/draw-highlighted.frag +0 -44
  108. package/src/modules/Points/draw-highlighted.vert +0 -145
  109. package/src/modules/Points/draw-points.frag +0 -259
  110. package/src/modules/Points/draw-points.vert +0 -203
  111. package/src/modules/Points/fill-sampled-points.frag +0 -12
  112. package/src/modules/Points/fill-sampled-points.vert +0 -51
  113. package/src/modules/Points/find-hovered-point.frag +0 -15
  114. package/src/modules/Points/find-hovered-point.vert +0 -90
  115. package/src/modules/Points/find-points-on-area-selection.frag +0 -88
  116. package/src/modules/Points/find-points-on-polygon-selection.frag +0 -89
  117. package/src/modules/Points/index.ts +0 -2292
  118. package/src/modules/Points/track-positions.frag +0 -30
  119. package/src/modules/Points/update-position.frag +0 -39
  120. package/src/modules/Shared/buffer.ts +0 -39
  121. package/src/modules/Shared/clear.frag +0 -10
  122. package/src/modules/Shared/quad.vert +0 -13
  123. package/src/modules/Store/index.ts +0 -283
  124. package/src/modules/Zoom/index.ts +0 -148
  125. package/src/modules/core-module.ts +0 -28
  126. package/src/stories/1. welcome.mdx +0 -75
  127. package/src/stories/2. configuration.mdx +0 -111
  128. package/src/stories/3. api-reference.mdx +0 -591
  129. package/src/stories/beginners/basic-set-up/data-gen.ts +0 -33
  130. package/src/stories/beginners/basic-set-up/index.ts +0 -167
  131. package/src/stories/beginners/basic-set-up/style.css +0 -35
  132. package/src/stories/beginners/link-hovering/data-generator.ts +0 -198
  133. package/src/stories/beginners/link-hovering/index.ts +0 -65
  134. package/src/stories/beginners/link-hovering/style.css +0 -73
  135. package/src/stories/beginners/point-labels/data.ts +0 -73
  136. package/src/stories/beginners/point-labels/index.ts +0 -69
  137. package/src/stories/beginners/point-labels/labels.ts +0 -46
  138. package/src/stories/beginners/point-labels/style.css +0 -16
  139. package/src/stories/beginners/quick-start.ts +0 -54
  140. package/src/stories/beginners/remove-points/config.ts +0 -25
  141. package/src/stories/beginners/remove-points/data-gen.ts +0 -30
  142. package/src/stories/beginners/remove-points/index.ts +0 -96
  143. package/src/stories/beginners/remove-points/style.css +0 -31
  144. package/src/stories/beginners.stories.ts +0 -130
  145. package/src/stories/clusters/polygon-selection/index.ts +0 -52
  146. package/src/stories/clusters/polygon-selection/polygon.ts +0 -143
  147. package/src/stories/clusters/polygon-selection/style.css +0 -8
  148. package/src/stories/clusters/radial.ts +0 -24
  149. package/src/stories/clusters/with-labels.ts +0 -54
  150. package/src/stories/clusters/worm.ts +0 -40
  151. package/src/stories/clusters.stories.ts +0 -77
  152. package/src/stories/create-cluster-labels.ts +0 -50
  153. package/src/stories/create-cosmos.ts +0 -72
  154. package/src/stories/create-story.ts +0 -51
  155. package/src/stories/experiments/full-mesh.ts +0 -13
  156. package/src/stories/experiments/mesh-with-holes.ts +0 -13
  157. package/src/stories/experiments.stories.ts +0 -43
  158. package/src/stories/generate-mesh-data.ts +0 -125
  159. package/src/stories/geospatial/moscow-metro-stations/index.ts +0 -66
  160. package/src/stories/geospatial/moscow-metro-stations/moscow-metro-coords.ts +0 -1
  161. package/src/stories/geospatial/moscow-metro-stations/point-colors.ts +0 -46
  162. package/src/stories/geospatial/moscow-metro-stations/style.css +0 -30
  163. package/src/stories/geospatial.stories.ts +0 -30
  164. package/src/stories/shapes/all-shapes/index.ts +0 -73
  165. package/src/stories/shapes/image-example/icons/box.png +0 -0
  166. package/src/stories/shapes/image-example/icons/lego.png +0 -0
  167. package/src/stories/shapes/image-example/icons/s.png +0 -0
  168. package/src/stories/shapes/image-example/icons/swift.png +0 -0
  169. package/src/stories/shapes/image-example/icons/toolbox.png +0 -0
  170. package/src/stories/shapes/image-example/index.ts +0 -246
  171. package/src/stories/shapes.stories.ts +0 -37
  172. package/src/stories/test-luma-migration.ts +0 -195
  173. package/src/stories/test.stories.ts +0 -25
  174. package/src/variables.ts +0 -68
  175. package/tsconfig.json +0 -41
  176. package/vite.config.ts +0 -52
@@ -1,98 +0,0 @@
1
- ### Migration Guide cosmos.gl v2.0
2
-
3
- #### Introduction
4
-
5
- Welcome to the updated cosmos.gl library! Version 2.0 introduces significant improvements in data handling and performance, marking a major milestone for the library. This guide will help you transition to the new version smoothly.
6
-
7
- #### Key Changes in Data Handling
8
-
9
- This update is centered on enhancing data performance by utilizing formats directly compatible with WebGL. Since WebGL operates with buffers and framebuffers created from arrays of numbers, we have introduced new methods to handle data more efficiently.
10
-
11
- #### Replacing `setData`
12
-
13
- The `setData` method has been replaced with `setPointPositions` and `setLinks`. These new methods accept Float32Array, which are directly used to create WebGL textures.
14
-
15
- **Before:**
16
- ```js
17
- graph.setData(
18
- [{ id: 'a' }, { id: 'b' }], // Nodes
19
- [{ source: 'a', target: 'b' }] // Links
20
- );
21
- ```
22
-
23
- **After:**
24
- ```js
25
- graph.setPointPositions(new Float32Array([
26
- 400, 400, // x and y of the first point
27
- 500, 500, // x and y of the second point
28
- ]));
29
- graph.setLinks(new Float32Array([
30
- 0, 1 // Link between the first and second point
31
- ]));
32
- ```
33
-
34
- #### Configuration Updates
35
-
36
- Accessor functions for styling such as `nodeColor`, `nodeSize`, `linkColor`, `linkWidth`, and `linkArrows`, are eliminated. You can now set these attributes directly using Float32Array.
37
-
38
- **Old Method for Setting Node Color:**
39
- ```js
40
- config.nodeColor = node => node.color;
41
- ```
42
-
43
- **New Method for Setting Point Colors:**
44
- ```js
45
- graph.setPointColors(new Float32Array([
46
- 0.5, 0.5, 1, 1, // r, g, b, alpha for the first point
47
- 0.5, 1, 0.5, 1, // r, g, b, alpha for the second point
48
- ]));
49
- ```
50
-
51
- **Flat Configuration Object:**
52
-
53
- The configuration object is now flat instead of nested.
54
-
55
- **Old Config:**
56
- ```js
57
- const config = {
58
- backgroundColor: 'black',
59
- simulation: {
60
- repulsion: 0.5,
61
- },
62
- events: {
63
- onNodeMouseOver: (node, index, pos) => console.log(`Hovered over node ${node.id}`)
64
- }
65
- }
66
- ```
67
-
68
- **New config:**
69
- ```js
70
- const config = {
71
- backgroundColor: 'black',
72
- simulationRepulsion: 0.5,
73
- onPointMouseOver: (index, pos) => console.log(`Hovered over point at index ${index}`);
74
- }
75
- ```
76
-
77
- **Initialization Change: From Canvas to Div**
78
-
79
- In version 2.0, the initialization of the graph now requires a div element instead of a canvas element.
80
-
81
- **Before**
82
- ```js
83
- const canvas = document.getElementById('myCanvas')
84
- const graph = new Graph(canvas, config)
85
- ```
86
-
87
- **After**
88
- ```js
89
- const div = document.getElementById('myDiv')
90
- const graph = new Graph(div, config)
91
- ```
92
-
93
- **Summary of Additional Changes**
94
-
95
- - **Terminology Update:** "Node" is now "Point," but "Link" remains unchanged.
96
- - **API Modifications:** All methods that focused on node objects have been updated or replaced to handle indices.
97
- - **Manual Rendering:** After setting data or updating point/link properties, remember to run `graph.render()` to update WebGL textures and render the graph with the new data.
98
-
package/cosmos_awesome.md DELETED
@@ -1,96 +0,0 @@
1
- ## About
2
- The cosmos.gl awesome list is a list of awesome things curated by the community.
3
-
4
- ## cosmos.gl Examples:
5
- **MathWorks/Kuu** The MathWorks, Inc: symmetric positive definite matrix
6
- - Source: https://sparse.tamu.edu/MathWorks/Kuu
7
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/Kuu.csv
8
-
9
- **HB/blckhole** S CONNECTIVITY STRUCTURE OF A GEODESIC DOME ON A COARSE BASE
10
- - Source: https://sparse.tamu.edu/HB/blckhole
11
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/blckhole.csv
12
-
13
- **HB/can_229** SYMMETRIC PATTERN FROM CANNES,LUCIEN MARRO,JUNE 1981.
14
- - Source: https://sparse.tamu.edu/HB/can_229
15
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/can_229.csv
16
-
17
- **Gset/G34** 2D torus, 40-by-50, uniformly random +1/-1 entries
18
- - Source: https://sparse.tamu.edu/Gset/G34
19
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/G34.csv
20
-
21
- **Pothen/sphere3** sphere3, with coordinates. From NASA, collected by Alex Pothen
22
- - Source: https://sparse.tamu.edu/Pothen/sphere3
23
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/sphere3.csv
24
-
25
- **Bydder/mri1** MRI reconstruction (1), from Mark Bydder, UCSD
26
- - Source: https://sparse.tamu.edu/Bydder/mri1
27
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/mri1.csv
28
-
29
- **Mittelmann/pds-90** Patient distribution (evacuation) system
30
- - Source: https://sparse.tamu.edu/Mittelmann/pds-90
31
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/pds-90.csv
32
-
33
- **Chen/pkustk10** PKU SYMMETRIC STIFFNESS, 4 TOWER SILO
34
- - Source: https://sparse.tamu.edu/Chen/pkustk10
35
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/pkustk10.csv
36
-
37
- **GHS_indef/aug3d** Gould, Hu, & Scott: expanded system-3D PDE (CUTEr)
38
- - Source: https://sparse.tamu.edu/GHS_indef/aug3d
39
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/aug3d.csv
40
-
41
- **Nasa/barth5** BARTH5: Nasa matrix, but with a diagonal added to the original matrix
42
- - Source: https://sparse.tamu.edu/Nasa/barth5
43
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/barth5.csv
44
-
45
- **DIMACS10/delaunay_n10**
46
- DIMACS10 set: delaunay/delaunay_n10
47
- - Source: https://sparse.tamu.edu/DIMACS10/delaunay_n10
48
- - Example:https://cosmograph.app/run/?data=https://cosmograph.app/data/delaunay_n10.csv
49
-
50
- **HB/dwt_1005** SYMMETRIC CONNECTION TABLE FROM DTNSRDC, WASHINGTON
51
- - Source: https://sparse.tamu.edu/HB/dwt_1005
52
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/dwt_1005.csv
53
-
54
- **HB/gre_1107** UNSYMMETRIC MATRIX FROM GRENOBLE,FRANCOIS CACHARD,MARCH 1981.
55
- - Source: https://sparse.tamu.edu/HB/gre_1107
56
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/gre_1107.csv
57
-
58
- **Hollinger/jan99jac040sc** Jacobian from Bank of Canada ‘jan99’ model, oldstack 040, with scaling
59
- - Source: https://sparse.tamu.edu/Hollinger/jan99jac040sc
60
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/jan99jac040sc.csv
61
-
62
- **HB/man_5976** MANTEUFFEL’S FINITE ELEMENT PROBLEM (CONDENSED)
63
- - Source: https://sparse.tamu.edu/HB/man_5976
64
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/man_5976.csv
65
-
66
- **Boeing/msc01440** SYMMETRIC TEST MATRIX FROM MSC/NASTRAN CYLF8.OUT2
67
- - Source: https://sparse.tamu.edu/Boeing/msc01440
68
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/msc01440.csv
69
-
70
- **Nasa/nasa4704** STRUCTURE FROM NASA LANGLEY, 4704 DEGREES OF FREEDOM
71
- - Source: https://sparse.tamu.edu/Nasa/nasa4704
72
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/nasa4704.csv
73
-
74
- **Bai/rw5151** MARKOV CHAIN MODELING, RANDOM WALK (M = 100) G. W. STEWART
75
- - Source: https://sparse.tamu.edu/Bai/rw5151
76
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/rw5151.csv
77
-
78
- **Shyy/shyy41** Wei Shyy, Univ. Florida. CFD/Navier-Stokes,viscous flow, fully coupled
79
- - Source: https://sparse.tamu.edu/Shyy/shyy41
80
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/shyy41.csv
81
-
82
- **Shyy/shyy161** Wei Shyy, Univ. Florida. CFD/Navier-Stokes,viscous flow, fully coupled
83
- - Source: https://sparse.tamu.edu/Shyy/shyy161
84
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/shyy161.csv
85
-
86
- **HB/young3c** real matrix from aero research, David Young, corrected RUA version
87
- - Source: https://sparse.tamu.edu/HB/young3c
88
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/young3c.csv
89
-
90
- **TKK/cyl6** Cylindrical shell, non-linear analysis, 3 RHS vectors at step 6. R Kouhia
91
- - Source: https://sparse.tamu.edu/TKK/cyl6
92
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/cyl6.csv
93
-
94
- **GHS_psdef/cvxbqp1** Gould, Hu, & Scott: barrier Hessian from convex QP (CUTEr)
95
- - Source: https://sparse.tamu.edu/GHS_psdef/cvxbqp1
96
- - Example: https://cosmograph.app/run/?data=https://cosmograph.app/data/cvxbqp1.csv