@cosmos.gl/graph 2.5.0 → 2.6.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 (181) hide show
  1. package/dist/config.d.ts +8 -2
  2. package/dist/helper.d.ts +2 -2
  3. package/dist/index.d.ts +21 -2
  4. package/dist/index.js +4950 -14357
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +1 -1678
  7. package/dist/index.min.js.map +1 -1
  8. package/dist/modules/Clusters/index.d.ts +2 -2
  9. package/dist/modules/Drag/index.d.ts +3 -3
  10. package/dist/modules/ForceCenter/index.d.ts +1 -1
  11. package/dist/modules/ForceGravity/index.d.ts +1 -1
  12. package/dist/modules/ForceLink/index.d.ts +1 -1
  13. package/dist/modules/ForceManyBody/index.d.ts +1 -1
  14. package/dist/modules/ForceManyBodyQuadtree/index.d.ts +1 -1
  15. package/dist/modules/ForceMouse/index.d.ts +1 -1
  16. package/dist/modules/GraphData/index.d.ts +2 -1
  17. package/dist/modules/Lines/index.d.ts +2 -2
  18. package/dist/modules/Points/index.d.ts +5 -2
  19. package/dist/modules/Shared/buffer.d.ts +1 -1
  20. package/dist/modules/Store/index.d.ts +1 -1
  21. package/dist/modules/Zoom/index.d.ts +3 -3
  22. package/dist/modules/core-module.d.ts +5 -5
  23. package/package.json +5 -1
  24. package/.eslintrc +0 -147
  25. package/.github/SECURITY.md +0 -13
  26. package/.github/dco.yml +0 -4
  27. package/.github/workflows/github_pages.yml +0 -54
  28. package/.storybook/main.ts +0 -26
  29. package/.storybook/manager-head.html +0 -1
  30. package/.storybook/manager.ts +0 -14
  31. package/.storybook/preview.ts +0 -29
  32. package/.storybook/style.css +0 -3
  33. package/CHARTER.md +0 -69
  34. package/CODE_OF_CONDUCT.md +0 -178
  35. package/CONTRIBUTING.md +0 -22
  36. package/GOVERNANCE.md +0 -21
  37. package/cosmos-2-0-migration-notes.md +0 -98
  38. package/cosmos_awesome.md +0 -96
  39. package/dist/stories/beginners/basic-set-up/data-gen.d.ts +0 -4
  40. package/dist/stories/beginners/basic-set-up/index.d.ts +0 -5
  41. package/dist/stories/beginners/link-hovering/data-generator.d.ts +0 -19
  42. package/dist/stories/beginners/link-hovering/index.d.ts +0 -5
  43. package/dist/stories/beginners/point-labels/data.d.ts +0 -13
  44. package/dist/stories/beginners/point-labels/index.d.ts +0 -9
  45. package/dist/stories/beginners/point-labels/labels.d.ts +0 -8
  46. package/dist/stories/beginners/quick-start.d.ts +0 -5
  47. package/dist/stories/beginners/remove-points/config.d.ts +0 -2
  48. package/dist/stories/beginners/remove-points/data-gen.d.ts +0 -4
  49. package/dist/stories/beginners/remove-points/index.d.ts +0 -5
  50. package/dist/stories/beginners.stories.d.ts +0 -10
  51. package/dist/stories/clusters/polygon-selection/index.d.ts +0 -6
  52. package/dist/stories/clusters/polygon-selection/polygon.d.ts +0 -20
  53. package/dist/stories/clusters/radial.d.ts +0 -5
  54. package/dist/stories/clusters/with-labels.d.ts +0 -6
  55. package/dist/stories/clusters/worm.d.ts +0 -5
  56. package/dist/stories/clusters.stories.d.ts +0 -9
  57. package/dist/stories/create-cluster-labels.d.ts +0 -4
  58. package/dist/stories/create-cosmos.d.ts +0 -16
  59. package/dist/stories/create-story.d.ts +0 -16
  60. package/dist/stories/experiments/full-mesh.d.ts +0 -5
  61. package/dist/stories/experiments/mesh-with-holes.d.ts +0 -5
  62. package/dist/stories/experiments.stories.d.ts +0 -7
  63. package/dist/stories/generate-mesh-data.d.ts +0 -12
  64. package/dist/stories/geospatial/moscow-metro-stations/index.d.ts +0 -15
  65. package/dist/stories/geospatial/moscow-metro-stations/moscow-metro-coords.d.ts +0 -1
  66. package/dist/stories/geospatial/moscow-metro-stations/point-colors.d.ts +0 -1
  67. package/dist/stories/geospatial.stories.d.ts +0 -6
  68. package/dist/stories/shapes/all-shapes/index.d.ts +0 -5
  69. package/dist/stories/shapes/image-example/index.d.ts +0 -5
  70. package/dist/stories/shapes.stories.d.ts +0 -7
  71. package/logo.svg +0 -3
  72. package/rollup.config.js +0 -70
  73. package/src/config.ts +0 -726
  74. package/src/declaration.d.ts +0 -12
  75. package/src/graph/utils/error-message.ts +0 -23
  76. package/src/helper.ts +0 -74
  77. package/src/index.ts +0 -1608
  78. package/src/modules/Clusters/calculate-centermass.frag +0 -9
  79. package/src/modules/Clusters/calculate-centermass.vert +0 -26
  80. package/src/modules/Clusters/force-cluster.frag +0 -39
  81. package/src/modules/Clusters/index.ts +0 -200
  82. package/src/modules/Drag/index.ts +0 -33
  83. package/src/modules/FPSMonitor/css.ts +0 -53
  84. package/src/modules/FPSMonitor/index.ts +0 -28
  85. package/src/modules/ForceCenter/calculate-centermass.frag +0 -9
  86. package/src/modules/ForceCenter/calculate-centermass.vert +0 -18
  87. package/src/modules/ForceCenter/force-center.frag +0 -27
  88. package/src/modules/ForceCenter/index.ts +0 -104
  89. package/src/modules/ForceGravity/force-gravity.frag +0 -27
  90. package/src/modules/ForceGravity/index.ts +0 -33
  91. package/src/modules/ForceLink/force-spring.ts +0 -73
  92. package/src/modules/ForceLink/index.ts +0 -149
  93. package/src/modules/ForceManyBody/calculate-level.frag +0 -9
  94. package/src/modules/ForceManyBody/calculate-level.vert +0 -25
  95. package/src/modules/ForceManyBody/force-centermass.frag +0 -52
  96. package/src/modules/ForceManyBody/force-level.frag +0 -121
  97. package/src/modules/ForceManyBody/index.ts +0 -223
  98. package/src/modules/ForceManyBody/quadtree-frag-shader.ts +0 -90
  99. package/src/modules/ForceManyBodyQuadtree/calculate-level.frag +0 -9
  100. package/src/modules/ForceManyBodyQuadtree/calculate-level.vert +0 -25
  101. package/src/modules/ForceManyBodyQuadtree/index.ts +0 -157
  102. package/src/modules/ForceManyBodyQuadtree/quadtree-frag-shader.ts +0 -93
  103. package/src/modules/ForceMouse/force-mouse.frag +0 -24
  104. package/src/modules/ForceMouse/index.ts +0 -32
  105. package/src/modules/GraphData/index.ts +0 -383
  106. package/src/modules/Lines/draw-curve-line.frag +0 -46
  107. package/src/modules/Lines/draw-curve-line.vert +0 -194
  108. package/src/modules/Lines/geometry.ts +0 -18
  109. package/src/modules/Lines/hovered-line-index.frag +0 -27
  110. package/src/modules/Lines/hovered-line-index.vert +0 -8
  111. package/src/modules/Lines/index.ts +0 -273
  112. package/src/modules/Points/atlas-utils.ts +0 -137
  113. package/src/modules/Points/drag-point.frag +0 -20
  114. package/src/modules/Points/draw-highlighted.frag +0 -16
  115. package/src/modules/Points/draw-highlighted.vert +0 -86
  116. package/src/modules/Points/draw-points.frag +0 -243
  117. package/src/modules/Points/draw-points.vert +0 -127
  118. package/src/modules/Points/fill-sampled-points.frag +0 -9
  119. package/src/modules/Points/fill-sampled-points.vert +0 -29
  120. package/src/modules/Points/find-hovered-point.frag +0 -9
  121. package/src/modules/Points/find-hovered-point.vert +0 -57
  122. package/src/modules/Points/find-points-on-area-selection.frag +0 -48
  123. package/src/modules/Points/find-points-on-polygon-selection.frag +0 -65
  124. package/src/modules/Points/index.ts +0 -934
  125. package/src/modules/Points/track-positions.frag +0 -18
  126. package/src/modules/Points/update-position.frag +0 -25
  127. package/src/modules/Shared/buffer.ts +0 -37
  128. package/src/modules/Shared/clear.frag +0 -7
  129. package/src/modules/Shared/quad.vert +0 -12
  130. package/src/modules/Store/index.ts +0 -173
  131. package/src/modules/Zoom/index.ts +0 -148
  132. package/src/modules/core-module.ts +0 -28
  133. package/src/stories/1. welcome.mdx +0 -75
  134. package/src/stories/2. configuration.mdx +0 -112
  135. package/src/stories/3. api-reference.mdx +0 -591
  136. package/src/stories/beginners/basic-set-up/data-gen.ts +0 -33
  137. package/src/stories/beginners/basic-set-up/index.ts +0 -163
  138. package/src/stories/beginners/basic-set-up/style.css +0 -35
  139. package/src/stories/beginners/link-hovering/data-generator.ts +0 -198
  140. package/src/stories/beginners/link-hovering/index.ts +0 -61
  141. package/src/stories/beginners/link-hovering/style.css +0 -73
  142. package/src/stories/beginners/point-labels/data.ts +0 -73
  143. package/src/stories/beginners/point-labels/index.ts +0 -65
  144. package/src/stories/beginners/point-labels/labels.ts +0 -46
  145. package/src/stories/beginners/point-labels/style.css +0 -16
  146. package/src/stories/beginners/quick-start.ts +0 -50
  147. package/src/stories/beginners/remove-points/config.ts +0 -25
  148. package/src/stories/beginners/remove-points/data-gen.ts +0 -30
  149. package/src/stories/beginners/remove-points/index.ts +0 -92
  150. package/src/stories/beginners/remove-points/style.css +0 -31
  151. package/src/stories/beginners.stories.ts +0 -117
  152. package/src/stories/clusters/polygon-selection/index.ts +0 -51
  153. package/src/stories/clusters/polygon-selection/polygon.ts +0 -143
  154. package/src/stories/clusters/polygon-selection/style.css +0 -8
  155. package/src/stories/clusters/radial.ts +0 -24
  156. package/src/stories/clusters/with-labels.ts +0 -53
  157. package/src/stories/clusters/worm.ts +0 -40
  158. package/src/stories/clusters.stories.ts +0 -77
  159. package/src/stories/create-cluster-labels.ts +0 -50
  160. package/src/stories/create-cosmos.ts +0 -68
  161. package/src/stories/create-story.ts +0 -51
  162. package/src/stories/experiments/full-mesh.ts +0 -13
  163. package/src/stories/experiments/mesh-with-holes.ts +0 -13
  164. package/src/stories/experiments.stories.ts +0 -43
  165. package/src/stories/generate-mesh-data.ts +0 -125
  166. package/src/stories/geospatial/moscow-metro-stations/index.ts +0 -62
  167. package/src/stories/geospatial/moscow-metro-stations/moscow-metro-coords.ts +0 -1
  168. package/src/stories/geospatial/moscow-metro-stations/point-colors.ts +0 -46
  169. package/src/stories/geospatial/moscow-metro-stations/style.css +0 -30
  170. package/src/stories/geospatial.stories.ts +0 -30
  171. package/src/stories/shapes/all-shapes/index.ts +0 -69
  172. package/src/stories/shapes/image-example/icons/box.png +0 -0
  173. package/src/stories/shapes/image-example/icons/lego.png +0 -0
  174. package/src/stories/shapes/image-example/icons/s.png +0 -0
  175. package/src/stories/shapes/image-example/icons/swift.png +0 -0
  176. package/src/stories/shapes/image-example/icons/toolbox.png +0 -0
  177. package/src/stories/shapes/image-example/index.ts +0 -238
  178. package/src/stories/shapes.stories.ts +0 -37
  179. package/src/variables.ts +0 -68
  180. package/tsconfig.json +0 -41
  181. package/vite.config.ts +0 -54
