@unovis/ts 1.4.0-alpha.0 → 1.4.0-alpha.2

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.
@@ -1,8 +1,10 @@
1
+ import { D3DragEvent } from 'd3-drag';
2
+ import { D3ZoomEvent } from 'd3-zoom';
1
3
  import { ComponentConfigInterface } from "../../core/component/config";
2
4
  import { TrimMode } from "../../types/text";
3
5
  import { GraphInputLink, GraphInputNode } from "../../types/graph";
4
6
  import { BooleanAccessor, ColorAccessor, NumericAccessor, StringAccessor, GenericAccessor } from "../../types/accessor";
5
- import { GraphLayoutType, GraphCircleLabel, GraphLinkStyle, GraphLinkArrowStyle, GraphPanelConfig, GraphForceLayoutSettings, GraphElkLayoutSettings, GraphNodeShape, GraphDagreLayoutSetting } from './types';
7
+ import { GraphLayoutType, GraphCircleLabel, GraphLinkStyle, GraphLinkArrowStyle, GraphPanelConfig, GraphForceLayoutSettings, GraphElkLayoutSettings, GraphNodeShape, GraphDagreLayoutSetting, GraphNode } from './types';
6
8
  export interface GraphConfigInterface<N extends GraphInputNode, L extends GraphInputLink> extends ComponentConfigInterface {
7
9
  /** Zoom level constraints. Default: [0.35, 1.25] */
8
10
  zoomScaleExtent?: [number, number];
@@ -12,8 +14,6 @@ export interface GraphConfigInterface<N extends GraphInputNode, L extends GraphI
12
14
  disableDrag?: boolean;
13
15
  /** Interval to re-render the graph when zooming. Default: `100` */
14
16
  zoomThrottledUpdateNodeThreshold?: number;
15
- /** Zoom event callback. Default: `undefined` */
16
- onZoom?: (zoomScale: number, zoomScaleExtent: [number, number]) => void;
17
17
  /** Type of the graph layout. Default: `GraphLayoutType.Force` */
18
18
  layoutType?: GraphLayoutType | string;
19
19
  /** Fit the graph to container on data or config updates, or on container resize. Default: `true` */
@@ -56,7 +56,7 @@ export interface GraphConfigInterface<N extends GraphInputNode, L extends GraphI
56
56
  * Default: `undefined` */
57
57
  layoutParallelSortConnectionsByGroup?: string;
58
58
  /** Force Layout settings, see the `d3-force` package for more details */
59
- forceLayoutSettings?: GraphForceLayoutSettings;
59
+ forceLayoutSettings?: GraphForceLayoutSettings<N, L>;
60
60
  /** Darge Layout settings, see the `dagrejs` package
61
61
  * for more details: https://github.com/dagrejs/dagre/wiki#configuring-the-layout
62
62
  */
@@ -159,5 +159,13 @@ export interface GraphConfigInterface<N extends GraphInputNode, L extends GraphI
159
159
  selectedNodeId?: number | string;
160
160
  /** Panels configuration. An array of `GraphPanelConfig` objects. Default: `[]` */
161
161
  panels?: GraphPanelConfig[] | undefined;
162
+ /** Graph node drag start callback function. Default: `undefined` */
163
+ onNodeDragStart?: (n: GraphNode<N, L>, event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>) => void | undefined;
164
+ /** Graph node drag callback function. Default: `undefined` */
165
+ onNodeDrag?: (n: GraphNode<N, L>, event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>) => void | undefined;
166
+ /** Graph node drag end callback function. Default: `undefined` */
167
+ onNodeDragEnd?: (n: GraphNode<N, L>, event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>) => void | undefined;
168
+ /** Zoom event callback. Default: `undefined` */
169
+ onZoom?: (zoomScale: number, zoomScaleExtent: [number, number], event: D3ZoomEvent<SVGGElement, unknown> | undefined) => void;
162
170
  }
163
171
  export declare const GraphDefaultConfig: GraphConfigInterface<GraphInputNode, GraphInputLink>;
@@ -3,16 +3,18 @@ import { TrimMode } from '../../types/text.js';
3
3
  import { GraphLayoutType, GraphLinkStyle, GraphNodeShape } from './types.js';
