@cosmos.gl/graph 2.1.0 → 2.2.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/dist/index.d.ts +12 -0
- package/dist/index.js +2791 -2651
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +96 -34
- package/dist/index.min.js.map +1 -1
- package/dist/modules/Points/index.d.ts +6 -0
- package/dist/stories/clusters/lasso-selection/index.d.ts +6 -0
- package/dist/stories/clusters/lasso-selection/lasso.d.ts +20 -0
- package/dist/stories/clusters.stories.d.ts +1 -0
- package/package.json +1 -1
- package/src/index.ts +55 -0
- package/src/modules/Points/find-points-on-lasso-selection.frag +65 -0
- package/src/modules/Points/index.ts +69 -0
- package/src/stories/3. api-reference.mdx +19 -0
- package/src/stories/clusters/lasso-selection/index.ts +53 -0
- package/src/stories/clusters/lasso-selection/lasso.ts +143 -0
- package/src/stories/clusters/lasso-selection/style.css +8 -0
- package/src/stories/clusters.stories.ts +16 -0
package/dist/index.d.ts
CHANGED
|
@@ -239,11 +239,23 @@ export declare class Graph {
|
|
|
239
239
|
* @returns A Float32Array containing the indices of points inside a rectangular area.
|
|
240
240
|
*/
|
|
241
241
|
getPointsInRange(selection: [[number, number], [number, number]]): Float32Array;
|
|
242
|
+
/**
|
|
243
|
+
* Get points indices inside a lasso (polygon) area.
|
|
244
|
+
* @param lassoPath - Array of points `[[x1, y1], [x2, y2], ..., [xn, yn]]` that defines the lasso polygon.
|
|
245
|
+
* The coordinates should be from 0 to the width/height of the canvas.
|
|
246
|
+
* @returns A Float32Array containing the indices of points inside the lasso area.
|
|
247
|
+
*/
|
|
248
|
+
getPointsInLasso(lassoPath: [number, number][]): Float32Array;
|
|
242
249
|
/** Select points inside a rectangular area.
|
|
243
250
|
* @param selection - Array of two corner points `[[left, top], [right, bottom]]`.
|
|
244
251
|
* The `left` and `right` coordinates should be from 0 to the width of the canvas.
|
|
245
252
|
* The `top` and `bottom` coordinates should be from 0 to the height of the canvas. */
|
|
246
253
|
selectPointsInRange(selection: [[number, number], [number, number]] | null): void;
|
|
254
|
+
/** Select points inside a lasso (polygon) area.
|
|
255
|
+
* @param lassoPath - Array of points `[[x1, y1], [x2, y2], ..., [xn, yn]]` that defines the lasso polygon.
|
|
256
|
+
* The coordinates should be from 0 to the width/height of the canvas.
|
|
257
|
+
* Set to null to clear selection. */
|
|
258
|
+
selectPointsInLasso(lassoPath: [number, number][] | null): void;
|
|
247
259
|
/**
|
|
248
260
|
* Select a point by index. If you want the adjacent points to get selected too, provide `true` as the second argument.
|
|
249
261
|
* @param index The index of the point in the array of points.
|