@@ -1,12 +0,0 @@
1
- export type MeshData = {
2
- pointPositions: Float32Array;
3
- pointColors: Float32Array;
4
- pointSizes: Float32Array;
5
- links: Float32Array;
6
- linkColors: Float32Array;
7
- linkWidths: Float32Array;
8
- pointClusters: number[];
9
- clusterPositions: number[];
10
- clusterStrength: Float32Array;
11
- };
12
- export declare function generateMeshData(n: number, m: number, nClusters: number, wholeness: number, radialness?: number[]): MeshData;
@@ -1,15 +0,0 @@
1
- import { Graph } from '../../..';
2
- /**
3
- * This example demonstrates the importance of rescaling positions by Cosmos.
4
- * The Moscow Metro station coordinates are are normalized (0-1 range in both dimensions).
5
- * By default, cosmos.gl rescales these positions to fit the canvas.
6
- * When disabling rescaling (`rescalePositions: false`):
7
- * - Points render using raw coordinates
8
- * - The entire graph occupies a tiny 1x1 area in WebGL's clip space (-1 to 1)
9
- * - This causes visual artifacts due to WebGL's floating-point precision limitations
10
- * - Points cluster in the center and may exhibit rendering glitches
11
- */
12
- export declare const moscowMetroStations: () => {
13
- graph: Graph;
14
- div: HTMLDivElement;
15
- };
@@ -1 +0,0 @@
1
- export declare const moscowMetroCoords: number[];
@@ -1 +0,0 @@
1
- export declare const getPointColors: (pointPositions: number[]) => Float32Array;
@@ -1,6 +0,0 @@
1
- import { Meta } from '@storybook/html';
2
- import { Story } from './create-story';
3
- import { CosmosStoryProps } from './create-cosmos';
4
- declare const meta: Meta<CosmosStoryProps>;
5
- export declare const MoscowMetroStations: Story;
6
- export default meta;
@@ -1,5 +0,0 @@
1
- import { Graph } from '../../..';
2
- export declare const allShapes: () => {
3
- div: HTMLDivElement;
4
- graph: Graph;
5
- };
@@ -1,5 +0,0 @@
1
- import { Graph } from '../../..';
2
- export declare const imageExample: () => Promise<{
3
- div: HTMLDivElement;
4
- graph: Graph;
5
- }>;
@@ -1,7 +0,0 @@
1
- import { Meta } from '@storybook/html';
2
- import { Story } from './create-story';
3
- import { CosmosStoryProps } from './create-cosmos';
4
- declare const meta: Meta<CosmosStoryProps>;
5
- export declare const AllShapes: Story;
6
- export declare const ImageExample: Story;
7
- export default meta;
package/logo.svg DELETED
@@ -1,3 +0,0 @@
1
- <svg width="89" height="19" viewBox="0 0 89 19" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M6.968 18.336C2.792 18.336 0.2 15.936 0.2 11.616V7.584C0.2 3.264 2.792 0.863999 6.968 0.863999C11.096 0.863999 13.448 3.264 13.448 7.2V7.344H10.328V7.104C10.328 5.136 9.224 3.696 6.968 3.696C4.712 3.696 3.368 5.184 3.368 7.536V11.664C3.368 14.016 4.712 15.504 6.968 15.504C9.224 15.504 10.328 14.064 10.328 12.096V11.664H13.448V12C13.448 15.936 11.096 18.336 6.968 18.336ZM21.7893 18.336C18.2373 18.336 15.5493 16.08 15.5493 12.24V11.856C15.5493 8.016 18.2373 5.76 21.7893 5.76C25.3413 5.76 28.0293 8.016 28.0293 11.856V12.24C28.0293 16.08 25.3413 18.336 21.7893 18.336ZM21.7893 15.648C23.6373 15.648 25.0053 14.4 25.0053 12.168V11.928C25.0053 9.696 23.6613 8.448 21.7893 8.448C19.9173 8.448 18.5733 9.696 18.5733 11.928V12.168C18.5733 14.4 19.9413 15.648 21.7893 15.648ZM35.7646 18.336C32.6446 18.336 30.5566 16.944 30.1486 14.448L32.9326 13.728C33.2446 15.408 34.3726 15.936 35.7646 15.936C37.1566 15.936 37.8286 15.384 37.8286 14.64C37.8286 13.896 37.2286 13.56 35.8126 13.296L35.1406 13.176C32.6446 12.72 30.5806 11.784 30.5806 9.432C30.5806 7.08 32.4526 5.76 35.2846 5.76C37.9486 5.76 39.7726 7.056 40.3246 8.976L37.5166 9.84C37.2526 8.616 36.4366 8.16 35.2846 8.16C34.1326 8.16 33.5086 8.592 33.5086 9.288C33.5086 10.056 34.1806 10.368 35.2846 10.56L35.9566 10.68C38.6446 11.16 40.7566 11.928 40.7566 14.424C40.7566 16.92 38.7886 18.336 35.7646 18.336ZM43.4066 18V6.096H46.3826V7.392H46.8146C47.2226 6.6 48.1586 5.904 49.7426 5.904C51.4466 5.904 52.4066 6.624 52.9586 7.68H53.3906C53.9186 6.672 54.8306 5.904 56.6546 5.904C58.8626 5.904 60.6386 7.296 60.6386 10.176V18H57.6146V10.392C57.6146 9.096 56.8946 8.424 55.6946 8.424C54.3026 8.424 53.5346 9.336 53.5346 10.968V18H50.5106V10.392C50.5106 9.096 49.7906 8.424 48.5906 8.424C47.1986 8.424 46.4306 9.336 46.4306 10.968V18H43.4066ZM69.5549 18.336C66.0029 18.336 63.3149 16.08 63.3149 12.24V11.856C63.3149 8.016 66.0029 5.76 69.5549 5.76C73.1069 5.76 75.7949 8.016 75.7949 11.856V12.24C75.7949 16.08 73.1069 18.336 69.5549 18.336ZM69.5549 15.648C71.4029 15.648 72.7709 14.4 72.7709 12.168V11.928C72.7709 9.696 71.4269 8.448 69.5549 8.448C67.6829 8.448 66.3389 9.696 66.3389 11.928V12.168C66.3389 14.4 67.7069 15.648 69.5549 15.648ZM83.5303 18.336C80.4103 18.336 78.3223 16.944 77.9143 14.448L80.6983 13.728C81.0103 15.408 82.1383 15.936 83.5303 15.936C84.9223 15.936 85.5943 15.384 85.5943 14.64C85.5943 13.896 84.9943 13.56 83.5783 13.296L82.9062 13.176C80.4103 12.72 78.3463 11.784 78.3463 9.432C78.3463 7.08 80.2183 5.76 83.0503 5.76C85.7143 5.76 87.5383 7.056 88.0903 8.976L85.2823 9.84C85.0183 8.616 84.2023 8.16 83.0503 8.16C81.8983 8.16 81.2743 8.592 81.2743 9.288C81.2743 10.056 81.9463 10.368 83.0503 10.56L83.7223 10.68C86.4103 11.16 88.5223 11.928 88.5223 14.424C88.5223 16.92 86.5543 18.336 83.5303 18.336Z" fill="currentColor"/>
3
- </svg>
package/rollup.config.js DELETED
@@ -1,70 +0,0 @@
1
- import path from 'path'
2
- import alias from '@rollup/plugin-alias'
3
- import commonjs from '@rollup/plugin-commonjs'
4
- import resolve from '@rollup/plugin-node-resolve'
5
- import terser from '@rollup/plugin-terser'
6
- import glslify from 'rollup-plugin-glslify'
7
- import typescript from '@rollup/plugin-typescript'
8
- import pkg from './package.json'
9
-
10
- const libraryName = 'index'
11
- const outputFolder = 'dist'
12
-
13
- const externals = [
14
- ...Object.keys(pkg.dependencies || {}),
15
- ...Object.keys(pkg.peerDependencies || {}),
16
- ]
17
-
18
- const config = {
19
- input: 'src/index.ts',
20
- output: {
21
- file: `${outputFolder}/${libraryName}.js`,
22
- name: 'Cosmos',
23
- format: 'umd',
24
- sourcemap: true,
25
- },
26
- plugins: [
27
- resolve(),
28
- commonjs(),
29
- glslify({
30
- include: [
31
- '**/*.vs',
32
- '**/*.fs',
33
- '**/*.vert',
34
- '**/*.frag',
35
- '**/*.glsl',
36
- ],
37
- exclude: 'node_modules/**',
38
- }),
39
- typescript(),
40
- alias({
41
- resolve: ['', '/index.ts', '.ts'],
42
- entries: [
43
- { find: '@/graph', replacement: path.resolve(__dirname, 'src/') },
44
- { find: '@cosmos.gl/graph', replacement: path.resolve(__dirname, 'src/') },
45
- ],
46
- }),
47
- ],
48
- }
49
- // eslint-disable-next-line import/no-default-export
50
- export default [
51
- {
52
- ...config,
53
- external: externals,
54
- output: {
55
- ...config.output,
56
- format: 'es',
57
- },
58
- },
59
- {
60
- ...config,
61
- output: {
62
- ...config.output,
63
- file: `${outputFolder}/${libraryName}.min.js`,
64
- },
65
- plugins: [
66
- ...config.plugins,
67
- terser(),
68
- ],
69
- },
70
- ]