@unovis/ts 1.5.1-exf.6 → 1.5.1-exf.7
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.
|
@@ -112,6 +112,10 @@ export interface GraphConfigInterface<N extends GraphInputNode, L extends GraphI
|
|
|
112
112
|
linkCurvature?: NumericAccessor<L>;
|
|
113
113
|
/** Highlight links on hover. Default: `true` */
|
|
114
114
|
linkHighlightOnHover?: boolean;
|
|
115
|
+
/** Offset [x,y] in pixels from the source node's center point where the link should start. Default: `undefined` */
|
|
116
|
+
linkSourcePointOffset?: GenericAccessor<[number, number], GraphLink<N, L>>;
|
|
117
|
+
/** Offset [x,y] in pixels from the target node's center point where the link should end. Default: `undefined` */
|
|
118
|
+
linkTargetPointOffset?: GenericAccessor<[number, number], GraphLink<N, L>>;
|
|
115
119
|
/** Set selected link by its unique id. Default: `undefined` */
|
|
116
120
|
selectedLinkId?: number | string;
|
|
117
121
|
/** Node size accessor function or constant value. Default: `30` */
|
|
@@ -15,7 +15,7 @@ const GraphDefaultConfig = Object.assign(Object.assign({}, ComponentDefaultConfi
|
|
|
15
15
|
}, dagreLayoutSettings: {
|
|
16
16
|
rankdir: 'BT',
|
|
17
17
|
ranker: 'longest-path',
|
|
18
|
-
}, 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, linkHighlightOnHover: true,
|
|
18
|
+
}, 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, linkHighlightOnHover: true, linkSourcePointOffset: undefined, linkTargetPointOffset: undefined, selectedLinkId: undefined, 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, nodeSelectionHighlightMode: GraphNodeSelectionHighlightMode.GreyoutNonConnected, nodeGaugeAnimDuration: 1500, selectedNodeId: undefined, selectedNodeIds: undefined, panels: undefined, onNodeDragStart: undefined, onNodeDrag: undefined, onNodeDragEnd: undefined, onZoom: undefined, onZoomStart: undefined, onZoomEnd: undefined, onLayoutCalculated: undefined, onNodeSelectionBrush: undefined, onNodeSelectionDrag: undefined, onRenderComplete: undefined, shouldDataUpdate: (prevData, nextData) => {
|
|
19
19
|
return !isEqual(prevData, nextData);
|
|
20
20
|
} });
|
|
21
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/graph/config.ts"],"sourcesContent":["import { D3BrushEvent } from 'd3-brush'\nimport { D3DragEvent } from 'd3-drag'\nimport { D3ZoomEvent, ZoomTransform } from 'd3-zoom'\nimport { Selection } from 'd3-selection'\n\n// Core\nimport type { GraphDataModel } from 'data-models/graph'\n\n// Utils\nimport { isEqual } from 'utils/data'\n\n// Config\nimport { ComponentConfigInterface, ComponentDefaultConfig } from 'core/component/config'\n\n// Types\nimport { TrimMode } from 'types/text'\nimport { GraphInputLink, GraphInputNode, GraphInputData } from 'types/graph'\nimport { BooleanAccessor, ColorAccessor, NumericAccessor, StringAccessor, GenericAccessor } from 'types/accessor'\n\n// Local Types\nimport {\n GraphLayoutType,\n GraphCircleLabel,\n GraphLinkStyle,\n GraphLinkArrowStyle,\n GraphPanelConfig,\n GraphForceLayoutSettings,\n GraphElkLayoutSettings,\n GraphNodeShape,\n GraphDagreLayoutSetting,\n GraphNode,\n GraphLink,\n GraphNodeSelectionHighlightMode,\n} from './types'\n\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 /** Custom Zoom event filter to better control which actions should trigger zooming.\n * Learn more: https://d3js.org/d3-zoom#zoom_filter.\n * Default: `undefined` */\n zoomEventFilter?: (event: PointerEvent) => boolean;\n /** Disable node dragging. Default: `false` */\n disableDrag?: boolean;\n /** Disable brush for multiple node selection. Default: `false` */\n disableBrush?: 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 | 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 /** Highlight links on hover. Default: `true` */\n linkHighlightOnHover?: boolean;\n /** Set selected link by its unique id. Default: `undefined` */\n selectedLinkId?: number | string;\n\n // Nodes\n /** Node size accessor function or constant value. Default: `30` */\n nodeSize?: NumericAccessor<N>;\n /** Node stroke width accessor function or constant value. Default: `3` */\n nodeStrokeWidth?: NumericAccessor<N>;\n /** Node shape accessor function or constant value. Default: `GraphNodeShape.Circle` */\n nodeShape?: GenericAccessor<GraphNodeShape | string, N>;\n /** Node gauge outline accessor function or constant value in the range [0,100]. Default: `0` */\n nodeGaugeValue?: NumericAccessor<N>;\n /** Node gauge outline fill color accessor function or constant value. Default: `undefined` */\n nodeGaugeFill?: ColorAccessor<N>;\n /** Animation duration of the node gauge outline. Default: `1500` */\n nodeGaugeAnimDuration?: number;\n /** Node central icon accessor function or constant value. Default: `node => node.icon` */\n nodeIcon?: StringAccessor<N>;\n /** Node central icon size accessor function or constant value. Default: `undefined` */\n nodeIconSize?: NumericAccessor<N>;\n /** Node label accessor function or constant value. Default: `node => node.label` */\n nodeLabel?: StringAccessor<N>;\n /** Defines whether to trim the node labels or not. Default: `true` */\n nodeLabelTrim?: BooleanAccessor<N>;\n /** Node label trimming mode. Default: `TrimMode.Middle` */\n nodeLabelTrimMode?: GenericAccessor<TrimMode | string, N>;\n /** Node label maximum allowed text length above which the label will be trimmed. Default: `15` */\n nodeLabelTrimLength?: NumericAccessor<N>;\n /** Node sub-label accessor function or constant value: Default: `''` */\n nodeSubLabel?: StringAccessor<N>;\n /** Defines whether to trim the node sub-labels or not. Default: `true` */\n nodeSubLabelTrim?: BooleanAccessor<N>;\n /** Node sub-label trimming mode. Default: `TrimMode.Middle` */\n nodeSubLabelTrimMode?: GenericAccessor<TrimMode | string, N>;\n /** Node sub-label maximum allowed text length above which the label will be trimmed. Default: `15` */\n nodeSubLabelTrimLength?: NumericAccessor<N>;\n /** Node circular side labels accessor function. The function should return an array of GraphCircleLabel objects. Default: `undefined` */\n nodeSideLabels?: GenericAccessor<GraphCircleLabel[], N>;\n /** Node bottom icon accessor function. Default: `undefined` */\n nodeBottomIcon?: StringAccessor<N>;\n /** Node disabled state accessor function or constant value. Default: `false` */\n nodeDisabled?: BooleanAccessor<N>;\n /** Node fill color accessor function or constant value. Default: `node => node.fill` */\n nodeFill?: ColorAccessor<N>;\n /** Node stroke color accessor function or constant value. Default: `node => node.stroke` */\n nodeStroke?: ColorAccessor<N>;\n /** Sorting function to determine node placement. Default: `undefined` */\n nodeSort?: ((a: N, b: N) => number);\n /** Specify the initial position for entering nodes as [x, y]. Default: `undefined` */\n nodeEnterPosition?: GenericAccessor<[number, number], N> | undefined;\n /** Specify the initial scale for entering nodes in the range [0,1]. Default: `0.75` */\n nodeEnterScale?: NumericAccessor<N> | undefined;\n /** Specify the destination position for exiting nodes as [x, y]. Default: `undefined` */\n nodeExitPosition?: GenericAccessor<[number, number], N> | undefined;\n /** Specify the destination scale for exiting nodes in the range [0,1]. Default: `0.75` */\n nodeExitScale?: NumericAccessor<N> | undefined;\n /** Custom \"enter\" function for node rendering. Default: `undefined` */\n nodeEnterCustomRenderFunction?:\n (datum: GraphNode<N, L>, nodeGroupElementSelection: Selection<SVGGElement, GraphNode<N, L>, null, unknown>, config: GraphConfigInterface<N, L>, duration: number, zoomLevel: number) => void;\n /** Custom \"update\" function for node rendering. Default: `undefined` */\n nodeUpdateCustomRenderFunction?:\n (datum: GraphNode<N, L>, nodeGroupElementSelection: Selection<SVGGElement, GraphNode<N, L>, null, unknown>, config: GraphConfigInterface<N, L>, duration: number, zoomLevel: number) => void;\n /** Custom partial \"update\" function for node rendering which will be triggered after the following events:\n * - Full node update (`nodeUpdateCustomRenderFunction`);\n * - Background click;\n * - Node and Link mouseover and mouseout;\n * - Node brushing,\n * Default: `undefined` */\n nodePartialUpdateCustomRenderFunction?:\n (datum: GraphNode<N, L>, nodeGroupElementSelection: Selection<SVGGElement, GraphNode<N, L>, null, unknown>, config: GraphConfigInterface<N, L>, duration: number, zoomLevel: number) => void;\n /** Custom \"exit\" function for node rendering. Default: `undefined` */\n nodeExitCustomRenderFunction?:\n (datum: GraphNode<N, L>, nodeGroupElementSelection: Selection<SVGGElement, GraphNode<N, L>, null, unknown>, config: GraphConfigInterface<N, L>, duration: number, zoomLevel: number) => void;\n /** Custom render function that will be called while zooming / panning the graph. Default: `undefined` */\n nodeOnZoomCustomRenderFunction?:\n (datum: GraphNode<N, L>, nodeGroupElementSelection: Selection<SVGGElement, GraphNode<N, L>, null, unknown>, config: GraphConfigInterface<N, L>, zoomLevel: number) => void;\n /** Define the mode for highlighting selected nodes in the graph. Default: `GraphNodeSelectionHighlightMode.GreyoutNonConnected` */\n nodeSelectionHighlightMode?: GraphNodeSelectionHighlightMode;\n /** Set selected node by unique id. Default: `undefined` */\n selectedNodeId?: number | string;\n /** Set selected nodes by unique id. Default: `undefined` */\n selectedNodeIds?: 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, transform: ZoomTransform) => void;\n /** Zoom start event callback. Default: `undefined` */\n onZoomStart?: (zoomScale: number, zoomScaleExtent: [number, number], event: D3ZoomEvent<SVGGElement, unknown> | undefined, transform: ZoomTransform) => void;\n /** Zoom end event callback. Default: `undefined` */\n onZoomEnd?: (zoomScale: number, zoomScaleExtent: [number, number], event: D3ZoomEvent<SVGGElement, unknown> | undefined, transform: ZoomTransform) => void;\n /** Callback function to be called when the graph layout is calculated. Default: `undefined` */\n onLayoutCalculated?: (nodes: GraphNode<N, L>[], links: GraphLink<N, L>[]) => void;\n /** Graph node selection brush callback function. Default: `undefined` */\n onNodeSelectionBrush?: (selectedNodes: GraphNode<N, L>[], event: D3BrushEvent<SVGGElement> | undefined) => void;\n /** Graph multiple node drag callback function. Default: `undefined` */\n onNodeSelectionDrag?: (selectedNodes: GraphNode<N, L>[], event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>) => void;\n /** Callback function to be called when the graph rendering is complete. Default: `undefined` */\n onRenderComplete?: (\n g: Selection<SVGGElement, unknown, null, undefined>,\n nodes: GraphNode<N, L>[],\n links: GraphLink<N, L>[],\n config: GraphConfigInterface<N, L>,\n duration: number,\n zoomLevel: number,\n width: number,\n height: number\n ) => void;\n\n /** Determines whether the component should update when new data is provided.\n * This function takes the previous and new data as parameters and returns a boolean\n * indicating whether the update should proceed. Useful for fine-grained control over\n * update behavior when your data has a complex nested structure.\n * By default the `isEqual` function from Unovis will be used to do the comparison.\n */\n shouldDataUpdate?: (\n prevData: GraphInputData<N, L>,\n nextData: GraphInputData<N, L>,\n datamodel: GraphDataModel<N, L, GraphNode<N, L>, GraphLink<N, L>>\n ) => boolean;\n}\n\nexport const GraphDefaultConfig: GraphConfigInterface<GraphInputNode, GraphInputLink> = {\n ...ComponentDefaultConfig,\n duration: 1000,\n zoomScaleExtent: [0.35, 1.25],\n disableZoom: false,\n zoomEventFilter: undefined,\n disableDrag: false,\n disableBrush: 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 linkHighlightOnHover: true,\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 nodeSelectionHighlightMode: GraphNodeSelectionHighlightMode.GreyoutNonConnected,\n\n selectedNodeId: undefined,\n selectedNodeIds: undefined,\n\n panels: undefined,\n\n onNodeDragStart: undefined,\n onNodeDrag: undefined,\n onNodeDragEnd: undefined,\n onZoom: undefined,\n onZoomStart: undefined,\n onZoomEnd: undefined,\n onLayoutCalculated: undefined,\n onNodeSelectionBrush: undefined,\n onNodeSelectionDrag: undefined,\n onRenderComplete: undefined,\n\n shouldDataUpdate: (prevData: GraphInputData<GraphInputNode, GraphInputLink>, nextData: GraphInputData<GraphInputNode, GraphInputLink>): boolean => {\n return !isEqual(prevData, nextData)\n },\n}\n"],"names":[],"mappings":";;;;;AAQA;MAqRa,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,eAAe,EAAE,SAAS,EAC1B,WAAW,EAAE,KAAK,EAClB,YAAY,EAAE,KAAK,EACnB,gCAAgC,EAAE,GAAG,EACrC,UAAU,EAAE,eAAe,CAAC,KAAK,EACjC,aAAa,EAAE,IAAI,EACnB,sBAAsB,EAAE,GAAG,EAC3B,uBAAuB,EAAE,KAAK,EAE9B,gBAAgB,EAAE,EAAE,EACpB,6BAA6B,EAAE,CAAC,EAChC,4BAA4B,EAAE,CAAC,EAC/B,0BAA0B,EAAE,SAAS,EACrC,oCAAoC,EAAE,SAAS,EAC/C,eAAe,EAAE,CAAC,CAAiB,KAAc,CAAuB,CAAC,KAAK,EAC9E,0BAA0B,EAAE,CAAC,CAAiB,KAAc,CAA0B,CAAC,QAAQ,EAE/F,mBAAmB,EAAE;AACnB,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,YAAY,EAAE,IAAI;QAClB,MAAM,EAAE,CAAC,GAAG;AACZ,QAAA,cAAc,EAAE,IAAI;AACpB,QAAA,cAAc,EAAE,IAAI;AACpB,QAAA,aAAa,EAAE,SAAS;AACxB,QAAA,8BAA8B,EAAE,KAAK;AACtC,KAAA,EAED,mBAAmB,EAAE;AACnB,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,MAAM,EAAE,cAAc;AACvB,KAAA,EAED,iBAAiB,EAAE,SAAS,EAC5B,mBAAmB,EAAE,SAAS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AAE,+BAA+B,CAAC,mBAAmB,EAE/E,cAAc,EAAE,SAAS,EACzB,eAAe,EAAE,SAAS,EAE1B,MAAM,EAAE,SAAS,EAEjB,eAAe,EAAE,SAAS,EAC1B,UAAU,EAAE,SAAS,EACrB,aAAa,EAAE,SAAS,EACxB,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,SAAS,EACtB,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,SAAS,EAC7B,oBAAoB,EAAE,SAAS,EAC/B,mBAAmB,EAAE,SAAS,EAC9B,gBAAgB,EAAE,SAAS,EAE3B,gBAAgB,EAAE,CAAC,QAAwD,EAAE,QAAwD,KAAa;AAChJ,QAAA,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;AACrC,KAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/graph/config.ts"],"sourcesContent":["import { D3BrushEvent } from 'd3-brush'\nimport { D3DragEvent } from 'd3-drag'\nimport { D3ZoomEvent, ZoomTransform } from 'd3-zoom'\nimport { Selection } from 'd3-selection'\n\n// Core\nimport type { GraphDataModel } from 'data-models/graph'\n\n// Utils\nimport { isEqual } from 'utils/data'\n\n// Config\nimport { ComponentConfigInterface, ComponentDefaultConfig } from 'core/component/config'\n\n// Types\nimport { TrimMode } from 'types/text'\nimport { GraphInputLink, GraphInputNode, GraphInputData } from 'types/graph'\nimport { BooleanAccessor, ColorAccessor, NumericAccessor, StringAccessor, GenericAccessor } from 'types/accessor'\n\n// Local Types\nimport {\n GraphLayoutType,\n GraphCircleLabel,\n GraphLinkStyle,\n GraphLinkArrowStyle,\n GraphPanelConfig,\n GraphForceLayoutSettings,\n GraphElkLayoutSettings,\n GraphNodeShape,\n GraphDagreLayoutSetting,\n GraphNode,\n GraphLink,\n GraphNodeSelectionHighlightMode,\n} from './types'\n\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 /** Custom Zoom event filter to better control which actions should trigger zooming.\n * Learn more: https://d3js.org/d3-zoom#zoom_filter.\n * Default: `undefined` */\n zoomEventFilter?: (event: PointerEvent) => boolean;\n /** Disable node dragging. Default: `false` */\n disableDrag?: boolean;\n /** Disable brush for multiple node selection. Default: `false` */\n disableBrush?: 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 | 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 /** Highlight links on hover. Default: `true` */\n linkHighlightOnHover?: boolean;\n /** Offset [x,y] in pixels from the source node's center point where the link should start. Default: `undefined` */\n linkSourcePointOffset?: GenericAccessor<[number, number], GraphLink<N, L>>;\n /** Offset [x,y] in pixels from the target node's center point where the link should end. Default: `undefined` */\n linkTargetPointOffset?: GenericAccessor<[number, number], GraphLink<N, L>>;\n /** Set selected link by its unique id. Default: `undefined` */\n selectedLinkId?: number | string;\n\n // Nodes\n /** Node size accessor function or constant value. Default: `30` */\n nodeSize?: NumericAccessor<N>;\n /** Node stroke width accessor function or constant value. Default: `3` */\n nodeStrokeWidth?: NumericAccessor<N>;\n /** Node shape accessor function or constant value. Default: `GraphNodeShape.Circle` */\n nodeShape?: GenericAccessor<GraphNodeShape | string, N>;\n /** Node gauge outline accessor function or constant value in the range [0,100]. Default: `0` */\n nodeGaugeValue?: NumericAccessor<N>;\n /** Node gauge outline fill color accessor function or constant value. Default: `undefined` */\n nodeGaugeFill?: ColorAccessor<N>;\n /** Animation duration of the node gauge outline. Default: `1500` */\n nodeGaugeAnimDuration?: number;\n /** Node central icon accessor function or constant value. Default: `node => node.icon` */\n nodeIcon?: StringAccessor<N>;\n /** Node central icon size accessor function or constant value. Default: `undefined` */\n nodeIconSize?: NumericAccessor<N>;\n /** Node label accessor function or constant value. Default: `node => node.label` */\n nodeLabel?: StringAccessor<N>;\n /** Defines whether to trim the node labels or not. Default: `true` */\n nodeLabelTrim?: BooleanAccessor<N>;\n /** Node label trimming mode. Default: `TrimMode.Middle` */\n nodeLabelTrimMode?: GenericAccessor<TrimMode | string, N>;\n /** Node label maximum allowed text length above which the label will be trimmed. Default: `15` */\n nodeLabelTrimLength?: NumericAccessor<N>;\n /** Node sub-label accessor function or constant value: Default: `''` */\n nodeSubLabel?: StringAccessor<N>;\n /** Defines whether to trim the node sub-labels or not. Default: `true` */\n nodeSubLabelTrim?: BooleanAccessor<N>;\n /** Node sub-label trimming mode. Default: `TrimMode.Middle` */\n nodeSubLabelTrimMode?: GenericAccessor<TrimMode | string, N>;\n /** Node sub-label maximum allowed text length above which the label will be trimmed. Default: `15` */\n nodeSubLabelTrimLength?: NumericAccessor<N>;\n /** Node circular side labels accessor function. The function should return an array of GraphCircleLabel objects. Default: `undefined` */\n nodeSideLabels?: GenericAccessor<GraphCircleLabel[], N>;\n /** Node bottom icon accessor function. Default: `undefined` */\n nodeBottomIcon?: StringAccessor<N>;\n /** Node disabled state accessor function or constant value. Default: `false` */\n nodeDisabled?: BooleanAccessor<N>;\n /** Node fill color accessor function or constant value. Default: `node => node.fill` */\n nodeFill?: ColorAccessor<N>;\n /** Node stroke color accessor function or constant value. Default: `node => node.stroke` */\n nodeStroke?: ColorAccessor<N>;\n /** Sorting function to determine node placement. Default: `undefined` */\n nodeSort?: ((a: N, b: N) => number);\n /** Specify the initial position for entering nodes as [x, y]. Default: `undefined` */\n nodeEnterPosition?: GenericAccessor<[number, number], N> | undefined;\n /** Specify the initial scale for entering nodes in the range [0,1]. Default: `0.75` */\n nodeEnterScale?: NumericAccessor<N> | undefined;\n /** Specify the destination position for exiting nodes as [x, y]. Default: `undefined` */\n nodeExitPosition?: GenericAccessor<[number, number], N> | undefined;\n /** Specify the destination scale for exiting nodes in the range [0,1]. Default: `0.75` */\n nodeExitScale?: NumericAccessor<N> | undefined;\n /** Custom \"enter\" function for node rendering. Default: `undefined` */\n nodeEnterCustomRenderFunction?:\n (datum: GraphNode<N, L>, nodeGroupElementSelection: Selection<SVGGElement, GraphNode<N, L>, null, unknown>, config: GraphConfigInterface<N, L>, duration: number, zoomLevel: number) => void;\n /** Custom \"update\" function for node rendering. Default: `undefined` */\n nodeUpdateCustomRenderFunction?:\n (datum: GraphNode<N, L>, nodeGroupElementSelection: Selection<SVGGElement, GraphNode<N, L>, null, unknown>, config: GraphConfigInterface<N, L>, duration: number, zoomLevel: number) => void;\n /** Custom partial \"update\" function for node rendering which will be triggered after the following events:\n * - Full node update (`nodeUpdateCustomRenderFunction`);\n * - Background click;\n * - Node and Link mouseover and mouseout;\n * - Node brushing,\n * Default: `undefined` */\n nodePartialUpdateCustomRenderFunction?:\n (datum: GraphNode<N, L>, nodeGroupElementSelection: Selection<SVGGElement, GraphNode<N, L>, null, unknown>, config: GraphConfigInterface<N, L>, duration: number, zoomLevel: number) => void;\n /** Custom \"exit\" function for node rendering. Default: `undefined` */\n nodeExitCustomRenderFunction?:\n (datum: GraphNode<N, L>, nodeGroupElementSelection: Selection<SVGGElement, GraphNode<N, L>, null, unknown>, config: GraphConfigInterface<N, L>, duration: number, zoomLevel: number) => void;\n /** Custom render function that will be called while zooming / panning the graph. Default: `undefined` */\n nodeOnZoomCustomRenderFunction?:\n (datum: GraphNode<N, L>, nodeGroupElementSelection: Selection<SVGGElement, GraphNode<N, L>, null, unknown>, config: GraphConfigInterface<N, L>, zoomLevel: number) => void;\n /** Define the mode for highlighting selected nodes in the graph. Default: `GraphNodeSelectionHighlightMode.GreyoutNonConnected` */\n nodeSelectionHighlightMode?: GraphNodeSelectionHighlightMode;\n /** Set selected node by unique id. Default: `undefined` */\n selectedNodeId?: number | string;\n /** Set selected nodes by unique id. Default: `undefined` */\n selectedNodeIds?: 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, transform: ZoomTransform) => void;\n /** Zoom start event callback. Default: `undefined` */\n onZoomStart?: (zoomScale: number, zoomScaleExtent: [number, number], event: D3ZoomEvent<SVGGElement, unknown> | undefined, transform: ZoomTransform) => void;\n /** Zoom end event callback. Default: `undefined` */\n onZoomEnd?: (zoomScale: number, zoomScaleExtent: [number, number], event: D3ZoomEvent<SVGGElement, unknown> | undefined, transform: ZoomTransform) => void;\n /** Callback function to be called when the graph layout is calculated. Default: `undefined` */\n onLayoutCalculated?: (nodes: GraphNode<N, L>[], links: GraphLink<N, L>[]) => void;\n /** Graph node selection brush callback function. Default: `undefined` */\n onNodeSelectionBrush?: (selectedNodes: GraphNode<N, L>[], event: D3BrushEvent<SVGGElement> | undefined) => void;\n /** Graph multiple node drag callback function. Default: `undefined` */\n onNodeSelectionDrag?: (selectedNodes: GraphNode<N, L>[], event: D3DragEvent<SVGGElement, GraphNode<N, L>, unknown>) => void;\n /** Callback function to be called when the graph rendering is complete. Default: `undefined` */\n onRenderComplete?: (\n g: Selection<SVGGElement, unknown, null, undefined>,\n nodes: GraphNode<N, L>[],\n links: GraphLink<N, L>[],\n config: GraphConfigInterface<N, L>,\n duration: number,\n zoomLevel: number,\n width: number,\n height: number\n ) => void;\n\n /** Determines whether the component should update when new data is provided.\n * This function takes the previous and new data as parameters and returns a boolean\n * indicating whether the update should proceed. Useful for fine-grained control over\n * update behavior when your data has a complex nested structure.\n * By default the `isEqual` function from Unovis will be used to do the comparison.\n */\n shouldDataUpdate?: (\n prevData: GraphInputData<N, L>,\n nextData: GraphInputData<N, L>,\n datamodel: GraphDataModel<N, L, GraphNode<N, L>, GraphLink<N, L>>\n ) => boolean;\n}\n\nexport const GraphDefaultConfig: GraphConfigInterface<GraphInputNode, GraphInputLink> = {\n ...ComponentDefaultConfig,\n duration: 1000,\n zoomScaleExtent: [0.35, 1.25],\n disableZoom: false,\n zoomEventFilter: undefined,\n disableDrag: false,\n disableBrush: 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 linkHighlightOnHover: true,\n linkSourcePointOffset: undefined,\n linkTargetPointOffset: undefined,\n selectedLinkId: undefined,\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 nodeSelectionHighlightMode: GraphNodeSelectionHighlightMode.GreyoutNonConnected,\n nodeGaugeAnimDuration: 1500,\n\n selectedNodeId: undefined,\n selectedNodeIds: undefined,\n\n panels: undefined,\n\n onNodeDragStart: undefined,\n onNodeDrag: undefined,\n onNodeDragEnd: undefined,\n onZoom: undefined,\n onZoomStart: undefined,\n onZoomEnd: undefined,\n onLayoutCalculated: undefined,\n onNodeSelectionBrush: undefined,\n onNodeSelectionDrag: undefined,\n onRenderComplete: undefined,\n\n shouldDataUpdate: (prevData: GraphInputData<GraphInputNode, GraphInputLink>, nextData: GraphInputData<GraphInputNode, GraphInputLink>): boolean => {\n return !isEqual(prevData, nextData)\n },\n}\n"],"names":[],"mappings":";;;;;AAQA;MAyRa,k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AC1B,UAAU,EAAE,SAAS,EACrB,aAAa,EAAE,SAAS,EACxB,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,SAAS,EACtB,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,SAAS,EAC7B,oBAAoB,EAAE,SAAS,EAC/B,mBAAmB,EAAE,SAAS,EAC9B,gBAAgB,EAAE,SAAS,EAE3B,gBAAgB,EAAE,CAAC,QAAwD,EAAE,QAAwD,KAAa;AAChJ,QAAA,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;AACrC,KAAC;;;;"}
|
|
@@ -60,10 +60,12 @@ function updateLinkLines(selection, config, duration, scale = 1, getLinkArrowDef
|
|
|
60
60
|
const linkColor = getLinkColor(d, config);
|
|
61
61
|
const linkShiftTransform = getLinkShiftTransform(d, config.linkNeighborSpacing);
|
|
62
62
|
const linkLabelData = ensureArray(getValue(d, config.linkLabel, d._indexGlobal));
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
const
|
|
63
|
+
const offsetSource = getValue(d, config.linkSourcePointOffset, i);
|
|
64
|
+
const offsetTarget = getValue(d, config.linkTargetPointOffset, i);
|
|
65
|
+
const x1 = getX(d.source) + ((offsetSource === null || offsetSource === void 0 ? void 0 : offsetSource[0]) || 0);
|
|
66
|
+
const y1 = getY(d.source) + ((offsetSource === null || offsetSource === void 0 ? void 0 : offsetSource[1]) || 0);
|
|
67
|
+
const x2 = getX(d.target) + ((offsetTarget === null || offsetTarget === void 0 ? void 0 : offsetTarget[0]) || 0);
|
|
68
|
+
const y2 = getY(d.target) + ((offsetTarget === null || offsetTarget === void 0 ? void 0 : offsetTarget[1]) || 0);
|
|
67
69
|
const curvature = (_a = getNumber(d, config.linkCurvature, i)) !== null && _a !== void 0 ? _a : 0;
|
|
68
70
|
const cp1x = x1 + (x2 - x1) * 0.5 * curvature;
|
|
69
71
|
const cp1y = y1 + (y2 - y1) * 0.0 * curvature;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/graph/modules/link/index.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\nimport { range, sum } from 'd3-array'\nimport { Transition } from 'd3-transition'\nimport toPx from 'to-px'\n\n// Utils\nimport { throttle, getValue, getNumber, getBoolean, ensureArray } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\nimport { getCSSVariableValueInPixels } from 'utils/misc'\nimport { estimateStringPixelLength } from 'utils/text'\n\n// Types\nimport { GraphInputLink, GraphInputNode } from 'types/graph'\n\n// Local Types\nimport { GraphCircleLabel, GraphLink, GraphLinkArrowStyle, GraphLinkStyle } from '../../types'\n\n// Config\nimport { GraphConfigInterface } from '../../config'\n\n// Helpers\nimport { getX, getY, isInternalHref } from '../node/helper'\nimport {\n getLinkShiftTransform,\n getLinkStrokeWidth,\n getLinkBandWidth,\n getLinkColor,\n getLinkLabelTextColor,\n getLinkArrowStyle,\n LINK_MARKER_WIDTH,\n} from './helper'\nimport { ZoomLevel } from '../zoom-levels'\n\n// Styles\nimport * as generalSelectors from '../../style'\nimport * as linkSelectors from './style'\n\nexport function createLinks<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>\n): void {\n selection.attr('opacity', 0)\n\n selection.append('path')\n .attr('class', linkSelectors.linkSupport)\n\n selection.append('path')\n .attr('class', linkSelectors.link)\n\n selection.append('path')\n .attr('class', linkSelectors.linkBand)\n\n selection.append('use')\n .attr('class', linkSelectors.linkArrow)\n\n selection.append('g')\n .attr('class', linkSelectors.flowGroup)\n .style('opacity', 0)\n .selectAll(`.${linkSelectors.flowCircle}`)\n .data(range(0, 6)).enter()\n .append('circle')\n .attr('class', linkSelectors.flowCircle)\n}\n\n/** Updates the links partially according to their `_state` */\nexport function updateLinksPartial<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n scale: number\n): void {\n const isGreyedOut = (d: GraphLink<N, L>, i: number): boolean => getBoolean(d, config.linkDisabled, i) || d._state.greyout\n selection\n .classed(linkSelectors.greyedOutLink, (d, i) => isGreyedOut(d, i))\n\n selection.each((d, i, elements) => {\n const element = elements[i]\n const group = select(element)\n group.select(`.${linkSelectors.link}`)\n group.select(`.${linkSelectors.linkBand}`)\n const linkSupport = group.select(`.${linkSelectors.linkSupport}`)\n\n linkSupport\n .style('stroke-opacity', (d._state.hovered || d._state.selected) ? 0.2 : 0)\n .style('stroke-width',\n d._state.selected\n ? getLinkBandWidth(d, scale, config) + 5\n : d._state.hovered ? getLinkBandWidth(d, scale, config) + 10 : null\n )\n })\n}\n\nexport function updateLinkLines<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n duration: number,\n scale = 1,\n getLinkArrowDefId: (arrow: GraphLinkArrowStyle | undefined) => string,\n linkPathLengthMap: Map<string, number>\n): Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown> {\n return selection.each((d, i, elements) => {\n const element = elements[i]\n const linkGroup = select(element)\n const link = linkGroup.select<SVGPathElement>(`.${linkSelectors.link}`)\n const linkBand = linkGroup.select<SVGPathElement>(`.${linkSelectors.linkBand}`)\n const linkSupport = linkGroup.select<SVGPathElement>(`.${linkSelectors.linkSupport}`)\n const linkArrow = linkGroup.select<SVGUseElement>(`.${linkSelectors.linkArrow}`)\n const linkColor = getLinkColor(d, config)\n const linkShiftTransform = getLinkShiftTransform(d, config.linkNeighborSpacing)\n const linkLabelData = ensureArray(\n getValue<GraphLink<N, L>, GraphCircleLabel | GraphCircleLabel[]>(d, config.linkLabel, d._indexGlobal)\n )\n const x1 = getX(d.source)\n const y1 = getY(d.source)\n const x2 = getX(d.target)\n const y2 = getY(d.target)\n\n const curvature = getNumber(d, config.linkCurvature, i) ?? 0\n const cp1x = x1 + (x2 - x1) * 0.5 * curvature\n const cp1y = y1 + (y2 - y1) * 0.0 * curvature\n const cp2x = x1 + (x2 - x1) * 0.5 * curvature\n const cp2y = y1 + (y2 - y1) * 1.0 * curvature\n\n const pathData = `M${x1},${y1} C${cp1x},${cp1y} ${cp2x},${cp2y} ${x2},${y2}`\n const linkPathElement = linkSupport.attr('d', pathData).node()\n const cachedLinkPathLength = linkPathLengthMap.get(pathData)\n const pathLength = cachedLinkPathLength ?? linkPathElement.getTotalLength()\n if (!cachedLinkPathLength) linkPathLengthMap.set(pathData, pathLength)\n\n linkSupport\n .style('stroke', linkColor)\n .attr('transform', linkShiftTransform)\n\n link\n .attr('class', linkSelectors.link)\n .style('stroke-width', getLinkStrokeWidth(d, scale, config))\n .style('stroke', linkColor)\n .attr('transform', linkShiftTransform)\n\n smartTransition(link, duration)\n .attr('d', pathData)\n\n linkBand\n .attr('class', linkSelectors.linkBand)\n .attr('transform', linkShiftTransform)\n .style('stroke-width', getLinkBandWidth(d, scale, config))\n .style('stroke', linkColor)\n\n smartTransition(linkBand, duration)\n .attr('d', pathData)\n\n\n // Arrow\n const linkArrowStyle = getLinkArrowStyle(d, config)\n if (linkArrowStyle) {\n const arrowPos = pathLength * (linkLabelData.length ? 0.65 : 0.5)\n const p1 = linkPathElement.getPointAtLength(arrowPos)\n const p2 = linkPathElement.getPointAtLength(arrowPos + 1) // A point very close to p1\n\n // Calculate the angle for the arrowhead\n const angle = Math.atan2(p2.y - p1.y, p2.x - p1.x) * (180 / Math.PI)\n const arrowWasShownBefore = linkArrow.attr('href')\n linkArrow\n .attr('href', `#${getLinkArrowDefId(linkArrowStyle)}`)\n\n smartTransition(linkArrow, arrowWasShownBefore ? duration : 0)\n .attr('fill', linkColor)\n .attr('transform', `translate(${p1.x}, ${p1.y}) rotate(${angle})`)\n } else {\n linkArrow.attr('href', null)\n }\n })\n}\n\nexport function updateLinks<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n duration: number,\n scale = 1,\n getLinkArrowDefId: (arrow: GraphLinkArrowStyle | undefined) => string,\n linkPathLengthMap: Map<string, number>\n): void {\n const { linkFlowParticleSize, linkStyle, linkFlow, linkLabel, linkLabelShiftFromCenter } = config\n if (!selection.size()) return\n\n selection\n .classed(\n linkSelectors.linkDashed,\n d => getValue<GraphLink<N, L>, GraphLinkStyle>(d, linkStyle, d._indexGlobal) === GraphLinkStyle.Dashed\n )\n\n // Update line and arrow positions\n updateLinkLines(selection, config, duration, scale, getLinkArrowDefId, linkPathLengthMap)\n\n // Update labels and link flow (particles) groups\n selection.each((d, i, elements) => {\n const element = elements[i]\n const linkGroup = select(element)\n const flowGroup = linkGroup.select(`.${linkSelectors.flowGroup}`)\n const linkSupport = linkGroup.select<SVGPathElement>(`.${linkSelectors.linkSupport}`)\n const linkPathElement = linkSupport.node()\n const linkColor = getLinkColor(d, config)\n const linkShiftTransform = getLinkShiftTransform(d, config.linkNeighborSpacing)\n const linkLabelData = ensureArray(\n getValue<GraphLink<N, L>, GraphCircleLabel | GraphCircleLabel[]>(d, linkLabel, d._indexGlobal)\n )\n\n // Particle Flow\n flowGroup\n .attr('transform', linkShiftTransform)\n .style('display', getBoolean(d, linkFlow, d._indexGlobal) ? null : 'none')\n\n flowGroup\n .selectAll(`.${linkSelectors.flowCircle}`)\n .attr('r', linkFlowParticleSize / scale)\n .style('fill', linkColor)\n\n smartTransition(flowGroup, duration)\n .style('opacity', scale < ZoomLevel.Level2 ? 0 : 1)\n\n // Labels\n // Preparing the labels before rendering to be able to center them\n const linkLabelsDataPrepared = linkLabelData.map((linkLabelDatum) => {\n const text = linkLabelDatum.text?.toString() || ''\n const shouldRenderUseElement = isInternalHref(text)\n const fontSizePx = toPx(linkLabelDatum.fontSize) ?? getCSSVariableValueInPixels('var(--vis-graph-link-label-font-size)', linkGroup.node())\n const shouldBeRenderedAsCircle = text.length <= 2 || shouldRenderUseElement\n const paddingVertical = 4\n const paddingHorizontal = shouldBeRenderedAsCircle ? paddingVertical : 8\n const estimatedWidthPx = estimateStringPixelLength(text, fontSizePx)\n\n return {\n ...linkLabelDatum,\n _shouldRenderUseElement: shouldRenderUseElement,\n _fontSizePx: fontSizePx,\n _shouldBeRenderedAsCircle: shouldBeRenderedAsCircle,\n _paddingVertical: paddingVertical,\n _paddingHorizontal: paddingHorizontal,\n _estimatedWidthPx: estimatedWidthPx,\n _borderRadius: linkLabelDatum.radius ?? (shouldBeRenderedAsCircle ? fontSizePx : 4),\n _backgroundWidth: (shouldBeRenderedAsCircle ? fontSizePx : estimatedWidthPx) + paddingHorizontal * 2,\n _backgroundHeight: fontSizePx + paddingVertical * 2,\n }\n })\n type GraphCircleLabelPrepared = typeof linkLabelsDataPrepared[0]\n const linkLabelGroups = linkGroup\n .selectAll<SVGGElement, GraphCircleLabelPrepared>(`.${linkSelectors.linkLabelGroup}`)\n .data(linkLabelsDataPrepared, (d: GraphCircleLabelPrepared) => d.text)\n\n const linkLabelGroupsEnter = linkLabelGroups.enter().append('g').attr('class', linkSelectors.linkLabelGroup)\n linkLabelGroupsEnter.each((linkLabelDatum, i, elements) => {\n const linkLabelGroup = select<SVGGElement, GraphCircleLabelPrepared>(elements[i])\n linkLabelGroup.append('rect').attr('class', linkSelectors.linkLabelBackground)\n\n const linkLabelText = linkLabelDatum ? linkLabelDatum.text?.toString() : undefined\n const shouldRenderUseElement = isInternalHref(linkLabelText)\n linkLabelGroup.select<SVGTextElement>(`.${linkSelectors.linkLabelContent}`).remove()\n linkLabelGroup\n .append(shouldRenderUseElement ? 'use' : 'text')\n .attr('class', linkSelectors.linkLabelContent)\n })\n linkLabelGroupsEnter.style('opacity', 0)\n\n const linkLabelGroupsMerged = linkLabelGroups.merge(linkLabelGroupsEnter)\n const linkLabelMargin = 1\n let linkLabelShiftCumulative = -sum(linkLabelsDataPrepared, d => d._backgroundWidth + linkLabelMargin) / 2 // Centering the labels\n const cachedLinkPathLength = linkPathLengthMap.get(linkPathElement.getAttribute('d'))\n const pathLength = cachedLinkPathLength ?? linkPathElement.getTotalLength()\n const linkArrowStyle = getLinkArrowStyle(d, config)\n linkLabelGroupsMerged.each((linkLabelDatum, i, elements) => {\n const element = elements[i]\n const linkLabelGroup = select<SVGGElement, GraphCircleLabelPrepared>(element)\n const linkLabelText = linkLabelDatum.text?.toString()\n const linkLabelContent = linkLabelGroup.select<SVGTextElement | SVGUseElement>(`.${linkSelectors.linkLabelContent}`)\n const linkMarkerWidth = linkArrowStyle ? LINK_MARKER_WIDTH * 2 : 0\n const linkLabelShift = getBoolean(d, linkLabelShiftFromCenter, d._indexGlobal) ? -linkMarkerWidth + 4 : 0\n const linkLabelPos = linkPathElement.getPointAtLength(pathLength / 2 + linkLabelShift + linkLabelShiftCumulative + linkLabelDatum._backgroundWidth / 2)\n const linkLabelTranslate = `translate(${linkLabelPos.x}, ${linkLabelPos.y})`\n const linkLabelBackground = linkLabelGroup.select<SVGRectElement>(`.${linkSelectors.linkLabelBackground}`)\n\n // If the label was not displayed before, we set the initial transform\n if (!linkLabelGroup.attr('transform')) {\n linkLabelGroup.attr('transform', `${linkLabelTranslate} scale(0)`)\n }\n\n const linkLabelColor = linkLabelDatum.textColor ?? getLinkLabelTextColor(linkLabelDatum)\n if (linkLabelDatum._shouldRenderUseElement) {\n linkLabelContent\n .attr('href', linkLabelText)\n .attr('x', -linkLabelDatum._fontSizePx / 2)\n .attr('y', -linkLabelDatum._fontSizePx / 2)\n .attr('width', linkLabelDatum._fontSizePx)\n .attr('height', linkLabelDatum._fontSizePx)\n .style('fill', linkLabelColor)\n .style('color', linkLabelColor) // Setting `color` to be passed to SVGs that use `currentColor`\n } else {\n linkLabelContent\n .text(linkLabelText)\n .attr('dy', '0.1em')\n .style('font-size', linkLabelDatum._fontSizePx)\n .style('fill', linkLabelColor)\n }\n\n linkLabelGroup.attr('hidden', null)\n .style('cursor', linkLabelDatum.cursor)\n\n smartTransition(linkLabelGroup, duration)\n .attr('transform', `${linkLabelTranslate} scale(1)`)\n .style('opacity', 1)\n\n linkLabelBackground\n .attr('x', -linkLabelDatum._backgroundWidth / 2)\n .attr('y', -linkLabelDatum._backgroundHeight / 2)\n .attr('width', linkLabelDatum._backgroundWidth)\n .attr('height', linkLabelDatum._backgroundHeight)\n .attr('rx', linkLabelDatum._borderRadius)\n .style('fill', linkLabelDatum.color)\n\n linkLabelShiftCumulative += linkLabelDatum._backgroundWidth + linkLabelMargin\n })\n\n smartTransition(linkLabelGroups.exit(), duration)\n .style('opacity', 0)\n .remove()\n })\n\n // Pointer Events\n if (duration > 0) {\n selection.attr('pointer-events', 'none')\n const t = smartTransition(selection, duration) as Transition<SVGGElement, GraphLink<N, L>, SVGGElement, GraphLink<N, L>>\n t\n .attr('opacity', 1)\n .on('end interrupt', (d, i, elements) => {\n select(elements[i])\n .attr('pointer-events', 'stroke')\n .attr('opacity', 1)\n })\n } else {\n selection.attr('opacity', 1)\n }\n\n updateLinksPartial(selection, config, scale)\n}\n\nexport function removeLinks<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n duration: number\n): void {\n smartTransition(selection, duration / 2)\n .attr('opacity', 0)\n .remove()\n}\n\nexport function animateLinkFlow<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n scale: number,\n linkPathLengthMap: Map<string, number>\n): void {\n const { linkFlow } = config\n if (scale < ZoomLevel.Level2) return\n\n selection.each((d, i, elements) => {\n const element = elements[i]\n const linkGroup = select(element)\n const flowGroup = linkGroup.select(`.${linkSelectors.flowGroup}`)\n\n const linkPathElement = linkGroup.select<SVGPathElement>(`.${linkSelectors.linkSupport}`).node()\n const cachedLinkPathLength = linkPathLengthMap.get(linkPathElement.getAttribute('d'))\n const pathLength = cachedLinkPathLength ?? linkPathElement.getTotalLength()\n\n if (!getBoolean(d, linkFlow, d._indexGlobal) || !pathLength) return\n const t = d._state.flowAnimTime\n const circles = flowGroup.selectAll(`.${linkSelectors.flowCircle}`)\n\n circles\n .attr('transform', index => {\n const tt = (t + (+index) / (circles.size() - 1)) % 1\n const p = linkPathElement.getPointAtLength(tt * pathLength)\n return `translate(${p.x}, ${p.y})`\n })\n })\n}\n\nexport function zoomLinks<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n scale: number\n): void {\n const { linkFlowParticleSize } = config\n\n selection.classed(generalSelectors.zoomOutLevel2, scale < ZoomLevel.Level2)\n\n selection.select(`.${linkSelectors.flowGroup}`)\n .style('opacity', scale < ZoomLevel.Level2 ? 0 : 1)\n\n selection.selectAll(`.${linkSelectors.flowCircle}`)\n .attr('r', linkFlowParticleSize / scale)\n\n const linkElements = selection.selectAll<SVGGElement, GraphLink<N, L>>(`.${linkSelectors.link}`)\n linkElements\n .style('stroke-width', d => getLinkStrokeWidth(d, scale, config))\n\n const linkBandElements = selection.selectAll<SVGGElement, GraphLink<N, L>>(`.${linkSelectors.linkBand}`)\n linkBandElements\n .style('stroke-width', d => getLinkBandWidth(d, scale, config))\n}\n\nexport const zoomLinksThrottled = throttle(zoomLinks, 500)\n\n"],"names":["linkSelectors.linkSupport","linkSelectors.link","linkSelectors.linkBand","linkSelectors.linkArrow","linkSelectors.flowGroup","linkSelectors.flowCircle","linkSelectors.greyedOutLink","linkSupport","link","linkBand","linkArrow","linkSelectors.linkDashed","flowGroup","linkSelectors.linkLabelGroup","linkSelectors.linkLabelBackground","linkSelectors.linkLabelContent","linkLabelContent","linkLabelBackground","generalSelectors.zoomOutLevel2"],"mappings":";;;;;;;;;;;;;;AAqCM,SAAU,WAAW,CACzB,SAAwE,EAAA;AAExE,IAAA,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;AAE5B,IAAA,SAAS,CAAC,MAAM,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AErD,SAAS,CAAC,SAAS,CAAC,CAAA,CAAA,EAAIC,UAAwB,EAAE,CAAC;AAChD,SAAA,IAAI,CAAC,GAAG,EAAE,oBAAoB,GAAG,KAAK,CAAC,CAAA;AAE1C,IAAA,MAAM,YAAY,GAAG,SAAS,CAAC,SAAS,CAA+B,CAAI,CAAA,EAAAJ,IAAkB,CAAE,CAAA,CAAC,CAAA;IAChG,YAAY;AACT,SAAA,KAAK,CAAC,cAAc,EAAE,CAAC,IAAI,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;AAEnE,IAAA,MAAM,gBAAgB,GAAG,SAAS,CAAC,SAAS,CAA+B,CAAI,CAAA,EAAAC,QAAsB,CAAE,CAAA,CAAC,CAAA;IACxG,gBAAgB;AACb,SAAA,KAAK,CAAC,cAAc,EAAE,CAAC,IAAI,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;AACnE,CAAC;AAEY,MAAA,kBAAkB,GAAG,QAAQ,CAAC,SAAS,EAAE,GAAG;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/graph/modules/link/index.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\nimport { range, sum } from 'd3-array'\nimport { Transition } from 'd3-transition'\nimport toPx from 'to-px'\n\n// Utils\nimport { throttle, getValue, getNumber, getBoolean, ensureArray } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\nimport { getCSSVariableValueInPixels } from 'utils/misc'\nimport { estimateStringPixelLength } from 'utils/text'\n\n// Types\nimport { GraphInputLink, GraphInputNode } from 'types/graph'\n\n// Local Types\nimport { GraphCircleLabel, GraphLink, GraphLinkArrowStyle, GraphLinkStyle } from '../../types'\n\n// Config\nimport { GraphConfigInterface } from '../../config'\n\n// Helpers\nimport { getX, getY, isInternalHref } from '../node/helper'\nimport {\n getLinkShiftTransform,\n getLinkStrokeWidth,\n getLinkBandWidth,\n getLinkColor,\n getLinkLabelTextColor,\n getLinkArrowStyle,\n LINK_MARKER_WIDTH,\n} from './helper'\nimport { ZoomLevel } from '../zoom-levels'\n\n// Styles\nimport * as generalSelectors from '../../style'\nimport * as linkSelectors from './style'\n\nexport function createLinks<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>\n): void {\n selection.attr('opacity', 0)\n\n selection.append('path')\n .attr('class', linkSelectors.linkSupport)\n\n selection.append('path')\n .attr('class', linkSelectors.link)\n\n selection.append('path')\n .attr('class', linkSelectors.linkBand)\n\n selection.append('use')\n .attr('class', linkSelectors.linkArrow)\n\n selection.append('g')\n .attr('class', linkSelectors.flowGroup)\n .style('opacity', 0)\n .selectAll(`.${linkSelectors.flowCircle}`)\n .data(range(0, 6)).enter()\n .append('circle')\n .attr('class', linkSelectors.flowCircle)\n}\n\n/** Updates the links partially according to their `_state` */\nexport function updateLinksPartial<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n scale: number\n): void {\n const isGreyedOut = (d: GraphLink<N, L>, i: number): boolean => getBoolean(d, config.linkDisabled, i) || d._state.greyout\n selection\n .classed(linkSelectors.greyedOutLink, (d, i) => isGreyedOut(d, i))\n\n selection.each((d, i, elements) => {\n const element = elements[i]\n const group = select(element)\n group.select(`.${linkSelectors.link}`)\n group.select(`.${linkSelectors.linkBand}`)\n const linkSupport = group.select(`.${linkSelectors.linkSupport}`)\n\n linkSupport\n .style('stroke-opacity', (d._state.hovered || d._state.selected) ? 0.2 : 0)\n .style('stroke-width',\n d._state.selected\n ? getLinkBandWidth(d, scale, config) + 5\n : d._state.hovered ? getLinkBandWidth(d, scale, config) + 10 : null\n )\n })\n}\n\nexport function updateLinkLines<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n duration: number,\n scale = 1,\n getLinkArrowDefId: (arrow: GraphLinkArrowStyle | undefined) => string,\n linkPathLengthMap: Map<string, number>\n): Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown> {\n return selection.each((d, i, elements) => {\n const element = elements[i]\n const linkGroup = select(element)\n const link = linkGroup.select<SVGPathElement>(`.${linkSelectors.link}`)\n const linkBand = linkGroup.select<SVGPathElement>(`.${linkSelectors.linkBand}`)\n const linkSupport = linkGroup.select<SVGPathElement>(`.${linkSelectors.linkSupport}`)\n const linkArrow = linkGroup.select<SVGUseElement>(`.${linkSelectors.linkArrow}`)\n const linkColor = getLinkColor(d, config)\n const linkShiftTransform = getLinkShiftTransform(d, config.linkNeighborSpacing)\n const linkLabelData = ensureArray(\n getValue<GraphLink<N, L>, GraphCircleLabel | GraphCircleLabel[]>(d, config.linkLabel, d._indexGlobal)\n )\n const offsetSource = getValue(d, config.linkSourcePointOffset, i)\n const offsetTarget = getValue(d, config.linkTargetPointOffset, i)\n const x1 = getX(d.source) + (offsetSource?.[0] || 0)\n const y1 = getY(d.source) + (offsetSource?.[1] || 0)\n const x2 = getX(d.target) + (offsetTarget?.[0] || 0)\n const y2 = getY(d.target) + (offsetTarget?.[1] || 0)\n\n const curvature = getNumber(d, config.linkCurvature, i) ?? 0\n const cp1x = x1 + (x2 - x1) * 0.5 * curvature\n const cp1y = y1 + (y2 - y1) * 0.0 * curvature\n const cp2x = x1 + (x2 - x1) * 0.5 * curvature\n const cp2y = y1 + (y2 - y1) * 1.0 * curvature\n\n const pathData = `M${x1},${y1} C${cp1x},${cp1y} ${cp2x},${cp2y} ${x2},${y2}`\n const linkPathElement = linkSupport.attr('d', pathData).node()\n const cachedLinkPathLength = linkPathLengthMap.get(pathData)\n const pathLength = cachedLinkPathLength ?? linkPathElement.getTotalLength()\n if (!cachedLinkPathLength) linkPathLengthMap.set(pathData, pathLength)\n\n linkSupport\n .style('stroke', linkColor)\n .attr('transform', linkShiftTransform)\n\n link\n .attr('class', linkSelectors.link)\n .style('stroke-width', getLinkStrokeWidth(d, scale, config))\n .style('stroke', linkColor)\n .attr('transform', linkShiftTransform)\n\n smartTransition(link, duration)\n .attr('d', pathData)\n\n linkBand\n .attr('class', linkSelectors.linkBand)\n .attr('transform', linkShiftTransform)\n .style('stroke-width', getLinkBandWidth(d, scale, config))\n .style('stroke', linkColor)\n\n smartTransition(linkBand, duration)\n .attr('d', pathData)\n\n\n // Arrow\n const linkArrowStyle = getLinkArrowStyle(d, config)\n if (linkArrowStyle) {\n const arrowPos = pathLength * (linkLabelData.length ? 0.65 : 0.5)\n const p1 = linkPathElement.getPointAtLength(arrowPos)\n const p2 = linkPathElement.getPointAtLength(arrowPos + 1) // A point very close to p1\n\n // Calculate the angle for the arrowhead\n const angle = Math.atan2(p2.y - p1.y, p2.x - p1.x) * (180 / Math.PI)\n const arrowWasShownBefore = linkArrow.attr('href')\n linkArrow\n .attr('href', `#${getLinkArrowDefId(linkArrowStyle)}`)\n\n smartTransition(linkArrow, arrowWasShownBefore ? duration : 0)\n .attr('fill', linkColor)\n .attr('transform', `translate(${p1.x}, ${p1.y}) rotate(${angle})`)\n } else {\n linkArrow.attr('href', null)\n }\n })\n}\n\nexport function updateLinks<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n duration: number,\n scale = 1,\n getLinkArrowDefId: (arrow: GraphLinkArrowStyle | undefined) => string,\n linkPathLengthMap: Map<string, number>\n): void {\n const { linkFlowParticleSize, linkStyle, linkFlow, linkLabel, linkLabelShiftFromCenter } = config\n if (!selection.size()) return\n\n selection\n .classed(\n linkSelectors.linkDashed,\n d => getValue<GraphLink<N, L>, GraphLinkStyle>(d, linkStyle, d._indexGlobal) === GraphLinkStyle.Dashed\n )\n\n // Update line and arrow positions\n updateLinkLines(selection, config, duration, scale, getLinkArrowDefId, linkPathLengthMap)\n\n // Update labels and link flow (particles) groups\n selection.each((d, i, elements) => {\n const element = elements[i]\n const linkGroup = select(element)\n const flowGroup = linkGroup.select(`.${linkSelectors.flowGroup}`)\n const linkSupport = linkGroup.select<SVGPathElement>(`.${linkSelectors.linkSupport}`)\n const linkPathElement = linkSupport.node()\n const linkColor = getLinkColor(d, config)\n const linkShiftTransform = getLinkShiftTransform(d, config.linkNeighborSpacing)\n const linkLabelData = ensureArray(\n getValue<GraphLink<N, L>, GraphCircleLabel | GraphCircleLabel[]>(d, linkLabel, d._indexGlobal)\n )\n\n // Particle Flow\n flowGroup\n .attr('transform', linkShiftTransform)\n .style('display', getBoolean(d, linkFlow, d._indexGlobal) ? null : 'none')\n\n flowGroup\n .selectAll(`.${linkSelectors.flowCircle}`)\n .attr('r', linkFlowParticleSize / scale)\n .style('fill', linkColor)\n\n smartTransition(flowGroup, duration)\n .style('opacity', scale < ZoomLevel.Level2 ? 0 : 1)\n\n // Labels\n // Preparing the labels before rendering to be able to center them\n const linkLabelsDataPrepared = linkLabelData.map((linkLabelDatum) => {\n const text = linkLabelDatum.text?.toString() || ''\n const shouldRenderUseElement = isInternalHref(text)\n const fontSizePx = toPx(linkLabelDatum.fontSize) ?? getCSSVariableValueInPixels('var(--vis-graph-link-label-font-size)', linkGroup.node())\n const shouldBeRenderedAsCircle = text.length <= 2 || shouldRenderUseElement\n const paddingVertical = 4\n const paddingHorizontal = shouldBeRenderedAsCircle ? paddingVertical : 8\n const estimatedWidthPx = estimateStringPixelLength(text, fontSizePx)\n\n return {\n ...linkLabelDatum,\n _shouldRenderUseElement: shouldRenderUseElement,\n _fontSizePx: fontSizePx,\n _shouldBeRenderedAsCircle: shouldBeRenderedAsCircle,\n _paddingVertical: paddingVertical,\n _paddingHorizontal: paddingHorizontal,\n _estimatedWidthPx: estimatedWidthPx,\n _borderRadius: linkLabelDatum.radius ?? (shouldBeRenderedAsCircle ? fontSizePx : 4),\n _backgroundWidth: (shouldBeRenderedAsCircle ? fontSizePx : estimatedWidthPx) + paddingHorizontal * 2,\n _backgroundHeight: fontSizePx + paddingVertical * 2,\n }\n })\n type GraphCircleLabelPrepared = typeof linkLabelsDataPrepared[0]\n const linkLabelGroups = linkGroup\n .selectAll<SVGGElement, GraphCircleLabelPrepared>(`.${linkSelectors.linkLabelGroup}`)\n .data(linkLabelsDataPrepared, (d: GraphCircleLabelPrepared) => d.text)\n\n const linkLabelGroupsEnter = linkLabelGroups.enter().append('g').attr('class', linkSelectors.linkLabelGroup)\n linkLabelGroupsEnter.each((linkLabelDatum, i, elements) => {\n const linkLabelGroup = select<SVGGElement, GraphCircleLabelPrepared>(elements[i])\n linkLabelGroup.append('rect').attr('class', linkSelectors.linkLabelBackground)\n\n const linkLabelText = linkLabelDatum ? linkLabelDatum.text?.toString() : undefined\n const shouldRenderUseElement = isInternalHref(linkLabelText)\n linkLabelGroup.select<SVGTextElement>(`.${linkSelectors.linkLabelContent}`).remove()\n linkLabelGroup\n .append(shouldRenderUseElement ? 'use' : 'text')\n .attr('class', linkSelectors.linkLabelContent)\n })\n linkLabelGroupsEnter.style('opacity', 0)\n\n const linkLabelGroupsMerged = linkLabelGroups.merge(linkLabelGroupsEnter)\n const linkLabelMargin = 1\n let linkLabelShiftCumulative = -sum(linkLabelsDataPrepared, d => d._backgroundWidth + linkLabelMargin) / 2 // Centering the labels\n const cachedLinkPathLength = linkPathLengthMap.get(linkPathElement.getAttribute('d'))\n const pathLength = cachedLinkPathLength ?? linkPathElement.getTotalLength()\n const linkArrowStyle = getLinkArrowStyle(d, config)\n linkLabelGroupsMerged.each((linkLabelDatum, i, elements) => {\n const element = elements[i]\n const linkLabelGroup = select<SVGGElement, GraphCircleLabelPrepared>(element)\n const linkLabelText = linkLabelDatum.text?.toString()\n const linkLabelContent = linkLabelGroup.select<SVGTextElement | SVGUseElement>(`.${linkSelectors.linkLabelContent}`)\n const linkMarkerWidth = linkArrowStyle ? LINK_MARKER_WIDTH * 2 : 0\n const linkLabelShift = getBoolean(d, linkLabelShiftFromCenter, d._indexGlobal) ? -linkMarkerWidth + 4 : 0\n const linkLabelPos = linkPathElement.getPointAtLength(pathLength / 2 + linkLabelShift + linkLabelShiftCumulative + linkLabelDatum._backgroundWidth / 2)\n const linkLabelTranslate = `translate(${linkLabelPos.x}, ${linkLabelPos.y})`\n const linkLabelBackground = linkLabelGroup.select<SVGRectElement>(`.${linkSelectors.linkLabelBackground}`)\n\n // If the label was not displayed before, we set the initial transform\n if (!linkLabelGroup.attr('transform')) {\n linkLabelGroup.attr('transform', `${linkLabelTranslate} scale(0)`)\n }\n\n const linkLabelColor = linkLabelDatum.textColor ?? getLinkLabelTextColor(linkLabelDatum)\n if (linkLabelDatum._shouldRenderUseElement) {\n linkLabelContent\n .attr('href', linkLabelText)\n .attr('x', -linkLabelDatum._fontSizePx / 2)\n .attr('y', -linkLabelDatum._fontSizePx / 2)\n .attr('width', linkLabelDatum._fontSizePx)\n .attr('height', linkLabelDatum._fontSizePx)\n .style('fill', linkLabelColor)\n .style('color', linkLabelColor) // Setting `color` to be passed to SVGs that use `currentColor`\n } else {\n linkLabelContent\n .text(linkLabelText)\n .attr('dy', '0.1em')\n .style('font-size', linkLabelDatum._fontSizePx)\n .style('fill', linkLabelColor)\n }\n\n linkLabelGroup.attr('hidden', null)\n .style('cursor', linkLabelDatum.cursor)\n\n smartTransition(linkLabelGroup, duration)\n .attr('transform', `${linkLabelTranslate} scale(1)`)\n .style('opacity', 1)\n\n linkLabelBackground\n .attr('x', -linkLabelDatum._backgroundWidth / 2)\n .attr('y', -linkLabelDatum._backgroundHeight / 2)\n .attr('width', linkLabelDatum._backgroundWidth)\n .attr('height', linkLabelDatum._backgroundHeight)\n .attr('rx', linkLabelDatum._borderRadius)\n .style('fill', linkLabelDatum.color)\n\n linkLabelShiftCumulative += linkLabelDatum._backgroundWidth + linkLabelMargin\n })\n\n smartTransition(linkLabelGroups.exit(), duration)\n .style('opacity', 0)\n .remove()\n })\n\n // Pointer Events\n if (duration > 0) {\n selection.attr('pointer-events', 'none')\n const t = smartTransition(selection, duration) as Transition<SVGGElement, GraphLink<N, L>, SVGGElement, GraphLink<N, L>>\n t\n .attr('opacity', 1)\n .on('end interrupt', (d, i, elements) => {\n select(elements[i])\n .attr('pointer-events', 'stroke')\n .attr('opacity', 1)\n })\n } else {\n selection.attr('opacity', 1)\n }\n\n updateLinksPartial(selection, config, scale)\n}\n\nexport function removeLinks<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n duration: number\n): void {\n smartTransition(selection, duration / 2)\n .attr('opacity', 0)\n .remove()\n}\n\nexport function animateLinkFlow<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n scale: number,\n linkPathLengthMap: Map<string, number>\n): void {\n const { linkFlow } = config\n if (scale < ZoomLevel.Level2) return\n\n selection.each((d, i, elements) => {\n const element = elements[i]\n const linkGroup = select(element)\n const flowGroup = linkGroup.select(`.${linkSelectors.flowGroup}`)\n\n const linkPathElement = linkGroup.select<SVGPathElement>(`.${linkSelectors.linkSupport}`).node()\n const cachedLinkPathLength = linkPathLengthMap.get(linkPathElement.getAttribute('d'))\n const pathLength = cachedLinkPathLength ?? linkPathElement.getTotalLength()\n\n if (!getBoolean(d, linkFlow, d._indexGlobal) || !pathLength) return\n const t = d._state.flowAnimTime\n const circles = flowGroup.selectAll(`.${linkSelectors.flowCircle}`)\n\n circles\n .attr('transform', index => {\n const tt = (t + (+index) / (circles.size() - 1)) % 1\n const p = linkPathElement.getPointAtLength(tt * pathLength)\n return `translate(${p.x}, ${p.y})`\n })\n })\n}\n\nexport function zoomLinks<N extends GraphInputNode, L extends GraphInputLink> (\n selection: Selection<SVGGElement, GraphLink<N, L>, SVGGElement, unknown>,\n config: GraphConfigInterface<N, L>,\n scale: number\n): void {\n const { linkFlowParticleSize } = config\n\n selection.classed(generalSelectors.zoomOutLevel2, scale < ZoomLevel.Level2)\n\n selection.select(`.${linkSelectors.flowGroup}`)\n .style('opacity', scale < ZoomLevel.Level2 ? 0 : 1)\n\n selection.selectAll(`.${linkSelectors.flowCircle}`)\n .attr('r', linkFlowParticleSize / scale)\n\n const linkElements = selection.selectAll<SVGGElement, GraphLink<N, L>>(`.${linkSelectors.link}`)\n linkElements\n .style('stroke-width', d => getLinkStrokeWidth(d, scale, config))\n\n const linkBandElements = selection.selectAll<SVGGElement, GraphLink<N, L>>(`.${linkSelectors.linkBand}`)\n linkBandElements\n .style('stroke-width', d => getLinkBandWidth(d, scale, config))\n}\n\nexport const zoomLinksThrottled = throttle(zoomLinks, 500)\n\n"],"names":["linkSelectors.linkSupport","linkSelectors.link","linkSelectors.linkBand","linkSelectors.linkArrow","linkSelectors.flowGroup","linkSelectors.flowCircle","linkSelectors.greyedOutLink","linkSupport","link","linkBand","linkArrow","linkSelectors.linkDashed","flowGroup","linkSelectors.linkLabelGroup","linkSelectors.linkLabelBackground","linkSelectors.linkLabelContent","linkLabelContent","linkLabelBackground","generalSelectors.zoomOutLevel2"],"mappings":";;;;;;;;;;;;;;AAqCM,SAAU,WAAW,CACzB,SAAwE,EAAA;AAExE,IAAA,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;AAE5B,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;AACrB,SAAA,IAAI,CAAC,OAAO,EAAEA,WAAyB,CAAC,CAAA;AAE3C,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;AACrB,SAAA,IAAI,CAAC,OAAO,EAAEC,IAAkB,CAAC,CAAA;AAEpC,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;AACrB,SAAA,IAAI,CAAC,OAAO,EAAEC,QAAsB,CAAC,CAAA;AAExC,IAAA,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC;AACpB,SAAA,IAAI,CAAC,OAAO,EAAEC,SAAuB,CAAC,CAAA;AAEzC,IAAA,SAAS,CAAC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CAAC,MAAM,CAAC,CAAA,CAAA,EAAId,SAAuB,EAAE,CAAC;AAC5C,SAAA,KAAK,CAAC,SAAS,EAAE,KAAK,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;IAErD,SAAS,CAAC,SAAS,CAAC,CAAA,CAAA,EAAIC,UAAwB,EAAE,CAAC;AAChD,SAAA,IAAI,CAAC,GAAG,EAAE,oBAAoB,GAAG,KAAK,CAAC,CAAA;AAE1C,IAAA,MAAM,YAAY,GAAG,SAAS,CAAC,SAAS,CAA+B,CAAI,CAAA,EAAAJ,IAAkB,CAAE,CAAA,CAAC,CAAA;IAChG,YAAY;AACT,SAAA,KAAK,CAAC,cAAc,EAAE,CAAC,IAAI,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;AAEnE,IAAA,MAAM,gBAAgB,GAAG,SAAS,CAAC,SAAS,CAA+B,CAAI,CAAA,EAAAC,QAAsB,CAAE,CAAA,CAAC,CAAA;IACxG,gBAAgB;AACb,SAAA,KAAK,CAAC,cAAc,EAAE,CAAC,IAAI,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;AACnE,CAAC;AAEY,MAAA,kBAAkB,GAAG,QAAQ,CAAC,SAAS,EAAE,GAAG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unovis/ts",
|
|
3
3
|
"description": "Modular data visualization framework for React, Angular, Svelte, Vue, Solid, and vanilla TypeScript or JavaScript",
|
|
4
|
-
"version": "1.5.1-exf.
|
|
4
|
+
"version": "1.5.1-exf.7",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/f5/unovis.git",
|