@krainovsd/graph 0.14.0-beta.3 → 0.14.0-beta.4
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/lib/cjs/index.cjs +172 -1
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/esm/module/GraphCanvas/GraphCanvas.js +6 -0
- package/lib/esm/module/GraphCanvas/GraphCanvas.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-draw.js +13 -0
- package/lib/esm/module/GraphCanvas/slices/init-draw.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-pointer.js +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-pointer.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-selection.js +161 -0
- package/lib/esm/module/GraphCanvas/slices/init-selection.js.map +1 -0
- package/lib/esm/module/GraphCanvas/slices/init-zoom.js +3 -0
- package/lib/esm/module/GraphCanvas/slices/init-zoom.js.map +1 -1
- package/lib/index.d.ts +12 -0
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ interface NodeInterface<NodeData extends Record<string, unknown>> extends Simula
|
|
|
26
26
|
highlight?: boolean;
|
|
27
27
|
visible?: boolean;
|
|
28
28
|
image?: HTMLImageElement;
|
|
29
|
+
_selected?: boolean;
|
|
29
30
|
data?: NodeData;
|
|
30
31
|
}
|
|
31
32
|
type NodeShape = "circle" | "square" | "text";
|
|
@@ -36,6 +37,7 @@ interface LinkInterface<NodeData extends Record<string, unknown>, LinkData exten
|
|
|
36
37
|
data?: LinkData;
|
|
37
38
|
highlight?: boolean;
|
|
38
39
|
visible?: boolean;
|
|
40
|
+
_selected?: boolean;
|
|
39
41
|
_groupIndex?: number;
|
|
40
42
|
_groupSize?: number;
|
|
41
43
|
_self?: boolean;
|
|
@@ -349,6 +351,9 @@ type ListenersInterface<NodeData extends Record<string, unknown>, LinkData exten
|
|
|
349
351
|
onEndDragFinished?: (this: GraphCanvas<NodeData, LinkData>, event: DragEventInterface<NodeData>) => void;
|
|
350
352
|
onDrawFinished?: (this: GraphCanvas<NodeData, LinkData>) => void;
|
|
351
353
|
onSimulationEnd?: (this: GraphCanvas<NodeData, LinkData>) => void;
|
|
354
|
+
onSelectionIn?: (this: GraphCanvas<NodeData, LinkData>, node: NodeInterface<NodeData> | undefined, link: LinkInterface<NodeData, LinkData> | undefined) => void;
|
|
355
|
+
onSelectionOut?: (this: GraphCanvas<NodeData, LinkData>, node: NodeInterface<NodeData> | undefined, link: LinkInterface<NodeData, LinkData> | undefined) => void;
|
|
356
|
+
onSelectionEnd?: (this: GraphCanvas<NodeData, LinkData>, nodes: NodeInterface<NodeData>[], links: LinkInterface<NodeData, LinkData>[]) => void;
|
|
352
357
|
};
|
|
353
358
|
|
|
354
359
|
type GraphCanvasInterface<NodeData extends Record<string, unknown>, LinkData extends Record<string, unknown>> = {
|
|
@@ -405,6 +410,13 @@ declare class GraphCanvas<NodeData extends Record<string, unknown>, LinkData ext
|
|
|
405
410
|
protected _lastNodeZoomK: number | undefined;
|
|
406
411
|
protected _lastLinkZoomK: number | undefined;
|
|
407
412
|
protected _zoomAnimating: boolean;
|
|
413
|
+
protected isSelecting: boolean;
|
|
414
|
+
protected selectionRect: {
|
|
415
|
+
x1: number;
|
|
416
|
+
y1: number;
|
|
417
|
+
x2: number;
|
|
418
|
+
y2: number;
|
|
419
|
+
} | null;
|
|
408
420
|
protected get simulationWorking(): boolean;
|
|
409
421
|
constructor({ links, nodes, root, forceSettings, linkSettings, listeners, nodeSettings, graphSettings, highlightSettings, }: GraphCanvasInterface<NodeData, LinkData>);
|
|
410
422
|
get dpi(): number;
|