@cosmos.gl/graph 2.6.2-rc.0 → 2.7.0-beta.0
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/.eslintrc +147 -0
- package/.github/SECURITY.md +13 -0
- package/.github/dco.yml +4 -0
- package/.github/workflows/github_pages.yml +54 -0
- package/.storybook/main.ts +26 -0
- package/.storybook/manager-head.html +1 -0
- package/.storybook/manager.ts +14 -0
- package/.storybook/preview.ts +29 -0
- package/.storybook/style.css +3 -0
- package/CHARTER.md +69 -0
- package/CODE_OF_CONDUCT.md +178 -0
- package/CONTRIBUTING.md +22 -0
- package/GOVERNANCE.md +21 -0
- package/cosmos-2-0-migration-notes.md +98 -0
- package/cosmos_awesome.md +96 -0
- package/dist/config.d.ts +5 -9
- package/dist/graph/utils/error-message.d.ts +1 -1
- package/dist/helper.d.ts +39 -2
- package/dist/index-FUIgayhu.js +19827 -0
- package/dist/index-FUIgayhu.js.map +1 -0
- package/dist/index.d.ts +17 -64
- package/dist/index.js +14 -14654
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1062 -475
- package/dist/index.min.js.map +1 -1
- package/dist/modules/Clusters/index.d.ts +11 -3
- package/dist/modules/ForceCenter/index.d.ts +10 -3
- package/dist/modules/ForceGravity/index.d.ts +5 -1
- package/dist/modules/ForceLink/index.d.ts +8 -5
- package/dist/modules/ForceManyBody/index.d.ts +16 -7
- package/dist/modules/ForceMouse/index.d.ts +5 -1
- package/dist/modules/GraphData/index.d.ts +0 -1
- package/dist/modules/Lines/index.d.ts +11 -5
- package/dist/modules/Points/index.d.ts +31 -13
- package/dist/modules/Store/index.d.ts +93 -0
- package/dist/modules/core-module.d.ts +3 -3
- package/dist/stories/beginners/basic-set-up/data-gen.d.ts +4 -0
- package/dist/stories/beginners/basic-set-up/index.d.ts +6 -0
- package/dist/stories/beginners/link-hovering/data-generator.d.ts +19 -0
- package/dist/stories/beginners/link-hovering/index.d.ts +6 -0
- package/dist/stories/beginners/point-labels/data.d.ts +13 -0
- package/dist/stories/beginners/point-labels/index.d.ts +10 -0
- package/dist/stories/beginners/point-labels/labels.d.ts +8 -0
- package/dist/stories/beginners/quick-start.d.ts +6 -0
- package/dist/stories/beginners/remove-points/config.d.ts +2 -0
- package/dist/stories/beginners/remove-points/data-gen.d.ts +4 -0
- package/dist/stories/beginners/remove-points/index.d.ts +6 -0
- package/dist/stories/beginners.stories.d.ts +10 -0
- package/dist/stories/clusters/polygon-selection/index.d.ts +6 -0
- package/dist/stories/clusters/polygon-selection/polygon.d.ts +20 -0
- package/dist/stories/clusters/radial.d.ts +6 -0
- package/dist/stories/clusters/with-labels.d.ts +6 -0
- package/dist/stories/clusters/worm.d.ts +6 -0
- package/dist/stories/clusters.stories.d.ts +9 -0
- package/dist/stories/create-cluster-labels.d.ts +4 -0
- package/dist/stories/create-cosmos.d.ts +17 -0
- package/dist/stories/create-story.d.ts +16 -0
- package/dist/stories/experiments/full-mesh.d.ts +6 -0
- package/dist/stories/experiments/mesh-with-holes.d.ts +6 -0
- package/dist/stories/experiments.stories.d.ts +7 -0
- package/dist/stories/generate-mesh-data.d.ts +12 -0
- package/dist/stories/geospatial/moscow-metro-stations/index.d.ts +16 -0
- package/dist/stories/geospatial/moscow-metro-stations/moscow-metro-coords.d.ts +1 -0
- package/dist/stories/geospatial/moscow-metro-stations/point-colors.d.ts +1 -0
- package/dist/stories/geospatial.stories.d.ts +6 -0
- package/dist/stories/shapes/all-shapes/index.d.ts +6 -0
- package/dist/stories/shapes/image-example/index.d.ts +6 -0
- package/dist/stories/shapes.stories.d.ts +7 -0
- package/dist/stories/test-luma-migration.d.ts +6 -0
- package/dist/stories/test.stories.d.ts +6 -0
- package/dist/webgl-device-B9ewDj5L.js +3923 -0
- package/dist/webgl-device-B9ewDj5L.js.map +1 -0
- package/logo.svg +3 -0
- package/package.json +5 -7
- package/rollup.config.js +70 -0
- package/src/config.ts +728 -0
- package/src/declaration.d.ts +12 -0
- package/src/graph/utils/error-message.ts +23 -0
- package/src/helper.ts +113 -0
- package/src/index.ts +1769 -0
- package/src/modules/Clusters/calculate-centermass.frag +12 -0
- package/src/modules/Clusters/calculate-centermass.vert +38 -0
- package/src/modules/Clusters/force-cluster.frag +55 -0
- package/src/modules/Clusters/index.ts +578 -0
- package/src/modules/Drag/index.ts +33 -0
- package/src/modules/FPSMonitor/css.ts +53 -0
- package/src/modules/FPSMonitor/index.ts +28 -0
- package/src/modules/ForceCenter/calculate-centermass.frag +9 -0
- package/src/modules/ForceCenter/calculate-centermass.vert +26 -0
- package/src/modules/ForceCenter/force-center.frag +37 -0
- package/src/modules/ForceCenter/index.ts +284 -0
- package/src/modules/ForceGravity/force-gravity.frag +40 -0
- package/src/modules/ForceGravity/index.ts +107 -0
- package/src/modules/ForceLink/force-spring.ts +89 -0
- package/src/modules/ForceLink/index.ts +293 -0
- package/src/modules/ForceManyBody/calculate-level.frag +9 -0
- package/src/modules/ForceManyBody/calculate-level.vert +37 -0
- package/src/modules/ForceManyBody/force-centermass.frag +61 -0
- package/src/modules/ForceManyBody/force-level.frag +138 -0
- package/src/modules/ForceManyBody/index.ts +525 -0
- package/src/modules/ForceManyBody/quadtree-frag-shader.ts +89 -0
- package/src/modules/ForceManyBodyQuadtree/calculate-level.frag +9 -0
- package/src/modules/ForceManyBodyQuadtree/calculate-level.vert +25 -0
- package/src/modules/ForceManyBodyQuadtree/index.ts +157 -0
- package/src/modules/ForceManyBodyQuadtree/quadtree-frag-shader.ts +93 -0
- package/src/modules/ForceMouse/force-mouse.frag +35 -0
- package/src/modules/ForceMouse/index.ts +102 -0
- package/src/modules/GraphData/index.ts +383 -0
- package/src/modules/Lines/draw-curve-line.frag +59 -0
- package/src/modules/Lines/draw-curve-line.vert +248 -0
- package/src/modules/Lines/geometry.ts +18 -0
- package/src/modules/Lines/hovered-line-index.frag +43 -0
- package/src/modules/Lines/hovered-line-index.vert +13 -0
- package/src/modules/Lines/index.ts +661 -0
- package/src/modules/Points/atlas-utils.ts +137 -0
- package/src/modules/Points/drag-point.frag +34 -0
- package/src/modules/Points/draw-highlighted.frag +44 -0
- package/src/modules/Points/draw-highlighted.vert +145 -0
- package/src/modules/Points/draw-points.frag +259 -0
- package/src/modules/Points/draw-points.vert +203 -0
- package/src/modules/Points/fill-sampled-points.frag +12 -0
- package/src/modules/Points/fill-sampled-points.vert +51 -0
- package/src/modules/Points/find-hovered-point.frag +15 -0
- package/src/modules/Points/find-hovered-point.vert +90 -0
- package/src/modules/Points/find-points-on-area-selection.frag +88 -0
- package/src/modules/Points/find-points-on-polygon-selection.frag +89 -0
- package/src/modules/Points/index.ts +2292 -0
- package/src/modules/Points/track-positions.frag +30 -0
- package/src/modules/Points/update-position.frag +39 -0
- package/src/modules/Shared/buffer.ts +39 -0
- package/src/modules/Shared/clear.frag +10 -0
- package/src/modules/Shared/quad.vert +13 -0
- package/src/modules/Store/index.ts +283 -0
- package/src/modules/Zoom/index.ts +148 -0
- package/src/modules/core-module.ts +28 -0
- package/src/stories/1. welcome.mdx +75 -0
- package/src/stories/2. configuration.mdx +111 -0
- package/src/stories/3. api-reference.mdx +591 -0
- package/src/stories/beginners/basic-set-up/data-gen.ts +33 -0
- package/src/stories/beginners/basic-set-up/index.ts +167 -0
- package/src/stories/beginners/basic-set-up/style.css +35 -0
- package/src/stories/beginners/link-hovering/data-generator.ts +198 -0
- package/src/stories/beginners/link-hovering/index.ts +65 -0
- package/src/stories/beginners/link-hovering/style.css +73 -0
- package/src/stories/beginners/point-labels/data.ts +73 -0
- package/src/stories/beginners/point-labels/index.ts +69 -0
- package/src/stories/beginners/point-labels/labels.ts +46 -0
- package/src/stories/beginners/point-labels/style.css +16 -0
- package/src/stories/beginners/quick-start.ts +54 -0
- package/src/stories/beginners/remove-points/config.ts +25 -0
- package/src/stories/beginners/remove-points/data-gen.ts +30 -0
- package/src/stories/beginners/remove-points/index.ts +96 -0
- package/src/stories/beginners/remove-points/style.css +31 -0
- package/src/stories/beginners.stories.ts +130 -0
- package/src/stories/clusters/polygon-selection/index.ts +52 -0
- package/src/stories/clusters/polygon-selection/polygon.ts +143 -0
- package/src/stories/clusters/polygon-selection/style.css +8 -0
- package/src/stories/clusters/radial.ts +24 -0
- package/src/stories/clusters/with-labels.ts +54 -0
- package/src/stories/clusters/worm.ts +40 -0
- package/src/stories/clusters.stories.ts +77 -0
- package/src/stories/create-cluster-labels.ts +50 -0
- package/src/stories/create-cosmos.ts +72 -0
- package/src/stories/create-story.ts +51 -0
- package/src/stories/experiments/full-mesh.ts +13 -0
- package/src/stories/experiments/mesh-with-holes.ts +13 -0
- package/src/stories/experiments.stories.ts +43 -0
- package/src/stories/generate-mesh-data.ts +125 -0
- package/src/stories/geospatial/moscow-metro-stations/index.ts +66 -0
- package/src/stories/geospatial/moscow-metro-stations/moscow-metro-coords.ts +1 -0
- package/src/stories/geospatial/moscow-metro-stations/point-colors.ts +46 -0
- package/src/stories/geospatial/moscow-metro-stations/style.css +30 -0
- package/src/stories/geospatial.stories.ts +30 -0
- package/src/stories/shapes/all-shapes/index.ts +73 -0
- 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 +246 -0
- package/src/stories/shapes.stories.ts +37 -0
- package/src/stories/test-luma-migration.ts +195 -0
- package/src/stories/test.stories.ts +25 -0
- package/src/variables.ts +68 -0
- package/tsconfig.json +41 -0
- package/vite.config.ts +52 -0
package/logo.svg
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmos.gl/graph",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0-beta.0",
|
|
4
4
|
"description": "GPU-based force graph layout and rendering",
|
|
5
5
|
"jsdelivr": "dist/index.min.js",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,10 +8,6 @@
|
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"repository": "git://github.com/cosmos.gl/graph.git",
|
|
10
10
|
"type": "module",
|
|
11
|
-
"files": [
|
|
12
|
-
"dist",
|
|
13
|
-
"CITATION.cff"
|
|
14
|
-
],
|
|
15
11
|
"scripts": {
|
|
16
12
|
"build": "rm -rf dist; rollup -c",
|
|
17
13
|
"build:vite": "rm -rf dist; vite build",
|
|
@@ -77,10 +73,12 @@
|
|
|
77
73
|
"storybook": "^8.4.5",
|
|
78
74
|
"typescript": "^5.5.2",
|
|
79
75
|
"vite": "^6.3.4",
|
|
80
|
-
"vite-plugin-dts": "^4.3.0"
|
|
81
|
-
"vite-plugin-glsl": "^1.3.0"
|
|
76
|
+
"vite-plugin-dts": "^4.3.0"
|
|
82
77
|
},
|
|
83
78
|
"dependencies": {
|
|
79
|
+
"@luma.gl/core": "^9.2.3",
|
|
80
|
+
"@luma.gl/engine": "^9.2.3",
|
|
81
|
+
"@luma.gl/webgl": "^9.2.3",
|
|
84
82
|
"d3-array": "^3.2.0",
|
|
85
83
|
"d3-color": "^3.1.0",
|
|
86
84
|
"d3-drag": "^3.0.0",
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
]
|