@unovis/ts 1.4.2-alpha.3 → 1.4.2-alpha.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/components/graph/config.d.ts +9 -0
- package/components/graph/config.js +1 -1
- package/components/graph/config.js.map +1 -1
- package/components/graph/index.d.ts +1 -0
- package/components/graph/index.js +8 -4
- package/components/graph/index.js.map +1 -1
- package/components/graph/modules/node/index.d.ts +3 -3
- package/components/graph/modules/node/index.js +44 -22
- package/components/graph/modules/node/index.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { D3DragEvent } from 'd3-drag';
|
|
2
2
|
import { D3ZoomEvent } from 'd3-zoom';
|
|
3
|
+
import { Selection } from 'd3-selection';
|
|
3
4
|
import { ComponentConfigInterface } from "../../core/component/config";
|
|
4
5
|
import { TrimMode } from "../../types/text";
|
|
5
6
|
import { GraphInputLink, GraphInputNode } from "../../types/graph";
|
|
@@ -155,6 +156,12 @@ export interface GraphConfigInterface<N extends GraphInputNode, L extends GraphI
|
|
|
155
156
|
nodeExitPosition?: GenericAccessor<[number, number], N> | undefined;
|
|
156
157
|
/** Specify the destination scale for exiting nodes in the range [0,1]. Default: `0.75` */
|
|
157
158
|
nodeExitScale?: NumericAccessor<N> | undefined;
|
|
159
|
+
/** Custom "enter" function for node rendering. Default: `undefined` */
|
|
160
|
+
nodeEnterCustomRenderFunction?: (datum: GraphNode<N, L>, nodeGroupElement: SVGGElement, config: GraphConfigInterface<N, L>, duration: number, zoomLevel: number) => void;
|
|
161
|
+
/** Custom "update" function for node rendering. Default: `undefined` */
|
|
162
|
+
nodeUpdateCustomRenderFunction?: (datum: GraphNode<N, L>, nodeGroupElement: SVGGElement, config: GraphConfigInterface<N, L>, duration: number, zoomLevel: number) => void;
|
|
163
|
+
/** Custom "exit" function for node rendering. Default: `undefined` */
|
|
164
|
+
nodeExitCustomRenderFunction?: (datum: GraphNode<N, L>, nodeGroupElement: SVGGElement, config: GraphConfigInterface<N, L>, duration: number, zoomLevel: number) => void;
|
|
158
165
|
/** Set selected node by unique id. Default: `undefined` */
|
|
159
166
|
selectedNodeId?: number | string;
|
|
160
167
|
/** Panels configuration. An array of `GraphPanelConfig` objects. Default: `[]` */
|
|
@@ -169,5 +176,7 @@ export interface GraphConfigInterface<N extends GraphInputNode, L extends GraphI
|
|
|
169
176
|
onZoom?: (zoomScale: number, zoomScaleExtent: [number, number], event: D3ZoomEvent<SVGGElement, unknown> | undefined) => void;
|
|
170
177
|
/** Callback function to be called when the graph layout is calculated. Default: `undefined` */
|
|
171
178
|
onLayoutCalculated?: (n: GraphNode<N, L>[], links: GraphLink<N, L>[]) => void;
|
|
179
|
+
/** Callback function to be called when the graph rendering is complete. Default: `undefined` */
|
|
180
|
+
onRenderComplete?: (g: Selection<SVGGElement, unknown, null, undefined>, nodes: GraphNode<N, L>[], links: GraphLink<N, L>[], config: GraphConfigInterface<N, L>, duration: number, zoomLevel: number) => void;
|
|
172
181
|
}
|
|
173
182
|
export declare const GraphDefaultConfig: GraphConfigInterface<GraphInputNode, GraphInputLink>;
|
|
@@ -14,7 +14,7 @@ const GraphDefaultConfig = Object.assign(Object.assign({}, ComponentDefaultConfi
|
|
|
14
14
|
}, dagreLayoutSettings: {
|
|
15
15
|
rankdir: 'BT',
|
|
16
16
|
ranker: 'longest-path',
|
|
17
|
-
}, layoutElkSettings: undefined, layoutElkNodeGroups: undefined, linkFlowAnimDuration: 20000, linkFlowParticleSize: 2, linkWidth: 1, linkStyle: GraphLinkStyle.Solid, linkBandWidth: 0, linkArrow: undefined, linkStroke: undefined, linkFlow: false, linkLabel: undefined, linkLabelShiftFromCenter: true, linkNeighborSpacing: 8, linkDisabled: false, linkCurvature: 0, selectedLinkId: undefined, nodeGaugeAnimDuration: 1500, nodeSize: 30, nodeStrokeWidth: 3, nodeShape: GraphNodeShape.Circle, nodeGaugeValue: 0, nodeIcon: (n) => n.icon, nodeIconSize: undefined, nodeLabel: (n) => n.label, nodeLabelTrim: true, nodeLabelTrimLength: 15, nodeLabelTrimMode: TrimMode.Middle, nodeSubLabel: '', nodeSubLabelTrim: true, nodeSubLabelTrimLength: 15, nodeSubLabelTrimMode: TrimMode.Middle, nodeSideLabels: undefined, nodeBottomIcon: undefined, nodeDisabled: false, nodeFill: (n) => n.fill, nodeGaugeFill: undefined, nodeStroke: (n) => n.stroke, nodeEnterPosition: undefined, nodeEnterScale: 0.75, nodeExitPosition: undefined, nodeExitScale: 0.75, nodeSort: undefined, selectedNodeId: undefined, panels: undefined, onNodeDragStart: undefined, onNodeDrag: undefined, onNodeDragEnd: undefined, onZoom: undefined, onLayoutCalculated: undefined });
|
|
17
|
+
}, layoutElkSettings: undefined, layoutElkNodeGroups: undefined, linkFlowAnimDuration: 20000, linkFlowParticleSize: 2, linkWidth: 1, linkStyle: GraphLinkStyle.Solid, linkBandWidth: 0, linkArrow: undefined, linkStroke: undefined, linkFlow: false, linkLabel: undefined, linkLabelShiftFromCenter: true, linkNeighborSpacing: 8, linkDisabled: false, linkCurvature: 0, selectedLinkId: undefined, nodeGaugeAnimDuration: 1500, nodeSize: 30, nodeStrokeWidth: 3, nodeShape: GraphNodeShape.Circle, nodeGaugeValue: 0, nodeIcon: (n) => n.icon, nodeIconSize: undefined, nodeLabel: (n) => n.label, nodeLabelTrim: true, nodeLabelTrimLength: 15, nodeLabelTrimMode: TrimMode.Middle, nodeSubLabel: '', nodeSubLabelTrim: true, nodeSubLabelTrimLength: 15, nodeSubLabelTrimMode: TrimMode.Middle, nodeSideLabels: undefined, nodeBottomIcon: undefined, nodeDisabled: false, nodeFill: (n) => n.fill, nodeGaugeFill: undefined, nodeStroke: (n) => n.stroke, nodeEnterPosition: undefined, nodeEnterScale: 0.75, nodeExitPosition: undefined, nodeExitScale: 0.75, nodeSort: undefined, selectedNodeId: undefined, panels: undefined, onNodeDragStart: undefined, onNodeDrag: undefined, onNodeDragEnd: undefined, onZoom: undefined, onLayoutCalculated: undefined, onRenderComplete: undefined });
|
|
18
18
|
|
|
19
19
|
export { GraphDefaultConfig };
|
|
20
20
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/graph/config.ts"],"sourcesContent":["import { D3DragEvent } from 'd3-drag'\nimport { D3ZoomEvent } from 'd3-zoom'\n\n// Config\nimport { ComponentConfigInterface, ComponentDefaultConfig } from 'core/component/config'\n\n// Types\nimport { TrimMode } from 'types/text'\nimport { GraphInputLink, GraphInputNode } from 'types/graph'\nimport { BooleanAccessor, ColorAccessor, NumericAccessor, StringAccessor, GenericAccessor } from 'types/accessor'\n\n// Local Types\nimport {\n GraphLayoutType,\n GraphCircleLabel,\n GraphLinkStyle,\n GraphLinkArrowStyle,\n GraphPanelConfig,\n GraphForceLayoutSettings,\n GraphElkLayoutSettings,\n GraphNodeShape,\n GraphDagreLayoutSetting,\n GraphNode,\n GraphLink,\n} from './types'\n\nexport interface GraphConfigInterface<N extends GraphInputNode, L extends GraphInputLink> extends ComponentConfigInterface {\n // Zoom and drag\n /** Zoom level constraints. Default: [0.35, 1.25] */\n zoomScaleExtent?: [number, number];\n /** Disable zooming. Default: `false` */\n disableZoom?: boolean;\n /** Disable node dragging. Default: `false` */\n disableDrag?: boolean;\n /** Interval to re-render the graph when zooming. Default: `100` */\n zoomThrottledUpdateNodeThreshold?: number;\n\n // Layout general settings\n /** Type of the graph layout. Default: `GraphLayoutType.Force` */\n layoutType?: GraphLayoutType | string;\n /** Fit the graph to container on data or config updates, or on container resize. Default: `true` */\n layoutAutofit?: boolean;\n /** Tolerance constant defining whether the graph should be fitted to container\n * (on data or config update, or container resize) after a zoom / pan interaction or not.\n * `0` — Stop fitting after any pan or zoom\n * `Number.POSITIVE_INFINITY` — Always fit\n * Default: `8.0` */\n layoutAutofitTolerance?: number;\n /** Place non-connected nodes at the bottom of the graph. Default: `false` */\n layoutNonConnectedAside?: boolean;\n\n // Settings for Parallel and Concentric layouts\n /** Node group accessor function.\n * Only for `GraphLayoutType.Parallel`, `GraphLayoutType.ParallelHorizontal` and `GraphLayoutType.Concentric` layouts.\n * Default: `node => node.group` */\n layoutNodeGroup?: StringAccessor<N>;\n /** Order of the layout groups.\n * Only for `GraphLayoutType.Parallel`, `GraphLayoutType.ParallelHorizontal` and `GraphLayoutType.Concentric` layouts.\n * Default: `[]` */\n layoutGroupOrder?: string[];\n\n // Setting for Parallel layouts only\n /** Sets the number of nodes in a sub-group after which they'll continue on the next column (or row if `layoutType` is\n * `GraphLayoutType.ParallelHorizontal`).\n * Only for `GraphLayoutType.Parallel` and `GraphLayoutType.ParallelHorizontal` layouts.\n * Default: `6` */\n layoutParallelNodesPerColumn?: number;\n /** Node sub-group accessor function.\n * Only for `GraphLayoutType.Parallel` and `GraphLayoutType.ParallelHorizontal` layouts.\n * Default: `node => node.subgroup` */\n layoutParallelNodeSubGroup?: StringAccessor<N>;\n /** Number of sub-groups per row (or column if `layoutType` is `GraphLayoutType.ParallelHorizontal`) in a group.\n * Only for `GraphLayoutType.Parallel` and `GraphLayoutType.ParallelHorizontal` layouts.\n * Default: `1` */\n layoutParallelSubGroupsPerRow?: number;\n /** Spacing between groups.\n * Only for `GraphLayoutType.Parallel` and `GraphLayoutType.ParallelHorizontal` layouts.\n * Default: `undefined` */\n layoutParallelGroupSpacing?: number;\n /** Set a group by name to have priority in sorting the graph links.\n * Only for `GraphLayoutType.Parallel` and `GraphLayoutType.ParallelHorizontal` layouts.\n * Default: `undefined` */\n layoutParallelSortConnectionsByGroup?: string;\n\n // Force layout\n /** Force Layout settings, see the `d3-force` package for more details */\n forceLayoutSettings?: GraphForceLayoutSettings<N, L>;\n\n // Dagre layout\n /** Darge Layout settings, see the `dagrejs` package\n * for more details: https://github.com/dagrejs/dagre/wiki#configuring-the-layout\n */\n dagreLayoutSettings?: GraphDagreLayoutSetting;\n\n // ELK layout\n /** ELK layout options, see the `elkjs` package for more details: https://github.com/kieler/elkjs.\n * If you want to specify custom layout option for each node group, you can provide an accessor function that\n * receives group name ('root' for the top-level configuration) as the first argument and returns an object containing\n * layout options. Default: `undefined`\n */\n layoutElkSettings?: GenericAccessor<GraphElkLayoutSettings, string> | undefined;\n /** Array of accessor functions to define nested node groups for the ELK Layered layout.\n * E.g.: `[n => n.group, n => n.subGroup]`.\n * Default: `undefined` */\n layoutElkNodeGroups?: StringAccessor<N>[];\n\n // Links\n /** Link width accessor function ot constant value. Default: `1` */\n linkWidth?: NumericAccessor<L>;\n /** Link style accessor function or constant value. Default: `GraphLinkStyle.Solid` */\n linkStyle?: GenericAccessor<GraphLinkStyle, L>;\n /** Link band width accessor function or constant value. Default: `0` */\n linkBandWidth?: NumericAccessor<L>;\n /** Link arrow accessor function or constant value. Default: `undefined` */\n linkArrow?: GenericAccessor<GraphLinkArrowStyle | string | boolean, L> | undefined;\n /** Link stroke color accessor function or constant value. Default: `undefined` */\n linkStroke?: ColorAccessor<L>;\n /** Link disabled state accessor function or constant value. Default: `false` */\n linkDisabled?: BooleanAccessor<L>;\n /** Link flow animation accessor function or constant value. Default: `false` */\n linkFlow?: BooleanAccessor<L>;\n /** Animation duration of the flow (traffic) circles. Default: `20000` */\n linkFlowAnimDuration?: number;\n /** Size of the moving particles that represent traffic flow. Default: `2` */\n linkFlowParticleSize?: number;\n /** Link label accessor function or constant value. Default: `undefined` */\n linkLabel?: GenericAccessor<GraphCircleLabel, L> | undefined;\n /** Shift label along the link center a little bit to avoid overlap with the link arrow. Default: `true` */\n linkLabelShiftFromCenter?: BooleanAccessor<L>;\n /** Spacing between neighboring links. Default: `8` */\n linkNeighborSpacing?: number;\n /** Curvature of the link. Recommended value range: [0:1.5].\n * `0` - straight line,\n * `1` - nice curvature,\n * `1.5` - very curve.\n * Default: `0` */\n linkCurvature?: NumericAccessor<L>;\n /** Set selected link by its unique id. Default: `undefined` */\n selectedLinkId?: number | string;\n\n // Nodes\n /** Node size accessor function or constant value. Default: `30` */\n nodeSize?: NumericAccessor<N>;\n /** Node stroke width accessor function or constant value. Default: `3` */\n nodeStrokeWidth?: NumericAccessor<N>;\n /** Node shape accessor function or constant value. Default: `GraphNodeShape.Circle` */\n nodeShape?: GenericAccessor<GraphNodeShape | string, N>;\n /** Node gauge outline accessor function or constant value in the range [0,100]. Default: `0` */\n nodeGaugeValue?: NumericAccessor<N>;\n /** Node gauge outline fill color accessor function or constant value. Default: `undefined` */\n nodeGaugeFill?: ColorAccessor<N>;\n /** Animation duration of the node gauge outline. Default: `1500` */\n nodeGaugeAnimDuration?: number;\n /** Node central icon accessor function or constant value. Default: `node => node.icon` */\n nodeIcon?: StringAccessor<N>;\n /** Node central icon size accessor function or constant value. Default: `undefined` */\n nodeIconSize?: NumericAccessor<N>;\n /** Node label accessor function or constant value. Default: `node => node.label` */\n nodeLabel?: StringAccessor<N>;\n /** Defines whether to trim the node labels or not. Default: `true` */\n nodeLabelTrim?: BooleanAccessor<N>;\n /** Node label trimming mode. Default: `TrimMode.Middle` */\n nodeLabelTrimMode?: GenericAccessor<TrimMode | string, N>;\n /** Node label maximum allowed text length above which the label will be trimmed. Default: `15` */\n nodeLabelTrimLength?: NumericAccessor<N>;\n /** Node sub-label accessor function or constant value: Default: `''` */\n nodeSubLabel?: StringAccessor<N>;\n /** Defines whether to trim the node sub-labels or not. Default: `true` */\n nodeSubLabelTrim?: BooleanAccessor<N>;\n /** Node sub-label trimming mode. Default: `TrimMode.Middle` */\n nodeSubLabelTrimMode?: GenericAccessor<TrimMode | string, N>;\n /** Node sub-label maximum allowed text length above which the label will be trimmed. Default: `15` */\n nodeSubLabelTrimLength?: NumericAccessor<N>;\n /** Node circular side labels accessor function. The function should return an array of GraphCircleLabel objects. Default: `undefined` */\n nodeSideLabels?: GenericAccessor<GraphCircleLabel[], N>;\n /** Node bottom icon accessor function. Default: `undefined` */\n nodeBottomIcon?: StringAccessor<N>;\n /** Node disabled state accessor function or constant value. Default: `false` */\n nodeDisabled?: BooleanAccessor<N>;\n /** Node fill color accessor function or constant value. Default: `node => node.fill` */\n nodeFill?: ColorAccessor<N>;\n /** Node stroke color accessor function or constant value. Default: `node => node.stroke` */\n nodeStroke?: ColorAccessor<N>;\n /** Sorting function to determine node placement. Default: `undefined` */\n nodeSort?: ((a: N, b: N) => number);\n /** Specify the initial position for entering nodes as [x, y]. Default: `undefined` */\n nodeEnterPosition?: GenericAccessor<[number, number], N> | undefined;\n /** Specify the initial scale for entering nodes in the range [0,1]. Default: `0.75` */\n nodeEnterScale?: NumericAccessor<N> | undefined;\n /** Specify the destination position for exiting nodes as [x, y]. Default: `undefined` */\n nodeExitPosition?: GenericAccessor<[number, number], N> | undefined;\n /** Specify the destination scale for exiting nodes in the range [0,1]. Default: `0.75` */\n nodeExitScale?: NumericAccessor<N> | undefined;\n /** Set selected node by unique id. Default: `undefined` */\n selectedNodeId?: number | string;\n\n /** Panels configuration. An array of `GraphPanelConfig` objects. Default: `[]` */\n panels?: GraphPanelConfig[] | undefined;\n\n // Events\n /** Graph node drag start callback function. Default: `undefined` */\n onNodeDragStart?: (n: GraphNode<N, L>, event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>) => void | undefined;\n /** Graph node drag callback function. Default: `undefined` */\n onNodeDrag?: (n: GraphNode<N, L>, event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>) => void | undefined;\n /** Graph node drag end callback function. Default: `undefined` */\n onNodeDragEnd?: (n: GraphNode<N, L>, event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>) => void | undefined;\n /** Zoom event callback. Default: `undefined` */\n onZoom?: (zoomScale: number, zoomScaleExtent: [number, number], event: D3ZoomEvent<SVGGElement, unknown> | undefined) => void;\n /** Callback function to be called when the graph layout is calculated. Default: `undefined` */\n onLayoutCalculated?: (n: GraphNode<N, L>[], links: GraphLink<N, L>[]) => void;\n}\n\nexport const GraphDefaultConfig: GraphConfigInterface<GraphInputNode, GraphInputLink> = {\n ...ComponentDefaultConfig,\n duration: 1000,\n zoomScaleExtent: [0.35, 1.25],\n disableZoom: false,\n disableDrag: false,\n zoomThrottledUpdateNodeThreshold: 100,\n layoutType: GraphLayoutType.Force,\n layoutAutofit: true,\n layoutAutofitTolerance: 8.0,\n layoutNonConnectedAside: false,\n\n layoutGroupOrder: [],\n layoutParallelSubGroupsPerRow: 1,\n layoutParallelNodesPerColumn: 6,\n layoutParallelGroupSpacing: undefined,\n layoutParallelSortConnectionsByGroup: undefined,\n layoutNodeGroup: (n: GraphInputNode): string => (n as { group: string }).group,\n layoutParallelNodeSubGroup: (n: GraphInputNode): string => (n as { subgroup: string }).subgroup,\n\n forceLayoutSettings: {\n linkDistance: 60,\n linkStrength: 0.45,\n charge: -500,\n forceXStrength: 0.15,\n forceYStrength: 0.25,\n numIterations: undefined,\n fixNodePositionAfterSimulation: false,\n },\n\n dagreLayoutSettings: {\n rankdir: 'BT',\n ranker: 'longest-path',\n },\n\n layoutElkSettings: undefined,\n layoutElkNodeGroups: undefined,\n\n linkFlowAnimDuration: 20000,\n linkFlowParticleSize: 2,\n linkWidth: 1,\n linkStyle: GraphLinkStyle.Solid,\n linkBandWidth: 0,\n linkArrow: undefined,\n linkStroke: undefined,\n linkFlow: false,\n linkLabel: undefined,\n linkLabelShiftFromCenter: true,\n linkNeighborSpacing: 8,\n linkDisabled: false,\n linkCurvature: 0,\n selectedLinkId: undefined,\n nodeGaugeAnimDuration: 1500,\n\n nodeSize: 30,\n nodeStrokeWidth: 3,\n nodeShape: GraphNodeShape.Circle,\n nodeGaugeValue: 0,\n nodeIcon: (n: GraphInputNode): string => (n as { icon: string }).icon,\n nodeIconSize: undefined,\n nodeLabel: (n: GraphInputNode): string => (n as { label: string }).label,\n nodeLabelTrim: true,\n nodeLabelTrimLength: 15,\n nodeLabelTrimMode: TrimMode.Middle,\n nodeSubLabel: '',\n nodeSubLabelTrim: true,\n nodeSubLabelTrimLength: 15,\n nodeSubLabelTrimMode: TrimMode.Middle,\n nodeSideLabels: undefined,\n nodeBottomIcon: undefined,\n nodeDisabled: false,\n nodeFill: (n: GraphInputNode): string => (n as { fill: string }).fill,\n nodeGaugeFill: undefined,\n nodeStroke: (n: GraphInputNode): string => (n as { stroke: string }).stroke,\n nodeEnterPosition: undefined,\n nodeEnterScale: 0.75,\n nodeExitPosition: undefined,\n nodeExitScale: 0.75,\n nodeSort: undefined,\n\n selectedNodeId: undefined,\n panels: undefined,\n\n onNodeDragStart: undefined,\n onNodeDrag: undefined,\n onNodeDragEnd: undefined,\n onZoom: undefined,\n onLayoutCalculated: undefined,\n}\n"],"names":[],"mappings":";;;;AAGA;AAiNa,MAAA,kBAAkB,mCAC1B,sBAAsB,CAAA,EAAA,EACzB,QAAQ,EAAE,IAAI,EACd,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAC7B,WAAW,EAAE,KAAK,EAClB,WAAW,EAAE,KAAK,EAClB,gCAAgC,EAAE,GAAG,EACrC,UAAU,EAAE,eAAe,CAAC,KAAK,EACjC,aAAa,EAAE,IAAI,EACnB,sBAAsB,EAAE,GAAG,EAC3B,uBAAuB,EAAE,KAAK,EAE9B,gBAAgB,EAAE,EAAE,EACpB,6BAA6B,EAAE,CAAC,EAChC,4BAA4B,EAAE,CAAC,EAC/B,0BAA0B,EAAE,SAAS,EACrC,oCAAoC,EAAE,SAAS,EAC/C,eAAe,EAAE,CAAC,CAAiB,KAAc,CAAuB,CAAC,KAAK,EAC9E,0BAA0B,EAAE,CAAC,CAAiB,KAAc,CAA0B,CAAC,QAAQ,EAE/F,mBAAmB,EAAE;AACnB,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,YAAY,EAAE,IAAI;QAClB,MAAM,EAAE,CAAC,GAAG;AACZ,QAAA,cAAc,EAAE,IAAI;AACpB,QAAA,cAAc,EAAE,IAAI;AACpB,QAAA,aAAa,EAAE,SAAS;AACxB,QAAA,8BAA8B,EAAE,KAAK;AACtC,KAAA,EAED,mBAAmB,EAAE;AACnB,QAAA,OAAO,EAAE,IA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3B,aAAa,EAAE,IAAI,EACnB,QAAQ,EAAE,SAAS,EAEnB,cAAc,EAAE,SAAS,EACzB,MAAM,EAAE,SAAS,EAEjB,eAAe,EAAE,SAAS,EAC1B,UAAU,EAAE,SAAS,EACrB,aAAa,EAAE,SAAS,EACxB,MAAM,EAAE,SAAS,EACjB,kBAAkB,EAAE,SAAS,EAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/graph/config.ts"],"sourcesContent":["import { D3DragEvent } from 'd3-drag'\nimport { D3ZoomEvent } from 'd3-zoom'\nimport { Selection } from 'd3-selection'\n\n// Config\nimport { ComponentConfigInterface, ComponentDefaultConfig } from 'core/component/config'\n\n// Types\nimport { TrimMode } from 'types/text'\nimport { GraphInputLink, GraphInputNode } from 'types/graph'\nimport { BooleanAccessor, ColorAccessor, NumericAccessor, StringAccessor, GenericAccessor } from 'types/accessor'\n\n// Local Types\nimport {\n GraphLayoutType,\n GraphCircleLabel,\n GraphLinkStyle,\n GraphLinkArrowStyle,\n GraphPanelConfig,\n GraphForceLayoutSettings,\n GraphElkLayoutSettings,\n GraphNodeShape,\n GraphDagreLayoutSetting,\n GraphNode,\n GraphLink,\n} from './types'\n\nexport interface GraphConfigInterface<N extends GraphInputNode, L extends GraphInputLink> extends ComponentConfigInterface {\n // Zoom and drag\n /** Zoom level constraints. Default: [0.35, 1.25] */\n zoomScaleExtent?: [number, number];\n /** Disable zooming. Default: `false` */\n disableZoom?: boolean;\n /** Disable node dragging. Default: `false` */\n disableDrag?: boolean;\n /** Interval to re-render the graph when zooming. Default: `100` */\n zoomThrottledUpdateNodeThreshold?: number;\n\n // Layout general settings\n /** Type of the graph layout. Default: `GraphLayoutType.Force` */\n layoutType?: GraphLayoutType | string;\n /** Fit the graph to container on data or config updates, or on container resize. Default: `true` */\n layoutAutofit?: boolean;\n /** Tolerance constant defining whether the graph should be fitted to container\n * (on data or config update, or container resize) after a zoom / pan interaction or not.\n * `0` — Stop fitting after any pan or zoom\n * `Number.POSITIVE_INFINITY` — Always fit\n * Default: `8.0` */\n layoutAutofitTolerance?: number;\n /** Place non-connected nodes at the bottom of the graph. Default: `false` */\n layoutNonConnectedAside?: boolean;\n\n // Settings for Parallel and Concentric layouts\n /** Node group accessor function.\n * Only for `GraphLayoutType.Parallel`, `GraphLayoutType.ParallelHorizontal` and `GraphLayoutType.Concentric` layouts.\n * Default: `node => node.group` */\n layoutNodeGroup?: StringAccessor<N>;\n /** Order of the layout groups.\n * Only for `GraphLayoutType.Parallel`, `GraphLayoutType.ParallelHorizontal` and `GraphLayoutType.Concentric` layouts.\n * Default: `[]` */\n layoutGroupOrder?: string[];\n\n // Setting for Parallel layouts only\n /** Sets the number of nodes in a sub-group after which they'll continue on the next column (or row if `layoutType` is\n * `GraphLayoutType.ParallelHorizontal`).\n * Only for `GraphLayoutType.Parallel` and `GraphLayoutType.ParallelHorizontal` layouts.\n * Default: `6` */\n layoutParallelNodesPerColumn?: number;\n /** Node sub-group accessor function.\n * Only for `GraphLayoutType.Parallel` and `GraphLayoutType.ParallelHorizontal` layouts.\n * Default: `node => node.subgroup` */\n layoutParallelNodeSubGroup?: StringAccessor<N>;\n /** Number of sub-groups per row (or column if `layoutType` is `GraphLayoutType.ParallelHorizontal`) in a group.\n * Only for `GraphLayoutType.Parallel` and `GraphLayoutType.ParallelHorizontal` layouts.\n * Default: `1` */\n layoutParallelSubGroupsPerRow?: number;\n /** Spacing between groups.\n * Only for `GraphLayoutType.Parallel` and `GraphLayoutType.ParallelHorizontal` layouts.\n * Default: `undefined` */\n layoutParallelGroupSpacing?: number;\n /** Set a group by name to have priority in sorting the graph links.\n * Only for `GraphLayoutType.Parallel` and `GraphLayoutType.ParallelHorizontal` layouts.\n * Default: `undefined` */\n layoutParallelSortConnectionsByGroup?: string;\n\n // Force layout\n /** Force Layout settings, see the `d3-force` package for more details */\n forceLayoutSettings?: GraphForceLayoutSettings<N, L>;\n\n // Dagre layout\n /** Darge Layout settings, see the `dagrejs` package\n * for more details: https://github.com/dagrejs/dagre/wiki#configuring-the-layout\n */\n dagreLayoutSettings?: GraphDagreLayoutSetting;\n\n // ELK layout\n /** ELK layout options, see the `elkjs` package for more details: https://github.com/kieler/elkjs.\n * If you want to specify custom layout option for each node group, you can provide an accessor function that\n * receives group name ('root' for the top-level configuration) as the first argument and returns an object containing\n * layout options. Default: `undefined`\n */\n layoutElkSettings?: GenericAccessor<GraphElkLayoutSettings, string> | undefined;\n /** Array of accessor functions to define nested node groups for the ELK Layered layout.\n * E.g.: `[n => n.group, n => n.subGroup]`.\n * Default: `undefined` */\n layoutElkNodeGroups?: StringAccessor<N>[];\n\n // Links\n /** Link width accessor function ot constant value. Default: `1` */\n linkWidth?: NumericAccessor<L>;\n /** Link style accessor function or constant value. Default: `GraphLinkStyle.Solid` */\n linkStyle?: GenericAccessor<GraphLinkStyle, L>;\n /** Link band width accessor function or constant value. Default: `0` */\n linkBandWidth?: NumericAccessor<L>;\n /** Link arrow accessor function or constant value. Default: `undefined` */\n linkArrow?: GenericAccessor<GraphLinkArrowStyle | string | boolean, L> | undefined;\n /** Link stroke color accessor function or constant value. Default: `undefined` */\n linkStroke?: ColorAccessor<L>;\n /** Link disabled state accessor function or constant value. Default: `false` */\n linkDisabled?: BooleanAccessor<L>;\n /** Link flow animation accessor function or constant value. Default: `false` */\n linkFlow?: BooleanAccessor<L>;\n /** Animation duration of the flow (traffic) circles. Default: `20000` */\n linkFlowAnimDuration?: number;\n /** Size of the moving particles that represent traffic flow. Default: `2` */\n linkFlowParticleSize?: number;\n /** Link label accessor function or constant value. Default: `undefined` */\n linkLabel?: GenericAccessor<GraphCircleLabel, L> | undefined;\n /** Shift label along the link center a little bit to avoid overlap with the link arrow. Default: `true` */\n linkLabelShiftFromCenter?: BooleanAccessor<L>;\n /** Spacing between neighboring links. Default: `8` */\n linkNeighborSpacing?: number;\n /** Curvature of the link. Recommended value range: [0:1.5].\n * `0` - straight line,\n * `1` - nice curvature,\n * `1.5` - very curve.\n * Default: `0` */\n linkCurvature?: NumericAccessor<L>;\n /** Set selected link by its unique id. Default: `undefined` */\n selectedLinkId?: number | string;\n\n // Nodes\n /** Node size accessor function or constant value. Default: `30` */\n nodeSize?: NumericAccessor<N>;\n /** Node stroke width accessor function or constant value. Default: `3` */\n nodeStrokeWidth?: NumericAccessor<N>;\n /** Node shape accessor function or constant value. Default: `GraphNodeShape.Circle` */\n nodeShape?: GenericAccessor<GraphNodeShape | string, N>;\n /** Node gauge outline accessor function or constant value in the range [0,100]. Default: `0` */\n nodeGaugeValue?: NumericAccessor<N>;\n /** Node gauge outline fill color accessor function or constant value. Default: `undefined` */\n nodeGaugeFill?: ColorAccessor<N>;\n /** Animation duration of the node gauge outline. Default: `1500` */\n nodeGaugeAnimDuration?: number;\n /** Node central icon accessor function or constant value. Default: `node => node.icon` */\n nodeIcon?: StringAccessor<N>;\n /** Node central icon size accessor function or constant value. Default: `undefined` */\n nodeIconSize?: NumericAccessor<N>;\n /** Node label accessor function or constant value. Default: `node => node.label` */\n nodeLabel?: StringAccessor<N>;\n /** Defines whether to trim the node labels or not. Default: `true` */\n nodeLabelTrim?: BooleanAccessor<N>;\n /** Node label trimming mode. Default: `TrimMode.Middle` */\n nodeLabelTrimMode?: GenericAccessor<TrimMode | string, N>;\n /** Node label maximum allowed text length above which the label will be trimmed. Default: `15` */\n nodeLabelTrimLength?: NumericAccessor<N>;\n /** Node sub-label accessor function or constant value: Default: `''` */\n nodeSubLabel?: StringAccessor<N>;\n /** Defines whether to trim the node sub-labels or not. Default: `true` */\n nodeSubLabelTrim?: BooleanAccessor<N>;\n /** Node sub-label trimming mode. Default: `TrimMode.Middle` */\n nodeSubLabelTrimMode?: GenericAccessor<TrimMode | string, N>;\n /** Node sub-label maximum allowed text length above which the label will be trimmed. Default: `15` */\n nodeSubLabelTrimLength?: NumericAccessor<N>;\n /** Node circular side labels accessor function. The function should return an array of GraphCircleLabel objects. Default: `undefined` */\n nodeSideLabels?: GenericAccessor<GraphCircleLabel[], N>;\n /** Node bottom icon accessor function. Default: `undefined` */\n nodeBottomIcon?: StringAccessor<N>;\n /** Node disabled state accessor function or constant value. Default: `false` */\n nodeDisabled?: BooleanAccessor<N>;\n /** Node fill color accessor function or constant value. Default: `node => node.fill` */\n nodeFill?: ColorAccessor<N>;\n /** Node stroke color accessor function or constant value. Default: `node => node.stroke` */\n nodeStroke?: ColorAccessor<N>;\n /** Sorting function to determine node placement. Default: `undefined` */\n nodeSort?: ((a: N, b: N) => number);\n /** Specify the initial position for entering nodes as [x, y]. Default: `undefined` */\n nodeEnterPosition?: GenericAccessor<[number, number], N> | undefined;\n /** Specify the initial scale for entering nodes in the range [0,1]. Default: `0.75` */\n nodeEnterScale?: NumericAccessor<N> | undefined;\n /** Specify the destination position for exiting nodes as [x, y]. Default: `undefined` */\n nodeExitPosition?: GenericAccessor<[number, number], N> | undefined;\n /** Specify the destination scale for exiting nodes in the range [0,1]. Default: `0.75` */\n nodeExitScale?: NumericAccessor<N> | undefined;\n /** Custom \"enter\" function for node rendering. Default: `undefined` */\n nodeEnterCustomRenderFunction?: (datum: GraphNode<N, L>, nodeGroupElement: SVGGElement, config: GraphConfigInterface<N, L>, duration: number, zoomLevel: number) => void;\n /** Custom \"update\" function for node rendering. Default: `undefined` */\n nodeUpdateCustomRenderFunction?: (datum: GraphNode<N, L>, nodeGroupElement: SVGGElement, config: GraphConfigInterface<N, L>, duration: number, zoomLevel: number) => void;\n /** Custom \"exit\" function for node rendering. Default: `undefined` */\n nodeExitCustomRenderFunction?: (datum: GraphNode<N, L>, nodeGroupElement: SVGGElement, config: GraphConfigInterface<N, L>, duration: number, zoomLevel: number) => void;\n /** Set selected node by unique id. Default: `undefined` */\n selectedNodeId?: number | string;\n\n /** Panels configuration. An array of `GraphPanelConfig` objects. Default: `[]` */\n panels?: GraphPanelConfig[] | undefined;\n\n // Events\n /** Graph node drag start callback function. Default: `undefined` */\n onNodeDragStart?: (n: GraphNode<N, L>, event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>) => void | undefined;\n /** Graph node drag callback function. Default: `undefined` */\n onNodeDrag?: (n: GraphNode<N, L>, event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>) => void | undefined;\n /** Graph node drag end callback function. Default: `undefined` */\n onNodeDragEnd?: (n: GraphNode<N, L>, event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>) => void | undefined;\n /** Zoom event callback. Default: `undefined` */\n onZoom?: (zoomScale: number, zoomScaleExtent: [number, number], event: D3ZoomEvent<SVGGElement, unknown> | undefined) => void;\n /** Callback function to be called when the graph layout is calculated. Default: `undefined` */\n onLayoutCalculated?: (n: GraphNode<N, L>[], links: GraphLink<N, L>[]) => void;\n /** Callback function to be called when the graph rendering is complete. Default: `undefined` */\n onRenderComplete?: (\n g: Selection<SVGGElement, unknown, null, undefined>,\n nodes: GraphNode<N, L>[],\n links: GraphLink<N, L>[],\n config: GraphConfigInterface<N, L>,\n duration: number,\n zoomLevel: number\n ) => void;\n}\n\nexport const GraphDefaultConfig: GraphConfigInterface<GraphInputNode, GraphInputLink> = {\n ...ComponentDefaultConfig,\n duration: 1000,\n zoomScaleExtent: [0.35, 1.25],\n disableZoom: false,\n disableDrag: false,\n zoomThrottledUpdateNodeThreshold: 100,\n layoutType: GraphLayoutType.Force,\n layoutAutofit: true,\n layoutAutofitTolerance: 8.0,\n layoutNonConnectedAside: false,\n\n layoutGroupOrder: [],\n layoutParallelSubGroupsPerRow: 1,\n layoutParallelNodesPerColumn: 6,\n layoutParallelGroupSpacing: undefined,\n layoutParallelSortConnectionsByGroup: undefined,\n layoutNodeGroup: (n: GraphInputNode): string => (n as { group: string }).group,\n layoutParallelNodeSubGroup: (n: GraphInputNode): string => (n as { subgroup: string }).subgroup,\n\n forceLayoutSettings: {\n linkDistance: 60,\n linkStrength: 0.45,\n charge: -500,\n forceXStrength: 0.15,\n forceYStrength: 0.25,\n numIterations: undefined,\n fixNodePositionAfterSimulation: false,\n },\n\n dagreLayoutSettings: {\n rankdir: 'BT',\n ranker: 'longest-path',\n },\n\n layoutElkSettings: undefined,\n layoutElkNodeGroups: undefined,\n\n linkFlowAnimDuration: 20000,\n linkFlowParticleSize: 2,\n linkWidth: 1,\n linkStyle: GraphLinkStyle.Solid,\n linkBandWidth: 0,\n linkArrow: undefined,\n linkStroke: undefined,\n linkFlow: false,\n linkLabel: undefined,\n linkLabelShiftFromCenter: true,\n linkNeighborSpacing: 8,\n linkDisabled: false,\n linkCurvature: 0,\n selectedLinkId: undefined,\n nodeGaugeAnimDuration: 1500,\n\n nodeSize: 30,\n nodeStrokeWidth: 3,\n nodeShape: GraphNodeShape.Circle,\n nodeGaugeValue: 0,\n nodeIcon: (n: GraphInputNode): string => (n as { icon: string }).icon,\n nodeIconSize: undefined,\n nodeLabel: (n: GraphInputNode): string => (n as { label: string }).label,\n nodeLabelTrim: true,\n nodeLabelTrimLength: 15,\n nodeLabelTrimMode: TrimMode.Middle,\n nodeSubLabel: '',\n nodeSubLabelTrim: true,\n nodeSubLabelTrimLength: 15,\n nodeSubLabelTrimMode: TrimMode.Middle,\n nodeSideLabels: undefined,\n nodeBottomIcon: undefined,\n nodeDisabled: false,\n nodeFill: (n: GraphInputNode): string => (n as { fill: string }).fill,\n nodeGaugeFill: undefined,\n nodeStroke: (n: GraphInputNode): string => (n as { stroke: string }).stroke,\n nodeEnterPosition: undefined,\n nodeEnterScale: 0.75,\n nodeExitPosition: undefined,\n nodeExitScale: 0.75,\n nodeSort: undefined,\n\n selectedNodeId: undefined,\n panels: undefined,\n\n onNodeDragStart: undefined,\n onNodeDrag: undefined,\n onNodeDragEnd: undefined,\n onZoom: undefined,\n onLayoutCalculated: undefined,\n onRenderComplete: undefined,\n}\n"],"names":[],"mappings":";;;;AAIA;AAgOa,MAAA,kBAAkB,mCAC1B,sBAAsB,CAAA,EAAA,EACzB,QAAQ,EAAE,IAAI,EACd,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAC7B,WAAW,EAAE,KAAK,EAClB,WAAW,EA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B,SAAS,EAAE,cAAc,CAAC,MAAM,EAChC,cAAc,EAAE,CAAC,EACjB,QAAQ,EAAE,CAAC,CAAiB,KAAc,CAAsB,CAAC,IAAI,EACrE,YAAY,EAAE,SAAS,EACvB,SAAS,EAAE,CAAC,CAAiB,KAAc,CAAuB,CAAC,KAAK,EACxE,aAAa,EAAE,IAAI,EACnB,mBAAmB,EAAE,EAAE,EACvB,iBAAiB,EAAE,QAAQ,CAAC,MAAM,EAClC,YAAY,EAAE,EAAE,EAChB,gBAAgB,EAAE,IAAI,EACtB,sBAAsB,EAAE,EAAE,EAC1B,oBAAoB,EAAE,QAAQ,CAAC,MAAM,EACrC,cAAc,EAAE,SAAS,EACzB,cAAc,EAAE,SAAS,EACzB,YAAY,EAAE,KAAK,EACnB,QAAQ,EAAE,CAAC,CAAiB,KAAc,CAAsB,CAAC,IAAI,EACrE,aAAa,EAAE,SAAS,EACxB,UAAU,EAAE,CAAC,CAAiB,KAAc,CAAwB,CAAC,MAAM,EAC3E,iBAAiB,EAAE,SAAS,EAC5B,cAAc,EAAE,IAAI,EACpB,gBAAgB,EAAE,SAAS,EAC3B,aAAa,EAAE,IAAI,EACnB,QAAQ,EAAE,SAAS,EAEnB,cAAc,EAAE,SAAS,EACzB,MAAM,EAAE,SAAS,EAEjB,eAAe,EAAE,SAAS,EAC1B,UAAU,EAAE,SAAS,EACrB,aAAa,EAAE,SAAS,EACxB,MAAM,EAAE,SAAS,EACjB,kBAAkB,EAAE,SAAS,EAC7B,gBAAgB,EAAE,SAAS,EAAA;;;;"}
|
|
@@ -15,7 +15,7 @@ import * as style from './modules/node/style.js';
|
|
|
15
15
|
import { nodes, gNode, gNodeExit, node, nodeGauge, sideLabelGroup, label, greyedOutNode } from './modules/node/style.js';
|
|
16
16
|
import { links, gLink, gLinkExit, link, greyedOutLink } from './modules/link/style.js';
|
|
17
17
|
import { panels, gPanel, panel, panelSelection, label as label$1, labelText, sideIconGroup, sideIconShape, sideIconSymbol } from './modules/panel/style.js';
|
|
18
|
-
import { createNodes, updateNodes, removeNodes,
|
|
18
|
+
import { createNodes, updateNodes, removeNodes, updateNodeSelectedGreyout, zoomNodesThrottled, zoomNodes } from './modules/node/index.js';
|
|
19
19
|
import { getMaxNodeSize, getX, getY, getNodeSize } from './modules/node/helper.js';
|
|
20
20
|
import { createLinks, updateLinks, removeLinks, updateSelectedLinks, animateLinkFlow, zoomLinksThrottled, zoomLinks } from './modules/link/index.js';
|
|
21
21
|
import { getArrowPath, getDoubleArrowPath } from './modules/link/helper.js';
|
|
@@ -110,6 +110,7 @@ class Graph extends ComponentCore {
|
|
|
110
110
|
this._layoutCalculationPromise = this._calculateLayout();
|
|
111
111
|
}
|
|
112
112
|
this._layoutCalculationPromise.then((isFirstRender) => {
|
|
113
|
+
var _a, _b;
|
|
113
114
|
// If the component has been destroyed while the layout calculation
|
|
114
115
|
// was in progress, we cancel the render
|
|
115
116
|
if (this.isDestroyed())
|
|
@@ -163,6 +164,8 @@ class Graph extends ComponentCore {
|
|
|
163
164
|
// calculation and they were not set up properly (see the render function of `ComponentCore`)
|
|
164
165
|
this._setUpComponentEventsThrottled();
|
|
165
166
|
this._setCustomAttributesThrottled();
|
|
167
|
+
// On render complete callback
|
|
168
|
+
(_b = (_a = this.config).onRenderComplete) === null || _b === void 0 ? void 0 : _b.call(_a, this.g, datamodel.nodes, datamodel.links, this.config, animDuration, this._scale);
|
|
166
169
|
});
|
|
167
170
|
this._isFirstRender = false;
|
|
168
171
|
}
|
|
@@ -174,14 +177,14 @@ class Graph extends ComponentCore {
|
|
|
174
177
|
.data(nodes, d => String(d._id));
|
|
175
178
|
const nodeGroupsEnter = nodeGroups.enter().append('g')
|
|
176
179
|
.attr('class', gNode)
|
|
177
|
-
.call(createNodes, config, duration);
|
|
180
|
+
.call(createNodes, config, duration, this._scale);
|
|
178
181
|
const nodeGroupsMerged = nodeGroups.merge(nodeGroupsEnter);
|
|
179
182
|
const nodeUpdateSelection = updateNodes(nodeGroupsMerged, config, duration, this._scale);
|
|
180
183
|
this._drawPanels(nodeUpdateSelection, duration);
|
|
181
184
|
const nodesGroupExit = nodeGroups.exit();
|
|
182
185
|
nodesGroupExit
|
|
183
186
|
.classed(gNodeExit, true)
|
|
184
|
-
.call(removeNodes, config, duration);
|
|
187
|
+
.call(removeNodes, config, duration, this._scale);
|
|
185
188
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
186
189
|
const thisRef = this;
|
|
187
190
|
if (!config.disableDrag) {
|
|
@@ -414,7 +417,7 @@ class Graph extends ComponentCore {
|
|
|
414
417
|
const linkElements = this._linksGroup.selectAll(`.${gLink}`);
|
|
415
418
|
linkElements.call(updateSelectedLinks, config, this._scale);
|
|
416
419
|
const nodeElements = this._nodesGroup.selectAll(`.${gNode}`);
|
|
417
|
-
nodeElements.call(
|
|
420
|
+
nodeElements.call(updateNodeSelectedGreyout, config);
|
|
418
421
|
// this._drawPanels(nodeElements, 0)
|
|
419
422
|
}
|
|
420
423
|
_onBackgroundClick() {
|
|
@@ -657,6 +660,7 @@ class Graph extends ComponentCore {
|
|
|
657
660
|
}
|
|
658
661
|
Graph.selectors = {
|
|
659
662
|
root: root,
|
|
663
|
+
graphGroup: graphGroup,
|
|
660
664
|
background: background,
|
|
661
665
|
node: gNode,
|
|
662
666
|
nodeShape: node,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/graph/index.ts"],"sourcesContent":["import { min, max } from 'd3-array'\nimport { Transition } from 'd3-transition'\nimport { select, Selection, pointer } from 'd3-selection'\nimport { zoom, zoomTransform, zoomIdentity, ZoomTransform, D3ZoomEvent, ZoomBehavior } from 'd3-zoom'\nimport { drag, D3DragEvent } from 'd3-drag'\nimport { interval, Timer } from 'd3-timer'\n\n// Core\nimport { ComponentCore } from 'core/component'\nimport { GraphDataModel } from 'data-models/graph'\n\n// Types\nimport { GraphInputLink, GraphInputNode } from 'types/graph'\nimport { Spacing } from 'types/spacing'\n\n// Utils\nimport { isNumber, clamp, shallowDiff, isFunction, getBoolean, isPlainObject } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\n\n// Local Types\nimport { GraphNode, GraphLink, GraphLayoutType, GraphLinkArrowStyle, GraphPanel } from './types'\n\n// Config\nimport { GraphDefaultConfig, GraphConfigInterface } from './config'\n\n// Styles\nimport * as generalSelectors from './style'\nimport * as nodeSelectors from './modules/node/style'\nimport * as linkSelectors from './modules/link/style'\nimport * as panelSelectors from './modules/panel/style'\n\n// Modules\nimport { createNodes, updateNodes, removeNodes, zoomNodesThrottled, zoomNodes, updateSelectedNodes } from './modules/node'\nimport { getMaxNodeSize, getNodeSize, getX, getY } from './modules/node/helper'\nimport { createLinks, updateLinks, removeLinks, zoomLinksThrottled, zoomLinks, animateLinkFlow, updateSelectedLinks } from './modules/link'\nimport { getDoubleArrowPath, getArrowPath } from './modules/link/helper'\nimport { createPanels, updatePanels, removePanels } from './modules/panel'\nimport { setPanelForNodes, updatePanelBBoxSize, updatePanelNumNodes, initPanels } from './modules/panel/helper'\nimport { applyLayoutCircular, applyLayoutParallel, applyLayoutDagre, applyLayoutConcentric, applyLayoutForce, applyELKLayout } from './modules/layout'\n\nexport class Graph<\n N extends GraphInputNode,\n L extends GraphInputLink,\n> extends ComponentCore<\n {nodes: N[]; links?: L[]},\n GraphConfigInterface<N, L>\n > {\n static selectors = {\n root: generalSelectors.root,\n background: generalSelectors.background,\n node: nodeSelectors.gNode,\n nodeShape: nodeSelectors.node,\n nodeGauge: nodeSelectors.nodeGauge,\n nodeSideLabel: nodeSelectors.sideLabelGroup,\n nodeLabel: nodeSelectors.label,\n dimmedNode: nodeSelectors.greyedOutNode,\n link: linkSelectors.gLink,\n linkLine: linkSelectors.link,\n dimmedLink: linkSelectors.greyedOutLink,\n panel: panelSelectors.gPanel,\n panelRect: panelSelectors.panel,\n panelSelection: panelSelectors.panelSelection,\n panelLabel: panelSelectors.label,\n panelLabelText: panelSelectors.labelText,\n panelSideIcon: panelSelectors.sideIconGroup,\n panelSideIconShape: panelSelectors.sideIconShape,\n panelSideIconSymbol: panelSelectors.sideIconSymbol,\n }\n\n static nodeSelectors = nodeSelectors\n g: Selection<SVGGElement, unknown, null, undefined>\n protected _defaultConfig = GraphDefaultConfig as unknown as GraphConfigInterface<N, L>\n public config: GraphConfigInterface<N, L> = this._defaultConfig\n datamodel: GraphDataModel<N, L, GraphNode<N, L>, GraphLink<N, L>> = new GraphDataModel()\n private _selectedNode: GraphNode<N, L>\n private _selectedLink: GraphLink<N, L>\n\n private _graphGroup: Selection<SVGGElement, unknown, SVGGElement, undefined>\n private _panelsGroup: Selection<SVGGElement, unknown, SVGGElement, undefined>\n private _linksGroup: Selection<SVGGElement, unknown, SVGGElement, undefined>\n private _nodesGroup: Selection<SVGGElement, unknown, SVGGElement, undefined>\n private _timer: Timer\n\n private _isFirstRender = true\n private _prevWidth: number\n private _prevHeight: number\n private _shouldRecalculateLayout = false\n private _layoutCalculationPromise: Promise<boolean> | undefined\n\n private _shouldFitLayout: boolean\n private _shouldSetPanels = false\n private _panels: GraphPanel[]\n\n private _defs: Selection<SVGDefsElement, unknown, SVGGElement, undefined>\n private _backgroundRect: Selection<SVGRectElement, unknown, SVGGElement, undefined>\n private _zoomBehavior: ZoomBehavior<SVGGElement, unknown>\n private _isAutoFitDisabled = false\n private _scale: number\n private _initialTransform: ZoomTransform\n private _isDragging = false\n\n events = {\n [Graph.selectors.background]: {\n click: this._onBackgroundClick.bind(this),\n },\n [Graph.selectors.node]: {\n click: this._onNodeClick.bind(this),\n mouseover: this._onNodeMouseOver.bind(this),\n mouseout: this._onNodeMouseOut.bind(this),\n },\n [Graph.selectors.link]: {\n click: this._onLinkClick.bind(this),\n mouseover: this._onLinkMouseOver.bind(this),\n mouseout: this._onLinkMouseOut.bind(this),\n },\n }\n\n public get selectedNode (): GraphNode<N, L> {\n return this._selectedNode\n }\n\n public get selectedLink (): GraphLink<N, L> {\n return this._selectedLink\n }\n\n constructor (config?: GraphConfigInterface<N, L>) {\n super()\n if (config) this.setConfig(config)\n\n this._backgroundRect = this.g.append('rect').attr('class', generalSelectors.background)\n this._graphGroup = this.g.append('g').attr('class', generalSelectors.graphGroup)\n\n this._zoomBehavior = zoom<SVGGElement, unknown>()\n .scaleExtent(this.config.zoomScaleExtent)\n .on('zoom', (e: D3ZoomEvent<SVGGElement, unknown>) => this._onZoom(e.transform, e))\n\n this._panelsGroup = this._graphGroup.append('g').attr('class', panelSelectors.panels)\n this._linksGroup = this._graphGroup.append('g').attr('class', linkSelectors.links)\n this._nodesGroup = this._graphGroup.append('g').attr('class', nodeSelectors.nodes)\n\n this._defs = this._graphGroup.append('defs')\n\n this._getLinkArrowDefId = this._getLinkArrowDefId.bind(this)\n }\n\n setData (data: {nodes: N[]; links?: L[]}): void {\n const { config } = this\n\n this.datamodel.nodeSort = config.nodeSort\n this.datamodel.data = data\n this._shouldRecalculateLayout = true\n if (config.layoutAutofit) this._shouldFitLayout = true\n this._shouldSetPanels = true\n\n this._addSVGDefs()\n }\n\n setConfig (config: GraphConfigInterface<N, L>): void {\n super.setConfig(config)\n\n this._shouldRecalculateLayout = this._shouldRecalculateLayout || this._shouldLayoutRecalculate()\n this._shouldFitLayout = this._shouldFitLayout || this._shouldRecalculateLayout\n if (this._shouldFitLayout) this._isAutoFitDisabled = false\n this._shouldSetPanels = true\n }\n\n get bleed (): Spacing {\n const extraPadding = 50 // Extra padding to take into account labels and selection outlines\n return { top: extraPadding, bottom: extraPadding, left: extraPadding, right: extraPadding }\n }\n\n _render (customDuration?: number): void {\n const { config: { disableZoom, duration, layoutAutofit }, datamodel } = this\n if (!datamodel.nodes && !datamodel.links) return\n const animDuration = isNumber(customDuration) ? customDuration : duration\n\n this._backgroundRect\n .attr('width', this._width)\n .attr('height', this._height)\n .attr('opacity', 0)\n\n if ((this._prevWidth !== this._width || this._prevHeight !== this._height) && layoutAutofit) {\n // Fit layout on resize\n this._shouldFitLayout = true\n this._prevWidth = this._width\n this._prevHeight = this._height\n }\n\n // Apply layout and render\n if (this._shouldRecalculateLayout || !this._layoutCalculationPromise) {\n this._layoutCalculationPromise = this._calculateLayout()\n }\n\n this._layoutCalculationPromise.then((isFirstRender) => {\n // If the component has been destroyed while the layout calculation\n // was in progress, we cancel the render\n if (this.isDestroyed()) return\n\n this._initPanelsData()\n\n // Fit the view\n if (isFirstRender) {\n this._fit()\n this._shouldFitLayout = false\n } else if (this._shouldFitLayout && !this._isAutoFitDisabled) {\n this._fit(duration)\n this._shouldFitLayout = false\n }\n\n // Draw\n this._drawNodes(animDuration)\n this._drawLinks(animDuration)\n\n // Select Links / Nodes\n this._resetSelection()\n if (this.config.selectedNodeId) {\n const selectedNode = datamodel.nodes.find(node => node.id === this.config.selectedNodeId)\n this._selectNode(selectedNode)\n }\n\n if (this.config.selectedLinkId) {\n const selectedLink = datamodel.links.find(link => link.id === this.config.selectedLinkId)\n this._selectLink(selectedLink)\n }\n\n // Link flow animation timer\n if (!this._timer) {\n const refreshRateMs = 35\n this._timer = interval(this._onLinkFlowTimerFrame.bind(this), refreshRateMs)\n }\n\n // Zoom\n if (disableZoom) this.g.on('.zoom', null)\n else this.g.call(this._zoomBehavior).on('dblclick.zoom', null)\n\n if (!this._isFirstRender && !disableZoom) {\n const transform = zoomTransform(this.g.node())\n this._onZoom(transform)\n }\n\n // While the graph is animating we disable pointer events on the graph group\n if (animDuration) { this._graphGroup.attr('pointer-events', 'none') }\n smartTransition(this._graphGroup, animDuration)\n .on('end interrupt', () => {\n this._graphGroup.attr('pointer-events', null)\n })\n\n // We need to set up events and attributes again because the rendering might have been delayed by the layout\n // calculation and they were not set up properly (see the render function of `ComponentCore`)\n this._setUpComponentEventsThrottled()\n this._setCustomAttributesThrottled()\n })\n\n\n this._isFirstRender = false\n }\n\n private _drawNodes (duration: number): void {\n const { config, datamodel } = this\n\n const nodes: GraphNode<N, L>[] = datamodel.nodes\n const nodeGroups = this._nodesGroup\n .selectAll<SVGGElement, GraphNode<N, L>>(`.${nodeSelectors.gNode}:not(.${nodeSelectors.gNodeExit})`)\n .data(nodes, d => String(d._id))\n\n const nodeGroupsEnter = nodeGroups.enter().append('g')\n .attr('class', nodeSelectors.gNode)\n .call(createNodes, config, duration)\n\n const nodeGroupsMerged = nodeGroups.merge(nodeGroupsEnter)\n const nodeUpdateSelection = updateNodes(nodeGroupsMerged, config, duration, this._scale)\n\n this._drawPanels(nodeUpdateSelection, duration)\n\n const nodesGroupExit = nodeGroups.exit<GraphNode<N, L>>()\n nodesGroupExit\n .classed(nodeSelectors.gNodeExit, true)\n .call(removeNodes, config, duration)\n\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const thisRef = this\n if (!config.disableDrag) {\n const dragBehaviour = drag<SVGGElement, GraphNode<N, L>>()\n .on('start', function (event, d) { thisRef._onDragStarted(d, event, select(this)) })\n .on('drag', function (event, d) { thisRef._onDragged(d, event, nodeGroupsMerged) })\n .on('end', function (event, d) { thisRef._onDragEnded(d, event, select(this)) })\n nodeGroupsMerged.call(dragBehaviour)\n } else {\n nodeGroupsMerged.on('.drag', null)\n }\n }\n\n private _drawLinks (duration: number): void {\n const { config, datamodel: { links } } = this\n\n const linkGroups = this._linksGroup\n .selectAll<SVGGElement, GraphLink<N, L>>(`.${linkSelectors.gLink}`)\n .data(links, (d: GraphLink<N, L>) => String(d._id))\n\n const linkGroupsEnter = linkGroups.enter().append('g')\n .attr('class', linkSelectors.gLink)\n .call(createLinks, config, duration)\n\n const linkGroupsMerged = linkGroups.merge(linkGroupsEnter)\n linkGroupsMerged.call(updateLinks, config, duration, this._scale, this._getLinkArrowDefId)\n\n const linkGroupsExit = linkGroups.exit<GraphLink<N, L>>()\n linkGroupsExit\n .attr('class', linkSelectors.gLinkExit)\n .call(removeLinks, config, duration)\n }\n\n private _drawPanels (\n nodeUpdateSelection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown> | Transition<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,\n duration: number\n ): void {\n const { config } = this\n smartTransition(this._panelsGroup, duration / 2)\n .style('opacity', config.panels?.length ? 1 : 0)\n\n if (!this._panels) return\n\n const selection = ((nodeUpdateSelection as Transition<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>).duration)\n ? (nodeUpdateSelection as Transition<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>).selection()\n : nodeUpdateSelection as Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>\n\n updatePanelNumNodes(selection, this._panels, config)\n updatePanelBBoxSize(selection, this._panels, config)\n const panelData = this._panels.filter(p => p._numNodes)\n const panelGroup = this._panelsGroup\n .selectAll<SVGGElement, GraphPanel>(`.${panelSelectors.gPanel}`)\n .data(panelData, p => p.label)\n\n const panelGroupExit = panelGroup.exit<GraphPanel<N, L>>()\n panelGroupExit.call(removePanels, config, duration)\n\n const panelGroupEnter = panelGroup.enter().append('g')\n .attr('class', panelSelectors.gPanel)\n .call(createPanels, selection)\n const panelGroupMerged = panelGroup.merge(panelGroupEnter)\n\n this._updatePanels(panelGroupMerged, duration)\n }\n\n private _updatePanels (panelToUpdate: Selection<SVGGElement, GraphPanel, SVGGElement, unknown>, duration: number): void {\n const { config } = this\n if (!this._panels) return\n\n panelToUpdate.call(updatePanels, config, duration)\n }\n\n private async _calculateLayout (): Promise<boolean> {\n const { prevConfig, config, datamodel } = this\n const firstRender = this._isFirstRender\n\n // If the layout type has changed, we need to reset the node positions if they were fixed before\n if (prevConfig.layoutType !== config.layoutType) {\n for (const node of datamodel.nodes) {\n delete node._state.fx\n delete node._state.fy\n }\n }\n\n switch (config.layoutType) {\n case GraphLayoutType.Precalculated:\n break\n case GraphLayoutType.Parallel:\n applyLayoutParallel(datamodel, config, this._width, this._height)\n break\n case GraphLayoutType.ParallelHorizontal:\n applyLayoutParallel(datamodel, config, this._width, this._height, 'horizontal')\n break\n case GraphLayoutType.Dagre:\n await applyLayoutDagre(datamodel, config, this._width)\n break\n case GraphLayoutType.Force:\n await applyLayoutForce(datamodel, config, this._width)\n break\n case GraphLayoutType.Concentric:\n applyLayoutConcentric(datamodel, config, this._width, this._height)\n break\n case GraphLayoutType.Elk:\n await applyELKLayout(datamodel, config, this._width)\n break\n case GraphLayoutType.Circular:\n default:\n applyLayoutCircular(datamodel, config, this._width, this._height)\n break\n }\n\n // We need to update the panels data right after the layout calculation\n // because we want to have the latest coordinates before calling `onLayoutCalculated`\n this._initPanelsData()\n this.config.onLayoutCalculated?.(datamodel.nodes, datamodel.links)\n\n this._shouldRecalculateLayout = false\n\n return firstRender\n }\n\n private _initPanelsData (): void {\n const { config, datamodel } = this\n\n if (this._shouldSetPanels) {\n this._panels = initPanels(config.panels)\n setPanelForNodes(this._panels, datamodel.nodes, this.config)\n this._shouldSetPanels = false\n }\n }\n\n private _fit (duration = 0): void {\n const { datamodel: { nodes } } = this\n const transform = this._getTransform(nodes)\n smartTransition(this.g, duration)\n .call(this._zoomBehavior.transform, transform)\n this._onZoom(transform)\n }\n\n private _getTransform (nodes: GraphNode<N, L>[]): ZoomTransform {\n const { nodeSize, zoomScaleExtent } = this.config\n const { left, top, right, bottom } = this.bleed\n\n const maxNodeSize = getMaxNodeSize(nodes, nodeSize)\n const w = this._width\n const h = this._height\n\n const xExtent = [\n min(nodes, d => getX(d) - maxNodeSize / 2 - (max((d._panels || []).map(p => p._padding.left)) || 0)),\n max(nodes, d => getX(d) + maxNodeSize / 2 + (max((d._panels || []).map(p => p._padding.right)) || 0)),\n ]\n const yExtent = [\n min(nodes, d => getY(d) - maxNodeSize / 2 - (max((d._panels || []).map(p => p._padding.top)) || 0)),\n max(nodes, d => getY(d) + maxNodeSize / 2 + (max((d._panels || []).map(p => p._padding.bottom)) || 0)),\n ]\n\n if (xExtent.some(item => item === undefined) || yExtent.some(item => item === undefined)) {\n console.warn('Unovis | Graph: Some of the node coordinates are undefined. This can happen if you try to fit the graph before the layout has been calculated.')\n return zoomIdentity\n }\n\n const xScale = w / (xExtent[1] - xExtent[0] + left + right)\n const yScale = h / (yExtent[1] - yExtent[0] + top + bottom)\n\n const clampedScale = clamp(min([xScale, yScale]), zoomScaleExtent[0], zoomScaleExtent[1])\n\n const xCenter = (xExtent[1] + xExtent[0]) / 2\n const yCenter = (yExtent[1] + yExtent[0]) / 2\n const translateX = this._width / 2 - xCenter * clampedScale\n const translateY = this._height / 2 - yCenter * clampedScale\n const transform = zoomIdentity\n .translate(translateX, translateY)\n .scale(clampedScale)\n\n return transform\n }\n\n private _selectNode (node: GraphNode<N, L>): void {\n const { datamodel: { nodes, links } } = this\n if (!node) console.warn('Unovis | Graph: Select Node: Not found')\n this._selectedNode = node\n\n // Apply grey out\n // Grey out all nodes\n nodes.forEach(n => {\n n._state.selected = false\n n._state.greyout = true\n })\n\n // Grey out all links\n links.forEach(l => {\n l._state.greyout = true\n l._state.selected = false\n })\n\n // Highlight selected\n if (node) {\n node._state.selected = true\n node._state.greyout = false\n\n const connectedLinks = links.filter(l => (l.source === node) || (l.target === node))\n connectedLinks.forEach(l => {\n const source = l.source as GraphNode<N, L>\n const target = l.target as GraphNode<N, L>\n source._state.greyout = false\n target._state.greyout = false\n l._state.greyout = false\n })\n }\n\n this._updateSelectedElements()\n }\n\n private _selectLink (link: GraphLink<N, L>): void {\n const { datamodel: { nodes, links } } = this\n if (!link) console.warn('Unovis: Graph: Select Link: Not found')\n this._selectedLink = link\n const selectedLinkSource = link?.source as GraphNode<N, L>\n const selectedLinkTarget = link?.target as GraphNode<N, L>\n\n // Apply grey out\n nodes.forEach(n => {\n n._state.selected = false\n n._state.greyout = true\n if (selectedLinkTarget?._id === n._id || selectedLinkSource?._id === n._id) {\n link._state.greyout = false\n }\n })\n\n links.forEach(l => {\n l._state.greyout = true\n const source = l.source as GraphNode<N, L>\n const target = l.target as GraphNode<N, L>\n if ((source._id === selectedLinkSource?._id) && (target._id === selectedLinkTarget?._id)) {\n source._state.greyout = false\n target._state.greyout = false\n l._state.greyout = false\n }\n })\n\n links.forEach(l => {\n delete l._state.selected\n })\n\n if (link) link._state.selected = true\n\n this._updateSelectedElements()\n }\n\n private _resetSelection (): void {\n const { datamodel: { nodes, links } } = this\n this._selectedNode = undefined\n this._selectedLink = undefined\n\n // Disable Grayout\n nodes.forEach(n => {\n delete n._state.selected\n delete n._state.greyout\n })\n links.forEach(l => {\n delete l._state.greyout\n delete l._state.selected\n })\n\n this._updateSelectedElements()\n }\n\n private _updateSelectedElements (): void {\n const { config } = this\n\n const linkElements = this._linksGroup.selectAll<SVGGElement, GraphLink<N, L>>(`.${linkSelectors.gLink}`)\n linkElements.call(updateSelectedLinks, config, this._scale)\n\n const nodeElements = this._nodesGroup.selectAll<SVGGElement, GraphNode<N, L>>(`.${nodeSelectors.gNode}`)\n nodeElements.call(updateSelectedNodes, config)\n\n // this._drawPanels(nodeElements, 0)\n }\n\n private _onBackgroundClick (): void {\n this._resetSelection()\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private _onNodeClick (d: GraphNode<N, L>): void {\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private _onNodeMouseOut (d: GraphNode<N, L>): void {\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private _onNodeMouseOver (d: GraphNode<N, L>): void {\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private _onLinkClick (d: GraphLink<N, L>): void {\n }\n\n private _onLinkMouseOver (d: GraphLink<N, L>): void {\n if (this._isDragging) return\n\n d._state.hovered = true\n this._updateSelectedElements()\n }\n\n private _onLinkMouseOut (d: GraphLink<N, L>): void {\n if (this._isDragging) return\n\n delete d._state.hovered\n this._updateSelectedElements()\n }\n\n private _onLinkFlowTimerFrame (elapsed = 0): void {\n const { config: { linkFlow, linkFlowAnimDuration }, datamodel: { links } } = this\n\n const hasLinksWithFlow = links.some((d, i) => getBoolean(d, linkFlow, i))\n if (!hasLinksWithFlow) return\n\n const t = (elapsed % linkFlowAnimDuration) / linkFlowAnimDuration\n const linkElements = this._linksGroup.selectAll<SVGGElement, GraphLink<N, L>>(`.${linkSelectors.gLink}`)\n\n const linksToAnimate = linkElements.filter(d => !d._state.greyout)\n linksToAnimate.each(d => { d._state.flowAnimTime = t })\n animateLinkFlow(linksToAnimate, this.config, this._scale)\n }\n\n private _onZoom (t: ZoomTransform, event?: D3ZoomEvent<SVGGElement, unknown>): void {\n const { config, datamodel: { nodes } } = this\n const transform = t || event.transform\n this._scale = transform.k\n this._graphGroup.attr('transform', transform.toString())\n if (isFunction(config.onZoom)) config.onZoom(this._scale, config.zoomScaleExtent, event)\n\n // console.warn('Unovis | Graph: Zoom: ', transform)\n if (!this._initialTransform) this._initialTransform = transform\n\n // If the event was triggered by a mouse interaction (pan or zoom) we don't\n // refit the layout after recalculation (e.g. on container resize)\n if (event?.sourceEvent) {\n const diff = Object.keys(transform).reduce((acc, prop) => {\n const propVal = transform[prop as keyof ZoomTransform] as number\n const initialPropVal = this._initialTransform[prop as keyof ZoomTransform] as number\n const dVal = Math.abs(propVal - initialPropVal)\n const scaledDVal = prop === 'k' ? 20 * dVal : dVal / 15\n acc += scaledDVal\n return acc\n }, 0)\n\n if (diff > config.layoutAutofitTolerance) this._isAutoFitDisabled = true\n else this._isAutoFitDisabled = false\n }\n\n this._nodesGroup.selectAll<SVGGElement, GraphNode<N, L>>(`.${nodeSelectors.gNode}`)\n .call(\n (nodes.length > config.zoomThrottledUpdateNodeThreshold ? zoomNodesThrottled : zoomNodes) as typeof zoomNodes,\n config,\n this._scale\n )\n\n this._linksGroup.selectAll<SVGGElement, GraphLink<N, L>>(`.${linkSelectors.gLink}`)\n .call(\n (nodes.length > config.zoomThrottledUpdateNodeThreshold ? zoomLinksThrottled : zoomLinks) as typeof zoomLinks,\n config,\n this._scale,\n this._getLinkArrowDefId\n )\n }\n\n private _onDragStarted (\n d: GraphNode<N, L>,\n event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>,\n nodeSelection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>\n ): void {\n const { config } = this\n this._isDragging = true\n d._state.isDragged = true\n nodeSelection.call(updateNodes, config, 0, this._scale)\n config.onNodeDragStart?.(d, event)\n }\n\n private _onDragged (\n d: GraphNode<N, L>,\n event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>,\n allNodesSelection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>\n ): void {\n const { config } = this\n const transform = zoomTransform(this.g.node())\n const scale = transform.k\n\n // Prevent the node from being dragged offscreen or outside its panel\n const panels = this._panels?.filter(p => p.nodes.includes(d._id)) ?? []\n const nodeSizeValue = getNodeSize(d, config.nodeSize, d._index)\n const maxY = min([(this._height - transform.y) / scale, ...panels.map(p => p._y + p._height)]) - nodeSizeValue / 2\n const maxX = min([(this._width - transform.x) / scale, ...panels.map(p => p._x + p._width)]) - nodeSizeValue / 2\n const minY = max([-transform.y / scale, ...panels.map(p => p._y)]) + nodeSizeValue / 2\n const minX = max([-transform.x / scale, ...panels.map(p => p._x)]) + nodeSizeValue / 2\n\n let [x, y] = pointer(event, this._graphGroup.node())\n if (y < minY) y = minY\n else if (y > maxY) y = maxY\n if (x < minX) x = minX\n else if (x > maxX) x = maxX\n\n // Snap to Layout\n if (Math.sqrt(Math.pow(x - d.x, 2) + Math.pow(y - d.y, 2)) < 15) {\n x = d.x\n y = d.y\n }\n\n // Assign coordinates\n d._state.fx = x\n d._state.fy = y\n if (d._state.fx === d.x) delete d._state.fx\n if (d._state.fy === d.y) delete d._state.fy\n\n // Update affected DOM elements\n const nodeSelection = this._nodesGroup.selectAll<SVGGElement, GraphNode<N, L>>(`.${nodeSelectors.gNode}`)\n const nodeToUpdate = nodeSelection.filter((n: GraphNode<N, L>) => n._id === d._id)\n nodeToUpdate.call(updateNodes, config, 0, scale)\n\n const linkSelection = this._linksGroup.selectAll<SVGGElement, GraphLink<N, L>>(`.${linkSelectors.gLink}`)\n const linksToUpdate = linkSelection.filter((l: L) => {\n const source = l.source as GraphNode<N, L>\n const target = l.target as GraphNode<N, L>\n return source._id === d._id || target._id === d._id\n })\n linksToUpdate.call(updateLinks, config, 0, scale, this._getLinkArrowDefId)\n const linksToAnimate = linksToUpdate.filter(d => d._state.greyout)\n if (linksToAnimate.size()) animateLinkFlow(linksToAnimate, config, this._scale)\n\n config.onNodeDrag?.(d, event)\n }\n\n private _onDragEnded (\n d: GraphNode<N, L>,\n event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>,\n nodeSelection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>\n ): void {\n const { config } = this\n this._isDragging = false\n d._state.isDragged = false\n nodeSelection.call(updateNodes, config, 0, this._scale)\n config.onNodeDragEnd?.(d, event)\n }\n\n private _shouldLayoutRecalculate (): boolean {\n const { prevConfig, config } = this\n if (prevConfig.layoutType !== config.layoutType) return true\n if (prevConfig.layoutNonConnectedAside !== config.layoutNonConnectedAside) return true\n\n if (prevConfig.layoutType === GraphLayoutType.Force) {\n const forceSettingsDiff = shallowDiff(prevConfig.forceLayoutSettings, config.forceLayoutSettings)\n if (Object.keys(forceSettingsDiff).length) return true\n }\n\n if (prevConfig.layoutType === GraphLayoutType.Dagre) {\n const dagreSettingsDiff = shallowDiff(prevConfig.dagreLayoutSettings, config.dagreLayoutSettings)\n if (Object.keys(dagreSettingsDiff).length) return true\n }\n\n if (prevConfig.layoutType === GraphLayoutType.Elk) {\n if (isPlainObject(prevConfig.layoutElkSettings) && isPlainObject(config.layoutElkSettings)) {\n // Do a deeper comparison if `config.layoutElkSettings` is an object\n const elkSettingsDiff = shallowDiff(\n prevConfig.layoutElkSettings as Record<string, string>,\n config.layoutElkSettings as Record<string, string>\n )\n return Boolean(Object.keys(elkSettingsDiff).length)\n } else {\n // Otherwise, do a simple `===` comparison\n return prevConfig.layoutElkSettings !== config.layoutElkSettings\n }\n }\n\n if (\n prevConfig.layoutType === GraphLayoutType.Parallel ||\n prevConfig.layoutType === GraphLayoutType.ParallelHorizontal ||\n prevConfig.layoutType === GraphLayoutType.Concentric\n ) {\n if (prevConfig.layoutGroupOrder !== config.layoutGroupOrder) return true\n if (prevConfig.layoutParallelNodesPerColumn !== config.layoutParallelNodesPerColumn) return true\n if (prevConfig.layoutParallelSortConnectionsByGroup !== config.layoutParallelSortConnectionsByGroup) return true\n }\n\n return false\n }\n\n private _getLinkArrowDefId (arrow: GraphLinkArrowStyle | undefined): string | null {\n return arrow ? `${this.uid}-${arrow}` : null\n }\n\n private _addSVGDefs (): void {\n // Clean up old defs\n this._defs.selectAll('*').remove()\n\n // Single Arrow\n this._defs.append('path').attr('d', getArrowPath())\n .attr('id', this._getLinkArrowDefId(GraphLinkArrowStyle.Single))\n\n // Double Arrow\n this._defs.append('path').attr('d', getDoubleArrowPath())\n .attr('id', this._getLinkArrowDefId(GraphLinkArrowStyle.Double))\n }\n\n public zoomIn (increment = 0.3): void {\n const scaleBy = 1 + increment\n smartTransition(this.g, this.config.duration / 2)\n .call(this._zoomBehavior.scaleBy, scaleBy)\n }\n\n public zoomOut (increment = 0.3): void {\n const scaleBy = 1 - increment\n smartTransition(this.g, this.config.duration / 2)\n .call(this._zoomBehavior.scaleBy, scaleBy)\n }\n\n public setZoom (zoomLevel: number): void {\n smartTransition(this.g, this.config.duration / 2)\n .call(this._zoomBehavior.scaleTo, zoomLevel)\n }\n\n public getZoom (): number {\n return zoomTransform(this.g.node()).k\n }\n\n public fitView (duration = this.config.duration): void {\n this._layoutCalculationPromise.then(() => {\n this._fit(duration)\n })\n }\n\n /** Enable automatic fitting to container if it was disabled due to previous zoom / pan interactions */\n public resetAutofitState (): void {\n this._isAutoFitDisabled = false\n }\n\n /** Get current coordinates of the nodes as an array of { id: string; x: number; y: number } objects */\n public getNodesCoordinates (): { id: string; x: number; y: number }[] {\n const { datamodel: { nodes } } = this\n return nodes.map(n => ({\n id: n._id,\n x: n.x,\n y: n.y,\n }))\n }\n\n /** Get node coordinates by id as { id: string; x: number; y: number } */\n public getNodeCoordinatesById (id: string): { id: string; x: number; y: number } | undefined {\n const { datamodel: { nodes } } = this\n const node = nodes.find(n => n._id === id)\n\n if (!node) {\n console.warn(`Unovis | Graph: Node ${id} not found`)\n return undefined\n } else {\n return {\n id: node._id,\n x: node.x,\n y: node.y,\n }\n }\n }\n}\n"],"names":["generalSelectors.background","generalSelectors.graphGroup","panelSelectors.panels","linkSelectors.links","nodeSelectors.nodes","nodeSelectors.gNode","nodeSelectors.gNodeExit","linkSelectors.gLink","linkSelectors.gLinkExit","panelSelectors.gPanel","generalSelectors.root","nodeSelectors.node","nodeSelectors.nodeGauge","nodeSelectors.sideLabelGroup","nodeSelectors.label","nodeSelectors.greyedOutNode","linkSelectors.link","linkSelectors.greyedOutLink","panelSelectors.panel","panelSelectors.panelSelection","panelSelectors.label","panelSelectors.labelText","panelSelectors.sideIconGroup","panelSelectors.sideIconShape","panelSelectors.sideIconSymbol","nodeSelectors"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwCM,MAAO,KAGX,SAAQ,aAGP,CAAA;AA+ED,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;QAvDC,IAAc,CAAA,cAAA,GAAG,kBAA2D,CAAA;AAC/E,QAAA,IAAA,CAAA,MAAM,GAA+B,IAAI,CAAC,cAAc,CAAA;AAC/D,QAAA,IAAA,CAAA,SAAS,GAA2D,IAAI,cAAc,EAAE,CAAA;QAUhF,IAAc,CAAA,cAAA,GAAG,IAAI,CAAA;QAGrB,IAAwB,CAAA,wBAAA,GAAG,KAAK,CAAA;QAIhC,IAAgB,CAAA,gBAAA,GAAG,KAAK,CAAA;QAMxB,IAAkB,CAAA,kBAAA,GAAG,KAAK,CAAA;QAG1B,IAAW,CAAA,WAAA,GAAG,KAAK,CAAA;AAE3B,QAAA,IAAA,CAAA,MAAM,GAAG;AACP,YAAA,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,GAAG;gBAC5B,KAAK,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC;AAC1C,aAAA;AACD,YAAA,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG;gBACtB,KAAK,EAAE,IA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B;IACvC,IAAI,EAAEK,KAAmB;IACzB,SAAS,EAAEM,IAAkB;IAC7B,SAAS,EAAEC,SAAuB;IAClC,aAAa,EAAEC,cAA4B;IAC3C,SAAS,EAAEC,KAAmB;IAC9B,UAAU,EAAEC,aAA2B;IACvC,IAAI,EAAER,KAAmB;IACzB,QAAQ,EAAES,IAAkB;IAC5B,UAAU,EAAEC,aAA2B;IACvC,KAAK,EAAER,MAAqB;IAC5B,SAAS,EAAES,KAAoB;IAC/B,cAAc,EAAEC,cAA6B;IAC7C,UAAU,EAAEC,OAAoB;IAChC,cAAc,EAAEC,SAAwB;IACxC,aAAa,EAAEC,aAA4B;IAC3C,kBAAkB,EAAEC,aAA4B;IAChD,mBAAmB,EAAEC,cAA6B;CACnD,CAAA;AAEM,KAAa,CAAA,aAAA,GAAGC,KAAa;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/graph/index.ts"],"sourcesContent":["import { min, max } from 'd3-array'\nimport { Transition } from 'd3-transition'\nimport { select, Selection, pointer } from 'd3-selection'\nimport { zoom, zoomTransform, zoomIdentity, ZoomTransform, D3ZoomEvent, ZoomBehavior } from 'd3-zoom'\nimport { drag, D3DragEvent } from 'd3-drag'\nimport { interval, Timer } from 'd3-timer'\n\n// Core\nimport { ComponentCore } from 'core/component'\nimport { GraphDataModel } from 'data-models/graph'\n\n// Types\nimport { GraphInputLink, GraphInputNode } from 'types/graph'\nimport { Spacing } from 'types/spacing'\n\n// Utils\nimport { isNumber, clamp, shallowDiff, isFunction, getBoolean, isPlainObject } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\n\n// Local Types\nimport { GraphNode, GraphLink, GraphLayoutType, GraphLinkArrowStyle, GraphPanel } from './types'\n\n// Config\nimport { GraphDefaultConfig, GraphConfigInterface } from './config'\n\n// Styles\nimport * as generalSelectors from './style'\nimport * as nodeSelectors from './modules/node/style'\nimport * as linkSelectors from './modules/link/style'\nimport * as panelSelectors from './modules/panel/style'\n\n// Modules\nimport { createNodes, updateNodes, removeNodes, zoomNodesThrottled, zoomNodes, updateNodeSelectedGreyout } from './modules/node'\nimport { getMaxNodeSize, getNodeSize, getX, getY } from './modules/node/helper'\nimport { createLinks, updateLinks, removeLinks, zoomLinksThrottled, zoomLinks, animateLinkFlow, updateSelectedLinks } from './modules/link'\nimport { getDoubleArrowPath, getArrowPath } from './modules/link/helper'\nimport { createPanels, updatePanels, removePanels } from './modules/panel'\nimport { setPanelForNodes, updatePanelBBoxSize, updatePanelNumNodes, initPanels } from './modules/panel/helper'\nimport { applyLayoutCircular, applyLayoutParallel, applyLayoutDagre, applyLayoutConcentric, applyLayoutForce, applyELKLayout } from './modules/layout'\n\nexport class Graph<\n N extends GraphInputNode,\n L extends GraphInputLink,\n> extends ComponentCore<\n {nodes: N[]; links?: L[]},\n GraphConfigInterface<N, L>\n > {\n static selectors = {\n root: generalSelectors.root,\n graphGroup: generalSelectors.graphGroup,\n background: generalSelectors.background,\n node: nodeSelectors.gNode,\n nodeShape: nodeSelectors.node,\n nodeGauge: nodeSelectors.nodeGauge,\n nodeSideLabel: nodeSelectors.sideLabelGroup,\n nodeLabel: nodeSelectors.label,\n dimmedNode: nodeSelectors.greyedOutNode,\n link: linkSelectors.gLink,\n linkLine: linkSelectors.link,\n dimmedLink: linkSelectors.greyedOutLink,\n panel: panelSelectors.gPanel,\n panelRect: panelSelectors.panel,\n panelSelection: panelSelectors.panelSelection,\n panelLabel: panelSelectors.label,\n panelLabelText: panelSelectors.labelText,\n panelSideIcon: panelSelectors.sideIconGroup,\n panelSideIconShape: panelSelectors.sideIconShape,\n panelSideIconSymbol: panelSelectors.sideIconSymbol,\n }\n\n static nodeSelectors = nodeSelectors\n g: Selection<SVGGElement, unknown, null, undefined>\n protected _defaultConfig = GraphDefaultConfig as unknown as GraphConfigInterface<N, L>\n public config: GraphConfigInterface<N, L> = this._defaultConfig\n datamodel: GraphDataModel<N, L, GraphNode<N, L>, GraphLink<N, L>> = new GraphDataModel()\n private _selectedNode: GraphNode<N, L>\n private _selectedLink: GraphLink<N, L>\n\n private _graphGroup: Selection<SVGGElement, unknown, null, undefined>\n private _panelsGroup: Selection<SVGGElement, unknown, null, undefined>\n private _linksGroup: Selection<SVGGElement, unknown, null, undefined>\n private _nodesGroup: Selection<SVGGElement, unknown, null, undefined>\n private _timer: Timer\n\n private _isFirstRender = true\n private _prevWidth: number\n private _prevHeight: number\n private _shouldRecalculateLayout = false\n private _layoutCalculationPromise: Promise<boolean> | undefined\n\n private _shouldFitLayout: boolean\n private _shouldSetPanels = false\n private _panels: GraphPanel[]\n\n private _defs: Selection<SVGDefsElement, unknown, SVGGElement, undefined>\n private _backgroundRect: Selection<SVGRectElement, unknown, SVGGElement, undefined>\n private _zoomBehavior: ZoomBehavior<SVGGElement, unknown>\n private _isAutoFitDisabled = false\n private _scale: number\n private _initialTransform: ZoomTransform\n private _isDragging = false\n\n events = {\n [Graph.selectors.background]: {\n click: this._onBackgroundClick.bind(this),\n },\n [Graph.selectors.node]: {\n click: this._onNodeClick.bind(this),\n mouseover: this._onNodeMouseOver.bind(this),\n mouseout: this._onNodeMouseOut.bind(this),\n },\n [Graph.selectors.link]: {\n click: this._onLinkClick.bind(this),\n mouseover: this._onLinkMouseOver.bind(this),\n mouseout: this._onLinkMouseOut.bind(this),\n },\n }\n\n public get selectedNode (): GraphNode<N, L> {\n return this._selectedNode\n }\n\n public get selectedLink (): GraphLink<N, L> {\n return this._selectedLink\n }\n\n constructor (config?: GraphConfigInterface<N, L>) {\n super()\n if (config) this.setConfig(config)\n\n this._backgroundRect = this.g.append('rect').attr('class', generalSelectors.background)\n this._graphGroup = this.g.append('g').attr('class', generalSelectors.graphGroup)\n\n this._zoomBehavior = zoom<SVGGElement, unknown>()\n .scaleExtent(this.config.zoomScaleExtent)\n .on('zoom', (e: D3ZoomEvent<SVGGElement, unknown>) => this._onZoom(e.transform, e))\n\n this._panelsGroup = this._graphGroup.append('g').attr('class', panelSelectors.panels)\n this._linksGroup = this._graphGroup.append('g').attr('class', linkSelectors.links)\n this._nodesGroup = this._graphGroup.append('g').attr('class', nodeSelectors.nodes)\n\n this._defs = this._graphGroup.append('defs')\n\n this._getLinkArrowDefId = this._getLinkArrowDefId.bind(this)\n }\n\n setData (data: {nodes: N[]; links?: L[]}): void {\n const { config } = this\n\n this.datamodel.nodeSort = config.nodeSort\n this.datamodel.data = data\n this._shouldRecalculateLayout = true\n if (config.layoutAutofit) this._shouldFitLayout = true\n this._shouldSetPanels = true\n\n this._addSVGDefs()\n }\n\n setConfig (config: GraphConfigInterface<N, L>): void {\n super.setConfig(config)\n\n this._shouldRecalculateLayout = this._shouldRecalculateLayout || this._shouldLayoutRecalculate()\n this._shouldFitLayout = this._shouldFitLayout || this._shouldRecalculateLayout\n if (this._shouldFitLayout) this._isAutoFitDisabled = false\n this._shouldSetPanels = true\n }\n\n get bleed (): Spacing {\n const extraPadding = 50 // Extra padding to take into account labels and selection outlines\n return { top: extraPadding, bottom: extraPadding, left: extraPadding, right: extraPadding }\n }\n\n _render (customDuration?: number): void {\n const { config: { disableZoom, duration, layoutAutofit }, datamodel } = this\n if (!datamodel.nodes && !datamodel.links) return\n const animDuration = isNumber(customDuration) ? customDuration : duration\n\n this._backgroundRect\n .attr('width', this._width)\n .attr('height', this._height)\n .attr('opacity', 0)\n\n if ((this._prevWidth !== this._width || this._prevHeight !== this._height) && layoutAutofit) {\n // Fit layout on resize\n this._shouldFitLayout = true\n this._prevWidth = this._width\n this._prevHeight = this._height\n }\n\n // Apply layout and render\n if (this._shouldRecalculateLayout || !this._layoutCalculationPromise) {\n this._layoutCalculationPromise = this._calculateLayout()\n }\n\n this._layoutCalculationPromise.then((isFirstRender) => {\n // If the component has been destroyed while the layout calculation\n // was in progress, we cancel the render\n if (this.isDestroyed()) return\n\n this._initPanelsData()\n\n // Fit the view\n if (isFirstRender) {\n this._fit()\n this._shouldFitLayout = false\n } else if (this._shouldFitLayout && !this._isAutoFitDisabled) {\n this._fit(duration)\n this._shouldFitLayout = false\n }\n\n // Draw\n this._drawNodes(animDuration)\n this._drawLinks(animDuration)\n\n // Select Links / Nodes\n this._resetSelection()\n if (this.config.selectedNodeId) {\n const selectedNode = datamodel.nodes.find(node => node.id === this.config.selectedNodeId)\n this._selectNode(selectedNode)\n }\n\n if (this.config.selectedLinkId) {\n const selectedLink = datamodel.links.find(link => link.id === this.config.selectedLinkId)\n this._selectLink(selectedLink)\n }\n\n // Link flow animation timer\n if (!this._timer) {\n const refreshRateMs = 35\n this._timer = interval(this._onLinkFlowTimerFrame.bind(this), refreshRateMs)\n }\n\n // Zoom\n if (disableZoom) this.g.on('.zoom', null)\n else this.g.call(this._zoomBehavior).on('dblclick.zoom', null)\n\n if (!this._isFirstRender && !disableZoom) {\n const transform = zoomTransform(this.g.node())\n this._onZoom(transform)\n }\n\n // While the graph is animating we disable pointer events on the graph group\n if (animDuration) { this._graphGroup.attr('pointer-events', 'none') }\n smartTransition(this._graphGroup, animDuration)\n .on('end interrupt', () => {\n this._graphGroup.attr('pointer-events', null)\n })\n\n // We need to set up events and attributes again because the rendering might have been delayed by the layout\n // calculation and they were not set up properly (see the render function of `ComponentCore`)\n this._setUpComponentEventsThrottled()\n this._setCustomAttributesThrottled()\n\n // On render complete callback\n this.config.onRenderComplete?.(this.g, datamodel.nodes, datamodel.links, this.config, animDuration, this._scale)\n })\n\n this._isFirstRender = false\n }\n\n private _drawNodes (duration: number): void {\n const { config, datamodel } = this\n\n const nodes: GraphNode<N, L>[] = datamodel.nodes\n const nodeGroups = this._nodesGroup\n .selectAll<SVGGElement, GraphNode<N, L>>(`.${nodeSelectors.gNode}:not(.${nodeSelectors.gNodeExit})`)\n .data(nodes, d => String(d._id))\n\n const nodeGroupsEnter = nodeGroups.enter().append('g')\n .attr('class', nodeSelectors.gNode)\n .call(createNodes, config, duration, this._scale)\n\n const nodeGroupsMerged = nodeGroups.merge(nodeGroupsEnter)\n const nodeUpdateSelection = updateNodes(nodeGroupsMerged, config, duration, this._scale)\n\n this._drawPanels(nodeUpdateSelection, duration)\n\n const nodesGroupExit = nodeGroups.exit<GraphNode<N, L>>()\n nodesGroupExit\n .classed(nodeSelectors.gNodeExit, true)\n .call(removeNodes, config, duration, this._scale)\n\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const thisRef = this\n if (!config.disableDrag) {\n const dragBehaviour = drag<SVGGElement, GraphNode<N, L>>()\n .on('start', function (event, d) { thisRef._onDragStarted(d, event, select(this)) })\n .on('drag', function (event, d) { thisRef._onDragged(d, event, nodeGroupsMerged) })\n .on('end', function (event, d) { thisRef._onDragEnded(d, event, select(this)) })\n nodeGroupsMerged.call(dragBehaviour)\n } else {\n nodeGroupsMerged.on('.drag', null)\n }\n }\n\n private _drawLinks (duration: number): void {\n const { config, datamodel: { links } } = this\n\n const linkGroups = this._linksGroup\n .selectAll<SVGGElement, GraphLink<N, L>>(`.${linkSelectors.gLink}`)\n .data(links, (d: GraphLink<N, L>) => String(d._id))\n\n const linkGroupsEnter = linkGroups.enter().append('g')\n .attr('class', linkSelectors.gLink)\n .call(createLinks, config, duration)\n\n const linkGroupsMerged = linkGroups.merge(linkGroupsEnter)\n linkGroupsMerged.call(updateLinks, config, duration, this._scale, this._getLinkArrowDefId)\n\n const linkGroupsExit = linkGroups.exit<GraphLink<N, L>>()\n linkGroupsExit\n .attr('class', linkSelectors.gLinkExit)\n .call(removeLinks, config, duration)\n }\n\n private _drawPanels (\n nodeUpdateSelection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown> | Transition<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,\n duration: number\n ): void {\n const { config } = this\n smartTransition(this._panelsGroup, duration / 2)\n .style('opacity', config.panels?.length ? 1 : 0)\n\n if (!this._panels) return\n\n const selection = ((nodeUpdateSelection as Transition<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>).duration)\n ? (nodeUpdateSelection as Transition<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>).selection()\n : nodeUpdateSelection as Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>\n\n updatePanelNumNodes(selection, this._panels, config)\n updatePanelBBoxSize(selection, this._panels, config)\n const panelData = this._panels.filter(p => p._numNodes)\n const panelGroup = this._panelsGroup\n .selectAll<SVGGElement, GraphPanel>(`.${panelSelectors.gPanel}`)\n .data(panelData, p => p.label)\n\n const panelGroupExit = panelGroup.exit<GraphPanel<N, L>>()\n panelGroupExit.call(removePanels, config, duration)\n\n const panelGroupEnter = panelGroup.enter().append('g')\n .attr('class', panelSelectors.gPanel)\n .call(createPanels, selection)\n const panelGroupMerged = panelGroup.merge(panelGroupEnter)\n\n this._updatePanels(panelGroupMerged, duration)\n }\n\n private _updatePanels (panelToUpdate: Selection<SVGGElement, GraphPanel, SVGGElement, unknown>, duration: number): void {\n const { config } = this\n if (!this._panels) return\n\n panelToUpdate.call(updatePanels, config, duration)\n }\n\n private async _calculateLayout (): Promise<boolean> {\n const { prevConfig, config, datamodel } = this\n const firstRender = this._isFirstRender\n\n // If the layout type has changed, we need to reset the node positions if they were fixed before\n if (prevConfig.layoutType !== config.layoutType) {\n for (const node of datamodel.nodes) {\n delete node._state.fx\n delete node._state.fy\n }\n }\n\n switch (config.layoutType) {\n case GraphLayoutType.Precalculated:\n break\n case GraphLayoutType.Parallel:\n applyLayoutParallel(datamodel, config, this._width, this._height)\n break\n case GraphLayoutType.ParallelHorizontal:\n applyLayoutParallel(datamodel, config, this._width, this._height, 'horizontal')\n break\n case GraphLayoutType.Dagre:\n await applyLayoutDagre(datamodel, config, this._width)\n break\n case GraphLayoutType.Force:\n await applyLayoutForce(datamodel, config, this._width)\n break\n case GraphLayoutType.Concentric:\n applyLayoutConcentric(datamodel, config, this._width, this._height)\n break\n case GraphLayoutType.Elk:\n await applyELKLayout(datamodel, config, this._width)\n break\n case GraphLayoutType.Circular:\n default:\n applyLayoutCircular(datamodel, config, this._width, this._height)\n break\n }\n\n // We need to update the panels data right after the layout calculation\n // because we want to have the latest coordinates before calling `onLayoutCalculated`\n this._initPanelsData()\n this.config.onLayoutCalculated?.(datamodel.nodes, datamodel.links)\n\n this._shouldRecalculateLayout = false\n\n return firstRender\n }\n\n private _initPanelsData (): void {\n const { config, datamodel } = this\n\n if (this._shouldSetPanels) {\n this._panels = initPanels(config.panels)\n setPanelForNodes(this._panels, datamodel.nodes, this.config)\n this._shouldSetPanels = false\n }\n }\n\n private _fit (duration = 0): void {\n const { datamodel: { nodes } } = this\n const transform = this._getTransform(nodes)\n smartTransition(this.g, duration)\n .call(this._zoomBehavior.transform, transform)\n this._onZoom(transform)\n }\n\n private _getTransform (nodes: GraphNode<N, L>[]): ZoomTransform {\n const { nodeSize, zoomScaleExtent } = this.config\n const { left, top, right, bottom } = this.bleed\n\n const maxNodeSize = getMaxNodeSize(nodes, nodeSize)\n const w = this._width\n const h = this._height\n\n const xExtent = [\n min(nodes, d => getX(d) - maxNodeSize / 2 - (max((d._panels || []).map(p => p._padding.left)) || 0)),\n max(nodes, d => getX(d) + maxNodeSize / 2 + (max((d._panels || []).map(p => p._padding.right)) || 0)),\n ]\n const yExtent = [\n min(nodes, d => getY(d) - maxNodeSize / 2 - (max((d._panels || []).map(p => p._padding.top)) || 0)),\n max(nodes, d => getY(d) + maxNodeSize / 2 + (max((d._panels || []).map(p => p._padding.bottom)) || 0)),\n ]\n\n if (xExtent.some(item => item === undefined) || yExtent.some(item => item === undefined)) {\n console.warn('Unovis | Graph: Some of the node coordinates are undefined. This can happen if you try to fit the graph before the layout has been calculated.')\n return zoomIdentity\n }\n\n const xScale = w / (xExtent[1] - xExtent[0] + left + right)\n const yScale = h / (yExtent[1] - yExtent[0] + top + bottom)\n\n const clampedScale = clamp(min([xScale, yScale]), zoomScaleExtent[0], zoomScaleExtent[1])\n\n const xCenter = (xExtent[1] + xExtent[0]) / 2\n const yCenter = (yExtent[1] + yExtent[0]) / 2\n const translateX = this._width / 2 - xCenter * clampedScale\n const translateY = this._height / 2 - yCenter * clampedScale\n const transform = zoomIdentity\n .translate(translateX, translateY)\n .scale(clampedScale)\n\n return transform\n }\n\n private _selectNode (node: GraphNode<N, L>): void {\n const { datamodel: { nodes, links } } = this\n if (!node) console.warn('Unovis | Graph: Select Node: Not found')\n this._selectedNode = node\n\n // Apply grey out\n // Grey out all nodes\n nodes.forEach(n => {\n n._state.selected = false\n n._state.greyout = true\n })\n\n // Grey out all links\n links.forEach(l => {\n l._state.greyout = true\n l._state.selected = false\n })\n\n // Highlight selected\n if (node) {\n node._state.selected = true\n node._state.greyout = false\n\n const connectedLinks = links.filter(l => (l.source === node) || (l.target === node))\n connectedLinks.forEach(l => {\n const source = l.source as GraphNode<N, L>\n const target = l.target as GraphNode<N, L>\n source._state.greyout = false\n target._state.greyout = false\n l._state.greyout = false\n })\n }\n\n this._updateSelectedElements()\n }\n\n private _selectLink (link: GraphLink<N, L>): void {\n const { datamodel: { nodes, links } } = this\n if (!link) console.warn('Unovis: Graph: Select Link: Not found')\n this._selectedLink = link\n const selectedLinkSource = link?.source as GraphNode<N, L>\n const selectedLinkTarget = link?.target as GraphNode<N, L>\n\n // Apply grey out\n nodes.forEach(n => {\n n._state.selected = false\n n._state.greyout = true\n if (selectedLinkTarget?._id === n._id || selectedLinkSource?._id === n._id) {\n link._state.greyout = false\n }\n })\n\n links.forEach(l => {\n l._state.greyout = true\n const source = l.source as GraphNode<N, L>\n const target = l.target as GraphNode<N, L>\n if ((source._id === selectedLinkSource?._id) && (target._id === selectedLinkTarget?._id)) {\n source._state.greyout = false\n target._state.greyout = false\n l._state.greyout = false\n }\n })\n\n links.forEach(l => {\n delete l._state.selected\n })\n\n if (link) link._state.selected = true\n\n this._updateSelectedElements()\n }\n\n private _resetSelection (): void {\n const { datamodel: { nodes, links } } = this\n this._selectedNode = undefined\n this._selectedLink = undefined\n\n // Disable Grayout\n nodes.forEach(n => {\n delete n._state.selected\n delete n._state.greyout\n })\n links.forEach(l => {\n delete l._state.greyout\n delete l._state.selected\n })\n\n this._updateSelectedElements()\n }\n\n private _updateSelectedElements (): void {\n const { config } = this\n\n const linkElements = this._linksGroup.selectAll<SVGGElement, GraphLink<N, L>>(`.${linkSelectors.gLink}`)\n linkElements.call(updateSelectedLinks, config, this._scale)\n\n const nodeElements = this._nodesGroup.selectAll<SVGGElement, GraphNode<N, L>>(`.${nodeSelectors.gNode}`)\n nodeElements.call(updateNodeSelectedGreyout, config)\n\n // this._drawPanels(nodeElements, 0)\n }\n\n private _onBackgroundClick (): void {\n this._resetSelection()\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private _onNodeClick (d: GraphNode<N, L>): void {\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private _onNodeMouseOut (d: GraphNode<N, L>): void {\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private _onNodeMouseOver (d: GraphNode<N, L>): void {\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private _onLinkClick (d: GraphLink<N, L>): void {\n }\n\n private _onLinkMouseOver (d: GraphLink<N, L>): void {\n if (this._isDragging) return\n\n d._state.hovered = true\n this._updateSelectedElements()\n }\n\n private _onLinkMouseOut (d: GraphLink<N, L>): void {\n if (this._isDragging) return\n\n delete d._state.hovered\n this._updateSelectedElements()\n }\n\n private _onLinkFlowTimerFrame (elapsed = 0): void {\n const { config: { linkFlow, linkFlowAnimDuration }, datamodel: { links } } = this\n\n const hasLinksWithFlow = links.some((d, i) => getBoolean(d, linkFlow, i))\n if (!hasLinksWithFlow) return\n\n const t = (elapsed % linkFlowAnimDuration) / linkFlowAnimDuration\n const linkElements = this._linksGroup.selectAll<SVGGElement, GraphLink<N, L>>(`.${linkSelectors.gLink}`)\n\n const linksToAnimate = linkElements.filter(d => !d._state.greyout)\n linksToAnimate.each(d => { d._state.flowAnimTime = t })\n animateLinkFlow(linksToAnimate, this.config, this._scale)\n }\n\n private _onZoom (t: ZoomTransform, event?: D3ZoomEvent<SVGGElement, unknown>): void {\n const { config, datamodel: { nodes } } = this\n const transform = t || event.transform\n this._scale = transform.k\n this._graphGroup.attr('transform', transform.toString())\n if (isFunction(config.onZoom)) config.onZoom(this._scale, config.zoomScaleExtent, event)\n\n // console.warn('Unovis | Graph: Zoom: ', transform)\n if (!this._initialTransform) this._initialTransform = transform\n\n // If the event was triggered by a mouse interaction (pan or zoom) we don't\n // refit the layout after recalculation (e.g. on container resize)\n if (event?.sourceEvent) {\n const diff = Object.keys(transform).reduce((acc, prop) => {\n const propVal = transform[prop as keyof ZoomTransform] as number\n const initialPropVal = this._initialTransform[prop as keyof ZoomTransform] as number\n const dVal = Math.abs(propVal - initialPropVal)\n const scaledDVal = prop === 'k' ? 20 * dVal : dVal / 15\n acc += scaledDVal\n return acc\n }, 0)\n\n if (diff > config.layoutAutofitTolerance) this._isAutoFitDisabled = true\n else this._isAutoFitDisabled = false\n }\n\n this._nodesGroup.selectAll<SVGGElement, GraphNode<N, L>>(`.${nodeSelectors.gNode}`)\n .call(\n (nodes.length > config.zoomThrottledUpdateNodeThreshold ? zoomNodesThrottled : zoomNodes) as typeof zoomNodes,\n config,\n this._scale\n )\n\n this._linksGroup.selectAll<SVGGElement, GraphLink<N, L>>(`.${linkSelectors.gLink}`)\n .call(\n (nodes.length > config.zoomThrottledUpdateNodeThreshold ? zoomLinksThrottled : zoomLinks) as typeof zoomLinks,\n config,\n this._scale,\n this._getLinkArrowDefId\n )\n }\n\n private _onDragStarted (\n d: GraphNode<N, L>,\n event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>,\n nodeSelection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>\n ): void {\n const { config } = this\n this._isDragging = true\n d._state.isDragged = true\n nodeSelection.call(updateNodes, config, 0, this._scale)\n config.onNodeDragStart?.(d, event)\n }\n\n private _onDragged (\n d: GraphNode<N, L>,\n event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>,\n allNodesSelection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>\n ): void {\n const { config } = this\n const transform = zoomTransform(this.g.node())\n const scale = transform.k\n\n // Prevent the node from being dragged offscreen or outside its panel\n const panels = this._panels?.filter(p => p.nodes.includes(d._id)) ?? []\n const nodeSizeValue = getNodeSize(d, config.nodeSize, d._index)\n const maxY = min([(this._height - transform.y) / scale, ...panels.map(p => p._y + p._height)]) - nodeSizeValue / 2\n const maxX = min([(this._width - transform.x) / scale, ...panels.map(p => p._x + p._width)]) - nodeSizeValue / 2\n const minY = max([-transform.y / scale, ...panels.map(p => p._y)]) + nodeSizeValue / 2\n const minX = max([-transform.x / scale, ...panels.map(p => p._x)]) + nodeSizeValue / 2\n\n let [x, y] = pointer(event, this._graphGroup.node())\n if (y < minY) y = minY\n else if (y > maxY) y = maxY\n if (x < minX) x = minX\n else if (x > maxX) x = maxX\n\n // Snap to Layout\n if (Math.sqrt(Math.pow(x - d.x, 2) + Math.pow(y - d.y, 2)) < 15) {\n x = d.x\n y = d.y\n }\n\n // Assign coordinates\n d._state.fx = x\n d._state.fy = y\n if (d._state.fx === d.x) delete d._state.fx\n if (d._state.fy === d.y) delete d._state.fy\n\n // Update affected DOM elements\n const nodeSelection = this._nodesGroup.selectAll<SVGGElement, GraphNode<N, L>>(`.${nodeSelectors.gNode}`)\n const nodeToUpdate = nodeSelection.filter((n: GraphNode<N, L>) => n._id === d._id)\n nodeToUpdate.call(updateNodes, config, 0, scale)\n\n const linkSelection = this._linksGroup.selectAll<SVGGElement, GraphLink<N, L>>(`.${linkSelectors.gLink}`)\n const linksToUpdate = linkSelection.filter((l: L) => {\n const source = l.source as GraphNode<N, L>\n const target = l.target as GraphNode<N, L>\n return source._id === d._id || target._id === d._id\n })\n linksToUpdate.call(updateLinks, config, 0, scale, this._getLinkArrowDefId)\n const linksToAnimate = linksToUpdate.filter(d => d._state.greyout)\n if (linksToAnimate.size()) animateLinkFlow(linksToAnimate, config, this._scale)\n\n config.onNodeDrag?.(d, event)\n }\n\n private _onDragEnded (\n d: GraphNode<N, L>,\n event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>,\n nodeSelection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>\n ): void {\n const { config } = this\n this._isDragging = false\n d._state.isDragged = false\n nodeSelection.call(updateNodes, config, 0, this._scale)\n config.onNodeDragEnd?.(d, event)\n }\n\n private _shouldLayoutRecalculate (): boolean {\n const { prevConfig, config } = this\n if (prevConfig.layoutType !== config.layoutType) return true\n if (prevConfig.layoutNonConnectedAside !== config.layoutNonConnectedAside) return true\n\n if (prevConfig.layoutType === GraphLayoutType.Force) {\n const forceSettingsDiff = shallowDiff(prevConfig.forceLayoutSettings, config.forceLayoutSettings)\n if (Object.keys(forceSettingsDiff).length) return true\n }\n\n if (prevConfig.layoutType === GraphLayoutType.Dagre) {\n const dagreSettingsDiff = shallowDiff(prevConfig.dagreLayoutSettings, config.dagreLayoutSettings)\n if (Object.keys(dagreSettingsDiff).length) return true\n }\n\n if (prevConfig.layoutType === GraphLayoutType.Elk) {\n if (isPlainObject(prevConfig.layoutElkSettings) && isPlainObject(config.layoutElkSettings)) {\n // Do a deeper comparison if `config.layoutElkSettings` is an object\n const elkSettingsDiff = shallowDiff(\n prevConfig.layoutElkSettings as Record<string, string>,\n config.layoutElkSettings as Record<string, string>\n )\n return Boolean(Object.keys(elkSettingsDiff).length)\n } else {\n // Otherwise, do a simple `===` comparison\n return prevConfig.layoutElkSettings !== config.layoutElkSettings\n }\n }\n\n if (\n prevConfig.layoutType === GraphLayoutType.Parallel ||\n prevConfig.layoutType === GraphLayoutType.ParallelHorizontal ||\n prevConfig.layoutType === GraphLayoutType.Concentric\n ) {\n if (prevConfig.layoutGroupOrder !== config.layoutGroupOrder) return true\n if (prevConfig.layoutParallelNodesPerColumn !== config.layoutParallelNodesPerColumn) return true\n if (prevConfig.layoutParallelSortConnectionsByGroup !== config.layoutParallelSortConnectionsByGroup) return true\n }\n\n return false\n }\n\n private _getLinkArrowDefId (arrow: GraphLinkArrowStyle | undefined): string | null {\n return arrow ? `${this.uid}-${arrow}` : null\n }\n\n private _addSVGDefs (): void {\n // Clean up old defs\n this._defs.selectAll('*').remove()\n\n // Single Arrow\n this._defs.append('path').attr('d', getArrowPath())\n .attr('id', this._getLinkArrowDefId(GraphLinkArrowStyle.Single))\n\n // Double Arrow\n this._defs.append('path').attr('d', getDoubleArrowPath())\n .attr('id', this._getLinkArrowDefId(GraphLinkArrowStyle.Double))\n }\n\n public zoomIn (increment = 0.3): void {\n const scaleBy = 1 + increment\n smartTransition(this.g, this.config.duration / 2)\n .call(this._zoomBehavior.scaleBy, scaleBy)\n }\n\n public zoomOut (increment = 0.3): void {\n const scaleBy = 1 - increment\n smartTransition(this.g, this.config.duration / 2)\n .call(this._zoomBehavior.scaleBy, scaleBy)\n }\n\n public setZoom (zoomLevel: number): void {\n smartTransition(this.g, this.config.duration / 2)\n .call(this._zoomBehavior.scaleTo, zoomLevel)\n }\n\n public getZoom (): number {\n return zoomTransform(this.g.node()).k\n }\n\n public fitView (duration = this.config.duration): void {\n this._layoutCalculationPromise.then(() => {\n this._fit(duration)\n })\n }\n\n /** Enable automatic fitting to container if it was disabled due to previous zoom / pan interactions */\n public resetAutofitState (): void {\n this._isAutoFitDisabled = false\n }\n\n /** Get current coordinates of the nodes as an array of { id: string; x: number; y: number } objects */\n public getNodesCoordinates (): { id: string; x: number; y: number }[] {\n const { datamodel: { nodes } } = this\n return nodes.map(n => ({\n id: n._id,\n x: n.x,\n y: n.y,\n }))\n }\n\n /** Get node coordinates by id as { id: string; x: number; y: number } */\n public getNodeCoordinatesById (id: string): { id: string; x: number; y: number } | undefined {\n const { datamodel: { nodes } } = this\n const node = nodes.find(n => n._id === id)\n\n if (!node) {\n console.warn(`Unovis | Graph: Node ${id} not found`)\n return undefined\n } else {\n return {\n id: node._id,\n x: node.x,\n y: node.y,\n }\n }\n }\n}\n"],"names":["generalSelectors.background","generalSelectors.graphGroup","panelSelectors.panels","linkSelectors.links","nodeSelectors.nodes","nodeSelectors.gNode","nodeSelectors.gNodeExit","linkSelectors.gLink","linkSelectors.gLinkExit","panelSelectors.gPanel","generalSelectors.root","nodeSelectors.node","nodeSelectors.nodeGauge","nodeSelectors.sideLabelGroup","nodeSelectors.label","nodeSelectors.greyedOutNode","linkSelectors.link","linkSelectors.greyedOutLink","panelSelectors.panel","panelSelectors.panelSelection","panelSelectors.label","panelSelectors.labelText","panelSelectors.sideIconGroup","panelSelectors.sideIconShape","panelSelectors.sideIconSymbol","nodeSelectors"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwCM,MAAO,KAGX,SAAQ,aAGP,CAAA;AAgFD,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;QAvDC,IAAc,CAAA,cAAA,GAAG,kBAA2D,CAAA;AAC/E,QAAA,IAAA,CAAA,MAAM,GAA+B,IAAI,CAAC,cAAc,CAAA;AAC/D,QAAA,IAAA,CAAA,SAAS,GAA2D,IAAI,cAAc,EAAE,CAAA;QAUhF,IAAc,CAAA,cAAA,GAAG,IAAI,CAAA;QAGrB,IAAwB,CAAA,wBAAA,GAAG,KAAK,CAAA;QAIhC,IAAgB,CAAA,gBAAA,GAAG,KAAK,CAAA;QAMxB,IAAkB,CAAA,kBAAA,GAAG,KAAK,CAAA;QAG1B,IAAW,CAAA,WAAA,GAAG,KAAK,CAAA;AAE3B,QAAA,IAAA,CAAA,MAAM,GAAG;AACP,YAAA,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,GAAG;gBAC5B,KAAK,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC;AAC1C,aAAA;AACD,YAAA,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG;gBACtB,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;gBACnC,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC3C,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;AAC1C,aAAA;AACD,YAAA,CAAC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BACT,CAAC,EAAE,IAAI,CAAC,CAAC;aACV,CAAA;AACF,SAAA;KACF;;AA7xBM,KAAA,CAAA,SAAS,GAAG;IACjB,IAAI,EAAEG,IAAqB;IAC3B,UAAU,EAAET,UAA2B;IACvC,UAAU,EAAED,UAA2B;IACvC,IAAI,EAAEK,KAAmB;IACzB,SAAS,EAAEM,IAAkB;IAC7B,SAAS,EAAEC,SAAuB;IAClC,aAAa,EAAEC,cAA4B;IAC3C,SAAS,EAAEC,KAAmB;IAC9B,UAAU,EAAEC,aAA2B;IACvC,IAAI,EAAER,KAAmB;IACzB,QAAQ,EAAES,IAAkB;IAC5B,UAAU,EAAEC,aAA2B;IACvC,KAAK,EAAER,MAAqB;IAC5B,SAAS,EAAES,KAAoB;IAC/B,cAAc,EAAEC,cAA6B;IAC7C,UAAU,EAAEC,OAAoB;IAChC,cAAc,EAAEC,SAAwB;IACxC,aAAa,EAAEC,aAA4B;IAC3C,kBAAkB,EAAEC,aAA4B;IAChD,mBAAmB,EAAEC,cAA6B;CACnD,CAAA;AAEM,KAAa,CAAA,aAAA,GAAGC,KAAa;;;;"}
|
|
@@ -6,9 +6,9 @@ import { GraphConfigInterface } from '../../config';
|
|
|
6
6
|
export interface GraphNodeSVGGElement extends SVGGElement {
|
|
7
7
|
nodeShape?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare function createNodes<N extends GraphInputNode, L extends GraphInputLink>(selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>, config: GraphConfigInterface<N, L
|
|
10
|
-
export declare function
|
|
9
|
+
export declare function createNodes<N extends GraphInputNode, L extends GraphInputLink>(selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>, config: GraphConfigInterface<N, L>, duration: number, scale?: number): void;
|
|
10
|
+
export declare function updateNodeSelectedGreyout<N extends GraphInputNode, L extends GraphInputLink>(selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>, config: GraphConfigInterface<N, L>): void;
|
|
11
11
|
export declare function updateNodes<N extends GraphInputNode, L extends GraphInputLink>(selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>, config: GraphConfigInterface<N, L>, duration: number, scale?: number): Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown> | Transition<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>;
|
|
12
|
-
export declare function removeNodes<N extends GraphInputNode, L extends GraphInputLink>(selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>, config: GraphConfigInterface<N, L>, duration: number): void;
|
|
12
|
+
export declare function removeNodes<N extends GraphInputNode, L extends GraphInputLink>(selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>, config: GraphConfigInterface<N, L>, duration: number, scale?: number): void;
|
|
13
13
|
export declare function zoomNodes<N extends GraphInputNode, L extends GraphInputLink>(selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>, config: GraphConfigInterface<N, L>, scale: number): void;
|
|
14
14
|
export declare const zoomNodesThrottled: import("throttle-debounce").throttle<typeof zoomNodes>;
|
|
@@ -11,10 +11,10 @@ import { getX, getY, getSideLabelTextColor, getNodeSize, getNodeColor, polyTween
|
|
|
11
11
|
import { appendShape, updateShape } from '../shape.js';
|
|
12
12
|
import { ZoomLevel } from '../zoom-levels.js';
|
|
13
13
|
import { zoomOutLevel2, zoomOutLevel1 } from '../../style.js';
|
|
14
|
-
import { node, customNode, nodeSelection, nodeGauge, nodeIcon, label, labelBackground, labelText, labelTextContent, subLabelTextContent,
|
|
14
|
+
import { node, customNode, nodeSelection, nodeGauge, nodeIcon, sideLabelsGroup, nodeBottomIcon, label, labelBackground, labelText, labelTextContent, subLabelTextContent, greyedOutNode, draggable, nodeSelectionActive, sideLabel, sideLabelBackground, nodeIsDragged, nodePolygon, sideLabelGroup } from './style.js';
|
|
15
15
|
|
|
16
16
|
const SIDE_LABEL_DEFAULT_RADIUS = 10;
|
|
17
|
-
function createNodes(selection, config) {
|
|
17
|
+
function createNodes(selection, config, duration, scale = 1) {
|
|
18
18
|
const { nodeShape } = config;
|
|
19
19
|
selection.each((d, i, elements) => {
|
|
20
20
|
const element = elements[i];
|
|
@@ -29,13 +29,24 @@ function createNodes(selection, config) {
|
|
|
29
29
|
return `translate(${x}, ${y}) scale(${scale})`;
|
|
30
30
|
})
|
|
31
31
|
.attr('opacity', 0);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
// If there's a custom render function, use it
|
|
33
|
+
if (config.nodeEnterCustomRenderFunction) {
|
|
34
|
+
config.nodeEnterCustomRenderFunction(d, element, config, duration, scale);
|
|
35
|
+
}
|
|
36
|
+
else { // Default node rendering
|
|
37
|
+
const shape = getString(d, nodeShape, d._index);
|
|
38
|
+
/** Todo: The 'nodeShape' storing logic below it a temporary fix, needs a cleaner implementation */
|
|
39
|
+
element.nodeShape = shape;
|
|
40
|
+
appendShape(group, shape, node, customNode, d._index);
|
|
41
|
+
appendShape(group, shape, nodeSelection, customNode, d._index);
|
|
42
|
+
group.append('path').attr('class', nodeGauge);
|
|
43
|
+
group.append('g').attr('class', nodeIcon);
|
|
44
|
+
group.append('g')
|
|
45
|
+
.attr('class', sideLabelsGroup);
|
|
46
|
+
group.append('text')
|
|
47
|
+
.attr('class', nodeBottomIcon);
|
|
48
|
+
}
|
|
49
|
+
// Label
|
|
39
50
|
const label$1 = group.append('g').attr('class', label);
|
|
40
51
|
label$1.append('rect').attr('class', labelBackground);
|
|
41
52
|
const labelText$1 = label$1.append('text')
|
|
@@ -46,13 +57,9 @@ function createNodes(selection, config) {
|
|
|
46
57
|
.attr('class', subLabelTextContent)
|
|
47
58
|
.attr('dy', '1.1em')
|
|
48
59
|
.attr('x', '0');
|
|
49
|
-
group.append('g')
|
|
50
|
-
.attr('class', sideLabelsGroup);
|
|
51
|
-
group.append('text')
|
|
52
|
-
.attr('class', nodeBottomIcon);
|
|
53
60
|
});
|
|
54
61
|
}
|
|
55
|
-
function
|
|
62
|
+
function updateNodeSelectedGreyout(selection, config) {
|
|
56
63
|
const { nodeDisabled } = config;
|
|
57
64
|
selection.each((d, i, elements) => {
|
|
58
65
|
const group = select(elements[i]);
|
|
@@ -69,7 +76,18 @@ function updateSelectedNodes(selection, config) {
|
|
|
69
76
|
}
|
|
70
77
|
function updateNodes(selection, config, duration, scale = 1) {
|
|
71
78
|
const { nodeGaugeAnimDuration, nodeStrokeWidth, nodeShape, nodeSize, nodeGaugeValue, nodeGaugeFill, nodeIcon: nodeIcon$1, nodeIconSize, nodeLabel, nodeLabelTrim, nodeLabelTrimMode, nodeLabelTrimLength, nodeSubLabel, nodeSubLabelTrim, nodeSubLabelTrimMode, nodeSubLabelTrimLength, nodeSideLabels, nodeStroke, nodeFill, nodeBottomIcon: nodeBottomIcon$1, } = config;
|
|
72
|
-
|
|
79
|
+
const nodeGroupsUpdate = smartTransition(selection, duration)
|
|
80
|
+
.attr('transform', d => `translate(${getX(d)}, ${getY(d)}) scale(1)`)
|
|
81
|
+
.attr('opacity', 1);
|
|
82
|
+
// If there's a custom render function, use it
|
|
83
|
+
if (config.nodeUpdateCustomRenderFunction) {
|
|
84
|
+
selection.each((d, i, elements) => {
|
|
85
|
+
config.nodeUpdateCustomRenderFunction(d, elements[i], config, duration, scale);
|
|
86
|
+
});
|
|
87
|
+
return nodeGroupsUpdate;
|
|
88
|
+
}
|
|
89
|
+
// Default node rendering
|
|
90
|
+
// Re-create nodes to update shapes if they were changed
|
|
73
91
|
selection.each((d, i, elements) => {
|
|
74
92
|
const element = elements[i];
|
|
75
93
|
const group = select(element);
|
|
@@ -224,12 +242,10 @@ function updateNodes(selection, config, duration, scale = 1) {
|
|
|
224
242
|
bottomIcon.html(getString(d, nodeBottomIcon$1, d._index))
|
|
225
243
|
.attr('transform', `translate(0, ${nodeHeight / 2})`);
|
|
226
244
|
});
|
|
227
|
-
|
|
228
|
-
return
|
|
229
|
-
.attr('transform', d => `translate(${getX(d)}, ${getY(d)}) scale(1)`)
|
|
230
|
-
.attr('opacity', 1);
|
|
245
|
+
updateNodeSelectedGreyout(selection, config);
|
|
246
|
+
return nodeGroupsUpdate;
|
|
231
247
|
}
|
|
232
|
-
function removeNodes(selection, config, duration) {
|
|
248
|
+
function removeNodes(selection, config, duration, scale = 1) {
|
|
233
249
|
smartTransition(selection, duration / 2)
|
|
234
250
|
.attr('opacity', 0)
|
|
235
251
|
.attr('transform', (d, i) => {
|
|
@@ -241,6 +257,12 @@ function removeNodes(selection, config, duration) {
|
|
|
241
257
|
return `translate(${x}, ${y}) scale(${scale})`;
|
|
242
258
|
})
|
|
243
259
|
.remove();
|
|
260
|
+
// If there's a custom render function, use it
|
|
261
|
+
if (config.nodeExitCustomRenderFunction) {
|
|
262
|
+
selection.each((d, i, elements) => {
|
|
263
|
+
config.nodeExitCustomRenderFunction(d, elements[i], config, duration, scale);
|
|
264
|
+
});
|
|
265
|
+
}
|
|
244
266
|
}
|
|
245
267
|
function setLabelBackgroundRect(selection, config) {
|
|
246
268
|
const { nodeLabel } = config;
|
|
@@ -258,10 +280,10 @@ function zoomNodes(selection, config, scale) {
|
|
|
258
280
|
.attr('transform', `scale(${1 / Math.pow(scale, 0.35)})`);
|
|
259
281
|
selection.selectAll(`.${sideLabel}`)
|
|
260
282
|
.attr('transform', `scale(${1 / Math.pow(scale, 0.45)})`);
|
|
261
|
-
if (scale >= ZoomLevel.Level3)
|
|
283
|
+
if (scale >= ZoomLevel.Level3 && !config.nodeEnterCustomRenderFunction)
|
|
262
284
|
selection.call(setLabelBackgroundRectThrottled, config);
|
|
263
285
|
}
|
|
264
286
|
const zoomNodesThrottled = throttle(zoomNodes, 500);
|
|
265
287
|
|
|
266
|
-
export { createNodes, removeNodes,
|
|
288
|
+
export { createNodes, removeNodes, updateNodeSelectedGreyout, updateNodes, zoomNodes, zoomNodesThrottled };
|
|
267
289
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/graph/modules/node/index.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\nimport { Transition } from 'd3-transition'\nimport { arc } from 'd3-shape'\n\n// Types\nimport { GraphInputLink, GraphInputNode } from 'types/graph'\nimport { TrimMode } from 'types/text'\n\n// Utils\nimport { trimString } from 'utils/text'\nimport { polygon } from 'utils/path'\nimport { smartTransition } from 'utils/d3'\nimport { getBoolean, getNumber, getString, getValue, throttle } from 'utils/data'\nimport { getColor } from 'utils/color'\nimport { isStringSvg } from 'utils/svg'\n\n// Local Types\nimport { GraphNode, GraphCircleLabel, GraphNodeAnimationState, GraphNodeAnimatedElement, GraphNodeShape } from '../../types'\n\n// Config\nimport { GraphConfigInterface } from '../../config'\n\n// Helpers\nimport {\n arcTween,\n polyTween,\n setLabelRect,\n getX,\n getY,\n getSideLabelTextColor,\n getNodeColor,\n getNodeIconColor,\n getNodeSize,\n LABEL_RECT_VERTICAL_PADDING,\n isInternalHref,\n} from './helper'\nimport { appendShape, updateShape } from '../shape'\nimport { ZoomLevel } from '../zoom-levels'\n\n// Styles\nimport * as generalSelectors from '../../style'\nimport * as nodeSelectors from './style'\n\nconst SIDE_LABEL_DEFAULT_RADIUS = 10\n\nexport interface GraphNodeSVGGElement extends SVGGElement {\n nodeShape?: string;\n}\n\nexport function createNodes<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>\n): void {\n const { nodeShape } = config\n\n selection.each((d, i, elements) => {\n const element = elements[i] as GraphNodeSVGGElement\n const group = select<SVGGElement, GraphNode<N, L>>(element)\n group\n .attr('transform', (d: GraphNode<N, L>, i) => {\n const configuredPosition = getValue<GraphNode<N, L>, [number, number] | undefined>(d, config.nodeEnterPosition, i)\n const scale = getNumber(d, config.nodeEnterScale, i) ?? 0\n const x = configuredPosition?.[0] ?? getX(d)\n const y = configuredPosition?.[1] ?? getY(d)\n return `translate(${x}, ${y}) scale(${scale})`\n })\n .attr('opacity', 0)\n\n const shape = getString(d, nodeShape, d._index)\n /** Todo: The 'nodeShape' storing logic below it a temporary fix, needs a cleaner implementation */\n element.nodeShape = shape\n appendShape(group, shape, nodeSelectors.node, nodeSelectors.customNode, d._index)\n appendShape(group, shape, nodeSelectors.nodeSelection, nodeSelectors.customNode, d._index)\n group.append('path').attr('class', nodeSelectors.nodeGauge)\n group.append('g').attr('class', nodeSelectors.nodeIcon)\n\n const label = group.append('g').attr('class', nodeSelectors.label)\n label.append('rect').attr('class', nodeSelectors.labelBackground)\n\n const labelText = label.append('text')\n .attr('class', nodeSelectors.labelText)\n .attr('dy', '0.32em')\n labelText.append('tspan').attr('class', nodeSelectors.labelTextContent)\n labelText.append('tspan')\n .attr('class', nodeSelectors.subLabelTextContent)\n .attr('dy', '1.1em')\n .attr('x', '0')\n\n group.append('g')\n .attr('class', nodeSelectors.sideLabelsGroup)\n\n group.append('text')\n .attr('class', nodeSelectors.nodeBottomIcon)\n })\n}\n\nexport function updateSelectedNodes<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>\n): void {\n const { nodeDisabled } = config\n\n selection.each((d, i, elements) => {\n const group: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown> = select(elements[i])\n const isGreyout = getBoolean(d, nodeDisabled, d._index) || d._state.greyout\n\n group.classed(nodeSelectors.greyedOutNode, isGreyout)\n .classed(nodeSelectors.draggable, !config.disableDrag)\n\n const nodeSelectionOutline = group.selectAll<SVGGElement, GraphNode<N, L>>(`.${nodeSelectors.nodeSelection}`)\n nodeSelectionOutline.classed(nodeSelectors.nodeSelectionActive, d._state.selected)\n\n group.selectAll<SVGTextElement, GraphCircleLabel>(`.${nodeSelectors.sideLabel}`)\n .style('fill', (l) => isGreyout ? null : getSideLabelTextColor(l, selection.node()))\n\n group.selectAll<SVGRectElement, GraphCircleLabel>(`.${nodeSelectors.sideLabelBackground}`)\n .style('fill', (l) => isGreyout ? null : l.color)\n })\n}\n\nexport function updateNodes<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n duration: number,\n scale = 1\n): Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown> | Transition<SVGGElement, GraphNode<N, L>, SVGGElement, unknown> {\n const {\n nodeGaugeAnimDuration, nodeStrokeWidth, nodeShape, nodeSize, nodeGaugeValue, nodeGaugeFill,\n nodeIcon, nodeIconSize, nodeLabel, nodeLabelTrim, nodeLabelTrimMode, nodeLabelTrimLength,\n nodeSubLabel, nodeSubLabelTrim, nodeSubLabelTrimMode, nodeSubLabelTrimLength,\n nodeSideLabels, nodeStroke, nodeFill, nodeBottomIcon,\n } = config\n\n // Re-create nodes to update shapes if they were changes\n selection.each((d, i, elements) => {\n const element = elements[i] as GraphNodeSVGGElement\n const group = select<SVGGElement, GraphNode<N, L>>(element)\n const shape = getString(d, nodeShape, d._index)\n\n if (element.nodeShape !== shape) {\n group.select(`.${nodeSelectors.node}`).remove()\n appendShape(group, nodeShape, nodeSelectors.node, nodeSelectors.customNode, d._index, `.${nodeSelectors.nodeSelection}`)\n group.select(`.${nodeSelectors.nodeSelection}`).remove()\n appendShape(group, shape, nodeSelectors.nodeSelection, null, d._index, `.${nodeSelectors.nodeGauge}`)\n element.nodeShape = shape\n }\n })\n\n // Update nodes themselves\n selection.each((d, i, elements) => {\n const groupElement = elements[i]\n const group: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown> = select(groupElement)\n const node: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown> = group.select(`.${nodeSelectors.node}`)\n const nodeArc = group.select<GraphNodeAnimatedElement<SVGElement>>(`.${nodeSelectors.nodeGauge}`)\n const icon = group.select<SVGTextElement>(`.${nodeSelectors.nodeIcon}`)\n const sideLabelsGroup = group.select<SVGGElement>(`.${nodeSelectors.sideLabelsGroup}`)\n const label = group.select<SVGGElement>(`.${nodeSelectors.label}`)\n const labelTextContent = label.select<SVGTextElement>(`.${nodeSelectors.labelTextContent}`)\n const sublabelTextContent = label.select<SVGTextElement>(`.${nodeSelectors.subLabelTextContent}`)\n const bottomIcon = group.select<SVGTextElement>(`.${nodeSelectors.nodeBottomIcon}`)\n const nodeSelectionOutline = group.select<SVGGElement>(`.${nodeSelectors.nodeSelection}`)\n const nodeSizeValue = getNodeSize(d, nodeSize, d._index)\n const arcGenerator = arc<GraphNodeAnimationState>()\n .innerRadius(state => state.nodeSize / 2 - state.borderWidth / 2)\n .outerRadius(state => state.nodeSize / 2 + state.borderWidth / 2)\n .startAngle(0 * (Math.PI / 180))\n // eslint-disable-next-line dot-notation\n .endAngle(a => a['endAngle'])\n\n group\n .classed(generalSelectors.zoomOutLevel2, scale < ZoomLevel.Level2)\n .classed(nodeSelectors.nodeIsDragged, (d: GraphNode<N, L>) => d._state.isDragged)\n\n // Update Group\n group\n .classed(nodeSelectors.nodePolygon, () => {\n const shape = getString(d, nodeShape, d._index)\n return shape === GraphNodeShape.Triangle || shape === GraphNodeShape.Hexagon || shape === GraphNodeShape.Square\n })\n\n // Update Node\n node\n .call(updateShape, nodeShape, nodeSize, d._index)\n .attr('stroke-width', getNumber(d, nodeStrokeWidth, d._index) ?? 0)\n .style('fill', getNodeColor(d, nodeFill, d._index))\n .style('stroke', getColor(d, nodeStroke, d._index, true) ?? null)\n\n const nodeBBox = (node.node() as SVGGraphicsElement).getBBox()\n\n nodeArc\n .attr('stroke-width', getNumber(d, nodeStrokeWidth, d._index))\n .style('display', !getNumber(d, nodeGaugeValue, d._index) ? 'none' : null)\n .style('fill', getNodeColor(d, nodeGaugeFill, d._index))\n .style('stroke', getNodeColor(d, nodeGaugeFill, d._index))\n .style('stroke-opacity', d => getString(d, nodeShape, d._index) === GraphNodeShape.Circle ? 0 : null)\n\n nodeArc\n .transition()\n .duration(nodeGaugeAnimDuration)\n .attrTween('d', (\n d,\n j,\n arr\n ) => {\n switch (getString(d, nodeShape, d._index)) {\n case GraphNodeShape.Circle: return arcTween(d, config, arcGenerator, arr[j])\n case GraphNodeShape.Hexagon: return polyTween(d, config, polygon, arr[j])\n case GraphNodeShape.Square: return polyTween(d, config, polygon, arr[j])\n case GraphNodeShape.Triangle: return polyTween(d, config, polygon, arr[j])\n default: return null\n }\n })\n\n // Set Node Selection\n updateShape(nodeSelectionOutline, nodeShape, nodeSize, d._index)\n\n // Update Node Icon\n const nodeIconContent = getString(d, nodeIcon, d._index)\n const nodeIconSizeValue = getNumber(d, nodeIconSize, d._index) ?? 2.5 * Math.sqrt(nodeSizeValue)\n const nodeIconColor = getNodeIconColor(d, nodeFill, d._index, selection.node())\n icon.selectAll('*').remove() // Removing all children first\n if (isInternalHref(nodeIconContent)) { // If the icon is a href, we need to append a <use> element and render the icon with it\n icon.append('use')\n .attr('href', nodeIconContent)\n .attr('x', -nodeIconSizeValue / 2)\n .attr('y', -nodeIconSizeValue / 2)\n .attr('width', nodeIconSizeValue)\n .attr('height', nodeIconSizeValue)\n .style('fill', nodeIconColor)\n } else { // If the icon is a text, we need to append a <text> element and render the icon as text\n icon\n .append('text')\n .style('font-size', `${nodeIconSizeValue}px`)\n .attr('dy', '0.1em')\n .style('fill', nodeIconColor)\n .html(nodeIconContent)\n }\n\n // Side Labels\n const sideLabelsData = getValue<GraphNode<N, L>, GraphCircleLabel[]>(d, nodeSideLabels, d._index) || []\n const sideLabels = sideLabelsGroup.selectAll<SVGGElement, GraphCircleLabel>('g').data(sideLabelsData)\n const sideLabelsEnter = sideLabels.enter().append('g')\n .attr('class', nodeSelectors.sideLabelGroup)\n sideLabelsEnter.append('circle')\n .attr('class', nodeSelectors.sideLabelBackground)\n .attr('r', l => l.radius ?? SIDE_LABEL_DEFAULT_RADIUS)\n sideLabelsEnter.append('text')\n .attr('class', nodeSelectors.sideLabel)\n\n const sideLabelsUpdate = sideLabels.merge(sideLabelsEnter)\n .style('cursor', l => l.cursor ?? null)\n\n // Side label text\n sideLabelsUpdate.select(`.${nodeSelectors.sideLabel}`).html(d => d.text)\n .attr('dy', '0.1em')\n .style('fill', l => l.textColor ?? getSideLabelTextColor(l, selection.node()))\n .style('font-size', l => l.fontSize ?? `${(2 + (l.radius ?? SIDE_LABEL_DEFAULT_RADIUS)) / Math.pow(l.text.toString().length, 0.3)}px`)\n // Side label circle background\n sideLabelsUpdate.select(`.${nodeSelectors.sideLabelBackground}`)\n .style('fill', l => l.color)\n\n sideLabelsUpdate.attr('transform', (l, j) => {\n if (sideLabelsData.length === 1) return `translate(${nodeSizeValue / 2.5}, ${-nodeSizeValue / 2.5})`\n const r = 1.05 * nodeSizeValue / 2\n const angle = j * 1.15 * 2 * Math.atan2(l.radius ?? SIDE_LABEL_DEFAULT_RADIUS, r) - Math.PI / 3\n return `translate(${r * Math.cos(angle)}, ${r * Math.sin(angle)})`\n })\n\n sideLabels.exit().remove()\n\n // Set label and sub-label text\n const labelText = getString(d, nodeLabel, d._index)\n const sublabelText = getString(d, nodeSubLabel, d._index)\n const labelTextTrimmed = getBoolean(d, nodeLabelTrim, d._index)\n ? trimString(labelText, getNumber(d, nodeLabelTrimLength, d._index), getValue(d, nodeLabelTrimMode as TrimMode, d._index))\n : labelText\n const sublabelTextTrimmed = getBoolean(d, nodeSubLabelTrim, d._index)\n ? trimString(sublabelText, getNumber(d, nodeSubLabelTrimLength, d._index), getValue(d, nodeSubLabelTrimMode as TrimMode, d._index))\n : sublabelText\n\n labelTextContent.text(labelTextTrimmed)\n sublabelTextContent.text(sublabelTextTrimmed)\n group\n .on('mouseenter', () => {\n labelTextContent.text(labelText)\n sublabelTextContent.text(sublabelText)\n setLabelRect(label, labelText, nodeSelectors.labelText)\n group.raise()\n })\n .on('mouseleave', () => {\n labelTextContent.text(labelTextTrimmed)\n sublabelTextContent.text(sublabelTextTrimmed)\n setLabelRect(label, labelTextTrimmed, nodeSelectors.labelText)\n })\n\n // Position label\n const labelFontSize = parseFloat(window.getComputedStyle(groupElement).getPropertyValue('--vis-graph-node-label-font-size')) || 12\n const labelMargin = LABEL_RECT_VERTICAL_PADDING + 1.25 * labelFontSize ** 1.03\n const nodeHeight = isStringSvg((getString(d, nodeShape, d._index)) as GraphNodeShape) ? nodeBBox.height : nodeSizeValue\n label.attr('transform', `translate(0, ${nodeHeight / 2 + labelMargin})`)\n if (scale >= ZoomLevel.Level3) setLabelRect(label, getString(d, nodeLabel, d._index), nodeSelectors.labelText)\n\n // Bottom Icon\n bottomIcon.html(getString(d, nodeBottomIcon, d._index))\n .attr('transform', `translate(0, ${nodeHeight / 2})`)\n })\n\n updateSelectedNodes(selection, config)\n\n return smartTransition(selection, duration)\n .attr('transform', d => `translate(${getX(d)}, ${getY(d)}) scale(1)`)\n .attr('opacity', 1)\n}\n\nexport function removeNodes<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n duration: number\n): void {\n smartTransition(selection, duration / 2)\n .attr('opacity', 0)\n .attr('transform', (d, i) => {\n const configuredPosition = getValue<GraphNode<N, L>, [number, number] | undefined>(d, config.nodeExitPosition, i)\n const scale = getNumber(d, config.nodeExitScale, i) ?? 0\n const x = configuredPosition?.[0] ?? getX(d)\n const y = configuredPosition?.[1] ?? getY(d)\n return `translate(${x}, ${y}) scale(${scale})`\n })\n .remove()\n}\n\nfunction setLabelBackgroundRect<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>\n): void {\n const { nodeLabel } = config\n\n selection.each((d, i, elements) => {\n const group: Selection<SVGGElement, N, SVGGElement, N> = select(elements[i])\n const label: Selection<SVGGElement, N, SVGGElement, N> = group.select(`.${nodeSelectors.label}`)\n setLabelRect(label, getString(d, nodeLabel, i), nodeSelectors.labelText)\n })\n}\n\nconst setLabelBackgroundRectThrottled = throttle(setLabelBackgroundRect, 1000) as typeof setLabelBackgroundRect\n\nexport function zoomNodes<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n scale: number\n): void {\n selection.classed(generalSelectors.zoomOutLevel1, scale < ZoomLevel.Level1)\n selection.classed(generalSelectors.zoomOutLevel2, scale < ZoomLevel.Level2)\n\n selection.selectAll(`${nodeSelectors.sideLabelBackground}`)\n .attr('transform', `scale(${1 / Math.pow(scale, 0.35)})`)\n selection.selectAll(`.${nodeSelectors.sideLabel}`)\n .attr('transform', `scale(${1 / Math.pow(scale, 0.45)})`)\n\n if (scale >= ZoomLevel.Level3) selection.call(setLabelBackgroundRectThrottled, config)\n}\n\nexport const zoomNodesThrottled = throttle(zoomNodes, 500)\n"],"names":["nodeSelectors.node","nodeSelectors.customNode","nodeSelectors.nodeSelection","nodeSelectors.nodeGauge","nodeSelectors.nodeIcon","label","nodeSelectors.label","nodeSelectors.labelBackground","labelText","nodeSelectors.labelText","nodeSelectors.labelTextContent","nodeSelectors.subLabelTextContent","nodeSelectors.sideLabelsGroup","nodeSelectors.nodeBottomIcon","nodeSelectors.greyedOutNode","nodeSelectors.draggable","nodeSelectors.nodeSelectionActive","nodeSelectors.sideLabel","nodeSelectors.sideLabelBackground","nodeIcon","nodeBottomIcon","node","sideLabelsGroup","labelTextContent","generalSelectors.zoomOutLevel2","nodeSelectors.nodeIsDragged","nodeSelectors.nodePolygon","nodeSelectors.sideLabelGroup","generalSelectors.zoomOutLevel1"],"mappings":";;;;;;;;;;;;;;;AA2CA,MAAM,yBAAyB,GAAG,EAAE,CAAA;AAMpB,SAAA,WAAW,CACzB,SAAwE,EACxE,MAAkC,EAAA;AAElC,IAAA,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAA;IAE5B,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,KAAI;AAChC,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,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K,EAAE,IAAI,CAAC,CAAA,CAAA,CAAG,CAAC,CAAA;AAE3D,IAAA,IAAI,KAAK,IAAI,SAAS,CAAC,MAAM;AAAE,QAAA,SAAS,CAAC,IAAI,CAAC,+BAA+B,EAAE,MAAM,CAAC,CAAA;AACxF,CAAC;AAEY,MAAA,kBAAkB,GAAG,QAAQ,CAAC,SAAS,EAAE,GAAG;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/graph/modules/node/index.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\nimport { Transition } from 'd3-transition'\nimport { arc } from 'd3-shape'\n\n// Types\nimport { GraphInputLink, GraphInputNode } from 'types/graph'\nimport { TrimMode } from 'types/text'\n\n// Utils\nimport { trimString } from 'utils/text'\nimport { polygon } from 'utils/path'\nimport { smartTransition } from 'utils/d3'\nimport { getBoolean, getNumber, getString, getValue, throttle } from 'utils/data'\nimport { getColor } from 'utils/color'\nimport { isStringSvg } from 'utils/svg'\n\n// Local Types\nimport { GraphNode, GraphCircleLabel, GraphNodeAnimationState, GraphNodeAnimatedElement, GraphNodeShape } from '../../types'\n\n// Config\nimport { GraphConfigInterface } from '../../config'\n\n// Helpers\nimport {\n arcTween,\n polyTween,\n setLabelRect,\n getX,\n getY,\n getSideLabelTextColor,\n getNodeColor,\n getNodeIconColor,\n getNodeSize,\n LABEL_RECT_VERTICAL_PADDING,\n isInternalHref,\n} from './helper'\nimport { appendShape, updateShape } from '../shape'\nimport { ZoomLevel } from '../zoom-levels'\n\n// Styles\nimport * as generalSelectors from '../../style'\nimport * as nodeSelectors from './style'\n\nconst SIDE_LABEL_DEFAULT_RADIUS = 10\n\nexport interface GraphNodeSVGGElement extends SVGGElement {\n nodeShape?: string;\n}\n\nexport function createNodes<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n duration: number,\n scale = 1\n): void {\n const { nodeShape } = config\n\n selection.each((d, i, elements) => {\n const element = elements[i] as GraphNodeSVGGElement\n const group = select<SVGGElement, GraphNode<N, L>>(element)\n group\n .attr('transform', (d: GraphNode<N, L>, i) => {\n const configuredPosition = getValue<GraphNode<N, L>, [number, number] | undefined>(d, config.nodeEnterPosition, i)\n const scale = getNumber(d, config.nodeEnterScale, i) ?? 0\n const x = configuredPosition?.[0] ?? getX(d)\n const y = configuredPosition?.[1] ?? getY(d)\n return `translate(${x}, ${y}) scale(${scale})`\n })\n .attr('opacity', 0)\n\n // If there's a custom render function, use it\n if (config.nodeEnterCustomRenderFunction) {\n config.nodeEnterCustomRenderFunction(d, element, config, duration, scale)\n } else { // Default node rendering\n const shape = getString(d, nodeShape, d._index) as GraphNodeShape\n /** Todo: The 'nodeShape' storing logic below it a temporary fix, needs a cleaner implementation */\n element.nodeShape = shape\n appendShape(group, shape, nodeSelectors.node, nodeSelectors.customNode, d._index)\n appendShape(group, shape, nodeSelectors.nodeSelection, nodeSelectors.customNode, d._index)\n group.append('path').attr('class', nodeSelectors.nodeGauge)\n group.append('g').attr('class', nodeSelectors.nodeIcon)\n\n group.append('g')\n .attr('class', nodeSelectors.sideLabelsGroup)\n\n group.append('text')\n .attr('class', nodeSelectors.nodeBottomIcon)\n }\n\n // Label\n const label = group.append('g').attr('class', nodeSelectors.label)\n label.append('rect').attr('class', nodeSelectors.labelBackground)\n\n const labelText = label.append('text')\n .attr('class', nodeSelectors.labelText)\n .attr('dy', '0.32em')\n labelText.append('tspan').attr('class', nodeSelectors.labelTextContent)\n labelText.append('tspan')\n .attr('class', nodeSelectors.subLabelTextContent)\n .attr('dy', '1.1em')\n .attr('x', '0')\n })\n}\n\nexport function updateNodeSelectedGreyout<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>\n): void {\n const { nodeDisabled } = config\n\n selection.each((d, i, elements) => {\n const group: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown> = select(elements[i])\n const isGreyout = getBoolean(d, nodeDisabled, d._index) || d._state.greyout\n\n group.classed(nodeSelectors.greyedOutNode, isGreyout)\n .classed(nodeSelectors.draggable, !config.disableDrag)\n\n const nodeSelectionOutline = group.selectAll<SVGGElement, GraphNode<N, L>>(`.${nodeSelectors.nodeSelection}`)\n nodeSelectionOutline.classed(nodeSelectors.nodeSelectionActive, d._state.selected)\n\n group.selectAll<SVGTextElement, GraphCircleLabel>(`.${nodeSelectors.sideLabel}`)\n .style('fill', (l) => isGreyout ? null : getSideLabelTextColor(l, selection.node()))\n\n group.selectAll<SVGRectElement, GraphCircleLabel>(`.${nodeSelectors.sideLabelBackground}`)\n .style('fill', (l) => isGreyout ? null : l.color)\n })\n}\n\nexport function updateNodes<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n duration: number,\n scale = 1\n): Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown> | Transition<SVGGElement, GraphNode<N, L>, SVGGElement, unknown> {\n const {\n nodeGaugeAnimDuration, nodeStrokeWidth, nodeShape, nodeSize, nodeGaugeValue, nodeGaugeFill,\n nodeIcon, nodeIconSize, nodeLabel, nodeLabelTrim, nodeLabelTrimMode, nodeLabelTrimLength,\n nodeSubLabel, nodeSubLabelTrim, nodeSubLabelTrimMode, nodeSubLabelTrimLength,\n nodeSideLabels, nodeStroke, nodeFill, nodeBottomIcon,\n } = config\n\n const nodeGroupsUpdate = smartTransition(selection, duration)\n .attr('transform', d => `translate(${getX(d)}, ${getY(d)}) scale(1)`)\n .attr('opacity', 1)\n\n // If there's a custom render function, use it\n if (config.nodeUpdateCustomRenderFunction) {\n selection.each((d, i, elements) => {\n config.nodeUpdateCustomRenderFunction(d, elements[i], config, duration, scale)\n })\n\n return nodeGroupsUpdate\n }\n\n // Default node rendering\n // Re-create nodes to update shapes if they were changed\n selection.each((d, i, elements) => {\n const element = elements[i] as GraphNodeSVGGElement\n const group = select<SVGGElement, GraphNode<N, L>>(element)\n const shape = getString(d, nodeShape, d._index)\n\n if (element.nodeShape !== shape) {\n group.select(`.${nodeSelectors.node}`).remove()\n appendShape(group, nodeShape, nodeSelectors.node, nodeSelectors.customNode, d._index, `.${nodeSelectors.nodeSelection}`)\n group.select(`.${nodeSelectors.nodeSelection}`).remove()\n appendShape(group, shape, nodeSelectors.nodeSelection, null, d._index, `.${nodeSelectors.nodeGauge}`)\n element.nodeShape = shape\n }\n })\n\n // Update nodes themselves\n selection.each((d, i, elements) => {\n const groupElement = elements[i]\n const group: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown> = select(groupElement)\n const node: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown> = group.select(`.${nodeSelectors.node}`)\n const nodeArc = group.select<GraphNodeAnimatedElement<SVGElement>>(`.${nodeSelectors.nodeGauge}`)\n const icon = group.select<SVGTextElement>(`.${nodeSelectors.nodeIcon}`)\n const sideLabelsGroup = group.select<SVGGElement>(`.${nodeSelectors.sideLabelsGroup}`)\n const label = group.select<SVGGElement>(`.${nodeSelectors.label}`)\n const labelTextContent = label.select<SVGTextElement>(`.${nodeSelectors.labelTextContent}`)\n const sublabelTextContent = label.select<SVGTextElement>(`.${nodeSelectors.subLabelTextContent}`)\n const bottomIcon = group.select<SVGTextElement>(`.${nodeSelectors.nodeBottomIcon}`)\n const nodeSelectionOutline = group.select<SVGGElement>(`.${nodeSelectors.nodeSelection}`)\n const nodeSizeValue = getNodeSize(d, nodeSize, d._index)\n const arcGenerator = arc<GraphNodeAnimationState>()\n .innerRadius(state => state.nodeSize / 2 - state.borderWidth / 2)\n .outerRadius(state => state.nodeSize / 2 + state.borderWidth / 2)\n .startAngle(0 * (Math.PI / 180))\n // eslint-disable-next-line dot-notation\n .endAngle(a => a['endAngle'])\n\n group\n .classed(generalSelectors.zoomOutLevel2, scale < ZoomLevel.Level2)\n .classed(nodeSelectors.nodeIsDragged, (d: GraphNode<N, L>) => d._state.isDragged)\n\n // Update Group\n group\n .classed(nodeSelectors.nodePolygon, () => {\n const shape = getString(d, nodeShape, d._index)\n return shape === GraphNodeShape.Triangle || shape === GraphNodeShape.Hexagon || shape === GraphNodeShape.Square\n })\n\n // Update Node\n node\n .call(updateShape, nodeShape, nodeSize, d._index)\n .attr('stroke-width', getNumber(d, nodeStrokeWidth, d._index) ?? 0)\n .style('fill', getNodeColor(d, nodeFill, d._index))\n .style('stroke', getColor(d, nodeStroke, d._index, true) ?? null)\n\n const nodeBBox = (node.node() as SVGGraphicsElement).getBBox()\n\n nodeArc\n .attr('stroke-width', getNumber(d, nodeStrokeWidth, d._index))\n .style('display', !getNumber(d, nodeGaugeValue, d._index) ? 'none' : null)\n .style('fill', getNodeColor(d, nodeGaugeFill, d._index))\n .style('stroke', getNodeColor(d, nodeGaugeFill, d._index))\n .style('stroke-opacity', d => getString(d, nodeShape, d._index) === GraphNodeShape.Circle ? 0 : null)\n\n nodeArc\n .transition()\n .duration(nodeGaugeAnimDuration)\n .attrTween('d', (\n d,\n j,\n arr\n ) => {\n switch (getString(d, nodeShape, d._index)) {\n case GraphNodeShape.Circle: return arcTween(d, config, arcGenerator, arr[j])\n case GraphNodeShape.Hexagon: return polyTween(d, config, polygon, arr[j])\n case GraphNodeShape.Square: return polyTween(d, config, polygon, arr[j])\n case GraphNodeShape.Triangle: return polyTween(d, config, polygon, arr[j])\n default: return null\n }\n })\n\n // Set Node Selection\n updateShape(nodeSelectionOutline, nodeShape, nodeSize, d._index)\n\n // Update Node Icon\n const nodeIconContent = getString(d, nodeIcon, d._index)\n const nodeIconSizeValue = getNumber(d, nodeIconSize, d._index) ?? 2.5 * Math.sqrt(nodeSizeValue)\n const nodeIconColor = getNodeIconColor(d, nodeFill, d._index, selection.node())\n icon.selectAll('*').remove() // Removing all children first\n if (isInternalHref(nodeIconContent)) { // If the icon is a href, we need to append a <use> element and render the icon with it\n icon.append('use')\n .attr('href', nodeIconContent)\n .attr('x', -nodeIconSizeValue / 2)\n .attr('y', -nodeIconSizeValue / 2)\n .attr('width', nodeIconSizeValue)\n .attr('height', nodeIconSizeValue)\n .style('fill', nodeIconColor)\n } else { // If the icon is a text, we need to append a <text> element and render the icon as text\n icon\n .append('text')\n .style('font-size', `${nodeIconSizeValue}px`)\n .attr('dy', '0.1em')\n .style('fill', nodeIconColor)\n .html(nodeIconContent)\n }\n\n // Side Labels\n const sideLabelsData = getValue<GraphNode<N, L>, GraphCircleLabel[]>(d, nodeSideLabels, d._index) || []\n const sideLabels = sideLabelsGroup.selectAll<SVGGElement, GraphCircleLabel>('g').data(sideLabelsData)\n const sideLabelsEnter = sideLabels.enter().append('g')\n .attr('class', nodeSelectors.sideLabelGroup)\n sideLabelsEnter.append('circle')\n .attr('class', nodeSelectors.sideLabelBackground)\n .attr('r', l => l.radius ?? SIDE_LABEL_DEFAULT_RADIUS)\n sideLabelsEnter.append('text')\n .attr('class', nodeSelectors.sideLabel)\n\n const sideLabelsUpdate = sideLabels.merge(sideLabelsEnter)\n .style('cursor', l => l.cursor ?? null)\n\n // Side label text\n sideLabelsUpdate.select(`.${nodeSelectors.sideLabel}`).html(d => d.text)\n .attr('dy', '0.1em')\n .style('fill', l => l.textColor ?? getSideLabelTextColor(l, selection.node()))\n .style('font-size', l => l.fontSize ?? `${(2 + (l.radius ?? SIDE_LABEL_DEFAULT_RADIUS)) / Math.pow(l.text.toString().length, 0.3)}px`)\n // Side label circle background\n sideLabelsUpdate.select(`.${nodeSelectors.sideLabelBackground}`)\n .style('fill', l => l.color)\n\n sideLabelsUpdate.attr('transform', (l, j) => {\n if (sideLabelsData.length === 1) return `translate(${nodeSizeValue / 2.5}, ${-nodeSizeValue / 2.5})`\n const r = 1.05 * nodeSizeValue / 2\n const angle = j * 1.15 * 2 * Math.atan2(l.radius ?? SIDE_LABEL_DEFAULT_RADIUS, r) - Math.PI / 3\n return `translate(${r * Math.cos(angle)}, ${r * Math.sin(angle)})`\n })\n\n sideLabels.exit().remove()\n\n // Set label and sub-label text\n const labelText = getString(d, nodeLabel, d._index)\n const sublabelText = getString(d, nodeSubLabel, d._index)\n const labelTextTrimmed = getBoolean(d, nodeLabelTrim, d._index)\n ? trimString(labelText, getNumber(d, nodeLabelTrimLength, d._index), getValue(d, nodeLabelTrimMode as TrimMode, d._index))\n : labelText\n const sublabelTextTrimmed = getBoolean(d, nodeSubLabelTrim, d._index)\n ? trimString(sublabelText, getNumber(d, nodeSubLabelTrimLength, d._index), getValue(d, nodeSubLabelTrimMode as TrimMode, d._index))\n : sublabelText\n\n labelTextContent.text(labelTextTrimmed)\n sublabelTextContent.text(sublabelTextTrimmed)\n group\n .on('mouseenter', () => {\n labelTextContent.text(labelText)\n sublabelTextContent.text(sublabelText)\n setLabelRect(label, labelText, nodeSelectors.labelText)\n group.raise()\n })\n .on('mouseleave', () => {\n labelTextContent.text(labelTextTrimmed)\n sublabelTextContent.text(sublabelTextTrimmed)\n setLabelRect(label, labelTextTrimmed, nodeSelectors.labelText)\n })\n\n // Position label\n const labelFontSize = parseFloat(window.getComputedStyle(groupElement).getPropertyValue('--vis-graph-node-label-font-size')) || 12\n const labelMargin = LABEL_RECT_VERTICAL_PADDING + 1.25 * labelFontSize ** 1.03\n const nodeHeight = isStringSvg((getString(d, nodeShape, d._index)) as GraphNodeShape) ? nodeBBox.height : nodeSizeValue\n label.attr('transform', `translate(0, ${nodeHeight / 2 + labelMargin})`)\n if (scale >= ZoomLevel.Level3) setLabelRect(label, getString(d, nodeLabel, d._index), nodeSelectors.labelText)\n\n // Bottom Icon\n bottomIcon.html(getString(d, nodeBottomIcon, d._index))\n .attr('transform', `translate(0, ${nodeHeight / 2})`)\n })\n\n updateNodeSelectedGreyout(selection, config)\n\n return nodeGroupsUpdate\n}\n\nexport function removeNodes<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n duration: number,\n scale = 1\n): void {\n smartTransition(selection, duration / 2)\n .attr('opacity', 0)\n .attr('transform', (d, i) => {\n const configuredPosition = getValue<GraphNode<N, L>, [number, number] | undefined>(d, config.nodeExitPosition, i)\n const scale = getNumber(d, config.nodeExitScale, i) ?? 0\n const x = configuredPosition?.[0] ?? getX(d)\n const y = configuredPosition?.[1] ?? getY(d)\n return `translate(${x}, ${y}) scale(${scale})`\n })\n .remove()\n\n // If there's a custom render function, use it\n if (config.nodeExitCustomRenderFunction) {\n selection.each((d, i, elements) => {\n config.nodeExitCustomRenderFunction(d, elements[i], config, duration, scale)\n })\n }\n}\n\nfunction setLabelBackgroundRect<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>\n): void {\n const { nodeLabel } = config\n\n selection.each((d, i, elements) => {\n const group: Selection<SVGGElement, N, SVGGElement, N> = select(elements[i])\n const label: Selection<SVGGElement, N, SVGGElement, N> = group.select(`.${nodeSelectors.label}`)\n setLabelRect(label, getString(d, nodeLabel, i), nodeSelectors.labelText)\n })\n}\n\nconst setLabelBackgroundRectThrottled = throttle(setLabelBackgroundRect, 1000) as typeof setLabelBackgroundRect\n\nexport function zoomNodes<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphNode<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n scale: number\n): void {\n selection.classed(generalSelectors.zoomOutLevel1, scale < ZoomLevel.Level1)\n selection.classed(generalSelectors.zoomOutLevel2, scale < ZoomLevel.Level2)\n\n selection.selectAll(`${nodeSelectors.sideLabelBackground}`)\n .attr('transform', `scale(${1 / Math.pow(scale, 0.35)})`)\n selection.selectAll(`.${nodeSelectors.sideLabel}`)\n .attr('transform', `scale(${1 / Math.pow(scale, 0.45)})`)\n\n if (scale >= ZoomLevel.Level3 && !config.nodeEnterCustomRenderFunction) selection.call(setLabelBackgroundRectThrottled, config)\n}\n\nexport const zoomNodesThrottled = throttle(zoomNodes, 500)\n"],"names":["nodeSelectors.node","nodeSelectors.customNode","nodeSelectors.nodeSelection","nodeSelectors.nodeGauge","nodeSelectors.nodeIcon","nodeSelectors.sideLabelsGroup","nodeSelectors.nodeBottomIcon","label","nodeSelectors.label","nodeSelectors.labelBackground","labelText","nodeSelectors.labelText","nodeSelectors.labelTextContent","nodeSelectors.subLabelTextContent","nodeSelectors.greyedOutNode","nodeSelectors.draggable","nodeSelectors.nodeSelectionActive","nodeSelectors.sideLabel","nodeSelectors.sideLabelBackground","nodeIcon","nodeBottomIcon","node","sideLabelsGroup","labelTextContent","generalSelectors.zoomOutLevel2","nodeSelectors.nodeIsDragged","nodeSelectors.nodePolygon","nodeSelectors.sideLabelGroup","generalSelectors.zoomOutLevel1"],"mappings":";;;;;;;;;;;;;;;AA2CA,MAAM,yBAAyB,GAAG,EAAE,CAAA;AAM9B,SAAU,WAAW,CACzB,SAAwE,EACxE,MAAkC,EAClC,QAAgB,EAChB,KAAK,GAAG,CAAC,EAAA;AAET,IAAA,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAA;IAE5B,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,KAAI;AAChC,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAyB,CAAA;AACnD,QAAA,MAAM,KAAK,GAAG,MAAM,CAA+B,OAAO,CAAC,CAAA;QAC3D,KAAK;aACF,IAAI,CAAC,WAAW,EAAE,CAAC,CAAkB,EAAE,CAAC,KAAI;;AAC3C,YAAA,MAAM,kBAAkB,GAAG,QAAQ,CAAgD,CAAC,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAA;AAClH,YAAA,MAAM,KAAK,GAAG,CAAA,EAAA,GAAA,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,CAAC,CAAA;AACz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AS,CAAC,MAAM,CAAC,CAAA;IAE3E,SAAS,CAAC,SAAS,CAAC,CAAA,EAAGN,mBAAiC,EAAE,CAAC;AACxD,SAAA,IAAI,CAAC,WAAW,EAAE,CAAS,MAAA,EAAA,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA,CAAA,CAAG,CAAC,CAAA;IAC3D,SAAS,CAAC,SAAS,CAAC,CAAA,CAAA,EAAID,SAAuB,EAAE,CAAC;AAC/C,SAAA,IAAI,CAAC,WAAW,EAAE,CAAS,MAAA,EAAA,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA,CAAA,CAAG,CAAC,CAAA;IAE3D,IAAI,KAAK,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,6BAA6B;AAAE,QAAA,SAAS,CAAC,IAAI,CAAC,+BAA+B,EAAE,MAAM,CAAC,CAAA;AACjI,CAAC;AAEY,MAAA,kBAAkB,GAAG,QAAQ,CAAC,SAAS,EAAE,GAAG;;;;"}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -5,6 +5,8 @@ export { colors, colorsDark, getCSSColorVariable, getDarkerColor, getLighterColo
|
|
|
5
5
|
export { styleExtraLargeSize, styleLargeSize } from './styles/sizes.js';
|
|
6
6
|
export { arrayOfIndices, clamp, clean, cloneDeep, countUnique, filterDataByRange, flatten, getBoolean, getExtent, getMax, getMin, getNearest, getNumber, getStackedData, getStackedExtent, getStackedValues, getString, getValue, groupBy, isAClassInstance, isArray, isEmpty, isEqual, isFunction, isNil, isNumber, isNumberWithinRange, isObject, isPlainObject, isString, isUndefined, merge, omit, shallowDiff, sortBy, throttle, unique, without } from './utils/data.js';
|
|
7
7
|
export { allowedSvgTextTags, escapeStringKeepHash, estimateStringPixelLength, estimateTextSize, estimateWrappedTextHeight, getPreciseStringLengthPx, getWrappedText, kebabCase, kebabCaseToCamel, renderTextIntoFrame, renderTextToSvgTextElement, splitString, trimSVGText, trimString, trimStringEnd, trimStringMiddle, trimStringStart, wrapSVGText } from './utils/text.js';
|
|
8
|
+
export { allowedSvgTags, getTransformValues, isStringSvg, sanitizeSvgString, transformValuesToString } from './utils/svg.js';
|
|
9
|
+
export { getColor, getHexValue, hexToBrightness, hexToRgb, rgbToBrightness, rgbaToRgb } from './utils/color.js';
|
|
8
10
|
export { ContainerCore } from './core/container/index.js';
|
|
9
11
|
export { SingleContainer } from './containers/single-container/index.js';
|
|
10
12
|
export { XYContainer } from './containers/xy-container/index.js';
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unovis/ts",
|
|
3
3
|
"description": "Modular data visualization framework for React, Angular, Svelte, and vanilla TypeScript or JavaScript",
|
|
4
|
-
"version": "1.4.2-alpha.
|
|
4
|
+
"version": "1.4.2-alpha.4",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/f5/unovis.git",
|