@cosmos.gl/graph 2.3.1-beta.0 → 2.3.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.
- package/dist/config.d.ts +7 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +481 -312
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +169 -43
- package/dist/index.min.js.map +1 -1
- package/dist/modules/GraphData/index.d.ts +16 -0
- package/dist/modules/Points/index.d.ts +2 -0
- package/dist/stories/shapes/all-shapes/index.d.ts +5 -0
- package/dist/stories/shapes.stories.d.ts +6 -0
- package/package.json +1 -1
- package/src/config.ts +7 -0
- package/src/index.ts +22 -2
- package/src/modules/GraphData/index.ts +39 -0
- package/src/modules/Points/draw-points.frag +131 -6
- package/src/modules/Points/draw-points.vert +7 -4
- package/src/modules/Points/index.ts +18 -5
- package/src/stories/2. configuration.mdx +1 -0
- package/src/stories/3. api-reference.mdx +33 -0
- package/src/stories/shapes/all-shapes/index.ts +69 -0
- package/src/stories/shapes.stories.ts +25 -0
package/dist/config.d.ts
CHANGED
|
@@ -439,6 +439,12 @@ export interface GraphConfigInterface {
|
|
|
439
439
|
* Default: `undefined`
|
|
440
440
|
*/
|
|
441
441
|
fitViewByPointsInRect?: [[number, number], [number, number]] | [number, number][];
|
|
442
|
+
/**
|
|
443
|
+
* When `fitViewOnInit` is set to `true`, fits the view to show only the specified points by their indices.
|
|
444
|
+
* Takes precedence over `fitViewByPointsInRect` when both are provided.
|
|
445
|
+
* Default: `undefined`
|
|
446
|
+
*/
|
|
447
|
+
fitViewByPointIndices?: number[];
|
|
442
448
|
/**
|
|
443
449
|
* Providing a `randomSeed` value allows you to control
|
|
444
450
|
* the randomness of the layout across different simulation runs.
|
|
@@ -545,6 +551,7 @@ export declare class GraphConfig implements GraphConfigInterface {
|
|
|
545
551
|
fitViewPadding: number;
|
|
546
552
|
fitViewDuration: number;
|
|
547
553
|
fitViewByPointsInRect: undefined;
|
|
554
|
+
fitViewByPointIndices: undefined;
|
|
548
555
|
randomSeed: undefined;
|
|
549
556
|
pointSamplingDistance: number;
|
|
550
557
|
attribution: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export declare class Graph {
|
|
|
40
40
|
private _needsPointPositionsUpdate;
|
|
41
41
|
private _needsPointColorUpdate;
|
|
42
42
|
private _needsPointSizeUpdate;
|
|
43
|
+
private _needsPointShapeUpdate;
|
|
43
44
|
private _needsLinksUpdate;
|
|
44
45
|
private _needsLinkColorUpdate;
|
|
45
46
|
private _needsLinkWidthUpdate;
|
|
@@ -102,6 +103,15 @@ export declare class Graph {
|
|
|
102
103
|
* Example: `new Float32Array([10, 20, 30])` sets the first point to size 10, the second point to size 20, and the third point to size 30.
|
|
103
104
|
*/
|
|
104
105
|
setPointSizes(pointSizes: Float32Array): void;
|
|
106
|
+
/**
|
|
107
|
+
* Sets the shapes for the graph points.
|
|
108
|
+
*
|
|
109
|
+
* @param {Float32Array} pointShapes - A Float32Array representing the shapes of points in the format [shape1, shape2, ..., shapen],
|
|
110
|
+
* where `n` is the index of the point and each shape value corresponds to a PointShape enum:
|
|
111
|
+
* 0 = Circle, 1 = Square, 2 = Triangle, 3 = Diamond, 4 = Pentagon, 5 = Hexagon, 6 = Star, 7 = Cross.
|
|
112
|
+
* Example: `new Float32Array([0, 1, 2])` sets the first point to Circle, the second point to Square, and the third point to Triangle.
|
|
113
|
+
*/
|
|
114
|
+
setPointShapes(pointShapes: Float32Array): void;
|
|
105
115
|
/**
|
|
106
116
|
* Gets the current sizes of the graph points.
|
|
107
117
|
*
|
|
@@ -450,4 +460,5 @@ export declare class Graph {
|
|
|
450
460
|
private addAttribution;
|
|
451
461
|
}
|
|
452
462
|
export type { GraphConfigInterface } from './config';
|
|
463
|
+
export { PointShape } from './modules/GraphData';
|
|
453
464
|
export * from './helper';
|