@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,178 +0,0 @@
1
- # Code of Conduct
2
-
3
- Cosmos, as member project of the OpenJS Foundation, use [Contributor Covenant
4
- v2.0](https://contributor-covenant.org/version/2/0/code_of_conduct) as their
5
- code of conduct. The full text is included
6
- [below](#contributor-covenant-code-of-conduct) in English, and translations are
7
- available from the Contributor Covenant organisation:
8
-
9
- - [contributor-covenant.org/translations](https://www.contributor-covenant.org/translations)
10
- - [github.com/ContributorCovenant](https://github.com/ContributorCovenant/contributor_covenant/tree/release/content/version/2/0)
11
-
12
- Refer to the sections on reporting and escalation in this document for the
13
- specific emails that can be used to report and escalate issues.
14
-
15
- ## Reporting
16
-
17
- ### Project Spaces
18
-
19
- For reporting issues in spaces related to cosmos.gl please use the email
20
- `cosmosgl@rokotyan.com`. Cosmos.gl handles CoC issues
21
- related to the spaces that it maintains. Projects maintainers commit to:
22
-
23
- - maintain the confidentiality with regard to the reporter of an incident
24
- - to participate in the path for escalation as outlined in the section on
25
- Escalation when required.
26
-
27
- ### Foundation Spaces
28
-
29
- For reporting issues in spaces managed by the OpenJS Foundation, for example,
30
- repositories within the OpenJS organization, use the email
31
- `report@lists.openjsf.org`. The Cross Project Council (CPC) is responsible for
32
- managing these reports and commits to:
33
-
34
- - maintain the confidentiality with regard to the reporter of an incident
35
- - to participate in the path for escalation as outlined in the section on
36
- Escalation when required.
37
-
38
- ## Escalation
39
-
40
- The OpenJS Foundation maintains a Code of Conduct Panel (CoCP). This is a
41
- foundation-wide team established to manage escalation when a reporter believes
42
- that a report to a member project or the CPC has not been properly handled. In
43
- order to escalate to the CoCP send an email to
44
- `coc-escalation@lists.openjsf.org`.
45
-
46
- For more information, refer to the full [Code of Conduct governance
47
- document](https://github.com/openjs-foundation/cross-project-council/blob/HEAD/CODE_OF_CONDUCT.md).
48
-
49
- ---
50
-
51
- ## Contributor Covenant Code of Conduct v2.0
52
-
53
- ### Our Pledge
54
-
55
- We as members, contributors, and leaders pledge to make participation in our
56
- community a harassment-free experience for everyone, regardless of age, body
57
- size, visible or invisible disability, ethnicity, sex characteristics, gender
58
- identity and expression, level of experience, education, socio-economic status,
59
- nationality, personal appearance, race, religion, or sexual identity and
60
- orientation.
61
-
62
- We pledge to act and interact in ways that contribute to an open, welcoming,
63
- diverse, inclusive, and healthy community.
64
-
65
- ### Our Standards
66
-
67
- Examples of behavior that contributes to a positive environment for our
68
- community include:
69
-
70
- * Demonstrating empathy and kindness toward other people
71
- * Being respectful of differing opinions, viewpoints, and experiences
72
- * Giving and gracefully accepting constructive feedback
73
- * Accepting responsibility and apologizing to those affected by our mistakes,
74
- and learning from the experience
75
- * Focusing on what is best not just for us as individuals, but for the overall
76
- community
77
-
78
- Examples of unacceptable behavior include:
79
-
80
- * The use of sexualized language or imagery, and sexual attention or advances of
81
- any kind
82
- * Trolling, insulting or derogatory comments, and personal or political attacks
83
- * Public or private harassment
84
- * Publishing others' private information, such as a physical or email address,
85
- without their explicit permission
86
- * Other conduct which could reasonably be considered inappropriate in a
87
- professional setting
88
-
89
- ### Enforcement Responsibilities
90
-
91
- Community leaders are responsible for clarifying and enforcing our standards of
92
- acceptable behavior and will take appropriate and fair corrective action in
93
- response to any behavior that they deem inappropriate, threatening, offensive,
94
- or harmful.
95
-
96
- Community leaders have the right and responsibility to remove, edit, or reject
97
- comments, commits, code, wiki edits, issues, and other contributions that are
98
- not aligned to this Code of Conduct, and will communicate reasons for moderation
99
- decisions when appropriate.
100
-
101
- ### Scope
102
-
103
- This Code of Conduct applies within all community spaces, and also applies when
104
- an individual is officially representing the community in public spaces.
105
- Examples of representing our community include using an official e-mail address,
106
- posting via an official social media account, or acting as an appointed
107
- representative at an online or offline event.
108
-
109
- ### Enforcement
110
-
111
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
112
- reported to the community leaders responsible for enforcement at the email
113
- addresses listed above in the [Reporting](#reporting) and
114
- [Escalation](#escalation) sections. All complaints will be reviewed and
115
- investigated promptly and fairly.
116
-
117
- All community leaders are obligated to respect the privacy and security of the
118
- reporter of any incident.
119
-
120
- ### Enforcement Guidelines
121
-
122
- Community leaders will follow these Community Impact Guidelines in determining
123
- the consequences for any action they deem in violation of this Code of Conduct:
124
-
125
- #### 1. Correction
126
-
127
- **Community Impact**: Use of inappropriate language or other behavior deemed
128
- unprofessional or unwelcome in the community.
129
-
130
- **Consequence**: A private, written warning from community leaders, providing
131
- clarity around the nature of the violation and an explanation of why the
132
- behavior was inappropriate. A public apology may be requested.
133
-
134
- #### 2. Warning
135
-
136
- **Community Impact**: A violation through a single incident or series of
137
- actions.
138
-
139
- **Consequence**: A warning with consequences for continued behavior. No
140
- interaction with the people involved, including unsolicited interaction with
141
- those enforcing the Code of Conduct, for a specified period of time. This
142
- includes avoiding interactions in community spaces as well as external channels
143
- like social media. Violating these terms may lead to a temporary or permanent
144
- ban.
145
-
146
- #### 3. Temporary Ban
147
-
148
- **Community Impact**: A serious violation of community standards, including
149
- sustained inappropriate behavior.
150
-
151
- **Consequence**: A temporary ban from any sort of interaction or public
152
- communication with the community for a specified period of time. No public or
153
- private interaction with the people involved, including unsolicited interaction
154
- with those enforcing the Code of Conduct, is allowed during this period.
155
- Violating these terms may lead to a permanent ban.
156
-
157
- #### 4. Permanent Ban
158
-
159
- **Community Impact**: Demonstrating a pattern of violation of community
160
- standards, including sustained inappropriate behavior, harassment of an
161
- individual, or aggression toward or disparagement of classes of individuals.
162
-
163
- **Consequence**: A permanent ban from any sort of public interaction within the
164
- project community.
165
-
166
- ### Attribution
167
-
168
- This Code of Conduct is adapted from the [Contributor
169
- Covenant](https://www.contributor-covenant.org), version 2.0, available at
170
- [contributor-covenant.org/version/2/0/code_of_conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct).
171
-
172
- Community Impact Guidelines were inspired by [Mozilla's code of conduct
173
- enforcement ladder](https://github.com/mozilla/diversity).
174
-
175
- For answers to common questions about this code of conduct, see the FAQ at
176
- [contributor-covenant.org/faq](https://www.contributor-covenant.org/faq).
177
- Translations are available at
178
- [contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).
package/CONTRIBUTING.md DELETED
@@ -1,22 +0,0 @@
1
- # Contributing to _Cosmos_
2
- We want to make contributing to this project as easy and transparent as possible.
3
-
4
- ## Code of Conduct
5
- cosmos.gl has a Code of Conduct that we expect project participants to adhere
6
- to. Please read [the full text](https://github.com/cosmos.gl/graph/CODE_OF_CONDUCT.md) so that you can understand
7
- what actions will and will not be tolerated.
8
-
9
- ## Our Development Process
10
- We use Storybook to simplify the development process. You can start it by running `npm run storybook` in the root directory.
11
- If you've added a new feature, changed the configuration or public methods, please add a new example with its source code to Storybook if applicable and suggest changes to the docs.
12
-
13
- ## Pull Requests
14
- We actively welcome pull requests. If you want to submit one, please follow the following process:
15
-
16
- 1. Fork the repo and create your branch from `main`;
17
- 2. Code;
18
- 3. Make sure the project lints and builds after your changes;
19
- 4. Submit your PR!
20
-
21
- ## License
22
- By contributing to _Cosmos_, you agree that your contributions will be licensed its MIT license.
package/GOVERNANCE.md DELETED
@@ -1,21 +0,0 @@
1
- # cosmos.gl Governance Guidelines
2
-
3
- The [TSC Charter](./CHARTER.md) governs the operations of the TSC. All changes to the Charter need approval by the OpenJS Foundation Cross-Project Council (CPC).
4
-
5
- The TSC oversees all technical development in the cosmos.gl project, as long as it follows policies set by CPC, including:
6
- - Setting release dates.
7
- - Release quality standards.
8
- - Technical direction.
9
- - Project governance and process.
10
- - GitHub repository hosting.
11
- - Conduct guidelines.
12
- - Maintaining the list of additional collaborators.
13
- - Development process and any coding standards.
14
- - Mediating technical conflicts between collaborators or foundation projects.
15
-
16
- The TSC will define cosmos.gl project’s release vehicles.
17
-
18
- ### **Project Operations & Management**
19
- The TSC will establish and maintain a development process for the cosmos.gl project. The development process will establish guidelines for how the developers and community will operate. It will, for example, establish appropriate timelines for TSC review (e.g. agenda items must be published at least a certain number of hours in advance of a TSC meeting).
20
-
21
- The TSC and entire technical community will follow any processes as may be specified by the OpenJS Foundation Board relating to the intake and license compliance review of contributions, including the OpenJS Foundation IP Policy.
@@ -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
@@ -1,4 +0,0 @@
1
- export declare function generateData(n?: number, m?: number): {
2
- pointPositions: Float32Array;
3
- links: Float32Array;
4
- };
@@ -1,5 +0,0 @@
1
- import { Graph } from '../../..';
2
- export declare const basicSetUp: () => {
3
- graph: Graph;
4
- div: HTMLDivElement;
5
- };
@@ -1,19 +0,0 @@
1
- interface Point {
2
- id: number;
3
- }
4
- interface Link {
5
- source: number;
6
- target: number;
7
- }
8
- interface NetworkData {
9
- pointPositions: Float32Array;
10
- pointColors: Float32Array;
11
- pointSizes: Float32Array;
12
- links: Float32Array;
13
- linkColors: Float32Array;
14
- linkWidths: Float32Array;
15
- points: Point[];
16
- connections: Link[];
17
- }
18
- export declare function generateData(pointCount?: number): NetworkData;
19
- export {};
@@ -1,5 +0,0 @@
1
- import { Graph } from '../../..';
2
- export declare const linkHovering: () => {
3
- div: HTMLDivElement;
4
- graph: Graph;
5
- };
@@ -1,13 +0,0 @@
1
- export declare const pointsToShowLabelsFor: string[];
2
- export declare const processPerformances: (performances: {
3
- theaterCode: string;
4
- performanceTitle: string;
5
- theaterName: string;
6
- }[]) => {
7
- pointPositions: Float32Array;
8
- pointColors: Float32Array;
9
- pointSizes: Float32Array;
10
- pointLabelToIndex: Map<string, number>;
11
- pointIndexToLabel: Map<number, string>;
12
- links: Float32Array;
13
- };
@@ -1,9 +0,0 @@
1
- import { Graph } from '../../..';
2
- export declare const pointLabels: (performances: {
3
- theaterCode: string;
4
- performanceTitle: string;
5
- theaterName: string;
6
- }[]) => {
7
- graph: Graph;
8
- div: HTMLDivElement;
9
- };
@@ -1,8 +0,0 @@
1
- import { Graph } from '../../..';
2
- export declare class CosmosLabels {
3
- private labelRenderer;
4
- private labels;
5
- private pointIndexToLabel;
6
- constructor(div: HTMLDivElement, pointIndexToLabel: Map<number, string>);
7
- update(graph: Graph): void;
8
- }
@@ -1,5 +0,0 @@
1
- import { Graph } from '../..';
2
- export declare const quickStart: () => {
3
- graph: Graph;
4
- div: HTMLDivElement;
5
- };
@@ -1,2 +0,0 @@
1
- import { GraphConfigInterface } from '../../..';
2
- export declare const config: GraphConfigInterface;
@@ -1,4 +0,0 @@
1
- export declare function generateData(n?: number, m?: number): {
2
- pointPositions: number[];
3
- links: number[];
4
- };
@@ -1,5 +0,0 @@
1
- import { Graph } from '../../..';
2
- export declare const removePoints: () => {
3
- graph: Graph;
4
- div: HTMLDivElement;
5
- };
@@ -1,10 +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 QuickStart: Story;
6
- export declare const BasicSetUp: Story;
7
- export declare const PointLabels: Story;
8
- export declare const RemovePoints: Story;
9
- export declare const LinkHovering: Story;
10
- export default meta;
@@ -1,6 +0,0 @@
1
- import { Graph } from '../../..';
2
- export declare const polygonSelection: () => {
3
- div: HTMLDivElement;
4
- graph: Graph;
5
- destroy: () => void;
6
- };
@@ -1,20 +0,0 @@
1
- export declare class PolygonSelection {
2
- private canvas;
3
- private ctx;
4
- private isDrawing;
5
- private points;
6
- private graphDiv;
7
- private onPolygonComplete?;
8
- private boundStartDrawing;
9
- private boundDraw;
10
- private boundStopDrawing;
11
- private resizeObserver;
12
- constructor(graphDiv: HTMLElement, onPolygonComplete?: (points: [number, number][]) => void);
13
- enablePolygonMode(): void;
14
- disablePolygonMode(): void;
15
- destroy(): void;
16
- private resizeCanvas;
17
- private startDrawing;
18
- private draw;
19
- private stopDrawing;
20
- }
@@ -1,5 +0,0 @@
1
- import { Graph } from '../..';
2
- export declare const radial: () => {
3
- graph: Graph;
4
- div: HTMLDivElement;
5
- };
@@ -1,6 +0,0 @@
1
- import { Graph } from '../..';
2
- export declare const withLabels: () => {
3
- div: HTMLDivElement;
4
- graph: Graph;
5
- destroy: () => void;
6
- };
@@ -1,5 +0,0 @@
1
- import { Graph } from '../..';
2
- export declare const worm: () => {
3
- graph: Graph;
4
- div: HTMLDivElement;
5
- };
@@ -1,9 +0,0 @@
1
- import { Meta } from '@storybook/html';
2
- import { CosmosStoryProps } from './create-cosmos';
3
- import { Story } from './create-story';
4
- declare const meta: Meta<CosmosStoryProps>;
5
- export declare const Worm: Story;
6
- export declare const Radial: Story;
7
- export declare const WithLabels: Story;
8
- export declare const PolygonSelection: Story;
9
- export default meta;
@@ -1,4 +0,0 @@
1
- import { Graph } from '..';
2
- export declare const createClusterLabels: (props: {
3
- div: HTMLDivElement;
4
- }) => (graph: Graph) => void;
@@ -1,16 +0,0 @@
1
- import { Graph, GraphConfigInterface } from '..';
2
- export type CosmosStoryProps = GraphConfigInterface & {
3
- pointPositions: Float32Array;
4
- pointColors?: Float32Array;
5
- pointSizes?: Float32Array;
6
- links?: Float32Array;
7
- linkColors?: Float32Array;
8
- linkWidths?: Float32Array;
9
- pointClusters?: number[];
10
- clusterPositions?: number[];
11
- clusterStrength?: Float32Array;
12
- };
13
- export declare const createCosmos: (props: CosmosStoryProps) => {
14
- div: HTMLDivElement;
15
- graph: Graph;
16
- };
@@ -1,16 +0,0 @@
1
- import { Graph } from '..';
2
- import { StoryObj } from '@storybook/html';
3
- import { CosmosStoryProps } from './create-cosmos';
4
- export type Story = StoryObj<CosmosStoryProps & {
5
- graph: Graph;
6
- destroy?: () => void;
7
- }>;
8
- export declare const createStory: (storyFunction: () => {
9
- graph: Graph;
10
- div: HTMLDivElement;
11
- destroy?: () => void;
12
- } | Promise<{
13
- graph: Graph;
14
- div: HTMLDivElement;
15
- destroy?: () => void;
16
- }>) => Story;
@@ -1,5 +0,0 @@
1
- import { Graph } from '../..';
2
- export declare const fullMesh: () => {
3
- graph: Graph;
4
- div: HTMLDivElement;
5
- };
@@ -1,5 +0,0 @@
1
- import { Graph } from '../..';
2
- export declare const meshWithHoles: () => {
3
- graph: Graph;
4
- div: HTMLDivElement;
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 FullMesh: Story;
6
- export declare const MeshWithHoles: Story;
7
- export default meta;