4
4
 
5
5
  // Config
6
- const GraphDefaultConfig = Object.assign(Object.assign({}, ComponentDefaultConfig), { duration: 1000, zoomScaleExtent: [0.35, 1.25], disableZoom: false, disableDrag: false, zoomThrottledUpdateNodeThreshold: 100, onZoom: undefined, layoutType: GraphLayoutType.Force, layoutAutofit: true, layoutAutofitTolerance: 8.0, layoutNonConnectedAside: false, layoutGroupOrder: [], layoutParallelSubGroupsPerRow: 1, layoutParallelNodesPerColumn: 6, layoutParallelGroupSpacing: undefined, layoutParallelSortConnectionsByGroup: undefined, layoutNodeGroup: (n) => n.group, layoutParallelNodeSubGroup: (n) => n.subgroup, forceLayoutSettings: {
6
+ const GraphDefaultConfig = Object.assign(Object.assign({}, ComponentDefaultConfig), { duration: 1000, zoomScaleExtent: [0.35, 1.25], disableZoom: false, disableDrag: false, zoomThrottledUpdateNodeThreshold: 100, layoutType: GraphLayoutType.Force, layoutAutofit: true, layoutAutofitTolerance: 8.0, layoutNonConnectedAside: false, layoutGroupOrder: [], layoutParallelSubGroupsPerRow: 1, layoutParallelNodesPerColumn: 6, layoutParallelGroupSpacing: undefined, layoutParallelSortConnectionsByGroup: undefined, layoutNodeGroup: (n) => n.group, layoutParallelNodeSubGroup: (n) => n.subgroup, forceLayoutSettings: {
7
7
  linkDistance: 60,
8
8
  linkStrength: 0.45,
9
9
  charge: -500,
10
10
  forceXStrength: 0.15,
11
11
  forceYStrength: 0.25,
12
+ numIterations: undefined,
13
+ fixNodePositionAfterSimulation: false,
12
14
  }, dagreLayoutSettings: {
13
15
  rankdir: 'BT',
14
16
  ranker: 'longest-path',
15
- }, 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 });
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 });
16
18
 
17
19
  export { GraphDefaultConfig };
18
20
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../../src/components/graph/config.ts"],"sourcesContent":["// 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} 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 /** Zoom event callback. Default: `undefined` */\n onZoom?: (zoomScale: number, zoomScaleExtent: [number, number]) => void;\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\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\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 onZoom: undefined,\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 },\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"],"names":[],"mappings":";;;;AAAA;MAqMa,kBAAkB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAC1B,sBAAsB,CACzB,EAAA,EAAA,QAAQ,EAAE,IAAI,EACd,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAC7B,WAAW,EAAE,KAAK,EAClB,WAAW,EAAE,KAAK,EAClB,gCAAgC,EAAE,GAAG,EACrC,MAAM,EAAE,SAAS,EACjB,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,C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AS,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,EAAA;;;;"}
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} 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}\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}\n"],"names":[],"mappings":";;;;AAGA;AA8Ma,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,8BAA8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AiB,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,EAAA;;;;"}
@@ -18,8 +18,10 @@ export declare class Graph<N extends GraphInputNode, L extends GraphInputLink> e
18
18
  nodeGauge: string;
19
19
  nodeSideLabel: string;
20
20
  nodeLabel: string;
21
+ dimmedNode: string;
21
22
  link: string;
22
23
  linkLine: string;
24
+ dimmedLink: string;
23
25
  panel: string;
24
26
  panelRect: string;
25
27
  panelSelection: string;
@@ -12,8 +12,8 @@ import { GraphLayoutType, GraphLinkArrowStyle } from './types.js';
12
12
  import { GraphDefaultConfig } from './config.js';
13
13
  import { background, graphGroup, root } from './style.js';
14
14
  import * as style from './modules/node/style.js';
15
- import { nodes, gNode, gNodeExit, node, nodeGauge, sideLabelGroup, label } from './modules/node/style.js';
16
- import { links, gLink, gLinkExit, link } from './modules/link/style.js';
15
+ import { nodes, gNode, gNodeExit, node, nodeGauge, sideLabelGroup, label, greyedOutNode } from './modules/node/style.js';
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
18
  import { createNodes, updateNodes, removeNodes, updateSelectedNodes, zoomNodesThrottled, zoomNodes } from './modules/node/index.js';
