@cosmos.gl/graph 2.5.0 → 2.6.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/.github/SECURITY.md +7 -1
- package/dist/config.d.ts +4 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.js +1098 -1047
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +28 -16
- package/dist/index.min.js.map +1 -1
- package/dist/modules/GraphData/index.d.ts +1 -0
- package/dist/modules/Points/index.d.ts +3 -0
- package/dist/stories/beginners/pinned-points/data-gen.d.ts +5 -0
- package/dist/stories/beginners/pinned-points/index.d.ts +5 -0
- package/dist/stories/beginners.stories.d.ts +1 -0
- package/package.json +1 -1
- package/src/config.ts +9 -1
- package/src/index.ts +28 -1
- package/src/modules/GraphData/index.ts +2 -1
- package/src/modules/Points/index.ts +34 -0
- package/src/modules/Points/update-position.frag +12 -0
- package/src/stories/1. welcome.mdx +9 -3
- package/src/stories/2. configuration.mdx +3 -2
- package/src/stories/beginners/basic-set-up/index.ts +1 -1
- package/src/stories/beginners/pinned-points/data-gen.ts +153 -0
- package/src/stories/beginners/pinned-points/index.ts +61 -0
- package/src/stories/beginners/quick-start.ts +1 -1
- package/src/stories/beginners/remove-points/config.ts +1 -1
- package/src/stories/beginners.stories.ts +14 -0
- package/src/stories/create-cosmos.ts +1 -1
- package/src/stories/geospatial/moscow-metro-stations/index.ts +1 -1
package/.github/SECURITY.md
CHANGED
|
@@ -10,4 +10,10 @@ If you have discovered a security vulnerability in this project, please report i
|
|
|
10
10
|
|
|
11
11
|
Please disclose it at [security advisory](https://github.com/cosmograph-org/cosmos/security/advisories/new).
|
|
12
12
|
|
|
13
|
-
This project is maintained by a team of volunteers on a reasonable-effort basis. As such, please give us at least 90 days to work on a fix before public exposure.
|
|
13
|
+
This project is maintained by a team of volunteers on a reasonable-effort basis. As such, please give us at least 90 days to work on a fix before public exposure.
|
|
14
|
+
|
|
15
|
+
## Escalation
|
|
16
|
+
|
|
17
|
+
If you do not receive an acknowledgement of your report within 6 business days, or if you cannot find a private security contact for the project, you may escalate to the OpenJS Foundation CNA at `security@lists.openjsf.org`.
|
|
18
|
+
|
|
19
|
+
If the project acknowledges your report but does not provide any further response or engagement within 14 days, escalation is also appropriate.
|
package/dist/config.d.ts
CHANGED
|
@@ -27,13 +27,15 @@ export interface GraphConfigInterface {
|
|
|
27
27
|
* in the format `[red, green, blue, alpha]` where each value is a number between 0 and 255.
|
|
28
28
|
* Default value: '#b3b3b3'
|
|
29
29
|
*/
|
|
30
|
+
pointDefaultColor?: string | [number, number, number, number];
|
|
31
|
+
/** @deprecated Use `pointDefaultColor` instead */
|
|
30
32
|
pointColor?: string | [number, number, number, number];
|
|
31
33
|
/**
|
|
32
34
|
* The color to use for points when they are greyed out (when selection is active).
|
|
33
35
|
* This can be either a hex color string (e.g., '#b3b3b3') or an array of RGBA values
|
|
34
36
|
* in the format `[red, green, blue, alpha]` where each value is a number between 0 and 255.
|
|
35
37
|
*
|
|
36
|
-
* If not provided, the color will be the same as the
|
|
38
|
+
* If not provided, the color will be the same as the point's original color,
|
|
37
39
|
* but darkened or lightened depending on the background color.
|
|
38
40
|
*
|
|
39
41
|
* If `pointGreyoutOpacity` is also defined, it will override the alpha/opacity component
|
|
@@ -545,6 +547,7 @@ export declare class GraphConfig implements GraphConfigInterface {
|
|
|
545
547
|
backgroundColor: string;
|
|
546
548
|
spaceSize: number;
|
|
547
549
|
pointColor: string;
|
|
550
|
+
pointDefaultColor: undefined;
|
|
548
551
|
pointGreyoutOpacity: undefined;
|
|
549
552
|
pointGreyoutColor: undefined;
|
|
550
553
|
pointSize: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -237,6 +237,24 @@ export declare class Graph {
|
|
|
237
237
|
* Example: `new Float32Array([1, 0.4, 0.3])` sets the force coefficient for point 0 to 1, point 1 to 0.4, and point 2 to 0.3.
|
|
238
238
|
*/
|
|
239
239
|
setPointClusterStrength(clusterStrength: Float32Array): void;
|
|
240
|
+
/**
|
|
241
|
+
* Sets which points are pinned (fixed) in position.
|
|
242
|
+
*
|
|
243
|
+
* Pinned points:
|
|
244
|
+
* - Do not move due to physics forces (gravity, repulsion, link forces, etc.)
|
|
245
|
+
* - Still participate in force calculations (other nodes are attracted to/repelled by them)
|
|
246
|
+
* - Can still be dragged by the user if `enableDrag` is true
|
|
247
|
+
*
|
|
248
|
+
* @param {number[] | null} pinnedIndices - Array of point indices to pin. Set to `[]` or `null` to unpin all points.
|
|
249
|
+
* @example
|
|
250
|
+
* // Pin points 0 and 5
|
|
251
|
+
* graph.setPinnedPoints([0, 5])
|
|
252
|
+
*
|
|
253
|
+
* // Unpin all points
|
|
254
|
+
* graph.setPinnedPoints([])
|
|
255
|
+
* graph.setPinnedPoints(null)
|
|
256
|
+
*/
|
|
257
|
+
setPinnedPoints(pinnedIndices: number[] | null): void;
|
|
240
258
|
/**
|
|
241
259
|
* Renders the graph.
|
|
242
260
|
*
|