19
19
  import { getMaxNodeSize, getX, getY, getNodeSize } from './modules/node/helper.js';
@@ -243,6 +243,8 @@ class Graph extends ComponentCore {
243
243
  const firstRender = this._isFirstRender;
244
244
  if (this._shouldRecalculateLayout) {
245
245
  switch (config.layoutType) {
246
+ case GraphLayoutType.Precalculated:
247
+ break;
246
248
  case GraphLayoutType.Parallel:
247
249
  applyLayoutParallel(datamodel, config, this._width, this._height);
248
250
  break;
@@ -440,7 +442,8 @@ class Graph extends ComponentCore {
440
442
  this._scale = transform.k;
441
443
  this._graphGroup.attr('transform', transform.toString());
442
444
  if (isFunction(config.onZoom))
443
- config.onZoom(this._scale, config.zoomScaleExtent);
445
+ config.onZoom(this._scale, config.zoomScaleExtent, event);
446
+ // console.warn('Unovis | Graph: Zoom: ', transform)
444
447
  if (!this._initialTransform)
445
448
  this._initialTransform = transform;
446
449
  // If the event was triggered by a mouse interaction (pan or zoom) we don't
@@ -450,7 +453,9 @@ class Graph extends ComponentCore {
450
453
  const propVal = transform[prop];
451
454
  const initialPropVal = this._initialTransform[prop];
452
455
  const dVal = Math.abs(propVal - initialPropVal);
453
- return prop === 'k' ? 2 * dVal : dVal / 50;
456
+ const scaledDVal = prop === 'k' ? 20 * dVal : dVal / 15;
457
+ acc += scaledDVal;
458
+ return acc;
454
459
  }, 0);
455
460
  if (diff > config.layoutAutofitTolerance)
456
461
  this._isAutoFitDisabled = true;
@@ -463,13 +468,15 @@ class Graph extends ComponentCore {
463
468
  .call((nodes.length > config.zoomThrottledUpdateNodeThreshold ? zoomLinksThrottled : zoomLinks), config, this._scale, this._getLinkArrowDefId);
464
469
  }
465
470
  _onDragStarted(d, event, nodeSelection) {
471
+ var _a;
466
472
  const { config } = this;
467
473
  this._isDragging = true;
468
474
  d._state.isDragged = true;
469
475
  nodeSelection.call(updateNodes, config, 0, this._scale);
476
+ (_a = config.onNodeDragStart) === null || _a === void 0 ? void 0 : _a.call(config, d, event);
470
477
  }
471
478
  _onDragged(d, event, allNodesSelection) {
472
- var _a, _b;
479
+ var _a, _b, _c;
473
480
  const { config } = this;
474
481
  const transform = zoomTransform(this.g.node());
475
482
  const scale = transform.k;
@@ -515,12 +522,15 @@ class Graph extends ComponentCore {
515
522
  const linksToAnimate = linksToUpdate.filter(d => d._state.greyout);
516
523
  if (linksToAnimate.size())
517
524
  animateLinkFlow(linksToAnimate, config, this._scale);
525
+ (_c = config.onNodeDrag) === null || _c === void 0 ? void 0 : _c.call(config, d, event);
518
526
  }
519
527
  _onDragEnded(d, event, nodeSelection) {
528
+ var _a;
520
529
  const { config } = this;
521
530
  this._isDragging = false;
522
531
  d._state.isDragged = false;
523
532
  nodeSelection.call(updateNodes, config, 0, this._scale);
533
+ (_a = config.onNodeDragEnd) === null || _a === void 0 ? void 0 : _a.call(config, d, event);
524
534
  }
525
535
  _shouldLayoutRecalculate(nextConfig) {
526
536
  const { config } = this;
@@ -618,8 +628,10 @@ Graph.selectors = {
618
628
  nodeGauge: nodeGauge,
619
629
  nodeSideLabel: sideLabelGroup,
620
630
  nodeLabel: label,
631
+ dimmedNode: greyedOutNode,
621
632
  link: gLink,
622
633
  linkLine: link,
634
+ dimmedLink: greyedOutLink,
623
635
  panel: gPanel,
624
636
  panelRect: panel,
625
637
  panelSelection: panelSelection,
@@ -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 } 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 link: linkSelectors.gLink,\n linkLine: linkSelectors.link,\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 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\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 this._shouldRecalculateLayout = this._shouldRecalculateLayout || this._shouldLayoutRecalculate(config)\n this._shouldFitLayout = this._shouldFitLayout || this._shouldRecalculateLayout\n\n super.setConfig(config)\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, panels }, 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 this._calculateLayout().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 if (this._shouldSetPanels) {\n smartTransition(this._panelsGroup, duration / 2)\n .style('opacity', panels?.length ? 1 : 0)\n\n this._panels = initPanels(panels)\n setPanelForNodes(this._panels, datamodel.nodes, this.config)\n this._shouldSetPanels = false\n }\n\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 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 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 { config, datamodel } = this\n\n const firstRender = this._isFirstRender\n if (this._shouldRecalculateLayout) {\n switch (config.layoutType) {\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 this._shouldRecalculateLayout = false\n }\n\n return firstRender\n }\n\n private _fit (duration = 0): void {\n const { datamodel: { nodes } } = this\n if (nodes?.length && this.g?.size()) {\n const transform = this._getTransform(nodes)\n smartTransition(this.g, duration)\n .call(this._zoomBehavior.transform, transform)\n this._onZoom(transform)\n } else {\n console.warn('Unovis | Graph: Node data is not defined. Check if the component has been initialized.')\n }\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 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 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)\n\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 return prop === 'k' ? 2 * dVal : dVal / 50\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 }\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\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 }\n\n private _shouldLayoutRecalculate (nextConfig: GraphConfigInterface<N, L>): boolean {\n const { config } = this\n if (config.layoutType !== nextConfig.layoutType) return true\n if (config.layoutNonConnectedAside !== nextConfig.layoutNonConnectedAside) return true\n\n if (config.layoutType === GraphLayoutType.Force) {\n const forceSettingsDiff = shallowDiff(config.forceLayoutSettings, nextConfig.forceLayoutSettings)\n if (Object.keys(forceSettingsDiff).length) return true\n }\n\n if (config.layoutType === GraphLayoutType.Dagre) {\n const dagreSettingsDiff = shallowDiff(config.dagreLayoutSettings, nextConfig.dagreLayoutSettings)\n if (Object.keys(dagreSettingsDiff).length) return true\n }\n\n if (\n config.layoutType === GraphLayoutType.Parallel ||\n config.layoutType === GraphLayoutType.ParallelHorizontal ||\n config.layoutType === GraphLayoutType.Concentric\n ) {\n if (config.layoutGroupOrder !== nextConfig.layoutGroupOrder) return true\n if (config.layoutParallelNodesPerColumn !== nextConfig.layoutParallelNodesPerColumn) return true\n if (config.layoutParallelSortConnectionsByGroup !== nextConfig.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 fitView (): void {\n this._fit(this.config.duration / 2)\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","linkSelectors.link","panelSelectors.panel","panelSelectors.panelSelection","panelSelectors.label","panelSelectors.labelText","panelSelectors.sideIconGroup","panelSelectors.sideIconShape","panelSelectors.sideIconSymbol","nodeSelectors"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwCM,MAAO,KAGX,SAAQ,aAGP,CAAA;AA4ED,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;QAtDC,IAAc,CAAA,cAAA,GAAG,kBAAgD,CAAA;AACpE,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;QAGhC,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,CAA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Z,CAAC,EAAE,IAAI,CAAC,CAAC;gBACT,CAAC,EAAE,IAAI,CAAC,CAAC;aACV,CAAA;AACF,SAAA;KACF;;AAhuBM,KAAA,CAAA,SAAS,GAAG;IACjB,IAAI,EAAEG,IAAqB;IAC3B,UAAU,EAAEV,UAA2B;IACvC,IAAI,EAAEK,KAAmB;IACzB,SAAS,EAAEM,IAAkB;IAC7B,SAAS,EAAEC,SAAuB;IAClC,aAAa,EAAEC,cAA4B;IAC3C,SAAS,EAAEC,KAAmB;IAC9B,IAAI,EAAEP,KAAmB;IACzB,QAAQ,EAAEQ,IAAkB;IAC5B,KAAK,EAAEN,MAAqB;IAC5B,SAAS,EAAEO,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 } 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\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 this._shouldRecalculateLayout = this._shouldRecalculateLayout || this._shouldLayoutRecalculate(config)\n this._shouldFitLayout = this._shouldFitLayout || this._shouldRecalculateLayout\n\n super.setConfig(config)\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, panels }, 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 this._calculateLayout().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 if (this._shouldSetPanels) {\n smartTransition(this._panelsGroup, duration / 2)\n .style('opacity', panels?.length ? 1 : 0)\n\n this._panels = initPanels(panels)\n setPanelForNodes(this._panels, datamodel.nodes, this.config)\n this._shouldSetPanels = false\n }\n\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 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 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 { config, datamodel } = this\n\n const firstRender = this._isFirstRender\n if (this._shouldRecalculateLayout) {\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 this._shouldRecalculateLayout = false\n }\n\n return firstRender\n }\n\n private _fit (duration = 0): void {\n const { datamodel: { nodes } } = this\n if (nodes?.length && this.g?.size()) {\n const transform = this._getTransform(nodes)\n smartTransition(this.g, duration)\n .call(this._zoomBehavior.transform, transform)\n this._onZoom(transform)\n } else {\n console.warn('Unovis | Graph: Node data is not defined. Check if the component has been initialized.')\n }\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 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 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 (nextConfig: GraphConfigInterface<N, L>): boolean {\n const { config } = this\n if (config.layoutType !== nextConfig.layoutType) return true\n if (config.layoutNonConnectedAside !== nextConfig.layoutNonConnectedAside) return true\n\n if (config.layoutType === GraphLayoutType.Force) {\n const forceSettingsDiff = shallowDiff(config.forceLayoutSettings, nextConfig.forceLayoutSettings)\n if (Object.keys(forceSettingsDiff).length) return true\n }\n\n if (config.layoutType === GraphLayoutType.Dagre) {\n const dagreSettingsDiff = shallowDiff(config.dagreLayoutSettings, nextConfig.dagreLayoutSettings)\n if (Object.keys(dagreSettingsDiff).length) return true\n }\n\n if (\n config.layoutType === GraphLayoutType.Parallel ||\n config.layoutType === GraphLayoutType.ParallelHorizontal ||\n config.layoutType === GraphLayoutType.Concentric\n ) {\n if (config.layoutGroupOrder !== nextConfig.layoutGroupOrder) return true\n if (config.layoutParallelNodesPerColumn !== nextConfig.layoutParallelNodesPerColumn) return true\n if (config.layoutParallelSortConnectionsByGroup !== nextConfig.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 fitView (): void {\n this._fit(this.config.duration / 2)\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;AA8ED,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;QAtDC,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;QAGhC,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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kB;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,7 +1,7 @@
1
1
  import { __awaiter } from 'tslib';
2
2
  import { max, min, group } from 'd3-array';
3
- import { unique, getString, sortBy, groupBy, without, clamp, getNumber, merge, getValue } from '../../../utils/data.js';
4
- import { getMaxNodeSize, configuredNodeSize, getAverageNodeSize, getNodeSize } from './node/helper.js';
3
+ import { unique, getString, sortBy, groupBy, without, clamp, getNumber, isFunction, merge, getValue } from '../../../utils/data.js';
4
+ import { getMaxNodeSize, configuredNodeSize, getAverageNodeSize, getX, getY, getNodeSize } from './node/helper.js';
5
5
  import { positionNonConnectedNodes, toElkHierarchy, DEFAULT_ELK_SETTINGS, adjustElkHierarchyCoordinates } from './layout-helpers.js';
6
6
 
7
7
  function applyLayoutCircular(datamodel, config, width, height) {
@@ -312,35 +312,46 @@ function applyLayoutConcentric(datamodel, config, width, height) {
312
312
  }
313
313
  }
314
314
  function applyLayoutForce(datamodel, config, width) {
315
- var _a, _b;
315
+ var _a;
316
316
  return __awaiter(this, void 0, void 0, function* () {
317
- const { layoutNonConnectedAside, forceLayoutSettings: { linkDistance, linkStrength, charge, forceXStrength, forceYStrength }, nodeSize } = config;
317
+ const { layoutNonConnectedAside, forceLayoutSettings, nodeSize } = config;
318
318
  const { forceSimulation, forceLink, forceManyBody, forceX, forceY, forceCollide } = yield import('d3-force');
319
319
  const { nonConnectedNodes, connectedNodes, nodes, links } = datamodel;
320
+ // Apply fx and fy to nodes if present before running the simulation
321
+ nodes.forEach((d) => {
322
+ d.fx = getX(d);
323
+ d.fy = getY(d);
324
+ });
320
325
  const simulation = forceSimulation(layoutNonConnectedAside ? connectedNodes : nodes)
321
326
  .force('link', forceLink(links)
322
327
  .id((d) => String(d._id))
323
- .distance(linkDistance)
324
- .strength(linkStrength))
325
- .force('charge', forceManyBody().strength(d => {
326
- const linkCount = links.reduce((count, l) => count + Number((l.source === d) || (l.target === d)), 0);
327
- return charge * Math.sqrt(linkCount);
328
+ .distance((l, i) => isFunction(forceLayoutSettings.linkDistance) ? forceLayoutSettings.linkDistance(l, i) : forceLayoutSettings.linkDistance)
329
+ .strength((l, i) => isFunction(forceLayoutSettings.linkStrength) ? forceLayoutSettings.linkStrength(l, i) : forceLayoutSettings.linkStrength))
330
+ .force('charge', forceManyBody().strength((d, i) => {
331
+ if (isFunction(forceLayoutSettings.charge)) {
332
+ return forceLayoutSettings.charge(d, i);
333
+ }
334
+ else {
335
+ const linkCount = links.reduce((count, l) => count + Number((l.source === d) || (l.target === d)), 0);
336
+ return forceLayoutSettings.charge * Math.sqrt(linkCount);
337
+ }
328
338
  }))
329
- .force('x', forceX().strength(forceXStrength))
330
- .force('y', forceY().strength(forceYStrength))
339
+ .force('x', forceX().strength(forceLayoutSettings.forceXStrength))
340
+ .force('y', forceY().strength(forceLayoutSettings.forceYStrength))
331
341
  .force('collide', forceCollide().radius((d, i) => getNodeSize(d, nodeSize, i)).iterations(1))
332
342
  .stop();
333
343
  // See https://bl.ocks.org/mbostock/1667139, https://github.com/d3/d3-force/blob/master/README.md#simulation_tick
334
- for (let i = 0, n = Math.ceil(Math.log(simulation.alphaMin()) / Math.log(1 - simulation.alphaDecay())); i < n; ++i) {
344
+ const numIterations = (_a = forceLayoutSettings.numIterations) !== null && _a !== void 0 ? _a : Math.ceil(Math.log(simulation.alphaMin()) / Math.log(1 - simulation.alphaDecay()));
345
+ for (let i = 0, n = numIterations; i < n; ++i) {
335
346
  simulation.tick();
336
347
  }
337
- // Translate coordinates to values > 0 for better animated transition between layout
338
- const yMin = (_a = min(connectedNodes.map(d => d.y))) !== null && _a !== void 0 ? _a : 0;
339
- const xMin = (_b = min(connectedNodes.map(d => d.x))) !== null && _b !== void 0 ? _b : 0;
340
- nodes.forEach(d => {
341
- d.x -= xMin;
342
- d.y -= yMin;
343
- });
348
+ // Fix node positions if requested
349
+ if (forceLayoutSettings.fixNodePositionAfterSimulation) {
350
+ nodes.forEach(d => {
351
+ d._state.fx = d.x;
352
+ d._state.fy = d.y;
353
+ });
354
+ }
344
355
  // Handle non-connected nodes
345
356
  if (layoutNonConnectedAside) {
346
357
  const maxSize = getMaxNodeSize(nonConnectedNodes, nodeSize);