@deck.gl-community/graph-layers 9.2.8 → 9.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/graph-style-schema.cdn.js +1 -1
- package/dist/graph-style-schema.json +1 -1
- package/dist/index.cjs +16 -24
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/layers/common-layers/grid-layer/grid-layer.d.ts +1 -0
- package/dist/layers/common-layers/grid-layer/grid-layer.d.ts.map +1 -1
- package/dist/layers/common-layers/grid-layer/grid-layer.js +1 -0
- package/dist/layers/common-layers/grid-layer/grid-layer.js.map +1 -1
- package/dist/layers/common-layers/zoomable-text-layer/zoomable-text-layer.d.ts +0 -6
- package/dist/layers/common-layers/zoomable-text-layer/zoomable-text-layer.d.ts.map +1 -1
- package/dist/layers/common-layers/zoomable-text-layer/zoomable-text-layer.js +20 -23
- package/dist/layers/common-layers/zoomable-text-layer/zoomable-text-layer.js.map +1 -1
- package/dist/loaders/dot-graph-loader.js +1 -1
- package/dist/loaders/dot-graph-loader.js.map +1 -1
- package/dist/loaders/json-graph-loader.js +1 -1
- package/dist/loaders/json-graph-loader.js.map +1 -1
- package/package.json +9 -9
- package/src/index.ts +2 -1
- package/src/layers/common-layers/grid-layer/grid-layer.ts +1 -0
- package/src/layers/common-layers/zoomable-text-layer/zoomable-text-layer.ts +23 -24
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/graph-data/arrow-graph-data-builder.ts", "../src/graph/graph-normalization.ts", "../src/graph/node.ts", "../src/graph/edge.ts", "../src/utils/log.ts", "../src/core/cache.ts", "../src/graph/graph.ts", "../src/graph/classic-graph.ts", "../src/graph-data/plain-graph-data-builder.ts", "../src/graph/functions/arrow-utils.ts", "../src/graph/arrow-graph.ts", "../src/core/graph-layout.ts", "../src/style/graph-style-engine.ts", "../src/style/style-property.ts", "../src/style/stylesheet-engine.ts", "../src/style/graph-stylesheet-schema.ts", "../src/style/graph-style-accessor-map.ts", "../src/core/graph-engine.ts", "../src/layouts/simple-layout.ts", "../src/layouts/d3-force/d3-force-layout.ts", "../src/layouts/d3-dag/d3-dag-layout.ts", "../src/layouts/d3-dag/collapsable-d3-dag-layout.ts", "../src/layouts/gpu-force/gpu-force-layout.ts", "../src/layouts/experimental/radial-layout.ts", "../src/layouts/experimental/force-multi-graph-layout.ts", "../src/layouts/experimental/hive-plot-layout.ts", "../src/layers/graph-layer.ts", "../src/style/graph-layer-stylesheet.ts", "../src/layers/node-layers/circle-layer.ts", "../src/layers/node-layers/image-layer.ts", "../src/layers/node-layers/label-layer.ts", "../src/layers/common-layers/zoomable-text-layer/zoomable-text-layer.ts", "../src/layers/node-layers/rectangle-layer.ts", "../src/layers/node-layers/rounded-rectangle-layer-fragment.ts", "../src/layers/node-layers/rounded-rectangle-layer.ts", "../src/layers/node-layers/path-rounded-rectangle-layer.ts", "../src/utils/polygon-calculations.ts", "../src/layers/node-layers/zoomable-marker-layer.ts", "../src/layers/common-layers/marker-layer/marker-layer.ts", "../src/layers/common-layers/marker-layer/marker-mapping.ts", "../src/layers/common-layers/marker-layer/atlas-data-url.ts", "../src/layers/edge-layer.ts", "../src/layers/edge-layers/straight-line-edge-layer.ts", "../src/layers/edge-layers/path-edge-layer.ts", "../src/layers/edge-layers/curved-edge-layer.ts", "../src/layers/common-layers/spline-layer/spline-layer.ts", "../src/layers/edge-layers/edge-label-layer.ts", "../src/layers/edge-layers/flow-layer.ts", "../src/layers/common-layers/flow-path-layer/flow-path-layer.ts", "../src/layers/common-layers/flow-path-layer/flow-path-layer-vertex.glsl.ts", "../src/layers/common-layers/flow-path-layer/flow-path-layer-fragment.glsl.ts", "../src/layers/edge-layers/edge-arrow-layer.ts", "../src/layers/edge-layers/arrow-2d-geometry.ts", "../src/utils/node-boundary.ts", "../src/layers/edge-attachment-helper.ts", "../src/layers/common-layers/grid-layer/grid-layer.ts", "../src/utils/layer-utils.ts", "../src/utils/collapsed-chains.ts", "../src/core/interaction-manager.ts", "../src/utils/rank-grid.ts", "../src/graph-data/graph-data.ts", "../src/graph/functions/create-graph-from-data.ts", "../src/loaders/json-graph-loader.ts", "../src/loaders/dot-graph-loader.ts", "../src/_deprecated/old-constants.ts"],
|
|
4
|
-
"sourcesContent": ["// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// Graph Data - output from loaders, input to writers\n\nexport type {\n GraphData,\n PlainGraphData,\n ArrowGraphData /* , GraphNodeData, GraphEdgeData */\n} from './graph-data/graph-data';\nexport type {\n GraphDataBuilder /* , GraphDataBuilderOptions */\n} from './graph-data/graph-data-builder';\nexport {\n ArrowGraphDataBuilder,\n type ArrowGraphDataBuilderOptions\n} from './graph-data/arrow-graph-data-builder';\n\n// core - Graph representation and layout\nexport type {Graph, NodeInterface, EdgeInterface} from './graph/graph';\nexport {Node} from './graph/node';\nexport {Edge} from './graph/edge';\n\nexport {ClassicGraph} from './graph/classic-graph';\nexport {ArrowGraph} from './graph/arrow-graph';\n// export {\n// TabularGraph,\n// TabularNode,\n// TabularEdge,\n// type NodeIndex,\n// type EdgeIndex,\n// type TabularGraphSource,\n// type TabularGraphAccessors,\n// type TabularNodeAccessors,\n// type TabularEdgeAccessors\n// } from './graph/tabular-graph';\n\n// Graph Engine\n\nexport {GraphEngine} from './core/graph-engine';\n\n// graph-layers layouts\nexport type {GraphLayoutProps, GraphLayoutState, GraphLayoutEventDetail} from './core/graph-layout';\nexport {GraphLayout} from './core/graph-layout';\n\nexport {SimpleLayout} from './layouts/simple-layout';\nexport {D3ForceLayout} from './layouts/d3-force/d3-force-layout';\nexport {D3DagLayout} from './layouts/d3-dag/d3-dag-layout';\nexport {CollapsableD3DagLayout} from './layouts/d3-dag/collapsable-d3-dag-layout';\nexport {GPUForceLayout} from './layouts/gpu-force/gpu-force-layout';\nexport {RadialLayout} from './layouts/experimental/radial-layout';\nexport {ForceMultiGraphLayout} from './layouts/experimental/force-multi-graph-layout';\nexport {HivePlotLayout} from './layouts/experimental/hive-plot-layout';\n\nexport type {\n Marker,\n NodeState,\n NodeType,\n EdgeType,\n EdgeDecoratorType,\n LayoutState\n} from './core/constants';\n\n// deck.gl components\nexport {GraphLayer} from './layers/graph-layer';\nexport type {RankGridConfig} from './layers/graph-layer';\nexport {EdgeLayer} from './layers/edge-layer';\nexport {\n GridLayer,\n type GridLayerProps,\n type GridLineDatum\n} from './layers/common-layers/grid-layer/grid-layer';\nexport {StylesheetEngine} from './style/stylesheet-engine';\nexport {GraphStylesheetEngine, GraphStyleEngine} from './style/graph-style-engine';\nexport type {\n GraphStylesheet,\n GraphStyleRule,\n GraphStyleRuleParsed,\n GraphStylesheetParsed,\n GraphStyleAttributeReference,\n GraphStyleScale,\n GraphStyleScaleType,\n GraphStyleValue\n} from './style/graph-style-engine';\nexport {GraphStylesheetSchema} from './style/graph-style-engine';\nexport {\n DEFAULT_GRAPH_LAYER_STYLESHEET,\n type GraphLayerStylesheet,\n type GraphLayerEdgeStyle,\n type GraphLayerNodeStyle\n} from './style/graph-layer-stylesheet';\n\n// utils\nexport {mixedGetPosition} from './utils/layer-utils';\nexport {log} from './utils/log';\nexport {\n mapRanksToYPositions,\n selectRankLines,\n type RankAccessor,\n type LabelAccessor,\n type RankPosition,\n type MapRanksToYPositionsOptions,\n type SelectRankLinesOptions\n} from './utils/rank-grid';\n\n// graph format loaders\nexport {JSONGraphLoader, type JSONGraphLoaderOptions} from './loaders/json-graph-loader';\n\nexport {\n DOTGraphLoader,\n type DOTGraphLoaderOptions,\n type DOTGraphLoaderMetadata\n} from './loaders/dot-graph-loader';\n\n// Deprecated exports\nexport {\n MARKER_TYPE,\n NODE_STATE,\n EDGE_STATE,\n NODE_TYPE,\n EDGE_TYPE,\n EDGE_DECORATOR_TYPE,\n LAYOUT_STATE\n} from './_deprecated/old-constants';\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// eslint-disable-next-line import/no-unresolved\nimport * as arrow from 'apache-arrow';\n\nimport type {EdgeState, NodeState} from '../core/constants';\nimport type {GraphEdgeData, GraphNodeData, ArrowGraphData} from './graph-data';\nimport {\n cloneRecord,\n normalizeEdgeState,\n normalizeNodeState,\n normalizeVersion\n} from '../graph/graph-normalization';\n\ntype Builder = ReturnType<typeof arrow.makeBuilder>;\ntype ArrowVector = ReturnType<Builder['toVector']>;\ntype ColumnArray = ReturnType<ArrowVector['toArray']>;\ntype ColumnBuilderMap = Map<string, Builder>;\n\nexport type ArrowGraphDataBuilderOptions = {\n version?: number;\n};\n\nexport class ArrowGraphDataBuilder {\n private readonly nodeBuilders: ColumnBuilderMap = new Map();\n private readonly edgeBuilders: ColumnBuilderMap = new Map();\n\n private nodeLength = 0;\n private edgeLength = 0;\n\n private _version: number;\n\n constructor(options: ArrowGraphDataBuilderOptions = {}) {\n this._version = normalizeVersion(options.version);\n }\n\n get version(): number {\n return this._version;\n }\n\n setVersion(version: unknown): void {\n this._version = normalizeVersion(version);\n }\n\n addNode(node: GraphNodeData): number {\n if (typeof node?.id === 'undefined') {\n throw new Error('Graph node requires an \"id\" field.');\n }\n\n const index = this.nodeLength++;\n const attributes = cloneRecord(node.attributes);\n\n if (typeof node.label !== 'undefined') {\n attributes.label = node.label;\n }\n\n if (typeof node.weight !== 'undefined') {\n attributes.weight = node.weight;\n }\n\n const stateCandidate = node.state ?? (attributes.state as NodeState | undefined);\n const selectableCandidate = node.selectable ?? (attributes.selectable as boolean | undefined);\n const highlightCandidate =\n node.highlightConnectedEdges ?? (attributes.highlightConnectedEdges as boolean | undefined);\n\n this.appendUtf8(this.nodeBuilders, 'id', node.id);\n this.appendUtf8(this.nodeBuilders, 'state', normalizeNodeState(stateCandidate));\n this.appendBoolean(this.nodeBuilders, 'selectable', Boolean(selectableCandidate));\n this.appendBoolean(this.nodeBuilders, 'highlightConnectedEdges', Boolean(highlightCandidate));\n this.appendJson(this.nodeBuilders, 'data', attributes);\n\n return index;\n }\n\n addEdge(edge: GraphEdgeData): number {\n if (\n typeof edge?.id === 'undefined' ||\n typeof edge?.sourceId === 'undefined' ||\n typeof edge?.targetId === 'undefined'\n ) {\n throw new Error('Graph edge requires \"id\", \"sourceId\", and \"targetId\" fields.');\n }\n\n const index = this.edgeLength++;\n const attributes = cloneRecord(edge.attributes);\n\n if (typeof edge.label !== 'undefined') {\n attributes.label = edge.label;\n }\n\n if (typeof edge.weight !== 'undefined') {\n attributes.weight = edge.weight;\n }\n\n const stateCandidate = edge.state ?? (attributes.state as EdgeState | undefined);\n const directedCandidate = edge.directed ?? (attributes.directed as boolean | undefined);\n\n this.appendUtf8(this.edgeBuilders, 'id', edge.id);\n this.appendUtf8(this.edgeBuilders, 'sourceId', edge.sourceId);\n this.appendUtf8(this.edgeBuilders, 'targetId', edge.targetId);\n this.appendBoolean(this.edgeBuilders, 'directed', Boolean(directedCandidate));\n this.appendUtf8(this.edgeBuilders, 'state', normalizeEdgeState(stateCandidate));\n this.appendJson(this.edgeBuilders, 'data', attributes);\n\n return index;\n }\n\n finish(): ArrowGraphData {\n return {\n shape: 'arrow-graph-data',\n version: this._version,\n nodes: tableFromBuilders(this.nodeBuilders),\n edges: tableFromBuilders(this.edgeBuilders)\n };\n }\n\n private appendUtf8(builders: ColumnBuilderMap, columnName: string, value: string | number): void {\n const builder = this.getOrCreateBuilder(builders, columnName, () =>\n arrow.makeBuilder({type: new arrow.Utf8(), nullValues: [null, undefined]})\n );\n builder.append(typeof value === 'number' ? String(value) : value);\n }\n\n private appendBoolean(builders: ColumnBuilderMap, columnName: string, value: boolean): void {\n const builder = this.getOrCreateBuilder(builders, columnName, () =>\n arrow.makeBuilder({type: new arrow.Bool(), nullValues: [null, undefined]})\n );\n builder.append(value);\n }\n\n private appendJson(\n builders: ColumnBuilderMap,\n columnName: string,\n value: Record<string, unknown>\n ): void {\n const builder = this.getOrCreateBuilder(builders, columnName, () =>\n arrow.makeBuilder({type: new arrow.Utf8(), nullValues: [null, undefined]})\n );\n builder.append(JSON.stringify(value));\n }\n\n private getOrCreateBuilder(\n builders: ColumnBuilderMap,\n columnName: string,\n factory: () => Builder\n ): Builder {\n let builder = builders.get(columnName);\n if (!builder) {\n builder = factory();\n builders.set(columnName, builder);\n }\n return builder;\n }\n}\n\nfunction tableFromBuilders(builders: ColumnBuilderMap): arrow.Table {\n const columns: Record<string, ColumnArray> = {};\n\n for (const [columnName, builder] of builders.entries()) {\n builder.finish();\n const vector = builder.toVector();\n columns[columnName] = vector.toArray();\n }\n\n return arrow.tableFromArrays(columns);\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {NodeState, EdgeState} from '../core/constants';\n\nconst NODE_STATES: ReadonlySet<NodeState> = new Set(['default', 'hover', 'dragging', 'selected']);\nconst EDGE_STATES: ReadonlySet<EdgeState> = new Set(['default', 'hover', 'dragging', 'selected']);\n\nexport function normalizeNodeState(state: NodeState | undefined): NodeState {\n if (state && NODE_STATES.has(state)) {\n return state;\n }\n return 'default';\n}\n\nexport function normalizeEdgeState(state: EdgeState | undefined): EdgeState {\n if (state && EDGE_STATES.has(state)) {\n return state;\n }\n return 'default';\n}\n\nexport function normalizeNodeStateColumn(\n source: NodeState[] | undefined,\n length: number\n): NodeState[] {\n const result: NodeState[] = new Array(length);\n for (let i = 0; i < length; i++) {\n result[i] = normalizeNodeState(source?.[i]);\n }\n return result;\n}\n\nexport function normalizeEdgeStateColumn(\n source: EdgeState[] | undefined,\n length: number\n): EdgeState[] {\n const result: EdgeState[] = new Array(length);\n for (let i = 0; i < length; i++) {\n result[i] = normalizeEdgeState(source?.[i]);\n }\n return result;\n}\n\nexport function normalizeBooleanColumn(\n source: boolean[] | undefined,\n length: number,\n fallback: boolean\n): boolean[] {\n const result: boolean[] = new Array(length);\n for (let i = 0; i < length; i++) {\n const candidate = source?.[i];\n result[i] = typeof candidate === 'boolean' ? candidate : fallback;\n }\n return result;\n}\n\nexport function normalizeDataColumn(\n source: Record<string, unknown>[] | undefined,\n length: number\n): Record<string, unknown>[] {\n const result: Record<string, unknown>[] = new Array(length);\n for (let i = 0; i < length; i++) {\n result[i] = cloneRecord(source?.[i]);\n }\n return result;\n}\n\nexport function normalizeVersion(version: unknown): number {\n if (typeof version === 'number' && Number.isFinite(version)) {\n return version;\n }\n return 0;\n}\n\nexport function cloneRecord(value: unknown): Record<string, unknown> {\n if (value && typeof value === 'object') {\n return {...(value as Record<string, unknown>)};\n }\n return {};\n}\n\nexport function cloneDataColumn(\n source: Record<string, unknown>[],\n length: number\n): Record<string, unknown>[] {\n const result: Record<string, unknown>[] = new Array(length);\n for (let i = 0; i < length; i++) {\n result[i] = cloneRecord(source[i]);\n }\n return result;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {NodeState} from '../core/constants';\nimport type {EdgeInterface, NodeInterface} from './graph';\n\n/** Properties for creating a new node */\nexport interface NodeOptions {\n /** the unique ID of the node */\n id: number | string;\n selectable?: boolean;\n highlightConnectedEdges?: boolean;\n /* origin data reference */\n data?: Record<string, unknown>;\n}\n\n/** Basic data structure of a node */\nexport class Node implements NodeInterface {\n public readonly id: string | number;\n /** Keep a reference to origin data. */\n private _data: Record<string, unknown>;\n /** List edges. */\n private _connectedEdges: Record<string, EdgeInterface> = {};\n /** Interaction state of the node. */\n public state: NodeState = 'default';\n /** Can the node be selected? */\n private _selectable: boolean;\n /** Should the state of this node affect the state of the connected edges? */\n private _highlightConnectedEdges: boolean;\n /** Check the type of the object when picking engine gets it. */\n public readonly isNode = true;\n /**\n * The constructor of a node\n */\n constructor({id, selectable = false, highlightConnectedEdges = false, data = {}}: NodeOptions) {\n this.id = id;\n this._data = data;\n this._selectable = selectable;\n this._highlightConnectedEdges = highlightConnectedEdges;\n }\n\n /**\n * Return the ID of the node\n * @return - the ID of the node.\n */\n getId(): string | number {\n return this.id;\n }\n\n /**\n * Return the degree of the node -- includes in-degree and out-degree\n * @return {Number} - the degree of the node.\n */\n getDegree(): number {\n return Object.keys(this._connectedEdges).length;\n }\n\n /**\n * Return the in-degree of the node.\n * @return - the in-degree of the node.\n */\n getInDegree(): number {\n const nodeId = this.getId();\n return this.getConnectedEdges().reduce((count, e) => {\n const isDirected = e.isDirected();\n if (isDirected && e.getTargetNodeId() === nodeId) {\n count += 1;\n }\n return count;\n }, 0);\n }\n\n /**\n * Return the out-degree of the node.\n * @return - the out-degree of the node.\n */\n getOutDegree(): number {\n const nodeId = this.getId();\n return this.getConnectedEdges().reduce((count, e) => {\n const isDirected = e.isDirected();\n if (isDirected && e.getSourceNodeId() === nodeId) {\n count += 1;\n }\n return count;\n }, 0);\n }\n\n /**\n * Return all the IDs of the sibling nodes.\n * @return [description]\n */\n getSiblingIds(): (string | number)[] {\n const nodeId = this.getId();\n return this.getConnectedEdges().reduce(\n (siblings, e) => {\n if (e.getTargetNodeId() === nodeId) {\n siblings.push(e.getSourceNodeId());\n } else {\n siblings.push(e.getTargetNodeId());\n }\n return siblings;\n },\n [] as (string | number)[]\n );\n }\n\n /**\n * Return all the connected edges.\n * @return - an array of the connected edges.\n */\n getConnectedEdges(): EdgeInterface[] {\n return Object.values(this._connectedEdges);\n }\n\n /**\n * Return of the value of the selected property key.\n * @param key - property key.\n * @return - the value of the property or undefined (not found).\n */\n getPropertyValue(key: string): unknown {\n // try to search the key within this object\n if (this.hasOwnProperty(key)) {\n return this[key];\n }\n // try to search the key in the original data reference\n else if (this._data.hasOwnProperty(key)) {\n return this._data[key];\n }\n // otherwise, not found\n return undefined;\n }\n\n /**\n * Set the new node data.\n * @param data - the new data of the node\n */\n setData(data: Record<string, unknown>): void {\n this._data = data;\n }\n\n /**\n * Update a data property.\n * @param key - the key of the property\n * @param value - the value of the property.\n */\n setDataProperty(key: string, value: unknown): void {\n this._data[key] = value;\n }\n\n /**\n * Set node state\n * @param state - the new interaction state of the node\n */\n setState(state: NodeState): void {\n this.state = state;\n }\n\n /**\n * Get node state\n * @returns state - the current interaction state of the node\n */\n getState(): NodeState {\n return this.state;\n }\n\n /**\n * Add connected edges to the node\n * @param edge an edge or an array of edges to be added to this._connectedEdges\n */\n addConnectedEdges(edge: EdgeInterface | EdgeInterface[]): void {\n const iterableEdges = Array.isArray(edge) ? edge : [edge];\n iterableEdges.forEach((e) => {\n this._connectedEdges[e.getId()] = e;\n e.addNode(this);\n });\n }\n\n /**\n * Remove edges from this._connectedEdges\n * @param edge an edge or an array of edges to be removed from this._connectedEdges\n */\n removeConnectedEdges(edge: EdgeInterface | EdgeInterface[]): void {\n const iterableEdges = Array.isArray(edge) ? edge : [edge];\n iterableEdges.forEach((e) => {\n e.removeNode(this);\n delete this._connectedEdges[e.getId()];\n });\n }\n\n /**\n * Clear this._connectedEdges\n */\n clearConnectedEdges(): void {\n Object.values(this._connectedEdges).forEach((e) => e.removeNode(this));\n this._connectedEdges = {};\n }\n\n isSelectable(): boolean {\n return this._selectable;\n }\n\n shouldHighlightConnectedEdges(): boolean {\n return this._highlightConnectedEdges;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// Basic data structure of an edge\nimport type {EdgeState} from '../core/constants';\nimport type {EdgeInterface, NodeInterface} from './graph';\n\nexport interface EdgeOptions {\n /** the unique ID of the edge */\n id: string | number;\n /** the ID of the source node */\n sourceId: string | number;\n /** the ID of the target node */\n targetId: string | number;\n /** whether the edge is directed or not */\n directed?: boolean;\n /** origin data reference */\n data?: Record<string, unknown>;\n}\n\n/** Basic edge data structure */\nexport class Edge implements EdgeInterface {\n /** Unique uuid of the edge. */\n public readonly id: string | number;\n /** ID of the source node. */\n private _sourceId: string | number;\n /** ID of the target node. */\n private _targetId: string | number;\n /** Whether the edge is directed or not. */\n private _directed: boolean;\n /** Origin data reference of the edge. */\n private _data: Record<string, unknown>;\n /** Check the type of the object when picking engine gets it. */\n public readonly isEdge = true;\n /** Nodes at either end of this edge. */\n private readonly _connectedNodes: Record<string, NodeInterface> = {};\n /** Edge state. */\n public state: EdgeState = 'default';\n\n /**\n * The constructor\n * @param options.id - information about the edge\n */\n constructor({id, sourceId, targetId, data, directed = false}: EdgeOptions) {\n this.id = id;\n this._sourceId = sourceId;\n this._targetId = targetId;\n this._directed = directed;\n this._data = data;\n }\n\n /**\n * Return the ID of the edge\n * @return {String|Number} - the ID of the edge.\n */\n getId(): string | number {\n return this.id;\n }\n\n /**\n * Return whether the edge is directed or not.\n * @return {Boolean} true if the edge is directed.\n */\n isDirected(): boolean {\n return this._directed;\n }\n\n /**\n * Get the ID of the source node.\n * @return the ID of the source node.\n */\n getSourceNodeId(): string | number {\n return this._sourceId;\n }\n\n /**\n * Get the ID of the target node.\n * @return the ID of the target node.\n */\n getTargetNodeId(): string | number {\n return this._targetId;\n }\n\n /**\n * Return of the value of the selected property key.\n * @param key - property key.\n * @return - the value of the property.\n */\n getPropertyValue(key: string): unknown {\n // try to search the key within this object\n if (this.hasOwnProperty(key)) {\n return this[key];\n }\n // try to search the key in the original data reference\n else if (this._data.hasOwnProperty(key)) {\n return this._data[key];\n }\n // otherwise, not found\n return undefined;\n }\n\n /**\n * Set the origin data as a reference.\n * @param data - the origin data.\n */\n setData(data: Record<string, unknown>): void {\n this._data = data;\n }\n\n /**\n * Update a data property.\n * @param key - the key of the property\n * @param value - the value of the property.\n */\n setDataProperty(key: string, value: unknown): void {\n this._data[key] = value;\n }\n\n /**\n * Set edge state\n * @param state - the new interaction state for the edge\n */\n setState(state: EdgeState): void {\n this.state = state;\n }\n\n /**\n * Get edge state\n * @returns state - the current interaction state for the edge\n */\n getState(): EdgeState {\n return this.state;\n }\n\n addNode(node: NodeInterface): void {\n this._connectedNodes[node.getId()] = node;\n }\n\n removeNode(node: NodeInterface): void {\n delete this._connectedNodes[node.getId()];\n }\n\n getConnectedNodes(): NodeInterface[] {\n return Object.values(this._connectedNodes);\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Log, COLOR} from '@probe.gl/log';\n\nexport const log = new Log({id: 'graph-layers'}).enable();\n\nlog.log({color: COLOR.CYAN}, 'Initialize graph-layers logger.');\n\nfunction invokeLogFunction(result: unknown) {\n if (typeof result === 'function') {\n result();\n }\n}\n\nexport function warn(message: string, ...args: unknown[]) {\n invokeLogFunction(log.warn(message, ...args));\n}\n\nexport function error(message: string, ...args: unknown[]) {\n invokeLogFunction(log.error(message, ...args));\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport class Cache<K, V> {\n private readonly _keys = new Map<K, {value: V; version: number}>();\n\n /**\n * @param key The key of the cache\n * @returns {*} The value of the cache as set by the `set` method.\n */\n get(key: K): V | undefined {\n return this._keys.get(key)?.value;\n }\n\n /**\n * @param key The key of the cache\n * @param createValue A callback to create the value of the cache if it is needed.\n * @param version The version of the cache. If the version is smaller than the current version, the cache will not be updated.\n */\n set(key: K, createValue: (...args: unknown[]) => V, version: number): void {\n const cached = this._keys.get(key);\n\n const keyUpdated = cached === undefined || version > cached.version;\n if (!keyUpdated) {\n return;\n }\n\n this._keys.set(key, {version, value: createValue()});\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {NodeState, EdgeState} from '../core/constants';\n\n/** Shared interface for graph nodes used by the rendering runtime. */\nexport interface NodeInterface {\n readonly isNode: boolean;\n readonly id: string | number;\n getId(): string | number;\n getDegree(): number;\n getInDegree(): number;\n getOutDegree(): number;\n getSiblingIds(): (string | number)[];\n getConnectedEdges(): EdgeInterface[];\n addConnectedEdges(edge: EdgeInterface | EdgeInterface[]): void;\n removeConnectedEdges(edge: EdgeInterface | EdgeInterface[]): void;\n clearConnectedEdges(): void;\n getPropertyValue(key: string): unknown;\n setData(data: Record<string, unknown>): void;\n setDataProperty(key: string, value: unknown): void;\n setState(state: NodeState): void;\n getState(): NodeState;\n isSelectable(): boolean;\n shouldHighlightConnectedEdges(): boolean;\n}\n\n/** Shared interface for graph edges used by the rendering runtime. */\nexport interface EdgeInterface {\n readonly isEdge: boolean;\n readonly id: string | number;\n getId(): string | number;\n isDirected(): boolean;\n getSourceNodeId(): string | number;\n getTargetNodeId(): string | number;\n getConnectedNodes(): NodeInterface[];\n addNode(node: NodeInterface): void;\n removeNode(node: NodeInterface): void;\n getPropertyValue(key: string): unknown;\n setData(data: Record<string, unknown>): void;\n setDataProperty(key: string, value: unknown): void;\n setState(state: EdgeState): void;\n getState(): EdgeState;\n}\n\nexport type GraphProps = {\n onTransactionStart?: () => void;\n onTransactionEnd?: () => void;\n onNodeAdded?: (node: NodeInterface) => void;\n onNodeRemoved?: (node: NodeInterface) => void;\n onNodeUpdated?: (node: NodeInterface) => void;\n onEdgeAdded?: (edge: EdgeInterface) => void;\n onEdgeRemoved?: (edge: EdgeInterface) => void;\n onEdgeUpdated?: (edge: EdgeInterface) => void;\n};\n\n/** Runtime abstraction consumed by the rendering engine. */\nexport abstract class Graph<PropsT extends GraphProps = GraphProps> {\n private _props: PropsT;\n\n protected constructor(props: PropsT) {\n this._props = {...props};\n }\n\n get props(): PropsT {\n return {...this._props};\n }\n\n setProps(props: PropsT): void {\n this._props = {...props};\n }\n\n updateProps(props: PropsT): void {\n this._props = {...this._props, ...props};\n }\n\n abstract get version(): number;\n abstract getNodes(): Iterable<NodeInterface>;\n abstract getEdges(): Iterable<EdgeInterface>;\n abstract findNode(id: string | number): NodeInterface | undefined;\n findNodeById?(id: string | number): NodeInterface | undefined;\n getGraphName?(): string;\n triggerUpdate?(): void;\n abstract destroy?(): void;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {warn} from '../utils/log';\nimport {Cache} from '../core/cache';\nimport {Edge} from './edge';\nimport {Node} from './node';\nimport type {EdgeInterface, NodeInterface, GraphProps} from './graph';\nimport {Graph} from './graph';\nimport type {PlainGraphData, GraphNodeData, GraphEdgeData} from '../graph-data/graph-data';\nimport {\n cloneRecord,\n normalizeEdgeState,\n normalizeNodeState,\n normalizeVersion\n} from './graph-normalization';\n\nexport type ClassicGraphProps = GraphProps & {\n data: PlainGraphData;\n};\n\n/** Basic graph data structure */\nexport class ClassicGraph extends Graph {\n /** List object of nodes. */\n private _nodeMap: Record<string, Node> = {};\n /** List of object edges. */\n private _edgeMap: Record<string, Edge> = {};\n\n /**\n * Identifies whether performing dirty check when streaming new data. If\n * the name of the graph is not specified, will fall back to current time stamp.\n */\n private _name: string = Date.now().toString();\n /** Version the graph. A version is a number that is incremented every time the graph is updated. */\n public version = 0;\n /** Cached data: create array data from maps. */\n private _cache = new Cache<'nodes' | 'edges', Node[] | Edge[]>();\n private _suspendVersionUpdates = false;\n\n /**\n * The constructor of the graph class.\n * @param props -\n */\n constructor(props: ClassicGraphProps) {\n super(props);\n\n const data = props.data;\n const nodes = createNodesFromPlainGraphData(data?.nodes);\n const edges = createEdgesFromPlainGraphData(data?.edges);\n\n this._name = `unnamed-graph-${Date.now().toString()}`;\n this._suspendVersionUpdates = true;\n this.version = normalizeVersion(data?.version);\n try {\n this.batchAddNodes(nodes);\n this.batchAddEdges(edges);\n } finally {\n this._suspendVersionUpdates = false;\n }\n }\n\n /**\n * Set graph name\n * @param name\n */\n setGraphName(name: string): void {\n this._name = name;\n }\n\n /** Get the name of the graph. Default value is the time stamp when creating this graph.\n * @return graph name.\n */\n getGraphName(): string {\n return this._name.toString();\n }\n\n /**\n * Perform a batch of operations defined by cb before indicating graph is updated\n * @param {function} cb - a callback function containing the operations to perform\n */\n transaction<T>(cb: (...args: unknown[]) => T): T {\n try {\n this.props.onTransactionStart?.();\n return cb();\n } finally {\n this.props.onTransactionEnd?.();\n }\n }\n\n /**\n * Add a new node to the graph.\n * @paramnode - expect a Node object to be added to the graph.\n */\n addNode(node: Node): void {\n // add it to the list and map\n this._nodeMap[node.getId()] = node;\n // update last update time stamp\n this._bumpVersion();\n this.props.onNodeAdded?.(node);\n }\n\n /**\n * Batch add nodes to the graph.\n * @param nodes - a list of nodes to be added.\n */\n batchAddNodes(nodes: Node[]): void {\n // convert an array of objects to an object\n this._nodeMap = nodes.reduce(\n (res, node) => {\n res[node.getId()] = node;\n this.props.onNodeAdded?.(node);\n return res;\n },\n {...this._nodeMap}\n );\n this._bumpVersion();\n }\n\n /**\n * Get all the nodes of the graph.\n * @return {Node[]} - get all the nodes in the graph.\n */\n getNodes(): NodeInterface[] {\n this._updateCache('nodes', () => Object.values(this._nodeMap));\n\n return (this._cache.get('nodes') as Node[]) ?? [];\n }\n\n /**\n * Get the node map of the graph. The key of the map is the ID of the nodes.\n * @return - a map of nodes keyed by node IDs.\n */\n getNodeMap(): Record<string | number, Node> {\n return this._nodeMap;\n }\n\n /**\n * Find a node by id\n * @param nodeId The id of the node\n * @return Node\n */\n findNode(nodeId: string | number): Node | undefined {\n return this._nodeMap[nodeId];\n }\n\n findNodeById(nodeId: string | number): NodeInterface | undefined {\n return this.findNode(nodeId);\n }\n\n /**\n * Update the indicated node to the provided value\n * @param node\n */\n updateNode(node: Node): void {\n this._nodeMap[node.getId()] = node;\n this._bumpVersion();\n this.props.onNodeUpdated?.(node);\n }\n\n /**\n * Add a new edge to the graph.\n * @param edge - expect a Edge object to be added to the graph.\n */\n addEdge(edge: Edge): void {\n const sourceNode = this.findNode(edge.getSourceNodeId());\n const targetNode = this.findNode(edge.getTargetNodeId());\n\n if (!sourceNode || !targetNode) {\n warn(`Unable to add edge ${edge.id}, source or target node is missing.`);\n return;\n }\n\n this._edgeMap[edge.getId()] = edge;\n sourceNode.addConnectedEdges(edge);\n targetNode.addConnectedEdges(edge);\n this._bumpVersion();\n this.props.onEdgeAdded?.(edge);\n }\n\n /**\n * Batch add edges to the graph\n * @param edges - a list of edges to be added.\n */\n batchAddEdges(edges: Edge[]): void {\n edges.forEach((edge) => this.addEdge(edge));\n this._bumpVersion();\n }\n\n /**\n * Update the indicated edge to the provided value\n * @param edge\n */\n updateEdge(edge: Edge): void {\n this._edgeMap[edge.getId()] = edge;\n this._bumpVersion();\n this.props.onEdgeUpdated?.(edge);\n }\n\n /**\n * Remove a node from the graph by node ID\n * @param nodeId - the ID of the target node.\n */\n removeNode(nodeId: string | number): void {\n const node = this.findNode(nodeId);\n if (!node) {\n warn(`Unable to remove node ${nodeId} - doesn't exist`);\n return;\n }\n // remove all edges connect to this node from map\n node.getConnectedEdges().forEach((e) => {\n delete this._edgeMap[e.getId()];\n });\n // remove the node from map\n delete this._nodeMap[nodeId];\n this._bumpVersion();\n this.props.onNodeRemoved?.(node);\n }\n\n /**\n * Get all the edges of the graph.\n * @return get all the edges in the graph.\n */\n getEdges(): EdgeInterface[] {\n this._updateCache('edges', () => Object.values(this._edgeMap));\n\n return (this._cache.get('edges') as Edge[]) ?? [];\n }\n\n destroy(): void {\n // No additional teardown required for the legacy graph implementation.\n }\n\n /**\n * Get the edge map of the graph. The key of the map is the ID of the edges.\n * @return - a map of edges keyed by edge IDs.\n */\n getEdgeMap(): Record<string, Edge> {\n return this._edgeMap;\n }\n\n /**\n * Remove an edge from the graph by the edge ID\n * @param {String|Number} edgeId - the target edge ID.\n */\n removeEdge(edgeId: string | number): void {\n const edge = this.findEdge(edgeId);\n if (!edge) {\n warn(`Unable to remove edge ${edgeId} - doesn't exist`);\n return;\n }\n const sourceNode = this.findNode(edge.getSourceNodeId());\n const targetNode = this.findNode(edge.getTargetNodeId());\n\n delete this._edgeMap[edgeId];\n sourceNode.removeConnectedEdges(edge);\n targetNode.removeConnectedEdges(edge);\n this._bumpVersion();\n this.props.onEdgeRemoved?.(edge);\n }\n\n /**\n * Find the edge by edge ID.\n * @param id - the target edge ID\n * @return - the target edge.\n */\n findEdge(edgeId: string | number): Edge {\n return this._edgeMap[edgeId];\n }\n\n /**\n * Return all the connected edges of a node by nodeID.\n * @param nodeId - the target node ID\n * @return - an array of the connected edges.\n */\n getConnectedEdges(nodeId: string | number): EdgeInterface[] {\n const node = this.findNode(nodeId);\n if (!node) {\n warn(`Unable to find node ${nodeId} - doesn't exist`);\n return [];\n }\n return node.getConnectedEdges();\n }\n\n /**\n * Return all the sibling nodes of a node by nodeID.\n * @param nodeId - the target node ID\n * @return - an array of the sibling nodes.\n */\n getNodeSiblings(nodeId: string | number): Node[] {\n const node = this.findNode(nodeId);\n if (!node) {\n warn(`Unable to find node ${nodeId} - doesn't exist`);\n return [];\n }\n return node.getSiblingIds().map((siblingNodeId) => this.findNode(siblingNodeId));\n }\n\n /**\n * Get the degree of a node.\n * @param nodeId - the target node ID.\n * @return - the degree of the node.\n */\n getDegree(nodeId: string | number): number {\n const node = this.findNode(nodeId);\n if (!node) {\n warn(`Unable to find node ${nodeId} - doesn't exist`);\n return 0;\n }\n return node.getDegree();\n }\n\n /**\n * Clean up all the nodes in the graph.\n */\n resetNodes(): void {\n this._nodeMap = {};\n this._bumpVersion();\n }\n\n /**\n * Clean up all the edges in the graph.\n */\n resetEdges(): void {\n this._edgeMap = {};\n this._bumpVersion();\n }\n\n /**\n * Clean up everything in the graph.\n */\n reset(): void {\n this.resetNodes();\n this.resetEdges();\n this._bumpVersion();\n }\n\n /**\n * @deprecated Prefer interacting with this instance directly.\n */\n getClassicGraph(): ClassicGraph {\n return this;\n }\n\n /**\n * Trigger an update to the graph.\n */\n triggerUpdate(): void {\n this._bumpVersion();\n }\n\n /**\n * Return true if the graph is empty.\n * @return {Boolean} Return true if the graph is empty.\n */\n isEmpty(): boolean {\n return Object.keys(this._nodeMap).length === 0;\n }\n\n /**\n * Check the equality of two graphs data by checking last update time stamp\n * @param graph Another graph to be compared against itself\n * @return true if the graph is the same as itself.\n */\n equals(graph: ClassicGraph): boolean {\n if (!graph || !(graph instanceof ClassicGraph)) {\n return false;\n }\n return this.version === graph.version;\n }\n\n _bumpVersion(): void {\n if (this._suspendVersionUpdates) {\n return;\n }\n this.version += 1;\n }\n\n _updateCache(key: 'nodes' | 'edges', updateValue: unknown): void {\n this._cache.set(key, updateValue as any, this.version);\n }\n}\n\nfunction createNodesFromPlainGraphData(nodes?: GraphNodeData[] | null): Node[] {\n if (!nodes) {\n return [];\n }\n return nodes.map((nodeData) => {\n const nodeAttributes = createNodeAttributesFromPlainData(nodeData);\n const selectable =\n typeof nodeData.selectable === 'boolean'\n ? nodeData.selectable\n : Boolean(nodeAttributes.selectable);\n const highlightConnectedEdges =\n typeof nodeData.highlightConnectedEdges === 'boolean'\n ? nodeData.highlightConnectedEdges\n : Boolean(nodeAttributes.highlightConnectedEdges);\n\n const node = new Node({\n id: nodeData.id,\n selectable,\n highlightConnectedEdges,\n data: nodeAttributes\n });\n node.setState(normalizeNodeState(nodeData.state));\n return node;\n });\n}\n\nfunction createEdgesFromPlainGraphData(edges?: GraphEdgeData[] | null): Edge[] {\n if (!edges) {\n return [];\n }\n return edges.map((edgeData) => {\n const edgeAttributes = createEdgeAttributesFromPlainData(edgeData);\n const directed =\n typeof edgeData.directed === 'boolean' ? edgeData.directed : Boolean(edgeAttributes.directed);\n const edge = new Edge({\n id: edgeData.id,\n sourceId: edgeData.sourceId,\n targetId: edgeData.targetId,\n directed,\n data: edgeAttributes\n });\n edge.setState(normalizeEdgeState(edgeData.state));\n return edge;\n });\n}\n\nfunction createNodeAttributesFromPlainData(node: GraphNodeData): Record<string, unknown> {\n const attributes = cloneRecord(node.attributes);\n if (typeof node.label !== 'undefined') {\n attributes.label = node.label;\n }\n if (typeof node.weight !== 'undefined') {\n attributes.weight = node.weight;\n }\n return attributes;\n}\n\nfunction createEdgeAttributesFromPlainData(edge: GraphEdgeData): Record<string, unknown> {\n const attributes = cloneRecord(edge.attributes);\n if (typeof edge.label !== 'undefined') {\n attributes.label = edge.label;\n }\n if (typeof edge.weight !== 'undefined') {\n attributes.weight = edge.weight;\n }\n return attributes;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {PlainGraphData, GraphEdgeData, GraphNodeData} from './graph-data';\nimport {GraphDataBuilder} from './graph-data-builder';\nimport {cloneRecord, normalizeVersion} from '../graph/graph-normalization';\n\nexport type PlainGraphDataBuilderOptions = {\n version?: number;\n};\n\nexport class PlainGraphDataBuilder implements GraphDataBuilder {\n private readonly nodes: GraphNodeData[] = [];\n private readonly edges: GraphEdgeData[] = [];\n\n private _version: number;\n\n constructor(options: PlainGraphDataBuilderOptions = {}) {\n this._version = normalizeVersion(options.version);\n }\n\n get version(): number {\n return this._version;\n }\n\n setVersion(version: unknown): void {\n this._version = normalizeVersion(version);\n }\n\n get nodeCount(): number {\n return this.nodes.length;\n }\n\n get edgeCount(): number {\n return this.edges.length;\n }\n\n addNode(node: GraphNodeData): number {\n if (typeof node?.id === 'undefined') {\n throw new Error('Graph node requires an \"id\" field.');\n }\n\n const attributes = cloneRecord(node.attributes);\n this._assignNodeAttributes(attributes, node);\n const record: GraphNodeData = {\n ...node,\n attributes\n };\n\n this.nodes.push(record);\n return this.nodes.length - 1;\n }\n\n addEdge(edge: GraphEdgeData): number {\n if (\n typeof edge?.id === 'undefined' ||\n typeof edge?.sourceId === 'undefined' ||\n typeof edge?.targetId === 'undefined'\n ) {\n throw new Error('Graph edge requires \"id\", \"sourceId\", and \"targetId\" fields.');\n }\n\n const attributes = cloneRecord(edge.attributes);\n this._assignEdgeAttributes(attributes, edge);\n const record: GraphEdgeData = {\n ...edge,\n attributes\n };\n\n this.edges.push(record);\n return this.edges.length - 1;\n }\n\n private _assignNodeAttributes(target: Record<string, unknown>, node: GraphNodeData): void {\n if (typeof node.label !== 'undefined') {\n target.label = node.label;\n }\n if (typeof node.weight !== 'undefined') {\n target.weight = node.weight;\n }\n if (typeof node.state !== 'undefined') {\n target.state = node.state;\n }\n if (typeof node.selectable !== 'undefined') {\n target.selectable = node.selectable;\n }\n if (typeof node.highlightConnectedEdges !== 'undefined') {\n target.highlightConnectedEdges = node.highlightConnectedEdges;\n }\n }\n\n private _assignEdgeAttributes(target: Record<string, unknown>, edge: GraphEdgeData): void {\n if (typeof edge.label !== 'undefined') {\n target.label = edge.label;\n }\n if (typeof edge.weight !== 'undefined') {\n target.weight = edge.weight;\n }\n if (typeof edge.state !== 'undefined') {\n target.state = edge.state;\n }\n if (typeof edge.directed !== 'undefined') {\n target.directed = edge.directed;\n }\n }\n\n build(): PlainGraphData {\n return {\n shape: 'plain-graph-data',\n version: this._version,\n nodes: this.nodes.map(cloneNodeData),\n edges: this.edges.map(cloneEdgeData)\n };\n }\n}\n\nfunction cloneNodeData(node: GraphNodeData): GraphNodeData {\n const attributes = cloneRecord(node.attributes);\n return {\n ...node,\n attributes\n };\n}\n\nfunction cloneEdgeData(edge: GraphEdgeData): GraphEdgeData {\n const attributes = cloneRecord(edge.attributes);\n return {\n ...edge,\n attributes\n };\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport * as arrow from 'apache-arrow';\n\nexport function getVectorLength(vector: arrow.Vector | null): number {\n return vector?.length ?? 0;\n}\n\nexport function getVectorValue(vector: arrow.Vector | null, index: number): unknown {\n return vector ? (vector.get?.(index) ?? vector.toArray?.()[index]) : undefined;\n}\n\nexport function getColumnVector(table: arrow.Table, columnName: string): arrow.Vector | null {\n const candidate = (\n table as arrow.Table & {getColumn?: (name: string) => arrow.Vector | null}\n ).getColumn?.(columnName);\n if (candidate) {\n return candidate;\n }\n const childAccessor = (table as arrow.Table & {getChild?: (name: string) => arrow.Vector | null})\n .getChild;\n if (typeof childAccessor === 'function') {\n const vector = childAccessor.call(table, columnName);\n if (vector) {\n return vector;\n }\n }\n const getChildAt = (table as arrow.Table & {getChildAt?: (index: number) => arrow.Vector | null})\n .getChildAt;\n const schema = (table as arrow.Table & {schema?: {fields?: Array<{name: string}>}}).schema;\n if (schema && Array.isArray(schema.fields) && typeof getChildAt === 'function') {\n const index = schema.fields.findIndex((field) => field?.name === columnName);\n if (index >= 0) {\n return getChildAt.call(table, index) ?? null;\n }\n }\n return null;\n}\n\nexport function parseDataRecord(value: unknown): Record<string, unknown> {\n if (typeof value === 'string') {\n try {\n const parsed = JSON.parse(value);\n if (parsed && typeof parsed === 'object') {\n return {...(parsed as Record<string, unknown>)};\n }\n } catch {\n return {};\n }\n } else if (value && typeof value === 'object') {\n return {...(value as Record<string, unknown>)};\n }\n return {};\n}\n\nexport function coerceIdentifier(value: unknown): string | number {\n if (typeof value === 'number') {\n return value;\n }\n if (typeof value === 'string') {\n const trimmed = value.trim();\n if (trimmed !== '') {\n const numeric = Number(trimmed);\n if (!Number.isNaN(numeric) && String(numeric) === trimmed) {\n return numeric;\n }\n }\n return value;\n }\n if (value === null || typeof value === 'undefined') {\n throw new Error('Arrow graph encountered an undefined identifier.');\n }\n return String(value);\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport * as arrow from 'apache-arrow';\n\nimport type {NodeState, EdgeState} from '../core/constants';\nimport type {ArrowGraphData} from '../graph-data/graph-data';\nimport {PlainGraphDataBuilder} from '../graph-data/plain-graph-data-builder';\nimport type {GraphProps, NodeInterface, EdgeInterface} from './graph';\nimport {Graph} from './graph';\nimport {ClassicGraph} from './classic-graph';\nimport {cloneRecord, normalizeEdgeState, normalizeNodeState} from './graph-normalization';\n\nimport {\n getVectorLength,\n getVectorValue,\n getColumnVector,\n parseDataRecord,\n coerceIdentifier\n} from './functions/arrow-utils';\n\ntype NodeOverride = {\n state?: NodeState;\n selectable?: boolean;\n highlightConnectedEdges?: boolean;\n data?: Record<string, unknown>;\n};\n\ntype EdgeOverride = {\n state?: EdgeState;\n directed?: boolean;\n data?: Record<string, unknown>;\n};\n\ntype NodeVectors = {\n id: arrow.Vector | null;\n state: arrow.Vector | null;\n selectable: arrow.Vector | null;\n highlightConnectedEdges: arrow.Vector | null;\n data: arrow.Vector | null;\n};\n\ntype EdgeVectors = {\n id: arrow.Vector | null;\n sourceId: arrow.Vector | null;\n targetId: arrow.Vector | null;\n directed: arrow.Vector | null;\n state: arrow.Vector | null;\n data: arrow.Vector | null;\n};\n\nexport type ArrowGraphProps = GraphProps & {\n data: ArrowGraphData;\n};\n\nexport class ArrowGraph extends Graph<ArrowGraphProps> {\n private readonly nodeTable: arrow.Table;\n private readonly edgeTable: arrow.Table;\n\n private readonly nodeVectors: NodeVectors;\n private readonly edgeVectors: EdgeVectors;\n\n private readonly nodeOverrides: NodeOverride[];\n private readonly edgeOverrides: EdgeOverride[];\n\n private readonly nodeDataCache: Array<Record<string, unknown> | null>;\n private readonly edgeDataCache: Array<Record<string, unknown> | null>;\n\n private readonly nodeEdgeIndices: number[][];\n private nodeIndices: WeakMap<NodeInterface, number> = new WeakMap();\n private edgeIndices: WeakMap<EdgeInterface, number> = new WeakMap();\n\n private readonly nodes: ArrowGraphNode[];\n private readonly edges: ArrowGraphEdge[];\n private readonly nodeMap: Map<string | number, ArrowGraphNode> = new Map();\n\n private readonly _version: number;\n\n constructor(props: ArrowGraphProps) {\n super(props);\n\n this._version = props.data.version;\n this.nodeTable = props.data.nodes;\n this.edgeTable = props.data.edges;\n\n this.nodeVectors = this.extractNodeVectors();\n this.edgeVectors = this.extractEdgeVectors();\n this.assertRequiredColumns();\n\n const nodeCount = getVectorLength(this.nodeVectors.id);\n const edgeCount = getVectorLength(this.edgeVectors.id);\n\n this.nodeOverrides = new Array(nodeCount);\n this.edgeOverrides = new Array(edgeCount);\n this.nodeDataCache = new Array(nodeCount).fill(null);\n this.edgeDataCache = new Array(edgeCount).fill(null);\n this.nodeEdgeIndices = Array.from({length: nodeCount}, () => []);\n\n this.nodes = this.initializeNodes(nodeCount);\n this.edges = this.initializeEdges(edgeCount);\n\n this.registerNodes();\n this.registerEdges();\n }\n\n get version(): number {\n return this._version;\n }\n\n getNodes(): Iterable<NodeInterface> {\n return this.nodes;\n }\n\n getEdges(): Iterable<EdgeInterface> {\n return this.edges;\n }\n\n findNode(id: string | number): NodeInterface | undefined {\n return this.nodeMap.get(id) ?? this.nodeMap.get(String(id));\n }\n\n findNodeById(id: string | number): NodeInterface | undefined {\n return this.findNode(id);\n }\n\n destroy(): void {\n this.nodeMap.clear();\n this.nodeIndices = new WeakMap();\n this.edgeIndices = new WeakMap();\n this.nodeEdgeIndices.length = 0;\n this.nodes.length = 0;\n this.edges.length = 0;\n }\n\n getNodeIdByIndex(index: number): string | number {\n const value = getVectorValue(this.nodeVectors.id, index);\n if (typeof value === 'undefined') {\n throw new Error('Arrow graph requires an id column for nodes.');\n }\n return coerceIdentifier(value);\n }\n\n getNodeStateByIndex(index: number): NodeState {\n const override = this.nodeOverrides[index]?.state;\n if (override) {\n return override;\n }\n const value = getVectorValue(this.nodeVectors.state, index);\n return normalizeNodeState(typeof value === 'string' ? (value as NodeState) : undefined);\n }\n\n setNodeStateByIndex(index: number, state: NodeState): void {\n const override = (this.nodeOverrides[index] ??= {});\n override.state = state;\n }\n\n isNodeSelectableByIndex(index: number): boolean {\n const override = this.nodeOverrides[index]?.selectable;\n if (typeof override === 'boolean') {\n return override;\n }\n const value = getVectorValue(this.nodeVectors.selectable, index);\n return coerceBoolean(value, false);\n }\n\n shouldHighlightConnectedEdgesByIndex(index: number): boolean {\n const override = this.nodeOverrides[index]?.highlightConnectedEdges;\n if (typeof override === 'boolean') {\n return override;\n }\n const value = getVectorValue(this.nodeVectors.highlightConnectedEdges, index);\n return coerceBoolean(value, false);\n }\n\n getNodeDegreeByIndex(index: number): number {\n return this.nodeEdgeIndices[index]?.length ?? 0;\n }\n\n getNodeInDegreeByIndex(index: number): number {\n const id = this.getNodeIdByIndex(index);\n return (this.nodeEdgeIndices[index] ?? []).reduce((count, edgeIndex) => {\n if (this.getEdgeTargetIdByIndex(edgeIndex) === id && this.isEdgeDirectedByIndex(edgeIndex)) {\n return count + 1;\n }\n return count;\n }, 0);\n }\n\n getNodeOutDegreeByIndex(index: number): number {\n const id = this.getNodeIdByIndex(index);\n return (this.nodeEdgeIndices[index] ?? []).reduce((count, edgeIndex) => {\n if (this.getEdgeSourceIdByIndex(edgeIndex) === id && this.isEdgeDirectedByIndex(edgeIndex)) {\n return count + 1;\n }\n return count;\n }, 0);\n }\n\n getNodeSiblingIdsByIndex(index: number): (string | number)[] {\n const id = this.getNodeIdByIndex(index);\n const edges = this.nodeEdgeIndices[index] ?? [];\n const siblings: (string | number)[] = [];\n for (const edgeIndex of edges) {\n const source = this.getEdgeSourceIdByIndex(edgeIndex);\n const target = this.getEdgeTargetIdByIndex(edgeIndex);\n if (source === id) {\n siblings.push(target);\n } else {\n siblings.push(source);\n }\n }\n return siblings;\n }\n\n getNodeConnectedEdgesByIndex(index: number): EdgeInterface[] {\n return (this.nodeEdgeIndices[index] ?? [])\n .map((edgeIndex) => this.edges[edgeIndex])\n .filter((edge): edge is ArrowGraphEdge => Boolean(edge));\n }\n\n setNodeDataByIndex(index: number, data: Record<string, unknown>): void {\n const override = (this.nodeOverrides[index] ??= {});\n override.data = {...data};\n this.nodeDataCache[index] = {...data};\n }\n\n setNodeDataPropertyByIndex(index: number, key: string, value: unknown): void {\n const data = this.getNodeDataInternal(index);\n data[key] = value;\n const override = (this.nodeOverrides[index] ??= {});\n override.data = {...data};\n this.nodeDataCache[index] = {...data};\n }\n\n getNodeDataByIndex(index: number): Record<string, unknown> {\n return cloneRecord(this.getNodeDataInternal(index));\n }\n\n getNodePropertyValueByIndex(index: number, key: string): unknown {\n const data = this.getNodeDataInternal(index);\n if (key in data) {\n return data[key];\n }\n const accessors = this.nodeVectors.data;\n if (!accessors) {\n return undefined;\n }\n return undefined;\n }\n\n registerEdgeForNode(node: NodeInterface, edge: EdgeInterface): void {\n const nodeIndex = this.nodeIndices.get(node);\n const edgeIndex = this.edgeIndices.get(edge);\n if (nodeIndex === undefined || edgeIndex === undefined) {\n return;\n }\n const edges = this.nodeEdgeIndices[nodeIndex];\n if (!edges.includes(edgeIndex)) {\n edges.push(edgeIndex);\n }\n }\n\n unregisterEdgeForNode(node: NodeInterface, edge: EdgeInterface): void {\n const nodeIndex = this.nodeIndices.get(node);\n const edgeIndex = this.edgeIndices.get(edge);\n if (nodeIndex === undefined || edgeIndex === undefined) {\n return;\n }\n const edges = this.nodeEdgeIndices[nodeIndex];\n const next = edges.filter((candidate) => candidate !== edgeIndex);\n this.nodeEdgeIndices[nodeIndex] = next;\n }\n\n getEdgeIdByIndex(index: number): string | number {\n const value = getVectorValue(this.edgeVectors.id, index);\n if (typeof value === 'undefined') {\n throw new Error('Arrow graph requires an id column for edges.');\n }\n return coerceIdentifier(value);\n }\n\n getEdgeStateByIndex(index: number): EdgeState {\n const override = this.edgeOverrides[index]?.state;\n if (override) {\n return override;\n }\n const value = getVectorValue(this.edgeVectors.state, index);\n return normalizeEdgeState(typeof value === 'string' ? (value as EdgeState) : undefined);\n }\n\n setEdgeStateByIndex(index: number, state: EdgeState): void {\n const override = (this.edgeOverrides[index] ??= {});\n override.state = state;\n }\n\n isEdgeDirectedByIndex(index: number): boolean {\n const override = this.edgeOverrides[index]?.directed;\n if (typeof override === 'boolean') {\n return override;\n }\n const value = getVectorValue(this.edgeVectors.directed, index);\n return coerceBoolean(value, false);\n }\n\n getEdgeSourceIdByIndex(index: number): string | number {\n const value = getVectorValue(this.edgeVectors.sourceId, index);\n if (typeof value === 'undefined') {\n throw new Error('Arrow graph requires a sourceId column.');\n }\n return coerceIdentifier(value);\n }\n\n getEdgeTargetIdByIndex(index: number): string | number {\n const value = getVectorValue(this.edgeVectors.targetId, index);\n if (typeof value === 'undefined') {\n throw new Error('Arrow graph requires a targetId column.');\n }\n return coerceIdentifier(value);\n }\n\n getEdgePropertyValueByIndex(index: number, key: string): unknown {\n const data = this.getEdgeDataInternal(index);\n return data[key];\n }\n\n setEdgeDataByIndex(index: number, data: Record<string, unknown>): void {\n const override = (this.edgeOverrides[index] ??= {});\n override.data = {...data};\n this.edgeDataCache[index] = {...data};\n }\n\n setEdgeDataPropertyByIndex(index: number, key: string, value: unknown): void {\n const data = this.getEdgeDataInternal(index);\n data[key] = value;\n const override = (this.edgeOverrides[index] ??= {});\n override.data = {...data};\n this.edgeDataCache[index] = {...data};\n }\n\n getEdgeDataByIndex(index: number): Record<string, unknown> {\n return cloneRecord(this.getEdgeDataInternal(index));\n }\n\n getEdgeConnectedNodesByIndex(index: number): NodeInterface[] {\n return this.edges[index]?.getConnectedNodes() ?? [];\n }\n\n toClassicGraph(): ClassicGraph {\n const builder = new PlainGraphDataBuilder({version: this._version});\n\n const nodeCount = getVectorLength(this.nodeVectors.id);\n for (let index = 0; index < nodeCount; index++) {\n builder.addNode({\n id: this.getNodeIdByIndex(index),\n state: this.getNodeStateByIndex(index),\n selectable: this.isNodeSelectableByIndex(index),\n highlightConnectedEdges: this.shouldHighlightConnectedEdgesByIndex(index),\n attributes: this.getNodeDataByIndex(index)\n });\n }\n\n const edgeCount = getVectorLength(this.edgeVectors.id);\n for (let index = 0; index < edgeCount; index++) {\n builder.addEdge({\n id: this.getEdgeIdByIndex(index),\n sourceId: this.getEdgeSourceIdByIndex(index),\n targetId: this.getEdgeTargetIdByIndex(index),\n directed: this.isEdgeDirectedByIndex(index),\n state: this.getEdgeStateByIndex(index),\n attributes: this.getEdgeDataByIndex(index)\n });\n }\n\n return new ClassicGraph({data: builder.build()});\n }\n\n private getNodeDataInternal(index: number): Record<string, unknown> {\n const override = this.nodeOverrides[index]?.data;\n if (override) {\n return override;\n }\n const cached = this.nodeDataCache[index];\n if (cached) {\n return cached;\n }\n const value = getVectorValue(this.nodeVectors.data, index);\n const data = parseDataRecord(value);\n this.nodeDataCache[index] = data;\n return data;\n }\n\n private getEdgeDataInternal(index: number): Record<string, unknown> {\n const override = this.edgeOverrides[index]?.data;\n if (override) {\n return override;\n }\n const cached = this.edgeDataCache[index];\n if (cached) {\n return cached;\n }\n const value = getVectorValue(this.edgeVectors.data, index);\n const data = parseDataRecord(value);\n this.edgeDataCache[index] = data;\n return data;\n }\n private extractNodeVectors(): NodeVectors {\n return {\n id: getColumnVector(this.nodeTable, 'id'),\n state: getColumnVector(this.nodeTable, 'state'),\n selectable: getColumnVector(this.nodeTable, 'selectable'),\n highlightConnectedEdges: getColumnVector(this.nodeTable, 'highlightConnectedEdges'),\n data: getColumnVector(this.nodeTable, 'data')\n };\n }\n\n private extractEdgeVectors(): EdgeVectors {\n return {\n id: getColumnVector(this.edgeTable, 'id'),\n sourceId: getColumnVector(this.edgeTable, 'sourceId'),\n targetId: getColumnVector(this.edgeTable, 'targetId'),\n directed: getColumnVector(this.edgeTable, 'directed'),\n state: getColumnVector(this.edgeTable, 'state'),\n data: getColumnVector(this.edgeTable, 'data')\n };\n }\n\n private assertRequiredColumns(): void {\n if (!this.nodeVectors.id) {\n throw new Error('Arrow graph requires an \"id\" column for nodes.');\n }\n if (!this.edgeVectors.id || !this.edgeVectors.sourceId || !this.edgeVectors.targetId) {\n throw new Error('Arrow graph requires \"id\", \"sourceId\", and \"targetId\" columns for edges.');\n }\n }\n\n private initializeNodes(count: number): ArrowGraphNode[] {\n return Array.from({length: count}, (_, index) => new ArrowGraphNode(this, index));\n }\n\n private initializeEdges(count: number): ArrowGraphEdge[] {\n return Array.from({length: count}, (_, index) => new ArrowGraphEdge(this, index));\n }\n\n private registerNodes(): void {\n for (let index = 0; index < this.nodes.length; index++) {\n const node = this.nodes[index];\n const id = this.getNodeIdByIndex(index);\n registerNodeVariants(this.nodeMap, id, node);\n this.nodeIndices.set(node, index);\n }\n }\n\n private registerEdges(): void {\n for (let index = 0; index < this.edges.length; index++) {\n const edge = this.edges[index];\n this.edgeIndices.set(edge, index);\n\n const source = this.findNodeById(this.getEdgeSourceIdByIndex(index));\n if (source) {\n edge.addNode(source);\n }\n\n const target = this.findNodeById(this.getEdgeTargetIdByIndex(index));\n if (target) {\n edge.addNode(target);\n }\n }\n }\n}\n\nclass ArrowGraphNode implements NodeInterface {\n public readonly isNode = true;\n\n get id(): string | number {\n return this.getId();\n }\n\n constructor(\n private readonly graph: ArrowGraph,\n private readonly index: number\n ) {}\n\n getId(): string | number {\n return this.graph.getNodeIdByIndex(this.index);\n }\n\n getDegree(): number {\n return this.graph.getNodeDegreeByIndex(this.index);\n }\n\n getInDegree(): number {\n return this.graph.getNodeInDegreeByIndex(this.index);\n }\n\n getOutDegree(): number {\n return this.graph.getNodeOutDegreeByIndex(this.index);\n }\n\n getSiblingIds(): (string | number)[] {\n return this.graph.getNodeSiblingIdsByIndex(this.index);\n }\n\n getConnectedEdges(): EdgeInterface[] {\n return this.graph.getNodeConnectedEdgesByIndex(this.index);\n }\n\n addConnectedEdges(edge: EdgeInterface | EdgeInterface[]): void {\n const edges = Array.isArray(edge) ? edge : [edge];\n for (const candidate of edges) {\n candidate.addNode(this);\n }\n }\n\n removeConnectedEdges(edge: EdgeInterface | EdgeInterface[]): void {\n const edges = Array.isArray(edge) ? edge : [edge];\n for (const candidate of edges) {\n candidate.removeNode(this);\n }\n }\n\n clearConnectedEdges(): void {\n const edges = this.getConnectedEdges();\n for (const edge of edges) {\n edge.removeNode(this);\n }\n }\n\n getPropertyValue(key: string): unknown {\n return this.graph.getNodePropertyValueByIndex(this.index, key);\n }\n\n setData(data: Record<string, unknown>): void {\n this.graph.setNodeDataByIndex(this.index, data);\n }\n\n setDataProperty(key: string, value: unknown): void {\n this.graph.setNodeDataPropertyByIndex(this.index, key, value);\n }\n\n setState(state: NodeState): void {\n this.graph.setNodeStateByIndex(this.index, state);\n }\n\n getState(): NodeState {\n return this.graph.getNodeStateByIndex(this.index);\n }\n\n isSelectable(): boolean {\n return this.graph.isNodeSelectableByIndex(this.index);\n }\n\n shouldHighlightConnectedEdges(): boolean {\n return this.graph.shouldHighlightConnectedEdgesByIndex(this.index);\n }\n}\n\nclass ArrowGraphEdge implements EdgeInterface {\n public readonly isEdge = true;\n private readonly connectedNodes: Map<string | number, NodeInterface> = new Map();\n\n get id(): string | number {\n return this.getId();\n }\n\n constructor(\n private readonly graph: ArrowGraph,\n private readonly index: number\n ) {}\n\n getId(): string | number {\n return this.graph.getEdgeIdByIndex(this.index);\n }\n\n isDirected(): boolean {\n return this.graph.isEdgeDirectedByIndex(this.index);\n }\n\n getSourceNodeId(): string | number {\n return this.graph.getEdgeSourceIdByIndex(this.index);\n }\n\n getTargetNodeId(): string | number {\n return this.graph.getEdgeTargetIdByIndex(this.index);\n }\n\n getConnectedNodes(): NodeInterface[] {\n return [...this.connectedNodes.values()];\n }\n\n addNode(node: NodeInterface): void {\n this.connectedNodes.set(node.getId(), node);\n this.graph.registerEdgeForNode(node, this);\n }\n\n removeNode(node: NodeInterface): void {\n this.connectedNodes.delete(node.getId());\n this.graph.unregisterEdgeForNode(node, this);\n }\n\n getPropertyValue(key: string): unknown {\n return this.graph.getEdgePropertyValueByIndex(this.index, key);\n }\n\n setData(data: Record<string, unknown>): void {\n this.graph.setEdgeDataByIndex(this.index, data);\n }\n\n setDataProperty(key: string, value: unknown): void {\n this.graph.setEdgeDataPropertyByIndex(this.index, key, value);\n }\n\n setState(state: EdgeState): void {\n this.graph.setEdgeStateByIndex(this.index, state);\n }\n\n getState(): EdgeState {\n return this.graph.getEdgeStateByIndex(this.index);\n }\n}\n\nfunction registerNodeVariants(\n map: Map<string | number, ArrowGraphNode>,\n id: string | number,\n node: ArrowGraphNode\n): void {\n map.set(id, node);\n if (typeof id === 'string') {\n const numeric = Number(id);\n if (!Number.isNaN(numeric) && id.trim() !== '') {\n map.set(numeric, node);\n }\n } else {\n map.set(String(id), node);\n }\n}\n\nfunction coerceBoolean(value: unknown, fallback: boolean): boolean {\n if (typeof value === 'boolean') {\n return value;\n }\n if (typeof value === 'number') {\n return value !== 0;\n }\n if (typeof value === 'string') {\n const normalized = value.trim().toLowerCase();\n if (normalized === 'true' || normalized === '1') {\n return true;\n }\n if (normalized === 'false' || normalized === '0' || normalized === '') {\n return false;\n }\n }\n return fallback;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Bounds2D} from '@math.gl/types';\n\nimport type {Graph, NodeInterface, EdgeInterface} from '../graph/graph';\n\nimport isEqual from 'lodash.isequal';\nimport {log} from '../utils/log';\n\n// the status of the layout\nexport type GraphLayoutState = 'init' | 'start' | 'calculating' | 'done' | 'error';\n\nexport type GraphLayoutEventDetail = {\n bounds: Bounds2D | null;\n};\n\nexport type GraphLayoutProps = {\n onLayoutStart?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutChange?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutDone?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutError?: (error?: unknown) => void;\n};\n\nexport abstract class GraphLayout<PropsT extends GraphLayoutProps = GraphLayoutProps> {\n static defaultProps: Readonly<Required<GraphLayoutProps>> = {\n onLayoutStart: undefined,\n onLayoutChange: undefined,\n onLayoutDone: undefined,\n onLayoutError: undefined\n };\n\n get [Symbol.toStringTag](): string {\n return 'GraphLayout';\n }\n\n /** Extra configuration props of the layout. */\n protected props: Required<PropsT>;\n\n /**\n * Last computed layout bounds in local layout coordinates.\n *\n * Subclasses should update this value by overriding {@link _updateBounds}\n * so it reflects the latest geometry before layout lifecycle events fire.\n */\n protected _bounds: Bounds2D | null = null;\n\n public version = 0;\n public state: GraphLayoutState = 'init';\n\n /**\n * Constructor of GraphLayout\n * @param props extra configuration props of the layout\n */\n constructor(props: PropsT, defaultProps?: Required<PropsT>) {\n this.props = {\n ...GraphLayout.defaultProps,\n ...defaultProps,\n ...props\n };\n }\n\n getProps(): PropsT {\n return {...this.props};\n }\n\n setProps(props: Partial<PropsT>): void {\n this.props = {...this.props, ...props};\n }\n\n /**\n * Check the equality of two layouts\n * @param layout - The layout to be compared.\n * @return - True if the layout is the same as itself.\n */\n equals(layout: GraphLayout): boolean {\n if (!layout || !(layout instanceof GraphLayout)) {\n return false;\n }\n return this instanceof layout.constructor && isEqual(this.props, layout.props);\n }\n\n // Accessors\n\n /** access the position of the node in the layout */\n getNodePosition(node: NodeInterface): [number, number] {\n return [0, 0];\n }\n\n /** access the layout information of the edge */\n getEdgePosition(edge: EdgeInterface) {\n return {\n type: 'line',\n sourcePosition: [0, 0],\n targetPosition: [0, 0],\n controlPoints: []\n };\n }\n\n /**\n * Pin the node to a designated position, and the node won't move anymore\n * @param node Node to be locked\n * @param x x coordinate\n * @param y y coordinate\n */\n lockNodePosition(node: NodeInterface, x: number, y: number) {}\n\n /**\n * Unlock the node, the node will be able to move freely.\n * @param {Object} node Node to be unlocked\n */\n unlockNodePosition(node: NodeInterface) {}\n\n /** Returns the last computed layout bounds, if available. */\n getBounds(): Bounds2D | null {\n return this._bounds;\n }\n\n /** virtual functions: will be implemented in the child class */\n\n /** first time to pass the graph data into this layout */\n abstract initializeGraph(graph: Graph): void;\n /** update the existing graph */\n abstract updateGraph(graph: Graph): void;\n /** start the layout calculation */\n abstract start();\n /** update the layout calculation */\n abstract update();\n /** resume the layout calculation */\n abstract resume();\n /** stop the layout calculation */\n abstract stop();\n\n // INTERNAL METHODS\n\n /** Hook for subclasses to update bounds prior to emitting events. */\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n protected _updateBounds(): void {}\n\n /**\n * Utility for subclasses to derive layout bounds from an iterable of [x, y] positions.\n * @param positions Iterable of node positions.\n * @returns Layout bounds for the supplied positions or `null` if none are finite.\n */\n protected _calculateBounds(\n positions: Iterable<Readonly<[number, number]> | null | undefined>\n ): Bounds2D | null {\n let minX = Number.POSITIVE_INFINITY;\n let maxX = Number.NEGATIVE_INFINITY;\n let minY = Number.POSITIVE_INFINITY;\n let maxY = Number.NEGATIVE_INFINITY;\n\n for (const position of positions) {\n if (!position) {\n // eslint-disable-next-line no-continue\n continue;\n }\n const [x, y] = position;\n if (!Number.isFinite(x) || !Number.isFinite(y)) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n\n if (minX === Number.POSITIVE_INFINITY) {\n return null;\n }\n\n return [\n [minX, minY],\n [maxX, maxY]\n ];\n }\n\n /**\n * Attempt to coerce an arbitrary value into a finite 2D point.\n * @param value Candidate value that may represent a position.\n * @returns Finite [x, y] tuple or null if the value cannot be interpreted.\n */\n protected _normalizePosition(value: unknown): [number, number] | null {\n if (Array.isArray(value) && value.length >= 2) {\n const [x, y] = value as [unknown, unknown];\n if (this._isFiniteNumber(x) && this._isFiniteNumber(y)) {\n return [x, y];\n }\n return null;\n }\n\n if (value && typeof value === 'object') {\n const {x, y} = value as {x?: unknown; y?: unknown};\n if (this._isFiniteNumber(x) && this._isFiniteNumber(y)) {\n return [x, y];\n }\n }\n\n return null;\n }\n\n private _isFiniteNumber(value: unknown): value is number {\n return typeof value === 'number' && Number.isFinite(value);\n }\n\n protected _updateState(state: GraphLayoutState) {\n this.state = state;\n this.version += 1;\n }\n\n /** @fires GraphLayout#onLayoutStart */\n protected _onLayoutStart = (): void => {\n log.log(0, `GraphLayout(${this}): start`)();\n this._updateBounds();\n this._updateState('calculating');\n\n /**\n * Layout calculation start.\n * @event GraphLayout#onLayoutChange\n * @type {CustomEvent}\n */\n const detail: GraphLayoutEventDetail = {bounds: this._bounds};\n this.props.onLayoutStart?.(detail);\n };\n\n /** @fires GraphLayout#onLayoutChange */\n protected _onLayoutChange = (): void => {\n log.log(0, `GraphLayout(${this}): update`)();\n this._updateBounds();\n this._updateState('calculating');\n\n /**\n * Layout calculation iteration.\n * @event GraphLayout#onLayoutChange\n * @type {CustomEvent}\n */\n const detail: GraphLayoutEventDetail = {bounds: this._bounds};\n this.props.onLayoutChange?.(detail);\n };\n\n /** @fires GraphLayout#onLayoutDone */\n protected _onLayoutDone = (): void => {\n log.log(0, `GraphLayout(${this}): end`)();\n this._updateBounds();\n this._updateState('done');\n\n /**\n * Layout calculation is done.\n * @event GraphLayout#onLayoutDone\n * @type {CustomEvent}\n */\n const detail: GraphLayoutEventDetail = {bounds: this._bounds};\n this.props.onLayoutDone?.(detail);\n };\n\n /** @fires GraphLayout#onLayoutError */\n protected _onLayoutError = (): void => {\n this._updateState('error');\n\n /**\n * Layout calculation went wrong.\n * @event GraphLayout#onLayoutError\n * @type {CustomEvent}\n */\n this.props.onLayoutError?.();\n };\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable no-continue */\n\nimport {ZodError, type ZodIssue} from 'zod';\n\nimport {StylesheetEngine, type DeckGLUpdateTriggers} from './stylesheet-engine';\nimport {\n GraphStyleRuleSchema,\n type GraphStyleRule,\n type GraphStyleRuleParsed\n} from './graph-stylesheet-schema';\nimport {GRAPH_DECKGL_ACCESSOR_MAP} from './graph-style-accessor-map';\nimport {warn} from '../utils/log';\n\nconst GRAPH_DECKGL_UPDATE_TRIGGERS: DeckGLUpdateTriggers = {\n circle: ['getFillColor', 'getRadius', 'getLineColor', 'getLineWidth'],\n rectangle: ['getFillColor', 'getLineColor', 'getLineWidth'],\n 'rounded-rectangle': ['getFillColor', 'getLineColor', 'getLineWidth', 'getCornerRadius'],\n 'path-rounded-rectangle': ['getFillColor', 'getLineColor', 'getLineWidth', 'getCornerRadius'],\n label: ['getColor', 'getText', 'getSize', 'getTextAnchor', 'getAlignmentBaseline', 'getAngle'],\n marker: ['getColor', 'getSize', 'getMarker'],\n Edge: ['getColor', 'getWidth'],\n edge: ['getColor', 'getWidth'],\n 'edge-label': ['getColor', 'getText', 'getSize', 'getTextAnchor', 'getAlignmentBaseline'],\n flow: ['getColor', 'getWidth', 'getSpeed', 'getTailLength'],\n arrow: ['getColor', 'getSize', 'getOffset']\n};\n\nfunction formatStylesheetError(error: ZodError) {\n const details = error.issues\n .map((issue) => {\n const path = issue.path.length ? issue.path.join('.') : 'root';\n return ` \u2022 ${path}: ${issue.message}`;\n })\n .join('\\n');\n return `Invalid graph stylesheet:\\n${details}`;\n}\n\nexport class GraphStylesheetEngine extends StylesheetEngine {\n constructor(\n style: GraphStyleRule | GraphStyleRuleParsed,\n {stateUpdateTrigger}: {stateUpdateTrigger?: unknown} = {}\n ) {\n const result = GraphStyleRuleSchema.safeParse(style);\n const parsedStyle = result.success\n ? result.data\n : sanitizeStylesheet(style, result.error.issues);\n\n super(parsedStyle as GraphStyleRule, {\n deckglAccessorMap: GRAPH_DECKGL_ACCESSOR_MAP,\n deckglUpdateTriggers: GRAPH_DECKGL_UPDATE_TRIGGERS,\n stateUpdateTrigger\n });\n }\n}\n\nexport const GraphStyleEngine = GraphStylesheetEngine;\nexport type GraphStyleEngine = GraphStylesheetEngine;\n\nexport {\n GraphStyleScaleTypeEnum,\n GraphStyleScaleSchema,\n GraphStyleAttributeReferenceSchema,\n GraphStyleLeafValueSchema,\n GraphStyleStateMapSchema,\n GraphStyleValueSchema,\n GraphStylesheetSchema,\n GraphStyleRuleSchema\n} from './graph-stylesheet-schema';\n\nexport type {\n GraphStylesheet,\n GraphStyleRule,\n GraphStyleRuleParsed,\n GraphStylesheetParsed,\n GraphStyleSelector,\n GraphStyleType,\n GraphStyleAttributeReference,\n GraphStyleLeafValue,\n GraphStyleScale,\n GraphStyleScaleType,\n GraphStyleValue\n} from './graph-stylesheet-schema';\n\nexport {GRAPH_DECKGL_ACCESSOR_MAP} from './graph-style-accessor-map';\n\n// eslint-disable-next-line max-statements, complexity\nfunction sanitizeStylesheet(\n style: GraphStyleRule | GraphStyleRuleParsed,\n issues: ZodIssue[]\n): GraphStyleRuleParsed {\n if (issues.length) {\n const details = issues\n .map((issue) => {\n const path = issue.path.length ? issue.path.join('.') : 'root';\n return `${path}: ${issue.message}`;\n })\n .join('\\n \u2022 ');\n warn(`GraphStyleEngine: stylesheet issues detected:\\n \u2022 ${details}`);\n }\n\n const fallbackTypeCandidate =\n typeof (style as {type?: unknown}).type === 'string'\n ? (style as {type: string}).type\n : undefined;\n const fallbackCandidates = Array.from(\n new Set(\n [fallbackTypeCandidate, 'edge'].filter(\n (value): value is string => typeof value === 'string' && value.length > 0\n )\n )\n );\n\n for (const candidate of fallbackCandidates) {\n const sanitized = cloneValue(style) as Record<string, unknown>;\n sanitized.type = candidate;\n\n for (const issue of issues) {\n if (!Array.isArray(issue.path) || issue.path.length === 0) {\n continue;\n }\n\n const path = issue.path.filter(\n (segment): segment is string | number =>\n typeof segment === 'string' || typeof segment === 'number'\n );\n\n if (path.length === 0) {\n continue;\n }\n\n const [rootKey] = path;\n if (rootKey === undefined || rootKey === 'type') {\n continue;\n }\n\n if (typeof rootKey === 'string' && rootKey.startsWith(':')) {\n removeNestedProperty(sanitized, path);\n continue;\n }\n\n if (typeof rootKey !== 'string') {\n continue;\n }\n\n delete sanitized[rootKey];\n }\n\n const result = GraphStyleRuleSchema.safeParse(sanitized);\n if (result.success) {\n return result.data;\n }\n }\n\n // If every fallback failed, rethrow the detailed error so callers know parsing was impossible.\n throw new Error(formatStylesheetError(new ZodError(issues)));\n}\n\nfunction cloneValue<T>(value: T): T {\n if (Array.isArray(value)) {\n return value.map((item) => cloneValue(item)) as unknown as T;\n }\n if (value && typeof value === 'object') {\n if (value instanceof Date) {\n return new Date(value) as unknown as T;\n }\n if (value instanceof RegExp) {\n return new RegExp(value.source, value.flags) as unknown as T;\n }\n const cloned: Record<string, unknown> = {};\n for (const [key, entryValue] of Object.entries(value as Record<string, unknown>)) {\n cloned[key] = cloneValue(entryValue);\n }\n return cloned as unknown as T;\n }\n return value;\n}\n\n// eslint-disable-next-line max-statements, complexity\nfunction removeNestedProperty(\n target: Record<string, unknown> | unknown[],\n path: (string | number)[]\n) {\n if (path.length === 0) {\n return;\n }\n\n const [head, ...rest] = path;\n if (head === undefined) {\n return;\n }\n\n if (Array.isArray(target)) {\n const index = typeof head === 'number' ? head : Number(head);\n if (!Number.isInteger(index) || index < 0 || index >= target.length) {\n return;\n }\n if (rest.length === 0) {\n target.splice(index, 1);\n return;\n }\n const child = target[index];\n if (!child || typeof child !== 'object') {\n target.splice(index, 1);\n return;\n }\n removeNestedProperty(child as Record<string, unknown> | unknown[], rest);\n if (isEmptyObject(child)) {\n target.splice(index, 1);\n }\n return;\n }\n\n const recordTarget = target;\n\n if (rest.length === 0) {\n delete recordTarget[head as keyof typeof recordTarget];\n return;\n }\n\n const child = recordTarget[head as keyof typeof recordTarget];\n if (!child || typeof child !== 'object') {\n delete recordTarget[head as keyof typeof recordTarget];\n return;\n }\n\n removeNestedProperty(child as Record<string, unknown> | unknown[], rest);\n\n if (isEmptyObject(child)) {\n delete recordTarget[head as keyof typeof recordTarget];\n }\n}\n\nfunction isEmptyObject(value: unknown): boolean {\n if (Array.isArray(value)) {\n return value.length === 0;\n }\n if (!value || typeof value !== 'object') {\n return false;\n }\n return Object.keys(value as Record<string, unknown>).length === 0;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport Color from 'color';\nimport {\n scaleLinear,\n scaleLog,\n scaleOrdinal,\n scalePow,\n scaleQuantile,\n scaleQuantize,\n scaleSqrt\n} from 'd3-scale';\n\nimport {warn} from '../utils/log';\nimport type {\n GraphStyleAttributeReference,\n GraphStyleLeafValue,\n GraphStyleScale,\n GraphStyleScaleType\n} from './graph-style-engine';\n\n/* Utils for type check */\nfunction getColor(value) {\n if (typeof value === 'string') {\n try {\n const color = Color.rgb(value).array();\n if (Number.isFinite(color[3])) {\n color[3] *= 255;\n }\n return color;\n } catch (error) {\n return [0, 0, 0];\n }\n }\n if (Array.isArray(value) && Number.isFinite(value[0])) {\n return value;\n }\n return [0, 0, 0];\n}\n\nfunction getNumber(value) {\n switch (typeof value) {\n case 'string':\n value = Number(value);\n return isNaN(value) ? null : value;\n\n case 'number':\n return value;\n\n default:\n return null;\n }\n}\n\nfunction getBool(value) {\n switch (typeof value) {\n case 'boolean':\n return value;\n\n case 'string':\n return value.toLowerCase() !== 'false';\n\n case 'number':\n return Boolean(value);\n\n default:\n return null;\n }\n}\n\nfunction getOffset(value) {\n if (typeof value === 'function') {\n return value;\n }\n\n if (!Array.isArray(value) || value.length !== 2) {\n return null;\n }\n return value.map(getNumber);\n}\n\nconst IDENTITY = (x) => x;\nconst PROPERTY_FORMATTERS = {\n opacity: getNumber,\n zIndex: getNumber,\n\n width: getNumber,\n height: getNumber,\n radius: getNumber,\n\n fill: getColor,\n stroke: getColor,\n strokeWidth: getNumber,\n\n // for marker\n marker: String,\n size: getNumber,\n\n // text\n color: getColor,\n text: String,\n fontSize: getNumber,\n textAnchor: String,\n alignmentBaseline: String,\n angle: getNumber,\n textMaxWidth: getNumber,\n textWordBreak: String,\n textSizeMinPixels: getNumber,\n\n // edges\n speed: getNumber,\n tailLength: getNumber,\n\n offset: getOffset,\n scaleWithZoom: getBool\n};\n\nconst DEFAULT_STYLES = {\n opacity: 1,\n zIndex: 0,\n\n width: 0,\n height: 0,\n radius: 1,\n\n fill: [0, 0, 0],\n stroke: [0, 0, 0],\n strokeWidth: 0,\n\n marker: 'circle',\n size: 12,\n\n color: [0, 0, 0],\n text: '',\n fontSize: 12,\n textAnchor: 'middle',\n alignmentBaseline: 'center',\n angle: 0,\n textMaxWidth: -1,\n textWordBreak: 'break-all',\n textSizeMinPixels: 9,\n\n speed: 0,\n tailLength: 1,\n\n offset: null,\n scaleWithZoom: true\n};\n\n/** Union of supported D3 scale implementations. */\ntype SupportedScale =\n | ReturnType<typeof scaleLinear>\n | ReturnType<typeof scaleLog>\n | ReturnType<typeof scalePow>\n | ReturnType<typeof scaleQuantize>\n | ReturnType<typeof scaleQuantile>\n | ReturnType<typeof scaleOrdinal>;\n\nconst SCALE_FACTORIES: Record<GraphStyleScaleType, () => SupportedScale> = {\n linear: () => scaleLinear(),\n log: () => scaleLog(),\n pow: () => scalePow(),\n sqrt: () => scaleSqrt(),\n quantize: () => scaleQuantize(),\n quantile: () => scaleQuantile(),\n ordinal: () => scaleOrdinal()\n};\n\n/** Resolved attribute reference with guaranteed defaults. */\ntype NormalizedAttributeReference = {\n attribute: string;\n fallback: unknown;\n scale?: (value: unknown) => unknown;\n scaleConfig?: GraphStyleScale | ((value: unknown) => unknown);\n};\n\n/** Create a D3 scale instance based on a declarative configuration. */\n/* eslint-disable-next-line complexity */\nfunction createScaleFromConfig(config: GraphStyleScale): SupportedScale {\n const type = config.type ?? 'linear';\n const factory = SCALE_FACTORIES[type];\n if (!factory) {\n warn(`Invalid scale type: ${type}`);\n throw new Error(`Invalid scale type: ${type}`);\n }\n const scale = (factory as () => SupportedScale)();\n const anyScale = scale as any;\n if (config.domain && 'domain' in scale) {\n anyScale.domain(config.domain as never);\n }\n if (config.range && 'range' in scale) {\n anyScale.range(config.range as never);\n }\n if (\n typeof config.clamp === 'boolean' &&\n 'clamp' in scale &&\n typeof anyScale.clamp === 'function'\n ) {\n anyScale.clamp(config.clamp);\n }\n if (\n typeof config.nice !== 'undefined' &&\n 'nice' in scale &&\n typeof anyScale.nice === 'function'\n ) {\n anyScale.nice(config.nice as never);\n }\n if (\n type === 'pow' &&\n typeof config.exponent === 'number' &&\n 'exponent' in scale &&\n typeof anyScale.exponent === 'function'\n ) {\n anyScale.exponent(config.exponent);\n }\n if (\n type === 'log' &&\n typeof config.base === 'number' &&\n 'base' in scale &&\n typeof anyScale.base === 'function'\n ) {\n anyScale.base(config.base);\n }\n if (\n typeof config.unknown !== 'undefined' &&\n 'unknown' in scale &&\n typeof (scale as {unknown?: (value: unknown) => unknown}).unknown === 'function'\n ) {\n (scale as {unknown: (value: unknown) => unknown}).unknown(config.unknown);\n }\n return scale;\n}\n\n/** Normalize attribute reference definitions into a consistent structure. */\nfunction normalizeAttributeReference(\n key: string,\n reference: GraphStyleAttributeReference\n): NormalizedAttributeReference {\n if (typeof reference === 'string') {\n const attribute = reference.startsWith('@') ? reference.slice(1) : reference;\n if (!attribute) {\n throw new Error(`Invalid attribute reference for ${key}: ${reference}`);\n }\n return {\n attribute,\n fallback: DEFAULT_STYLES[key]\n };\n }\n\n const {attribute, fallback = DEFAULT_STYLES[key], scale} = reference;\n if (!attribute) {\n throw new Error(`Invalid attribute reference for ${key}: ${JSON.stringify(reference)}`);\n }\n\n let scaleFn: ((value: unknown) => unknown) | undefined;\n let scaleConfig: GraphStyleScale | ((value: unknown) => unknown) | undefined;\n\n if (scale) {\n if (typeof scale === 'function') {\n scaleFn = scale;\n scaleConfig = scale;\n } else {\n scaleFn = createScaleFromConfig(scale);\n scaleConfig = scale;\n }\n }\n\n return {\n attribute,\n fallback,\n scale: scaleFn,\n scaleConfig\n };\n}\n\n/** Determine whether a value points to a graph attribute reference. */\nfunction isAttributeReference(value: unknown): value is GraphStyleAttributeReference {\n if (typeof value === 'string') {\n return value.startsWith('@');\n }\n return (\n Boolean(value) &&\n typeof value === 'object' &&\n !Array.isArray(value) &&\n 'attribute' in (value as Record<string, unknown>)\n );\n}\n\n/** Determine whether a style value maps interaction states. */\nfunction isStatefulValue(value: unknown): value is Record<string, GraphStyleLeafValue> {\n return (\n Boolean(value) &&\n typeof value === 'object' &&\n !Array.isArray(value) &&\n !isAttributeReference(value)\n );\n}\n\n/** Resolve an attribute from a datum or `Graph` entity. */\nfunction getAttributeValue(datum: any, attribute: string) {\n if (datum && typeof datum.getPropertyValue === 'function') {\n return datum.getPropertyValue(attribute);\n }\n if (datum && typeof datum === 'object' && attribute in datum) {\n return datum[attribute];\n }\n return undefined;\n}\n\n/** Combine Deck.gl update triggers while filtering falsey entries. */\nfunction mergeUpdateTriggers(...triggers: unknown[]): unknown {\n const filtered = triggers.filter(\n (trigger) => !(trigger === false || trigger === undefined || trigger === null)\n );\n if (!filtered.length) {\n return false;\n }\n if (filtered.length === 1) {\n return filtered[0];\n }\n return filtered;\n}\n\n/** Build an accessor that reads and optionally scales an attribute. */\nfunction createAttributeAccessor(\n key: string,\n attributeRef: NormalizedAttributeReference,\n formatter: (value: unknown) => unknown\n) {\n const accessor = (datum: any) => {\n let raw = getAttributeValue(datum, attributeRef.attribute);\n if (raw === undefined || raw === null) {\n raw = attributeRef.fallback;\n }\n if (attributeRef.scale) {\n raw = attributeRef.scale(raw);\n }\n const formatted = formatter(raw);\n if (formatted === null) {\n warn(`Invalid ${key} value: ${raw}`);\n throw new Error(`Invalid ${key} value: ${raw}`);\n }\n return formatted;\n };\n\n const updateTrigger = {\n attribute: attributeRef.attribute,\n scale: attributeRef.scaleConfig ?? null\n };\n\n return {accessor, updateTrigger};\n}\n\n/** Result of parsing a leaf style value. */\ntype LeafParseResult = {\n value: any;\n isAccessor: boolean;\n updateTrigger: unknown;\n};\n\nfunction describeStyleValue(value: unknown): string {\n if (typeof value === 'string') {\n return value;\n }\n if (typeof value === 'number' || typeof value === 'boolean' || typeof value === 'undefined') {\n return String(value);\n }\n if (value === null) {\n return 'null';\n }\n if (typeof value === 'function') {\n return value.name ? `[Function ${value.name}]` : '[Function]';\n }\n if (Array.isArray(value)) {\n return `[${value.map((item) => describeStyleValue(item)).join(', ')}]`;\n }\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}\n\n/** Parse a non-stateful style value into deck.gl compatible form. */\nfunction parseLeafValue(key: string, value: GraphStyleLeafValue | undefined): LeafParseResult {\n const formatter = PROPERTY_FORMATTERS[key] || IDENTITY;\n\n if (typeof value === 'undefined') {\n const formatted = formatter(DEFAULT_STYLES[key]);\n if (formatted === null) {\n const description = describeStyleValue(value);\n warn(`Invalid ${key} value: ${description}`);\n throw new Error(`Invalid ${key} value: ${description}`);\n }\n return {value: formatted, isAccessor: false, updateTrigger: false};\n }\n\n if (isAttributeReference(value)) {\n const normalized = normalizeAttributeReference(key, value);\n const {accessor, updateTrigger} = createAttributeAccessor(key, normalized, formatter);\n return {value: accessor, isAccessor: true, updateTrigger};\n }\n\n if (typeof value === 'function') {\n return {\n value: (datum) => formatter(value(datum)),\n isAccessor: true,\n updateTrigger: value\n };\n }\n\n const formatted = formatter(value);\n if (formatted === null) {\n const description = describeStyleValue(value);\n warn(`Invalid ${key} value: ${description}`);\n throw new Error(`Invalid ${key} value: ${description}`);\n }\n\n return {value: formatted, isAccessor: false, updateTrigger: false};\n}\n\n/**\n * Create an accessor capable of handling interaction state overrides for a style property.\n */\nfunction createStatefulAccessor(\n key: string,\n value: Record<string, GraphStyleLeafValue>,\n stateUpdateTrigger: unknown\n) {\n const valueMap: Record<string, any> = {};\n const attributeTriggers: unknown[] = [];\n\n for (const state of Object.keys(value)) {\n const parsed = parseLeafValue(key, value[state]);\n valueMap[state] = parsed.value;\n if (parsed.updateTrigger) {\n attributeTriggers.push(parsed.updateTrigger);\n }\n }\n\n const defaultValue =\n typeof valueMap.default !== 'undefined'\n ? valueMap.default\n : parseLeafValue(key, undefined).value;\n\n const accessor = (datum: any) => {\n const stateValue = datum?.state ? valueMap[datum.state] : undefined;\n const candidate = typeof stateValue !== 'undefined' ? stateValue : defaultValue;\n return typeof candidate === 'function' ? candidate(datum) : candidate;\n };\n\n const updateTrigger = mergeUpdateTriggers(stateUpdateTrigger, ...attributeTriggers);\n\n return {accessor, updateTrigger};\n}\n\nconst VALUE_TYPE = {\n ACCESSOR: 'ACCESSOR',\n PLAIN_VALUE: 'PLAIN_VALUE'\n};\n\nexport class StyleProperty {\n key: any;\n _updateTrigger: unknown;\n _value: any;\n _valueType: any;\n\n // for getting default style\n static getDefault(key) {\n return DEFAULT_STYLES[key];\n }\n\n // pass the key and value of the property\n // and format the value properly.\n constructor({key, value, updateTrigger}) {\n this.key = key;\n this._updateTrigger = false;\n\n if (isStatefulValue(value)) {\n const {accessor, updateTrigger: triggers} = createStatefulAccessor(key, value, updateTrigger);\n this._value = accessor;\n this._valueType = VALUE_TYPE.ACCESSOR;\n this._updateTrigger = triggers;\n } else {\n const parsed = parseLeafValue(key, value as GraphStyleLeafValue | undefined);\n this._value = parsed.value;\n this._valueType = parsed.isAccessor ? VALUE_TYPE.ACCESSOR : VALUE_TYPE.PLAIN_VALUE;\n this._updateTrigger = mergeUpdateTriggers(parsed.updateTrigger);\n }\n\n if (this._value === null) {\n warn(`Invalid ${key} value: ${value}`);\n throw new Error(`Invalid ${key} value: ${value}`);\n }\n }\n\n // get the formatted value\n getValue() {\n return this._value;\n }\n\n getUpdateTrigger() {\n return this._updateTrigger;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {StyleProperty} from './style-property';\nimport {error} from '../utils/log';\n\nexport type DeckGLAccessorMap = Record<string, Record<string, string>>;\nexport type DeckGLUpdateTriggers = Record<string, string[]>;\n\nexport type StylePropertyConstructor<T extends StyleProperty = StyleProperty> = new (args: {\n key: string;\n value: unknown;\n updateTrigger: unknown;\n}) => T;\n\nexport type DefaultStyleValueFn = (property: string) => unknown;\n\nexport type StylesheetEngineOptions<T extends StyleProperty = StyleProperty> = {\n deckglAccessorMap: DeckGLAccessorMap;\n deckglUpdateTriggers?: DeckGLUpdateTriggers;\n stateUpdateTrigger?: unknown;\n StylePropertyClass?: StylePropertyConstructor<T>;\n getDefaultStyleValue?: DefaultStyleValueFn;\n};\n\nconst DEFAULT_UPDATE_TRIGGERS: DeckGLUpdateTriggers = {};\n\nexport class StylesheetEngine<TStyleProperty extends StyleProperty = StyleProperty> {\n type: string;\n properties: Record<string, TStyleProperty>;\n\n protected readonly deckglAccessorMap: DeckGLAccessorMap;\n protected readonly deckglUpdateTriggers: DeckGLUpdateTriggers;\n protected readonly stateUpdateTrigger: unknown;\n protected readonly StylePropertyClass: StylePropertyConstructor<TStyleProperty>;\n protected readonly getDefaultStyleValue: DefaultStyleValueFn;\n\n constructor(style: Record<string, any>, options: StylesheetEngineOptions<TStyleProperty>) {\n const {\n deckglAccessorMap,\n deckglUpdateTriggers = DEFAULT_UPDATE_TRIGGERS,\n stateUpdateTrigger = false,\n StylePropertyClass = StyleProperty as unknown as StylePropertyConstructor<TStyleProperty>,\n // eslint-disable-next-line @typescript-eslint/unbound-method\n getDefaultStyleValue = StyleProperty.getDefault\n } = options;\n\n const {type: layerType, ...restStyle} = style;\n\n if (!layerType || !(layerType in deckglAccessorMap)) {\n throw new Error(`illegal type: ${layerType}`);\n }\n\n this.type = layerType;\n this.deckglAccessorMap = deckglAccessorMap;\n this.deckglUpdateTriggers = deckglUpdateTriggers;\n this.stateUpdateTrigger = stateUpdateTrigger;\n this.StylePropertyClass = StylePropertyClass;\n this.getDefaultStyleValue = getDefaultStyleValue;\n\n const rules = Object.keys(restStyle).reduce(\n (res, key) => {\n const isSelector = key.startsWith(':');\n if (isSelector) {\n const state = key.substring(1);\n res[state] = restStyle[key];\n return res;\n }\n res.default[key] = restStyle[key];\n return res;\n },\n {default: {}} as Record<string, Record<string, unknown>>\n );\n\n const attributes = Object.values(rules).reduce<string[]>((res, rule) => {\n const attrs = Object.keys(rule || {});\n const set = new Set([...res, ...attrs]);\n return Array.from(set);\n }, []);\n\n const attrMap = attributes.reduce(\n (res, attr) => {\n res[attr] = Object.entries(rules).reduce(\n (acc, entry) => {\n const [state, rule] = entry;\n if (rule && typeof (rule as any)[attr] !== 'undefined') {\n (acc as any)[state] = (rule as any)[attr];\n }\n return acc;\n },\n {} as Record<string, unknown>\n );\n return res;\n },\n {} as Record<string, any>\n );\n\n const simplifiedStyleMap = Object.entries(attrMap).reduce(\n (res, entry) => {\n const [attr, valueMap] = entry as [string, Record<string, unknown>];\n const states = Object.keys(valueMap);\n const onlyDefault = states.length === 1 && valueMap.default !== undefined;\n if (onlyDefault) {\n res[attr] = valueMap.default;\n return res;\n }\n res[attr] = valueMap;\n return res;\n },\n {} as Record<string, unknown>\n );\n\n this.properties = {} as Record<string, TStyleProperty>;\n for (const key in simplifiedStyleMap) {\n this.properties[key] = new this.StylePropertyClass({\n key,\n value: simplifiedStyleMap[key],\n updateTrigger: this.stateUpdateTrigger\n });\n }\n }\n\n protected getDeckGLAccessorMapForType() {\n return this.deckglAccessorMap[this.type];\n }\n\n protected getDeckGLUpdateTriggersForType() {\n return this.deckglUpdateTriggers[this.type] || [];\n }\n\n protected _getProperty(deckglAccessor: string) {\n const map = this.getDeckGLAccessorMapForType();\n if (!map) {\n throw new Error(`illegal type: ${this.type}`);\n }\n const styleProp = map[deckglAccessor];\n if (!styleProp) {\n error(`Invalid DeckGL accessor: ${deckglAccessor}`);\n throw new Error(`Invalid DeckGL accessor: ${deckglAccessor}`);\n }\n return this.properties[styleProp];\n }\n\n getDeckGLAccessor(deckglAccessor: string) {\n const property = this._getProperty(deckglAccessor);\n if (property) {\n const value = property.getValue();\n return typeof value === 'function' ? value : () => value;\n }\n const styleProp = this.getDeckGLAccessorMapForType()?.[deckglAccessor];\n return this.getDefaultStyleValue(styleProp);\n }\n\n getDeckGLAccessorUpdateTrigger(deckglAccessor: string) {\n const property = this._getProperty(deckglAccessor);\n if (property) {\n return property.getUpdateTrigger();\n }\n return false;\n }\n\n getDeckGLAccessors() {\n const accessorMap = this.getDeckGLAccessorMapForType();\n return Object.keys(accessorMap).reduce(\n (res, accessor) => {\n res[accessor] = this.getDeckGLAccessor(accessor);\n return res;\n },\n {} as Record<string, (...args: any[]) => unknown>\n );\n }\n\n getDeckGLUpdateTriggers() {\n return this.getDeckGLUpdateTriggersForType().reduce(\n (res, accessor) => {\n res[accessor] = this.getDeckGLAccessorUpdateTrigger(accessor);\n return res;\n },\n {} as Record<string, unknown>\n );\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable no-continue */\n\nimport {z, type ZodTypeAny} from 'zod';\n\nimport {GRAPH_DECKGL_ACCESSOR_MAP} from './graph-style-accessor-map';\nexport {GRAPH_DECKGL_ACCESSOR_MAP};\n\nconst GraphStylePrimitiveSchema = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n z.array(z.union([z.string(), z.number(), z.boolean(), z.null()]))\n]);\n\nconst GraphStyleFunctionSchema = z.custom<(...args: unknown[]) => unknown>(\n (value) => typeof value === 'function',\n {\n message: 'Style functions must be callable.'\n }\n);\n\n/**\n * Supported scale identifiers for mapping data values to visual encodings.\n */\nexport const GraphStyleScaleTypeEnum = z.enum([\n 'linear',\n 'log',\n 'pow',\n 'sqrt',\n 'quantize',\n 'quantile',\n 'ordinal'\n]);\n\n/**\n * TypeScript union of {@link GraphStyleScaleTypeEnum} values.\n */\nexport type GraphStyleScaleType = z.infer<typeof GraphStyleScaleTypeEnum>;\n\n/**\n * Configuration for data-driven style scaling. Supports deck.gl compatible numeric and\n * categorical scaling with optional d3-scale like parameters.\n */\nexport const GraphStyleScaleSchema = z\n .object({\n type: GraphStyleScaleTypeEnum.optional(),\n domain: z.array(z.union([z.number(), z.string()])).optional(),\n range: z.array(z.any()).optional(),\n clamp: z.boolean().optional(),\n nice: z.union([z.boolean(), z.number()]).optional(),\n base: z.number().optional(),\n exponent: z.number().optional(),\n unknown: z.any().optional()\n })\n .strict();\n\n/**\n * TypeScript view of {@link GraphStyleScaleSchema} after parsing.\n */\nexport type GraphStyleScale = z.infer<typeof GraphStyleScaleSchema>;\n\n/**\n * Reference to node/edge attributes, optionally including fallback values and scale\n * configuration for data-driven styling.\n */\nexport const GraphStyleAttributeReferenceSchema = z.union([\n z\n .string()\n .regex(\n /^@.+/,\n 'Attribute reference strings must start with \"@\" and include an attribute name.'\n ),\n z\n .object({\n attribute: z.string().min(1, 'Attribute name is required.'),\n fallback: GraphStylePrimitiveSchema.optional(),\n scale: z.union([GraphStyleScaleSchema, GraphStyleFunctionSchema]).optional()\n })\n .strict()\n]);\n\n/**\n * Parsed value produced by {@link GraphStyleAttributeReferenceSchema}.\n */\nexport type GraphStyleAttributeReference = z.infer<typeof GraphStyleAttributeReferenceSchema>;\n\n/**\n * Primitive value allowed in stylesheet definitions. Supports literal values, attribute\n * references and imperative resolver functions.\n */\nexport const GraphStyleLeafValueSchema = z.union([\n GraphStylePrimitiveSchema,\n GraphStyleAttributeReferenceSchema,\n GraphStyleFunctionSchema\n]);\n\n/**\n * Union of literal, attribute-driven and functional style values.\n */\nexport type GraphStyleLeafValue = z.infer<typeof GraphStyleLeafValueSchema>;\n\nconst RESERVED_STATE_KEYS = new Set(['attribute', 'fallback', 'scale']);\n\n/**\n * Mapping of interaction or application state keys to leaf style values.\n */\nexport const GraphStyleStateMapSchema = z.record(\n z\n .string()\n .refine((key) => !RESERVED_STATE_KEYS.has(key), 'State overrides must not use reserved keys.'),\n GraphStyleLeafValueSchema\n);\n\n/**\n * Style value that may be either a simple leaf value or a keyed map of overrides.\n */\nexport const GraphStyleValueSchema = z.union([GraphStyleLeafValueSchema, GraphStyleStateMapSchema]);\n\n/**\n * Parsed style property value that may include state overrides.\n */\nexport type GraphStyleValue = z.infer<typeof GraphStyleValueSchema>;\n\nexport type GraphStyleType = keyof typeof GRAPH_DECKGL_ACCESSOR_MAP;\n\n/**\n * CSS-like pseudo selector supported by the stylesheet for state overrides.\n */\nexport type GraphStyleSelector = `:${string}`;\n\nconst GraphStyleSelectorKeySchema = z.string().regex(/^:[^\\s]+/, 'Selectors must start with \":\".');\n\nfunction createSelectorRefinement(allowedKeys: readonly string[], propertiesSchema: ZodTypeAny) {\n const allowedKeySet = new Set<string>(allowedKeys);\n\n return (value: unknown, ctx: z.RefinementCtx) => {\n if (typeof value !== 'object' || value === null) {\n return;\n }\n\n const record = value as Record<string, unknown>;\n\n for (const key of Object.keys(record)) {\n if (key === 'type') continue;\n if (allowedKeySet.has(key)) continue;\n\n if (!key.startsWith(':')) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [key],\n message: `Unknown style property \"${key}\".`\n });\n continue;\n }\n\n if (!GraphStyleSelectorKeySchema.safeParse(key).success) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [key],\n message: 'Selectors must start with \":\".'\n });\n continue;\n }\n\n const selectorResult = propertiesSchema.safeParse(record[key]);\n if (!selectorResult.success) {\n for (const issue of selectorResult.error.issues) {\n ctx.addIssue({\n ...issue,\n path: [key, ...(issue.path ?? [])]\n });\n }\n }\n }\n };\n}\n\nconst CircleShape = {\n offset: GraphStyleValueSchema.optional(),\n opacity: GraphStyleValueSchema.optional(),\n fill: GraphStyleValueSchema.optional(),\n stroke: GraphStyleValueSchema.optional(),\n strokeWidth: GraphStyleValueSchema.optional(),\n radius: GraphStyleValueSchema.optional()\n} as const;\n\nconst CirclePropertiesSchema = z.object(CircleShape).partial().strict();\n\nconst CircleStylesheetSchema = z\n .object({\n type: z.literal('circle'),\n ...CircleShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(CircleShape), CirclePropertiesSchema));\n\nconst RectangleShape = {\n offset: GraphStyleValueSchema.optional(),\n opacity: GraphStyleValueSchema.optional(),\n width: GraphStyleValueSchema.optional(),\n height: GraphStyleValueSchema.optional(),\n fill: GraphStyleValueSchema.optional(),\n stroke: GraphStyleValueSchema.optional(),\n strokeWidth: GraphStyleValueSchema.optional()\n} as const;\n\nconst RectanglePropertiesSchema = z.object(RectangleShape).partial().strict();\n\nconst RectangleStylesheetSchema = z\n .object({\n type: z.literal('rectangle'),\n ...RectangleShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(RectangleShape), RectanglePropertiesSchema));\n\nconst RoundedRectangleShape = {\n offset: GraphStyleValueSchema.optional(),\n opacity: GraphStyleValueSchema.optional(),\n cornerRadius: GraphStyleValueSchema.optional(),\n radius: GraphStyleValueSchema.optional(),\n width: GraphStyleValueSchema.optional(),\n height: GraphStyleValueSchema.optional(),\n fill: GraphStyleValueSchema.optional(),\n stroke: GraphStyleValueSchema.optional(),\n strokeWidth: GraphStyleValueSchema.optional()\n} as const;\n\nconst RoundedRectanglePropertiesSchema = z.object(RoundedRectangleShape).partial().strict();\n\nconst RoundedRectangleStylesheetSchema = z\n .object({\n type: z.literal('rounded-rectangle'),\n ...RoundedRectangleShape\n })\n .catchall(z.unknown())\n .superRefine(\n createSelectorRefinement(Object.keys(RoundedRectangleShape), RoundedRectanglePropertiesSchema)\n );\n\nconst PathRoundedRectangleShape = {\n offset: GraphStyleValueSchema.optional(),\n opacity: GraphStyleValueSchema.optional(),\n width: GraphStyleValueSchema.optional(),\n height: GraphStyleValueSchema.optional(),\n fill: GraphStyleValueSchema.optional(),\n stroke: GraphStyleValueSchema.optional(),\n strokeWidth: GraphStyleValueSchema.optional(),\n cornerRadius: GraphStyleValueSchema.optional()\n} as const;\n\nconst PathRoundedRectanglePropertiesSchema = z.object(PathRoundedRectangleShape).partial().strict();\n\nconst PathRoundedRectangleStylesheetSchema = z\n .object({\n type: z.literal('path-rounded-rectangle'),\n ...PathRoundedRectangleShape\n })\n .catchall(z.unknown())\n .superRefine(\n createSelectorRefinement(\n Object.keys(PathRoundedRectangleShape),\n PathRoundedRectanglePropertiesSchema\n )\n );\n\nconst LabelShape = {\n offset: GraphStyleValueSchema.optional(),\n opacity: GraphStyleValueSchema.optional(),\n color: GraphStyleValueSchema.optional(),\n text: GraphStyleValueSchema.optional(),\n fontSize: GraphStyleValueSchema.optional(),\n textAnchor: GraphStyleValueSchema.optional(),\n alignmentBaseline: GraphStyleValueSchema.optional(),\n angle: GraphStyleValueSchema.optional(),\n scaleWithZoom: GraphStyleValueSchema.optional(),\n textMaxWidth: GraphStyleValueSchema.optional(),\n textWordBreak: GraphStyleValueSchema.optional(),\n textSizeMinPixels: GraphStyleValueSchema.optional()\n} as const;\n\nconst LabelPropertiesSchema = z.object(LabelShape).partial().strict();\n\nconst LabelStylesheetSchema = z\n .object({\n type: z.literal('label'),\n ...LabelShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(LabelShape), LabelPropertiesSchema));\n\nconst MarkerShape = {\n offset: GraphStyleValueSchema.optional(),\n opacity: GraphStyleValueSchema.optional(),\n fill: GraphStyleValueSchema.optional(),\n size: GraphStyleValueSchema.optional(),\n marker: GraphStyleValueSchema.optional(),\n scaleWithZoom: GraphStyleValueSchema.optional()\n} as const;\n\nconst MarkerPropertiesSchema = z.object(MarkerShape).partial().strict();\n\nconst MarkerStylesheetSchema = z\n .object({\n type: z.literal('marker'),\n ...MarkerShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(MarkerShape), MarkerPropertiesSchema));\n\nconst EdgeUpperShape = {\n stroke: GraphStyleValueSchema.optional(),\n strokeWidth: GraphStyleValueSchema.optional()\n} as const;\n\nconst EdgeUpperPropertiesSchema = z.object(EdgeUpperShape).partial().strict();\n\nconst EdgeUpperStylesheetSchema = z\n .object({\n type: z.literal('Edge'),\n ...EdgeUpperShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(EdgeUpperShape), EdgeUpperPropertiesSchema));\n\nconst EdgeLowerShape = {\n stroke: GraphStyleValueSchema.optional(),\n strokeWidth: GraphStyleValueSchema.optional()\n} as const;\n\nconst EdgeLowerPropertiesSchema = z.object(EdgeLowerShape).partial().strict();\n\nconst EdgeLowerStylesheetSchema = z\n .object({\n type: z.literal('edge'),\n ...EdgeLowerShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(EdgeLowerShape), EdgeLowerPropertiesSchema));\n\nconst EdgeLabelShape = {\n color: GraphStyleValueSchema.optional(),\n text: GraphStyleValueSchema.optional(),\n fontSize: GraphStyleValueSchema.optional(),\n textAnchor: GraphStyleValueSchema.optional(),\n alignmentBaseline: GraphStyleValueSchema.optional(),\n scaleWithZoom: GraphStyleValueSchema.optional(),\n textMaxWidth: GraphStyleValueSchema.optional(),\n textWordBreak: GraphStyleValueSchema.optional(),\n textSizeMinPixels: GraphStyleValueSchema.optional()\n} as const;\n\nconst EdgeLabelPropertiesSchema = z.object(EdgeLabelShape).partial().strict();\n\nconst EdgeLabelStylesheetSchema = z\n .object({\n type: z.literal('edge-label'),\n ...EdgeLabelShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(EdgeLabelShape), EdgeLabelPropertiesSchema));\n\nconst FlowShape = {\n color: GraphStyleValueSchema.optional(),\n width: GraphStyleValueSchema.optional(),\n speed: GraphStyleValueSchema.optional(),\n tailLength: GraphStyleValueSchema.optional()\n} as const;\n\nconst FlowPropertiesSchema = z.object(FlowShape).partial().strict();\n\nconst FlowStylesheetSchema = z\n .object({\n type: z.literal('flow'),\n ...FlowShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(FlowShape), FlowPropertiesSchema));\n\nconst ArrowShape = {\n color: GraphStyleValueSchema.optional(),\n size: GraphStyleValueSchema.optional(),\n offset: GraphStyleValueSchema.optional()\n} as const;\n\nconst ArrowPropertiesSchema = z.object(ArrowShape).partial().strict();\n\nconst ArrowStylesheetSchema = z\n .object({\n type: z.literal('arrow'),\n ...ArrowShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(ArrowShape), ArrowPropertiesSchema));\n\nconst GraphNodeStylesheetVariants = [\n CircleStylesheetSchema,\n RectangleStylesheetSchema,\n RoundedRectangleStylesheetSchema,\n PathRoundedRectangleStylesheetSchema,\n LabelStylesheetSchema,\n MarkerStylesheetSchema\n];\n\nconst GraphEdgeStylesheetVariants = [\n EdgeUpperStylesheetSchema,\n EdgeLowerStylesheetSchema,\n EdgeLabelStylesheetSchema,\n FlowStylesheetSchema,\n ArrowStylesheetSchema\n];\n\nconst GraphStyleRuleVariants = [...GraphNodeStylesheetVariants, ...GraphEdgeStylesheetVariants];\n\ntype GraphStyleRuleVariantSchema = (typeof GraphStyleRuleVariants)[number];\n\n/**\n * Schema that validates stylesheet definitions for all graph style primitives.\n */\nexport const GraphStyleRuleSchema = z.discriminatedUnion(\n 'type',\n GraphStyleRuleVariants as [GraphStyleRuleVariantSchema, ...GraphStyleRuleVariantSchema[]]\n);\n\n/**\n * Runtime type accepted by {@link GraphStyleRuleSchema} before validation.\n */\nexport type GraphStyleRule = z.input<typeof GraphStyleRuleSchema>;\n/**\n * Type returned by {@link GraphStyleRuleSchema} after successful parsing.\n */\nexport type GraphStyleRuleParsed = z.infer<typeof GraphStyleRuleSchema>;\n\nconst GraphNodeStyleRuleSchema = z.discriminatedUnion(\n 'type',\n GraphNodeStylesheetVariants as [\n (typeof GraphNodeStylesheetVariants)[number],\n ...(typeof GraphNodeStylesheetVariants)[number][]\n ]\n);\n\nconst GraphEdgeDecoratorRuleSchema = z.discriminatedUnion('type', [\n EdgeLabelStylesheetSchema,\n FlowStylesheetSchema,\n ArrowStylesheetSchema\n] as [\n typeof EdgeLabelStylesheetSchema,\n typeof FlowStylesheetSchema,\n typeof ArrowStylesheetSchema,\n ...Array<\n typeof EdgeLabelStylesheetSchema | typeof FlowStylesheetSchema | typeof ArrowStylesheetSchema\n >\n]);\n\nconst EdgeUpperWithDecoratorsSchema = EdgeUpperStylesheetSchema.safeExtend({\n decorators: z.array(GraphEdgeDecoratorRuleSchema).optional()\n});\n\nconst EdgeLowerWithDecoratorsSchema = EdgeLowerStylesheetSchema.safeExtend({\n decorators: z.array(GraphEdgeDecoratorRuleSchema).optional()\n});\n\nconst GraphEdgeRuleWithDecoratorsSchema = z.discriminatedUnion('type', [\n EdgeUpperWithDecoratorsSchema,\n EdgeLowerWithDecoratorsSchema\n] as [typeof EdgeUpperWithDecoratorsSchema, typeof EdgeLowerWithDecoratorsSchema]);\n\n/**\n * Schema that validates a full graph stylesheet including nodes, edges, and decorators.\n */\nexport const GraphStylesheetSchema = z\n .object({\n nodes: z.array(GraphNodeStyleRuleSchema).optional(),\n edges: z.array(GraphEdgeRuleWithDecoratorsSchema).optional()\n })\n .strict();\n\n/**\n * Runtime type accepted by {@link GraphStylesheetSchema} before validation.\n */\nexport type GraphStylesheet = z.input<typeof GraphStylesheetSchema>;\n/**\n * Type returned by {@link GraphStylesheetSchema} after successful parsing.\n */\nexport type GraphStylesheetParsed = z.infer<typeof GraphStylesheetSchema>;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nconst COMMON_DECKGL_PROPS = {\n getOffset: 'offset',\n opacity: 'opacity'\n} as const;\n\nexport const GRAPH_DECKGL_ACCESSOR_MAP = {\n circle: {\n ...COMMON_DECKGL_PROPS,\n getFillColor: 'fill',\n getLineColor: 'stroke',\n getLineWidth: 'strokeWidth',\n getRadius: 'radius'\n },\n\n rectangle: {\n ...COMMON_DECKGL_PROPS,\n getWidth: 'width',\n getHeight: 'height',\n getFillColor: 'fill',\n getLineColor: 'stroke',\n getLineWidth: 'strokeWidth'\n },\n\n 'rounded-rectangle': {\n ...COMMON_DECKGL_PROPS,\n getCornerRadius: 'cornerRadius',\n getRadius: 'radius',\n getWidth: 'width',\n getHeight: 'height',\n getFillColor: 'fill',\n getLineColor: 'stroke',\n getLineWidth: 'strokeWidth'\n },\n\n 'path-rounded-rectangle': {\n ...COMMON_DECKGL_PROPS,\n getWidth: 'width',\n getHeight: 'height',\n getFillColor: 'fill',\n getLineColor: 'stroke',\n getLineWidth: 'strokeWidth',\n getCornerRadius: 'cornerRadius'\n },\n\n label: {\n ...COMMON_DECKGL_PROPS,\n getColor: 'color',\n getText: 'text',\n getSize: 'fontSize',\n getTextAnchor: 'textAnchor',\n getAlignmentBaseline: 'alignmentBaseline',\n getAngle: 'angle',\n scaleWithZoom: 'scaleWithZoom',\n textMaxWidth: 'textMaxWidth',\n textWordBreak: 'textWordBreak',\n textSizeMinPixels: 'textSizeMinPixels'\n },\n\n marker: {\n ...COMMON_DECKGL_PROPS,\n getColor: 'fill',\n getSize: 'size',\n getMarker: 'marker',\n scaleWithZoom: 'scaleWithZoom'\n },\n\n Edge: {\n getColor: 'stroke',\n getWidth: 'strokeWidth'\n },\n edge: {\n getColor: 'stroke',\n getWidth: 'strokeWidth'\n },\n 'edge-label': {\n getColor: 'color',\n getText: 'text',\n getSize: 'fontSize',\n getTextAnchor: 'textAnchor',\n getAlignmentBaseline: 'alignmentBaseline',\n scaleWithZoom: 'scaleWithZoom',\n textMaxWidth: 'textMaxWidth',\n textWordBreak: 'textWordBreak',\n textSizeMinPixels: 'textSizeMinPixels'\n },\n flow: {\n getColor: 'color',\n getWidth: 'width',\n getSpeed: 'speed',\n getTailLength: 'tailLength'\n },\n arrow: {\n getColor: 'color',\n getSize: 'size',\n getOffset: 'offset'\n }\n} as const;\n\nexport type GraphDeckGLAccessorMap = typeof GRAPH_DECKGL_ACCESSOR_MAP;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Bounds2D} from '@math.gl/types';\n\nimport type {Graph, EdgeInterface, NodeInterface} from '../graph/graph';\nimport {ClassicGraph} from '../graph/classic-graph';\nimport {GraphLayout, type GraphLayoutEventDetail} from './graph-layout';\nimport {Cache} from './cache';\nimport {log} from '../utils/log';\nimport {\n GraphStylesheetEngine,\n type GraphStyleRule,\n type GraphStyleRuleParsed\n} from '../style/graph-style-engine';\n\ntype ClassicGraphEngineProps = {\n graph: ClassicGraph;\n layout: GraphLayout;\n onLayoutStart?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutChange?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutDone?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutError?: (error?: unknown) => void;\n onTransactionStart?: () => void;\n onTransactionEnd?: () => void;\n onNodeAdded?: (node: NodeInterface) => void;\n onNodeRemoved?: (node: NodeInterface) => void;\n onNodeUpdated?: (node: NodeInterface) => void;\n onEdgeAdded?: (edge: EdgeInterface) => void;\n onEdgeRemoved?: (edge: EdgeInterface) => void;\n onEdgeUpdated?: (edge: EdgeInterface) => void;\n};\n\ntype InterfaceGraphEngineProps = {\n graph: Graph;\n layout: GraphLayout;\n onLayoutStart?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutChange?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutDone?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutError?: (error?: unknown) => void;\n onTransactionStart?: () => void;\n onTransactionEnd?: () => void;\n onNodeAdded?: (node: NodeInterface) => void;\n onNodeRemoved?: (node: NodeInterface) => void;\n onNodeUpdated?: (node: NodeInterface) => void;\n onEdgeAdded?: (edge: EdgeInterface) => void;\n onEdgeRemoved?: (edge: EdgeInterface) => void;\n onEdgeUpdated?: (edge: EdgeInterface) => void;\n};\n\nexport type GraphEngineProps = ClassicGraphEngineProps | InterfaceGraphEngineProps;\n\n/** Graph engine controls the graph data and layout calculation */\nexport class GraphEngine {\n private _props: GraphEngineProps;\n private readonly _graph: Graph;\n private readonly _layout: GraphLayout;\n private readonly _cache = new Cache<'nodes' | 'edges', NodeInterface[] | EdgeInterface[]>();\n private _layoutDirty = false;\n private _transactionInProgress = false;\n private _graphCallbacksAttached = false;\n private _layoutCallbacksAttached = false;\n\n constructor(props: GraphEngineProps);\n /** @deprecated Use props constructor: new GraphEngine(props) */\n constructor(graph: ClassicGraph, layout: GraphLayout);\n\n constructor(props: GraphEngineProps | ClassicGraph, layout?: GraphLayout) {\n let normalizedProps: GraphEngineProps;\n if (props instanceof ClassicGraph) {\n if (!(layout instanceof GraphLayout)) {\n throw new Error('GraphEngine: legacy graphs require a GraphLayout instance.');\n }\n normalizedProps = {graph: props, layout};\n } else {\n normalizedProps = props;\n }\n\n this._props = {...normalizedProps};\n\n this._graph = normalizedProps.graph;\n this._layout = normalizedProps.layout;\n }\n\n get props(): GraphEngineProps {\n return {...this._props};\n }\n\n setProps(props: Partial<Omit<GraphEngineProps, 'graph' | 'layout'>>): void {\n this._props = {\n ...this._props,\n ...props,\n graph: this._props.graph,\n layout: this._props.layout\n } as GraphEngineProps;\n }\n\n /** Getters */\n\n getNodes = (): NodeInterface[] => {\n this._updateCache('nodes', () =>\n Array.from(this._graph.getNodes()).filter((node) => {\n const position = this.getNodePosition(node);\n return position !== null && position !== undefined;\n })\n );\n\n return (this._cache.get('nodes') as NodeInterface[]) ?? [];\n };\n\n getEdges = () => {\n this._updateCache('edges', () =>\n Array.from(this._graph.getEdges()).filter((edge) => {\n const layout = this.getEdgePosition(edge);\n return layout !== null && layout !== undefined;\n })\n );\n\n return (this._cache.get('edges') as EdgeInterface[]) ?? [];\n };\n\n getNodePosition = (node: NodeInterface) => {\n return this._layout.getNodePosition(node) ?? null;\n };\n\n getEdgePosition = (edge: EdgeInterface) => {\n return this._layout.getEdgePosition(edge) ?? null;\n };\n\n getGraphVersion = () => this._graph.version;\n\n getLayoutLastUpdate = () => this._layout.version;\n\n getLayoutState = () => this._layout.state;\n\n getLayoutBounds = (): Bounds2D | null => this._layout.getBounds() ?? null;\n\n /** Operations on the graph */\n\n lockNodePosition = (node: NodeInterface, x: number, y: number) => {\n this._layout.lockNodePosition(node, x, y);\n };\n\n unlockNodePosition = (node: NodeInterface) => {\n this._layout.unlockNodePosition(node);\n };\n\n findNode(nodeId: string | number): NodeInterface | undefined {\n return this._graph.findNode?.(nodeId) ?? this._graph.findNodeById?.(nodeId);\n }\n\n /** Creates a stylesheet engine for a single validated or raw style rule. */\n createStylesheetEngine(\n style: GraphStyleRule | GraphStyleRuleParsed,\n options: {stateUpdateTrigger?: unknown} = {}\n ): GraphStylesheetEngine {\n return new GraphStylesheetEngine(style, options);\n }\n\n /**\n * @fires GraphEngine#onLayoutStart\n */\n _onLayoutStart = (detail?: GraphLayoutEventDetail) => {\n log.log(0, 'GraphEngine: layout start')();\n this._props.onLayoutStart?.(detail);\n };\n\n /**\n * @fires GraphEngine#onLayoutChange\n */\n _onLayoutChange = (detail?: GraphLayoutEventDetail) => {\n log.log(0, 'GraphEngine: layout update event')();\n this._props.onLayoutChange?.(detail);\n };\n\n /**\n * @fires GraphEngine#onLayoutDone\n */\n _onLayoutDone = (detail?: GraphLayoutEventDetail) => {\n log.log(0, 'GraphEngine: layout end')();\n this._props.onLayoutDone?.(detail);\n };\n\n /**\n * @fires GraphEngine#onLayoutError\n */\n _onLayoutError = (error?: unknown) => {\n this._props.onLayoutError?.(error);\n };\n\n _onGraphStructureChanged = () => {\n this._layoutDirty = true;\n this._graphChanged();\n };\n\n _onTransactionStart = () => {\n this._transactionInProgress = true;\n this._props.onTransactionStart?.();\n };\n\n _onTransactionEnd = () => {\n this._transactionInProgress = false;\n this._graphChanged();\n this._props.onTransactionEnd?.();\n };\n\n /** Layout calculations */\n\n run = () => {\n log.log(1, 'GraphEngine: run');\n // TODO: throw if running on a cleared engine\n\n this._attachGraphCallbacks();\n this._attachLayoutCallbacks();\n\n this._layout.initializeGraph(this._graph);\n this._layout.start();\n };\n\n clear = () => {\n log.log(1, 'GraphEngine: end');\n this._detachGraphCallbacks();\n this._detachLayoutCallbacks();\n };\n\n resume = () => {\n this._layout.resume();\n };\n\n stop = () => {\n this._layout.stop();\n };\n\n _graphChanged = () => {\n if (this._layoutDirty && !this._transactionInProgress) {\n this._updateLayout();\n }\n };\n\n _updateLayout = () => {\n log.log(0, 'GraphEngine: layout update');\n this._layout.updateGraph(this._graph);\n this._layout.update();\n this._layoutDirty = false;\n };\n\n _updateCache(key, updateValue) {\n this._cache.set(key, updateValue, this.getGraphVersion() + this.getLayoutLastUpdate());\n }\n\n private _attachGraphCallbacks() {\n if (this._graphCallbacksAttached) {\n return;\n }\n this._graph.updateProps({\n onTransactionStart: this._onTransactionStart,\n onTransactionEnd: this._onTransactionEnd,\n onNodeAdded: (node) => {\n this._onGraphStructureChanged();\n this._props.onNodeAdded?.(node);\n },\n onNodeRemoved: (node) => {\n this._onGraphStructureChanged();\n this._props.onNodeRemoved?.(node);\n },\n onNodeUpdated: (node) => {\n this._props.onNodeUpdated?.(node);\n },\n onEdgeAdded: (edge) => {\n this._onGraphStructureChanged();\n this._props.onEdgeAdded?.(edge);\n },\n onEdgeRemoved: (edge) => {\n this._onGraphStructureChanged();\n this._props.onEdgeRemoved?.(edge);\n },\n onEdgeUpdated: (edge) => {\n this._props.onEdgeUpdated?.(edge);\n }\n });\n this._graphCallbacksAttached = true;\n }\n\n private _detachGraphCallbacks() {\n if (!this._graphCallbacksAttached) {\n return;\n }\n this._graph.updateProps({\n onTransactionStart: undefined,\n onTransactionEnd: undefined,\n onNodeAdded: undefined,\n onNodeRemoved: undefined,\n onNodeUpdated: undefined,\n onEdgeAdded: undefined,\n onEdgeRemoved: undefined,\n onEdgeUpdated: undefined\n });\n this._graphCallbacksAttached = false;\n }\n\n private _attachLayoutCallbacks() {\n if (this._layoutCallbacksAttached) {\n return;\n }\n this._layout.setProps({\n onLayoutStart: this._onLayoutStart,\n onLayoutChange: this._onLayoutChange,\n onLayoutDone: this._onLayoutDone,\n onLayoutError: this._onLayoutError\n });\n this._layoutCallbacksAttached = true;\n }\n\n private _detachLayoutCallbacks() {\n if (!this._layoutCallbacksAttached) {\n return;\n }\n this._layout.setProps({\n onLayoutStart: undefined,\n onLayoutChange: undefined,\n onLayoutDone: undefined,\n onLayoutError: undefined\n });\n this._layoutCallbacksAttached = false;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {GraphLayout, GraphLayoutProps} from '../core/graph-layout';\nimport type {Graph, NodeInterface, EdgeInterface} from '../graph/graph';\n\nexport type SimpleLayoutProps = GraphLayoutProps & {\n /** The accessor lets the application supply the position ([x, y]) of each node. */\n nodePositionAccessor?: (node: NodeInterface) => [number, number];\n};\n\n/** A basic layout where the application controls positions of each node */\nexport class SimpleLayout extends GraphLayout<SimpleLayoutProps> {\n static defaultProps: Required<SimpleLayoutProps> = {\n ...GraphLayout.defaultProps,\n nodePositionAccessor: (node) =>\n [node.getPropertyValue('x'), node.getPropertyValue('y')] as [number, number]\n };\n\n protected readonly _name = 'SimpleLayout';\n protected _graph: Graph | null = null;\n protected _nodeMap: Map<string | number, NodeInterface> = new Map();\n protected _nodePositionMap: Map<string | number, [number, number] | null> = new Map();\n\n constructor(options: SimpleLayoutProps = {}) {\n super(options, SimpleLayout.defaultProps);\n }\n\n initializeGraph(graph: Graph): void {\n this.updateGraph(graph);\n }\n\n start(): void {\n this._notifyLayoutComplete();\n }\n\n stop(): void {}\n\n update(): void {\n this._notifyLayoutComplete();\n }\n\n resume(): void {\n this._notifyLayoutComplete();\n }\n\n updateGraph(graph: Graph): void {\n this._graph = graph;\n const nodes = Array.from(graph.getNodes());\n this._nodeMap = new Map(nodes.map((node) => [node.getId(), node]));\n this._nodePositionMap = new Map(\n nodes.map((node) => [\n node.getId(),\n this._normalizePosition(this.props.nodePositionAccessor(node))\n ])\n );\n }\n\n setNodePositionAccessor = (accessor) => {\n (this.props as any).nodePositionAccessor = accessor;\n };\n\n getNodePosition = (node: NodeInterface | null): [number, number] => {\n if (!node) {\n return [0, 0] as [number, number];\n }\n const position = this._nodePositionMap.get(node.getId());\n return position ?? ([0, 0] as [number, number]);\n };\n\n getEdgePosition = (edge: EdgeInterface) => {\n const sourceNode = this._nodeMap.get(edge.getSourceNodeId());\n const targetNode = this._nodeMap.get(edge.getTargetNodeId());\n const sourcePos = sourceNode ? this.getNodePosition(sourceNode) : [0, 0];\n const targetPos = targetNode ? this.getNodePosition(targetNode) : [0, 0];\n return {\n type: 'line',\n sourcePosition: sourcePos,\n targetPosition: targetPos,\n controlPoints: []\n };\n };\n\n lockNodePosition = (node: NodeInterface, x: number, y: number) => {\n this._nodePositionMap.set(node.getId(), [x, y]);\n this._onLayoutChange();\n this._onLayoutDone();\n };\n\n _notifyLayoutComplete(): void {\n this._onLayoutStart();\n this._onLayoutChange();\n this._onLayoutDone();\n }\n\n protected override _updateBounds(): void {\n const positions = Array.from(this._nodePositionMap.values(), (position) =>\n this._normalizePosition(position)\n );\n this._bounds = this._calculateBounds(positions);\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {GraphLayout, GraphLayoutProps} from '../../core/graph-layout';\nimport type {Graph, NodeInterface, EdgeInterface} from '../../graph/graph';\nimport {log} from '../../utils/log';\n\nexport type D3ForceLayoutOptions = GraphLayoutProps & {\n alpha?: number;\n resumeAlpha?: number;\n nBodyStrength?: number;\n nBodyDistanceMin?: number;\n nBodyDistanceMax?: number;\n getCollisionRadius?: number;\n};\n\nexport class D3ForceLayout extends GraphLayout<D3ForceLayoutOptions> {\n static defaultProps = {\n ...GraphLayout.defaultProps,\n alpha: 0.3,\n resumeAlpha: 0.1,\n nBodyStrength: -900,\n nBodyDistanceMin: 100,\n nBodyDistanceMax: 400,\n getCollisionRadius: 0\n } as const satisfies Readonly<Required<D3ForceLayoutOptions>>;\n\n protected readonly _name = 'D3';\n private _positionsByNodeId = new Map<string | number, any>();\n private _graph: Graph | null = null;\n private _worker: Worker | null = null;\n\n constructor(props?: D3ForceLayoutOptions) {\n super(props, D3ForceLayout.defaultProps);\n }\n\n initializeGraph(graph: Graph) {\n this._graph = graph;\n }\n\n // for streaming new data on the same graph\n updateGraph(graph: Graph) {\n this._graph = graph;\n\n this._positionsByNodeId = new Map(\n Array.from(this._graph.getNodes(), (node) => {\n const id = node.getId();\n return [id, this._positionsByNodeId.get(id)];\n })\n );\n }\n\n start() {\n this._engageWorker();\n\n this._onLayoutStart();\n }\n\n update() {\n this._engageWorker();\n }\n\n _engageWorker() {\n // prevent multiple start\n if (this._worker) {\n this._worker.terminate();\n }\n\n this._worker = new Worker(new URL('./worker.js', import.meta.url).href);\n\n if (!this._graph) {\n return;\n }\n\n const options = {...this.props};\n delete options.onLayoutStart;\n delete options.onLayoutChange;\n delete options.onLayoutDone;\n delete options.onLayoutError;\n\n this._worker.postMessage({\n nodes: Array.from(this._graph.getNodes(), (node) => {\n const id = node.getId();\n return {\n id,\n ...this._positionsByNodeId.get(id)\n };\n }),\n edges: Array.from(this._graph.getEdges(), (edge) => ({\n id: edge.getId(),\n source: edge.getSourceNodeId(),\n target: edge.getTargetNodeId()\n })),\n options\n });\n\n this._worker.onmessage = (event) => {\n log.log(0, 'D3ForceLayout: worker message', event.data?.type, event.data);\n if (event.data.type !== 'end') {\n return;\n }\n\n event.data.nodes.forEach(({id, ...d3}) =>\n this._positionsByNodeId.set(id, {\n ...d3,\n // precompute so that when we return the node position we do not need to do the conversion\n coordinates: [d3.x, d3.y]\n })\n );\n\n this._onLayoutChange();\n this._onLayoutDone();\n };\n }\n\n resume() {\n throw new Error('Resume unavailable');\n }\n\n stop() {\n if (this._worker) {\n this._worker.terminate();\n this._worker = null;\n }\n }\n\n getEdgePosition = (edge: EdgeInterface) => {\n if (!this._graph) {\n return null;\n }\n\n const sourceNode = this._graph.findNode(edge.getSourceNodeId());\n const targetNode = this._graph.findNode(edge.getTargetNodeId());\n if (!sourceNode || !targetNode) {\n return null;\n }\n\n const sourcePosition = this.getNodePosition(sourceNode);\n const targetPosition = this.getNodePosition(targetNode);\n\n if (!sourcePosition || !targetPosition) {\n return null;\n }\n\n return {\n type: 'line',\n sourcePosition,\n targetPosition,\n controlPoints: []\n };\n };\n\n getNodePosition = (node: NodeInterface | null) => {\n if (!node) {\n return null;\n }\n\n const d3Node = this._positionsByNodeId.get(node.getId());\n if (d3Node) {\n return d3Node.coordinates;\n }\n\n return null;\n };\n\n lockNodePosition = (node: NodeInterface, x: number, y: number) => {\n const id = node.getId();\n const d3Node = this._positionsByNodeId.get(id);\n this._positionsByNodeId.set(id, {\n ...d3Node,\n x,\n y,\n fx: x,\n fy: y,\n coordinates: [x, y]\n });\n this._onLayoutChange();\n this._onLayoutDone();\n };\n\n unlockNodePosition = (node: NodeInterface) => {\n const id = node.getId();\n const d3Node = this._positionsByNodeId.get(id);\n if (!d3Node) {\n return;\n }\n d3Node.fx = null;\n d3Node.fy = null;\n };\n\n protected override _updateBounds(): void {\n const positions = Array.from(\n this._positionsByNodeId.values(),\n (data) => data?.coordinates as [number, number] | null | undefined\n );\n this._bounds = this._calculateBounds(positions);\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable no-continue, complexity, max-statements */\n\nimport {GraphLayout, GraphLayoutProps} from '../../core/graph-layout';\nimport type {Graph, NodeInterface, EdgeInterface} from '../../graph/graph';\nimport {Node} from '../../graph/node';\nimport {\n coordCenter,\n coordGreedy,\n coordQuad,\n coordSimplex,\n coordTopological,\n decrossDfs,\n decrossOpt,\n decrossTwoLayer,\n graph as createDagGraph,\n graphConnect,\n graphStratify,\n grid,\n layeringLongestPath,\n layeringSimplex,\n layeringTopological,\n sugiyama,\n zherebko,\n // type Coord,\n // type Decross,\n type DefaultGrid,\n type DefaultSugiyama,\n type DefaultZherebko,\n type LayoutResult,\n type MutGraph,\n type MutGraphNode,\n type MutGraphLink,\n type NodeSize\n} from 'd3-dag';\nimport {log} from '../../utils/log';\n\nexport type D3DagLayoutProps = GraphLayoutProps & {\n /** Which high-level layout operator to use. */\n layout?: 'sugiyama' | 'grid' | 'zherebko';\n /** Layering operator used by sugiyama layouts. */\n layering?: 'simplex' | 'longestPath' | 'topological';\n /** Accessor for node rank for layering */\n nodeRank?: string | ((node: NodeInterface) => number | undefined);\n /** Decrossing operator used by sugiyama layouts. */\n decross?: 'twoLayer' | 'opt' | 'dfs';\n /** Coordinate assignment operator used by sugiyama layouts. */\n coord?: 'simplex' | 'greedy' | 'quad' | 'center' | 'topological';\n /** Node sizing accessor passed to the active layout. */\n nodeSize?: NodeSize<NodeInterface, EdgeInterface>;\n /** Optional gap between nodes. Alias: separation. */\n gap?: readonly [number, number];\n /** Optional gap between nodes. */\n separation?: readonly [number, number];\n /** Orientation transform applied after the layout finishes. */\n orientation?: 'TB' | 'BT' | 'LR' | 'RL';\n /** Whether to center the layout along each axis. */\n center?: boolean | {x?: boolean; y?: boolean};\n /** How to convert the Graph into a DAG. */\n dagBuilder?: 'graph' | 'connect' | 'stratify';\n\n customDagBuilder?: DagBuilder;\n customLayout?: D3DagLayoutOperator;\n customLayering?: LayeringOperator;\n customDecross?: DecrossOperator;\n customCoord?: CoordOperator;\n};\n\nexport type D3DagLayoutOperator =\n | DefaultSugiyama\n | DefaultGrid\n | DefaultZherebko\n | ((dag: MutGraph<NodeInterface, EdgeInterface>) => LayoutResult);\n\ntype DagBuilder = (graph: Graph) => MutGraph<NodeInterface, EdgeInterface>;\n\ntype LayeringOperator =\n | ReturnType<typeof layeringSimplex>\n | ReturnType<typeof layeringLongestPath>\n | ReturnType<typeof layeringTopological>;\ntype DecrossOperator =\n | ReturnType<typeof decrossTwoLayer>\n | ReturnType<typeof decrossOpt>\n | ReturnType<typeof decrossDfs>;\ntype CoordOperator =\n | ReturnType<typeof coordCenter>\n | ReturnType<typeof coordGreedy>\n | ReturnType<typeof coordQuad>\n | ReturnType<typeof coordSimplex>\n | ReturnType<typeof coordTopological>;\n\ntype LayoutCallable = (dag: MutGraph<NodeInterface, EdgeInterface>) => LayoutResult;\n\ntype LayoutWithConfiguration = LayoutCallable & {\n layering?: (layer?: any) => any;\n decross?: (decross?: any) => any;\n coord?: (coord?: any) => any;\n nodeSize?: (size?: NodeSize<NodeInterface, EdgeInterface>) => any;\n gap?: (gap?: readonly [number, number]) => any;\n};\n\ntype DagBounds = {\n minX: number;\n maxX: number;\n minY: number;\n maxY: number;\n centerX: number;\n centerY: number;\n};\n\nconst DAG_ID_SEPARATOR = '::';\n\nconst DEFAULT_NODE_SIZE: readonly [number, number] = [140, 120];\nconst DEFAULT_GAP: readonly [number, number] = [0, 0];\n\nconst LAYERING_FACTORIES = {\n simplex: layeringSimplex,\n longestPath: layeringLongestPath,\n topological: layeringTopological\n} as const satisfies Record<string, () => LayeringOperator>;\n\nconst DECROSS_FACTORIES = {\n twoLayer: decrossTwoLayer,\n opt: decrossOpt,\n dfs: decrossDfs\n} as const satisfies Record<string, () => DecrossOperator>;\n\nconst COORD_FACTORIES = {\n simplex: coordSimplex,\n greedy: coordGreedy,\n quad: coordQuad,\n center: coordCenter,\n topological: coordTopological\n} as const satisfies Record<string, () => CoordOperator>;\n\nconst LAYOUT_FACTORIES = {\n sugiyama: () => sugiyama(),\n grid: () => grid(),\n zherebko: () => zherebko()\n} as const satisfies Record<string, () => LayoutWithConfiguration>;\n\nfunction isNodeInterface(value: unknown): value is NodeInterface {\n return Boolean(value) && typeof value === 'object' && (value as NodeInterface).isNode === true;\n}\n\nfunction isEdgeInterface(value: unknown): value is EdgeInterface {\n return Boolean(value) && typeof value === 'object' && (value as EdgeInterface).isEdge === true;\n}\n\n/**\n * Layout that orchestrates d3-dag operators from declarative options.\n */\nexport class D3DagLayout<\n PropsT extends D3DagLayoutProps = D3DagLayoutProps\n> extends GraphLayout<PropsT> {\n static defaultProps: Readonly<Required<D3DagLayoutProps>> = {\n ...GraphLayout.defaultProps,\n layout: 'sugiyama',\n layering: 'topological',\n decross: 'twoLayer',\n coord: 'greedy',\n nodeRank: undefined,\n nodeSize: DEFAULT_NODE_SIZE,\n gap: DEFAULT_GAP,\n separation: DEFAULT_GAP,\n orientation: 'TB',\n center: true,\n dagBuilder: 'graph',\n\n customLayout: undefined,\n customLayering: undefined,\n customDecross: undefined,\n customCoord: undefined,\n customDagBuilder: undefined\n } as const;\n\n protected readonly _name = 'D3DagLayout';\n\n protected _graph: Graph | null = null;\n private _dag: MutGraph<NodeInterface, EdgeInterface> | null = null;\n private _layoutOperator: LayoutWithConfiguration | null = null;\n private _rawNodePositions = new Map<string | number, [number, number]>();\n private _rawEdgePoints = new Map<string | number, [number, number][]>();\n private _nodePositions = new Map<string | number, [number, number]>();\n private _edgePoints = new Map<string | number, [number, number][]>();\n private _edgeControlPoints = new Map<string | number, [number, number][]>();\n private _lockedNodePositions = new Map<string | number, [number, number]>();\n private _dagBounds: DagBounds | null = null;\n\n protected _nodeLookup = new Map<string | number, NodeInterface>();\n protected _stringIdLookup = new Map<string, string | number>();\n protected _edgeLookup = new Map<string, EdgeInterface>();\n protected _incomingParentMap = new Map<string | number, (string | number)[]>();\n\n constructor(props: D3DagLayoutProps, defaultProps?: Required<PropsT>) {\n // @ts-expect-error TS2345 - Type 'Required<D3DagLayoutProps>' is not assignable to type 'Required<PropsT>'.\n super(props, defaultProps || D3DagLayout.defaultProps);\n }\n\n setProps(options: Partial<D3DagLayoutProps>): void {\n this.props = {...this.props, ...options};\n if (\n options.layout !== undefined ||\n options.layering !== undefined ||\n options.decross !== undefined ||\n options.coord !== undefined ||\n options.nodeSize !== undefined ||\n options.gap !== undefined ||\n options.separation !== undefined\n ) {\n this._layoutOperator = null;\n }\n }\n\n initializeGraph(graph: Graph): void {\n this.updateGraph(graph);\n }\n\n updateGraph(graph: Graph): void {\n this._graph = graph;\n this._nodeLookup = new Map();\n this._stringIdLookup = new Map();\n this._edgeLookup = new Map();\n this._incomingParentMap = new Map();\n\n for (const node of graph.getNodes()) {\n const id = node.getId();\n const key = this._toDagId(id);\n this._nodeLookup.set(id, node);\n this._stringIdLookup.set(key, id);\n }\n\n for (const edge of graph.getEdges()) {\n if (!edge.isDirected()) {\n continue;\n }\n const key = this._edgeKey(edge.getSourceNodeId(), edge.getTargetNodeId());\n this._edgeLookup.set(key, edge);\n\n const targetId = edge.getTargetNodeId();\n const parents = this._incomingParentMap.get(targetId) ?? [];\n parents.push(edge.getSourceNodeId());\n this._incomingParentMap.set(targetId, parents);\n }\n }\n\n start(): void {\n this._runLayout();\n }\n\n update(): void {\n this._runLayout();\n }\n\n resume(): void {\n this._runLayout();\n }\n\n stop(): void {}\n\n toggleCollapsedChain(chainId: string): void {\n log.log(1, `D3DagLayout: toggleCollapsedChain(${chainId}) ignored (collapsing disabled)`);\n }\n\n setCollapsedChains(chainIds: Iterable<string>): void {\n const desired = Array.isArray(chainIds) ? chainIds : Array.from(chainIds);\n log.log(1, `D3DagLayout: setCollapsedChains(${desired.length}) ignored (collapsing disabled)`);\n }\n\n getNodePosition(node: NodeInterface): [number, number] | null {\n if (this._shouldSkipNode(node.getId())) {\n return null;\n }\n const mappedId = this._mapNodeId(node.getId());\n return this._nodePositions.get(mappedId) || null;\n }\n\n getEdgePosition(edge: EdgeInterface): {\n type: string;\n sourcePosition: [number, number];\n targetPosition: [number, number];\n controlPoints: [number, number][];\n } | null {\n const mappedSourceId = this._mapNodeId(edge.getSourceNodeId());\n const mappedTargetId = this._mapNodeId(edge.getTargetNodeId());\n if (mappedSourceId === mappedTargetId) {\n return null;\n }\n\n const sourcePosition = this._nodePositions.get(mappedSourceId);\n const targetPosition = this._nodePositions.get(mappedTargetId);\n if (!sourcePosition || !targetPosition) {\n return null;\n }\n\n if (!this._edgePoints.has(edge.getId())) {\n return null;\n }\n\n // const points = this._edgePoints.get(edge.getId()) || [sourcePosition, targetPosition];\n const controlPoints = this._edgeControlPoints.get(edge.getId()) || [];\n const edgeType = controlPoints.length ? 'spline-curve' : 'line';\n\n return {\n type: edgeType,\n sourcePosition,\n targetPosition,\n controlPoints\n };\n }\n\n getLinkControlPoints(edge: EdgeInterface): [number, number][] {\n return this._edgeControlPoints.get(edge.getId()) || [];\n }\n\n lockNodePosition(node: NodeInterface, x: number, y: number): void {\n this._lockedNodePositions.set(node.getId(), [x, y]);\n this._nodePositions.set(node.getId(), [x, y]);\n this._onLayoutChange();\n this._onLayoutDone();\n }\n\n unlockNodePosition(node: NodeInterface): void {\n this._lockedNodePositions.delete(node.getId());\n }\n\n protected _runLayout(): void {\n if (!this._graph) {\n return;\n }\n this._refreshCollapsedChains();\n this._onLayoutStart();\n\n try {\n this._dag = this._buildDag();\n const layout = this._getLayoutOperator();\n layout(this._dag);\n this._cacheGeometry();\n this._onLayoutChange();\n this._onLayoutDone();\n } catch (error) {\n this._onLayoutError();\n throw error;\n }\n }\n\n protected _refreshCollapsedChains(): void {\n this._updateCollapsedChainNodeMetadata();\n }\n\n private _buildDag(): MutGraph<NodeInterface, EdgeInterface> {\n if (this.props.customDagBuilder) {\n const dag = this.props.customDagBuilder(this._graph);\n return this._ensureEdgeData(dag);\n }\n\n switch (this.props.dagBuilder) {\n case 'connect':\n return this._buildDagWithConnect();\n case 'stratify':\n return this._buildDagWithStratify();\n case 'graph':\n default:\n return this._buildDagWithGraph();\n }\n }\n\n private _buildDagWithGraph(): MutGraph<NodeInterface, EdgeInterface> {\n const dag = createDagGraph<NodeInterface, EdgeInterface>();\n const dagNodeLookup = new Map<string | number, MutGraphNode<NodeInterface, EdgeInterface>>();\n\n for (const node of this._graph.getNodes()) {\n if (this._shouldSkipNode(node.getId())) {\n continue;\n }\n const dagNode = dag.node(node);\n dagNodeLookup.set(node.getId(), dagNode);\n }\n\n for (const edge of this._graph.getEdges()) {\n if (!edge.isDirected()) {\n continue;\n }\n const sourceId = this._mapNodeId(edge.getSourceNodeId());\n const targetId = this._mapNodeId(edge.getTargetNodeId());\n if (sourceId === targetId) {\n continue;\n }\n const source = dagNodeLookup.get(sourceId);\n const target = dagNodeLookup.get(targetId);\n if (!source || !target) {\n continue;\n }\n dag.link(source, target, edge);\n }\n\n return dag;\n }\n\n private _buildDagWithConnect(): MutGraph<NodeInterface, EdgeInterface> {\n type ConnectDatum = {source: string; target: string; edge: EdgeInterface};\n\n const connect = graphConnect()\n .sourceId(({source}: ConnectDatum): string => source)\n .targetId(({target}: ConnectDatum): string => target)\n .nodeDatum(\n (id: string): NodeInterface => this._nodeLookup.get(this._fromDagId(id)) ?? new Node({id})\n )\n .single(true);\n\n const edges = Array.from(this._graph.getEdges());\n\n const data: ConnectDatum[] = edges\n .filter((edge) => edge.isDirected())\n .map((edge) => {\n const sourceId = this._mapNodeId(edge.getSourceNodeId());\n const targetId = this._mapNodeId(edge.getTargetNodeId());\n return {sourceId, targetId, edge};\n })\n .filter(({sourceId, targetId}) => sourceId !== targetId)\n .map(({sourceId, targetId, edge}) => ({\n source: this._toDagId(sourceId),\n target: this._toDagId(targetId),\n edge\n }));\n\n const dag = connect(data);\n\n const seenIds = new Set<string | number>();\n for (const dagNode of dag.nodes()) {\n const datum = dagNode.data;\n if (isNodeInterface(datum)) {\n seenIds.add(datum.getId());\n }\n }\n\n for (const node of this._graph.getNodes()) {\n if (this._shouldSkipNode(node.getId())) {\n continue;\n }\n if (!seenIds.has(node.getId())) {\n dag.node(node);\n }\n }\n\n return this._ensureEdgeData(dag);\n }\n\n private _buildDagWithStratify(): MutGraph<NodeInterface, EdgeInterface> {\n const stratify = graphStratify()\n .id((node: NodeInterface): string => this._toDagId(node.getId()))\n .parentIds((node: NodeInterface): Iterable<string> => {\n const parentIds = this._incomingParentMap.get(node.getId()) ?? [];\n const mapped = new Set<string>();\n for (const parentId of parentIds) {\n if (!this._nodeLookup.has(parentId)) {\n continue;\n }\n const mappedId = this._mapNodeId(parentId);\n if (mappedId === node.getId()) {\n continue;\n }\n mapped.add(this._toDagId(mappedId));\n }\n return mapped;\n });\n\n const nodes = Array.from(this._graph.getNodes());\n const dag = stratify(nodes.filter((node) => !this._shouldSkipNode(node.getId())));\n return this._ensureEdgeData(dag);\n }\n\n protected _shouldSkipNode(_nodeId: string | number): boolean {\n return false;\n }\n\n protected _mapNodeId(nodeId: string | number): string | number {\n return nodeId;\n }\n\n protected _updateCollapsedChainNodeMetadata(): void {\n if (!this._graph) {\n return;\n }\n for (const node of this._graph.getNodes()) {\n node.setDataProperty('collapsedChainId', null);\n node.setDataProperty('collapsedChainLength', 1);\n node.setDataProperty('collapsedNodeIds', []);\n node.setDataProperty('collapsedEdgeIds', []);\n node.setDataProperty('collapsedChainRepresentativeId', null);\n node.setDataProperty('isCollapsedChain', false);\n }\n }\n\n protected _getIncomingEdges(node: NodeInterface): EdgeInterface[] {\n const nodeId = node.getId();\n return node\n .getConnectedEdges()\n .filter((edge) => edge.isDirected() && edge.getTargetNodeId() === nodeId);\n }\n\n protected _getOutgoingEdges(node: NodeInterface): EdgeInterface[] {\n const nodeId = node.getId();\n return node\n .getConnectedEdges()\n .filter((edge) => edge.isDirected() && edge.getSourceNodeId() === nodeId);\n }\n\n private _ensureEdgeData<T>(\n dag: MutGraph<NodeInterface, T>\n ): MutGraph<NodeInterface, EdgeInterface> {\n for (const link of dag.links()) {\n if (isEdgeInterface(link.data)) {\n continue;\n }\n const sourceNode = link.source.data;\n const targetNode = link.target.data;\n if (!isNodeInterface(sourceNode) || !isNodeInterface(targetNode)) {\n continue;\n }\n const key = this._edgeKey(sourceNode.getId(), targetNode.getId());\n const edge = this._edgeLookup.get(key);\n if (edge) {\n (link as unknown as MutGraphLink<NodeInterface, EdgeInterface>).data = edge;\n }\n }\n\n return dag as unknown as MutGraph<NodeInterface, EdgeInterface>;\n }\n\n private _getLayoutOperator(): LayoutWithConfiguration {\n if (this._layoutOperator) {\n return this._layoutOperator;\n }\n\n const layoutOption = this.props.layout ?? D3DagLayout.defaultProps.layout;\n let layout: LayoutWithConfiguration;\n\n if (typeof layoutOption === 'string') {\n layout = LAYOUT_FACTORIES[layoutOption]();\n } else {\n layout = layoutOption as LayoutWithConfiguration;\n }\n\n // TODO - is 'none' operator an option in d3-dag?\n if (layout.layering && this.props.layering) {\n let layeringOperator = this.props.customLayering || LAYERING_FACTORIES[this.props.layering]();\n layout = layout.layering(layeringOperator);\n const {nodeRank} = this.props;\n if (nodeRank) {\n // @ts-expect-error TS2345 - Argument of type '(dagNode: MutGraphNode<NodeInterface, EdgeInterface>) => number | undefined' is not assignable to parameter of type '(dagNode: MutGraphNode<NodeInterface, EdgeInterface>) => number'.\n layeringOperator = layeringOperator.rank((dagNode) => {\n const node = dagNode.data as NodeInterface;\n const rank =\n typeof nodeRank === 'function'\n ? nodeRank?.(node)\n : node?.getPropertyValue(nodeRank) || undefined;\n // if (rank !== undefined) {\n // console.log(`Node ${node.getId()} assigned to rank ${rank}`);\n // }\n return rank;\n });\n }\n layout = layout.layering(layeringOperator);\n }\n\n if (layout.decross && this.props.decross) {\n const decrossOperator = this.props.customDecross || DECROSS_FACTORIES[this.props.decross]();\n layout = layout.decross(decrossOperator);\n }\n\n if (layout.coord && this.props.coord) {\n const coordOperator = this.props.customCoord || COORD_FACTORIES[this.props.coord]();\n layout = layout.coord(coordOperator);\n }\n\n const nodeSize = this.props.nodeSize ?? DEFAULT_NODE_SIZE;\n if (layout.nodeSize) {\n layout = layout.nodeSize(nodeSize);\n }\n\n const gap = this.props.separation ?? this.props.gap ?? DEFAULT_GAP;\n if (layout.gap) {\n layout = layout.gap(gap);\n }\n\n this._layoutOperator = layout;\n return layout;\n }\n\n private _cacheGeometry(): void {\n this._rawNodePositions.clear();\n this._rawEdgePoints.clear();\n\n if (!this._dag) {\n this._dagBounds = null;\n this._bounds = null;\n return;\n }\n\n let minX = Number.POSITIVE_INFINITY;\n let maxX = Number.NEGATIVE_INFINITY;\n let minY = Number.POSITIVE_INFINITY;\n let maxY = Number.NEGATIVE_INFINITY;\n\n for (const dagNode of this._dag.nodes()) {\n const node = dagNode.data;\n const id = node.getId();\n const x = dagNode.x ?? 0;\n const y = dagNode.y ?? 0;\n\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n\n this._rawNodePositions.set(id, [x, y]);\n }\n\n if (minX === Number.POSITIVE_INFINITY) {\n this._dagBounds = null;\n this._bounds = null;\n this._nodePositions.clear();\n this._edgePoints.clear();\n this._edgeControlPoints.clear();\n return;\n }\n\n this._dagBounds = {\n minX,\n maxX,\n minY,\n maxY,\n centerX: (minX + maxX) / 2,\n centerY: (minY + maxY) / 2\n };\n\n for (const link of this._dag.links()) {\n const source = link.source.data;\n const target = link.target.data;\n if (!isNodeInterface(source) || !isNodeInterface(target)) {\n continue;\n }\n const edge = isEdgeInterface(link.data)\n ? link.data\n : this._edgeLookup.get(this._edgeKey(source.getId(), target.getId()));\n if (!edge) {\n continue;\n }\n const points =\n link.points && link.points.length\n ? link.points\n : [\n [link.source.x ?? 0, link.source.y ?? 0],\n [link.target.x ?? 0, link.target.y ?? 0]\n ];\n this._rawEdgePoints.set(\n edge.getId(),\n points.map((point) => [...point] as [number, number])\n );\n }\n\n this._updateTransformedGeometry();\n }\n\n private _updateTransformedGeometry(): void {\n this._nodePositions.clear();\n this._edgePoints.clear();\n this._edgeControlPoints.clear();\n\n if (!this._dagBounds) {\n this._bounds = null;\n return;\n }\n\n const {offsetX, offsetY} = this._getOffsets();\n const orientation = this.props.orientation ?? D3DagLayout.defaultProps.orientation;\n\n const transform = (x: number, y: number): [number, number] => {\n const localX = x - offsetX;\n const localY = y - offsetY;\n switch (orientation) {\n case 'BT':\n return [localX, localY];\n case 'LR':\n return [localY, localX];\n case 'RL':\n return [-localY, localX];\n case 'TB':\n default:\n return [localX, -localY];\n }\n };\n\n for (const [id, [x, y]] of this._rawNodePositions) {\n this._nodePositions.set(id, transform(x, y));\n }\n\n for (const [edgeId, points] of this._rawEdgePoints) {\n const transformed = points.map(([x, y]) => transform(x, y));\n this._edgePoints.set(edgeId, transformed);\n this._edgeControlPoints.set(edgeId, transformed.length > 2 ? transformed.slice(1, -1) : []);\n }\n\n for (const [id, position] of this._lockedNodePositions) {\n this._nodePositions.set(id, position);\n }\n\n this._bounds = this._calculateBounds(this._nodePositions.values());\n }\n\n private _getOffsets(): {offsetX: number; offsetY: number} {\n if (!this._dagBounds) {\n return {offsetX: 0, offsetY: 0};\n }\n const centerOption = this.props.center ?? true;\n let offsetX = 0;\n let offsetY = 0;\n if (centerOption === true) {\n offsetX = this._dagBounds.centerX;\n offsetY = this._dagBounds.centerY;\n } else if (centerOption && typeof centerOption === 'object') {\n if (centerOption.x) {\n offsetX = this._dagBounds.centerX;\n }\n if (centerOption.y) {\n offsetY = this._dagBounds.centerY;\n }\n }\n return {offsetX, offsetY};\n }\n\n protected override _updateBounds(): void {\n this._bounds = this._calculateBounds(this._nodePositions.values());\n }\n\n protected _edgeKey(sourceId: string | number, targetId: string | number): string {\n return `${this._toDagId(sourceId)}${DAG_ID_SEPARATOR}${this._toDagId(targetId)}`;\n }\n\n protected _toDagId(id: string | number): string {\n return String(id);\n }\n\n protected _fromDagId(id: string): string | number {\n return this._stringIdLookup.get(id) ?? id;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable no-continue, complexity, max-statements */\n\nimport type {Graph, NodeInterface, EdgeInterface} from '../../graph/graph';\nimport {log} from '../../utils/log';\n\nimport {D3DagLayout, type D3DagLayoutProps} from './d3-dag-layout';\n\ntype CollapsedChainDescriptor = {\n id: string;\n nodeIds: (string | number)[];\n edgeIds: (string | number)[];\n representativeId: string | number;\n};\n\nexport type CollapsableD3DagLayoutProps = D3DagLayoutProps & {\n /** Whether to collapse linear chains of nodes into a single representative. */\n collapseLinearChains?: boolean;\n};\n\nexport class CollapsableD3DagLayout extends D3DagLayout<CollapsableD3DagLayoutProps> {\n static override defaultProps: Required<CollapsableD3DagLayoutProps> = {\n ...D3DagLayout.defaultProps,\n collapseLinearChains: false\n };\n\n private _chainDescriptors = new Map<string, CollapsedChainDescriptor>();\n private _nodeToChainId = new Map<string | number, string>();\n private _collapsedChainState = new Map<string, boolean>();\n private _hiddenNodeIds = new Set<string | number>();\n\n constructor(props: CollapsableD3DagLayoutProps = {}) {\n super(props, CollapsableD3DagLayout.defaultProps);\n }\n\n override setProps(props: Partial<CollapsableD3DagLayoutProps>): void {\n super.setProps(props);\n if (props.collapseLinearChains !== undefined && this._graph) {\n this._runLayout();\n }\n }\n\n override updateGraph(graph: Graph): void {\n super.updateGraph(graph);\n this._chainDescriptors.clear();\n this._nodeToChainId.clear();\n this._hiddenNodeIds.clear();\n }\n\n override toggleCollapsedChain(chainId: string): void {\n if (!this._graph) {\n log.log(1, `CollapsableD3DagLayout: toggleCollapsedChain(${chainId}) ignored (no graph)`);\n return;\n }\n\n if (!this._chainDescriptors.has(chainId)) {\n this._refreshCollapsedChains();\n }\n\n if (!this._chainDescriptors.has(chainId)) {\n log.log(\n 1,\n `CollapsableD3DagLayout: toggleCollapsedChain(${chainId}) skipped (unknown chain)`\n );\n return;\n }\n\n const collapsed = this._isChainCollapsed(chainId);\n const nextState = !collapsed;\n log.log(\n 0,\n `CollapsableD3DagLayout: toggleCollapsedChain(${chainId}) -> ${nextState ? 'collapsed' : 'expanded'}`\n );\n // eslint-disable-next-line no-console\n console.log(\n `CollapsableD3DagLayout: toggleCollapsedChain(${chainId}) -> ${nextState ? 'collapsed' : 'expanded'}`\n );\n this._collapsedChainState.set(chainId, nextState);\n this._runLayout();\n }\n\n override setCollapsedChains(chainIds: Iterable<string>): void {\n if (!this._graph) {\n log.log(1, 'CollapsableD3DagLayout: setCollapsedChains ignored (no graph)');\n return;\n }\n\n if (!this._chainDescriptors.size) {\n this._refreshCollapsedChains();\n }\n\n const desired = new Set(chainIds);\n log.log(0, `CollapsableD3DagLayout: setCollapsedChains(${desired.size}) requested`);\n\n let changed = false;\n for (const chainId of this._chainDescriptors.keys()) {\n const next = desired.has(chainId);\n if (this._isChainCollapsed(chainId) !== next) {\n this._collapsedChainState.set(chainId, next);\n changed = true;\n }\n }\n\n if (changed) {\n log.log(\n 0,\n 'CollapsableD3DagLayout: setCollapsedChains -> changes detected, rerunning layout'\n );\n // eslint-disable-next-line no-console\n console.log(\n 'CollapsableD3DagLayout: setCollapsedChains -> changes detected, rerunning layout'\n );\n this._runLayout();\n } else {\n log.log(1, 'CollapsableD3DagLayout: setCollapsedChains -> no changes');\n // eslint-disable-next-line no-console\n console.log('CollapsableD3DagLayout: setCollapsedChains -> no changes');\n }\n }\n\n protected override _refreshCollapsedChains(): void {\n const previousChainCount = this._chainDescriptors.size;\n\n if (!this._graph) {\n if (previousChainCount > 0) {\n log.log(0, 'CollapsableD3DagLayout: clearing collapsed chains (graph unavailable)');\n // eslint-disable-next-line no-console\n console.log('CollapsableD3DagLayout: clearing collapsed chains (graph unavailable)');\n }\n this._chainDescriptors.clear();\n this._nodeToChainId.clear();\n this._hiddenNodeIds.clear();\n this._updateCollapsedChainNodeMetadata();\n return;\n }\n\n log.log(\n 0,\n `CollapsableD3DagLayout: refreshing collapsed chains (previous=${previousChainCount})`\n );\n // eslint-disable-next-line no-console\n console.log(\n `CollapsableD3DagLayout: refreshing collapsed chains (previous=${previousChainCount})`\n );\n\n const collapseDefault = this.props.collapseLinearChains;\n\n const previousStates = new Map(this._collapsedChainState);\n\n this._chainDescriptors.clear();\n this._nodeToChainId.clear();\n this._hiddenNodeIds.clear();\n\n const nodes = this._graph.getNodes();\n const candidateNodes = new Set<string | number>();\n const incomingCache = new Map<string | number, EdgeInterface[]>();\n const outgoingCache = new Map<string | number, EdgeInterface[]>();\n\n for (const node of nodes) {\n const incoming = this._getIncomingEdges(node);\n const outgoing = this._getOutgoingEdges(node);\n incomingCache.set(node.getId(), incoming);\n outgoingCache.set(node.getId(), outgoing);\n if (incoming.length <= 1 && outgoing.length <= 1 && incoming.length + outgoing.length > 0) {\n candidateNodes.add(node.getId());\n }\n }\n\n const visited = new Set<string | number>();\n for (const node of nodes) {\n const nodeId = node.getId();\n if (!candidateNodes.has(nodeId) || visited.has(nodeId)) {\n continue;\n }\n\n const incoming = incomingCache.get(nodeId) ?? [];\n const hasCandidateParent =\n incoming.length === 1 && candidateNodes.has(incoming[0].getSourceNodeId());\n if (hasCandidateParent) {\n continue;\n }\n\n const chainNodeIds: (string | number)[] = [];\n const chainEdgeIds: (string | number)[] = [];\n let currentNode: NodeInterface | undefined = node;\n\n while (currentNode) {\n const currentId = currentNode.getId();\n if (!candidateNodes.has(currentId) || visited.has(currentId)) {\n break;\n }\n\n visited.add(currentId);\n chainNodeIds.push(currentId);\n\n const outgoing = outgoingCache.get(currentId) ?? [];\n if (outgoing.length !== 1) {\n break;\n }\n\n const nextEdge = outgoing[0];\n const nextNodeId = nextEdge.getTargetNodeId();\n if (!candidateNodes.has(nextNodeId)) {\n break;\n }\n\n const nextIncoming = incomingCache.get(nextNodeId) ?? [];\n if (nextIncoming.length !== 1) {\n break;\n }\n\n chainEdgeIds.push(nextEdge.getId());\n currentNode = this._nodeLookup.get(nextNodeId);\n }\n\n if (chainNodeIds.length > 1) {\n const chainId = this._createChainId(chainNodeIds);\n const collapsed = previousStates.has(chainId)\n ? Boolean(previousStates.get(chainId))\n : collapseDefault;\n this._chainDescriptors.set(chainId, {\n id: chainId,\n nodeIds: chainNodeIds,\n edgeIds: chainEdgeIds,\n representativeId: chainNodeIds[0]\n });\n this._collapsedChainState.set(chainId, collapsed);\n for (const chainNodeId of chainNodeIds) {\n this._nodeToChainId.set(chainNodeId, chainId);\n }\n }\n }\n\n for (const key of previousStates.keys()) {\n if (!this._chainDescriptors.has(key)) {\n this._collapsedChainState.delete(key);\n }\n }\n\n this._hiddenNodeIds.clear();\n for (const [chainId, descriptor] of this._chainDescriptors) {\n const collapsed = this._isChainCollapsed(chainId);\n if (collapsed) {\n for (const nodeId of descriptor.nodeIds) {\n // eslint-disable-next-line max-depth\n if (nodeId !== descriptor.representativeId) {\n this._hiddenNodeIds.add(nodeId);\n }\n }\n }\n }\n\n this._updateCollapsedChainNodeMetadata();\n\n let collapsedCount = 0;\n for (const chainId of this._chainDescriptors.keys()) {\n if (this._isChainCollapsed(chainId)) {\n collapsedCount++;\n }\n }\n\n log.log(\n 0,\n `CollapsableD3DagLayout: refreshed collapsed chains -> total=${this._chainDescriptors.size}, collapsed=${collapsedCount}`\n );\n }\n\n protected override _updateCollapsedChainNodeMetadata(): void {\n if (!this._graph) {\n return;\n }\n\n for (const node of this._graph.getNodes()) {\n const nodeId = node.getId();\n const chainId = this._nodeToChainId.get(nodeId);\n\n if (!chainId) {\n node.setDataProperty('collapsedChainId', null);\n node.setDataProperty('collapsedChainLength', 1);\n node.setDataProperty('collapsedNodeIds', []);\n node.setDataProperty('collapsedEdgeIds', []);\n node.setDataProperty('collapsedChainRepresentativeId', null);\n node.setDataProperty('isCollapsedChain', false);\n continue;\n }\n\n const descriptor = this._chainDescriptors.get(chainId);\n if (!descriptor) {\n node.setDataProperty('collapsedChainId', null);\n node.setDataProperty('collapsedChainLength', 1);\n node.setDataProperty('collapsedNodeIds', []);\n node.setDataProperty('collapsedEdgeIds', []);\n node.setDataProperty('collapsedChainRepresentativeId', null);\n node.setDataProperty('isCollapsedChain', false);\n continue;\n }\n\n const collapsed = this._isChainCollapsed(chainId);\n node.setDataProperty('collapsedChainId', chainId);\n node.setDataProperty('collapsedChainLength', collapsed ? descriptor.nodeIds.length : 1);\n node.setDataProperty('collapsedNodeIds', descriptor.nodeIds);\n node.setDataProperty('collapsedEdgeIds', descriptor.edgeIds);\n node.setDataProperty('collapsedChainRepresentativeId', descriptor.representativeId);\n node.setDataProperty('isCollapsedChain', collapsed);\n }\n }\n\n protected override _shouldSkipNode(nodeId: string | number): boolean {\n return this._hiddenNodeIds.has(nodeId);\n }\n\n protected override _mapNodeId(nodeId: string | number): string | number {\n const chainId = this._nodeToChainId.get(nodeId);\n if (!chainId) {\n return nodeId;\n }\n\n const descriptor = this._chainDescriptors.get(chainId);\n if (!descriptor) {\n return nodeId;\n }\n\n return this._isChainCollapsed(chainId) ? descriptor.representativeId : nodeId;\n }\n\n private _createChainId(nodeIds: (string | number)[]): string {\n return `chain:${nodeIds.map((id) => this._toDagId(id)).join('>')}`;\n }\n\n private _isChainCollapsed(chainId: string): boolean {\n const collapseDefault = this.props.collapseLinearChains;\n return this._collapsedChainState.get(chainId) ?? collapseDefault;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {GraphLayout, GraphLayoutProps} from '../../core/graph-layout';\nimport type {Graph, NodeInterface, EdgeInterface} from '../../graph/graph';\n\nexport type GPUForceLayoutOptions = GraphLayoutProps & {\n alpha?: number;\n resumeAlpha?: number;\n nBodyStrength?: number;\n nBodyDistanceMin?: number;\n nBodyDistanceMax?: number;\n getCollisionRadius?: number;\n};\n\n/**\n * @todo this layout should be updated with the organizational and logic improvements made in d3-force\n */\nexport class GPUForceLayout extends GraphLayout<GPUForceLayoutOptions> {\n static defaultProps: Required<GPUForceLayoutOptions> = {\n ...GraphLayout.defaultProps,\n alpha: 0.3,\n resumeAlpha: 0.1,\n nBodyStrength: -900,\n nBodyDistanceMin: 100,\n nBodyDistanceMax: 400,\n getCollisionRadius: 0\n };\n\n protected readonly _name: string = 'GPU';\n private _d3Graph: {nodes: any[]; edges: any[]};\n private _nodeMap: Map<string | number, any>;\n private _edgeMap: Map<string | number, any>;\n private _graph: Graph | null;\n private _worker: Worker | null = null;\n\n constructor(options: GPUForceLayoutOptions = {}) {\n super(options, GPUForceLayout.defaultProps);\n\n this._name = 'GPU';\n // store graph and prepare internal data\n this._d3Graph = {nodes: [], edges: []};\n this._nodeMap = new Map();\n this._edgeMap = new Map();\n this._graph = null;\n }\n\n initializeGraph(graph: Graph) {\n this._graph = graph;\n this._nodeMap = new Map();\n this._edgeMap = new Map();\n // nodes\n const d3Nodes = Array.from(graph.getNodes(), (node) => {\n const id = node.getId();\n const locked = node.getPropertyValue('locked') || false;\n const x = node.getPropertyValue('x') || 0;\n const y = node.getPropertyValue('y') || 0;\n const collisionRadius = node.getPropertyValue('collisionRadius') || 0;\n const d3Node = {\n id,\n x,\n y,\n fx: locked ? x : null,\n fy: locked ? y : null,\n collisionRadius,\n locked\n };\n this._nodeMap.set(id, d3Node);\n return d3Node;\n });\n // edges\n const d3Edges = Array.from(graph.getEdges(), (edge) => {\n const id = edge.getId();\n const d3Edge = {\n id,\n source: this._nodeMap.get(edge.getSourceNodeId()),\n target: this._nodeMap.get(edge.getTargetNodeId())\n };\n this._edgeMap.set(id, d3Edge);\n return d3Edge;\n });\n this._d3Graph = {\n nodes: d3Nodes,\n edges: d3Edges\n };\n }\n\n start() {\n this._engageWorker();\n }\n\n update() {\n this._engageWorker();\n }\n\n _engageWorker() {\n // prevent multiple start\n if (this._worker) {\n this._worker.terminate();\n }\n\n this._worker = new Worker(new URL('./worker.js', import.meta.url).href);\n const {alpha, nBodyStrength, nBodyDistanceMin, nBodyDistanceMax, getCollisionRadius} =\n this.props;\n this._worker.postMessage({\n nodes: this._d3Graph.nodes,\n edges: this._d3Graph.edges,\n options: {\n alpha,\n nBodyStrength,\n nBodyDistanceMin,\n nBodyDistanceMax,\n getCollisionRadius\n }\n });\n this._worker.onmessage = (event) => {\n switch (event.data.type) {\n case 'tick':\n this.ticked(event.data);\n break;\n case 'end':\n this.ended(event.data);\n break;\n default:\n break;\n }\n };\n }\n ticked(data) {}\n ended(data) {\n const {nodes, edges} = data;\n this.updateD3Graph({nodes, edges});\n this._onLayoutChange();\n this._onLayoutDone();\n }\n resume() {\n throw new Error('Resume unavailable');\n }\n stop() {\n if (this._worker) {\n this._worker.terminate();\n this._worker = null;\n }\n }\n\n // for steaming new data on the same graph\n updateGraph(graph: Graph) {\n const previousName = this._graph?.getGraphName?.();\n const nextName = graph.getGraphName?.();\n const isSameGraph =\n (previousName && nextName && previousName === nextName) || this._graph === graph;\n if (!isSameGraph) {\n // reset the maps\n this._nodeMap = new Map();\n this._edgeMap = new Map();\n }\n this._graph = graph;\n // update internal layout data\n // nodes\n const newNodeMap = new Map<string | number, any>();\n const newD3Nodes = Array.from(graph.getNodes(), (node) => {\n const id = node.getId();\n const locked = node.getPropertyValue('locked') || false;\n const x = node.getPropertyValue('x') || 0;\n const y = node.getPropertyValue('y') || 0;\n const fx = locked ? x : null;\n const fy = locked ? y : null;\n const collisionRadius = node.getPropertyValue('collisionRadius') || 0;\n\n const oldD3Node = this._nodeMap.get(id);\n const newD3Node = oldD3Node ? oldD3Node : {id, x, y, fx, fy, collisionRadius};\n newNodeMap.set(id, newD3Node);\n return newD3Node;\n });\n this._nodeMap = newNodeMap;\n this._d3Graph.nodes = newD3Nodes;\n // edges\n const newEdgeMap = new Map<string | number, any>();\n const newD3Edges = Array.from(graph.getEdges(), (edge) => {\n const id = edge.getId();\n const oldD3Edge = this._edgeMap.get(id);\n const newD3Edge = oldD3Edge || {\n id,\n source: newNodeMap.get(edge.getSourceNodeId()),\n target: newNodeMap.get(edge.getTargetNodeId())\n };\n newEdgeMap.set(id, newD3Edge);\n return newD3Edge;\n });\n this._edgeMap = newEdgeMap;\n this._d3Graph.edges = newD3Edges;\n }\n\n updateD3Graph(graph: {nodes: any[]; edges: any[]}): void {\n const existingNodes = this._graph ? Array.from(this._graph.getNodes()) : [];\n // update internal layout data\n // nodes\n const newNodeMap = new Map<string | number, any>();\n const newD3Nodes = graph.nodes.map((node) => {\n // Update existing _graph with the new values\n const existingNode = existingNodes.find((n) => n.getId() === node.id);\n existingNode?.setDataProperty('locked', node.locked);\n existingNode?.setDataProperty('x', node.x);\n existingNode?.setDataProperty('y', node.y);\n existingNode?.setDataProperty('collisionRadius', node.collisionRadius);\n\n newNodeMap.set(node.id, node);\n return node;\n });\n this._nodeMap = newNodeMap;\n this._d3Graph.nodes = newD3Nodes;\n // edges\n const newEdgeMap = new Map<string | number, any>();\n const newD3Edges = graph.edges.map((edge) => {\n newEdgeMap.set(edge.id, edge);\n return edge;\n });\n this._graph?.triggerUpdate?.();\n this._edgeMap = newEdgeMap;\n this._d3Graph.edges = newD3Edges;\n }\n\n getNodePosition = (node: NodeInterface): [number, number] => {\n const d3Node = this._nodeMap.get(node.getId());\n if (d3Node) {\n return [d3Node.x, d3Node.y];\n }\n return [0, 0];\n };\n\n getEdgePosition = (edge: EdgeInterface) => {\n const d3Edge = this._edgeMap.get(edge.getId());\n const sourcePosition = d3Edge && d3Edge.source;\n const targetPosition = d3Edge && d3Edge.target;\n if (d3Edge && sourcePosition && targetPosition) {\n return {\n type: 'line',\n sourcePosition: [sourcePosition.x, sourcePosition.y],\n targetPosition: [targetPosition.x, targetPosition.y],\n controlPoints: []\n };\n }\n return {\n type: 'line',\n sourcePosition: [0, 0],\n targetPosition: [0, 0],\n controlPoints: []\n };\n };\n\n lockNodePosition = (node: NodeInterface, x: number, y: number) => {\n const d3Node = this._nodeMap.get(node.getId());\n if (!d3Node) {\n return;\n }\n d3Node.x = x;\n d3Node.y = y;\n d3Node.fx = x;\n d3Node.fy = y;\n this._onLayoutChange();\n this._onLayoutDone();\n };\n\n unlockNodePosition = (node: NodeInterface) => {\n const d3Node = this._nodeMap.get(node.getId());\n if (!d3Node) {\n return;\n }\n d3Node.fx = null;\n d3Node.fy = null;\n };\n\n protected override _updateBounds(): void {\n const positions = Array.from(this._nodeMap.values(), (node) => this._normalizePosition(node));\n this._bounds = this._calculateBounds(positions);\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {GraphLayout, GraphLayoutProps} from '../../core/graph-layout';\nimport type {Graph, NodeInterface, EdgeInterface} from '../../graph/graph';\n\nexport type RadialLayoutProps = GraphLayoutProps & {\n radius?: number;\n tree?: any;\n};\n\nconst getTreeNode = (\n nodeId: string,\n nodeMap: Record<string, {children?: string[]; isLeaf?: boolean}>\n) => {\n const node = nodeMap[nodeId];\n if (node) {\n return node;\n }\n return {\n id: nodeId,\n children: [],\n isLeaf: true\n };\n};\n\nconst traverseTree = (nodeId, nodeMap) => {\n const node = getTreeNode(nodeId, nodeMap);\n if (node.isLeaf) {\n return node;\n }\n return {\n ...node,\n children: (node.children ?? []).map((nid) => traverseTree(nid, nodeMap))\n };\n};\n\nconst getLeafNodeCount = (node, count) => {\n if (!node.children || node.children.length === 0) {\n return count + 1;\n }\n const sum = node.children.reduce((res, c) => {\n return res + getLeafNodeCount(c, 0);\n }, 0);\n return count + sum;\n};\n\nconst getTreeDepth = (node, depth = 0) => {\n if (node.isLeaf) {\n return depth;\n }\n return getTreeDepth(node.children[0], depth + 1);\n};\n\nconst getPath = (node, targetId, path) => {\n if (!node) {\n return false;\n }\n if (node.id === targetId) {\n path.push(node.id);\n return true;\n }\n const inChildren = node.children && node.children.some((c) => getPath(c, targetId, path));\n if (inChildren) {\n path.push(node.id);\n return true;\n }\n return false;\n};\n\nexport class RadialLayout extends GraphLayout<RadialLayoutProps> {\n static defaultProps = {\n ...GraphLayout.defaultProps,\n radius: 500,\n tree: []\n } as const satisfies Readonly<Required<RadialLayoutProps>>;\n\n _name = 'RadialLayout';\n _graph: Graph | null = null;\n // custom layout data structure\n _hierarchicalPoints = {};\n nestedTree;\n\n constructor(props: RadialLayoutProps = {}) {\n super(props, RadialLayout.defaultProps);\n }\n\n initializeGraph(graph: Graph): void {\n this.updateGraph(graph);\n }\n\n updateGraph(graph: Graph): void {\n this._graph = graph;\n }\n\n start(): void {\n if (!this._graph) {\n return;\n }\n const nodes = Array.from(this._graph.getNodes());\n const nodeCount = nodes.length;\n if (nodeCount === 0) {\n return;\n }\n\n const {tree} = this.props;\n\n if (!tree || tree.length === 0) {\n return;\n }\n\n this._onLayoutStart();\n\n const {radius} = this.props;\n const unitAngle = 360 / nodeCount;\n\n // hierarchical positions\n const rootNode = tree[0];\n\n const nodeMap = tree.reduce((res, node) => {\n res[node.id] = {\n ...node,\n isLeaf: !node.children || node.children.length === 0\n };\n return res;\n }, {});\n // nested structure\n this.nestedTree = traverseTree(rootNode.id, nodeMap);\n\n const totalLevels = getTreeDepth(this.nestedTree, 0);\n const distanceBetweenLevels = radius / (totalLevels - 1);\n\n const calculatePosition = (node, level, startAngle, positionMap) => {\n const isRoot = node.id === rootNode.id;\n\n if (node.children && node.children.length !== 0) {\n const groupSize = getLeafNodeCount(node, 0);\n // center the pos\n positionMap[node.id] = isRoot\n ? [0, 0]\n : rotate(\n 0,\n 0,\n 0,\n distanceBetweenLevels * (level + 1),\n startAngle + unitAngle * (groupSize / 2)\n );\n // calculate children position\n let tempAngle = startAngle;\n node.children.forEach((n) => {\n calculatePosition(n, level + 1, tempAngle, positionMap);\n tempAngle += getLeafNodeCount(n, 0) * unitAngle;\n });\n } else {\n positionMap[node.id] = rotate(\n 0,\n 0,\n 0,\n distanceBetweenLevels * (level + 1),\n startAngle + unitAngle\n );\n }\n };\n\n this._hierarchicalPoints = {};\n calculatePosition(this.nestedTree, 0, 0, this._hierarchicalPoints);\n // layout completes: notifiy component to re-render\n this._onLayoutChange();\n this._onLayoutDone();\n }\n\n stop(): void {}\n\n resume() {}\n\n update() {}\n\n getNodePosition = (node: NodeInterface) => {\n return this._hierarchicalPoints[node.getId()];\n };\n\n // spline curve version\n getEdgePosition = (edge: EdgeInterface) => {\n const sourceNodeId = edge.getSourceNodeId();\n const targetNodeId = edge.getTargetNodeId();\n const sourceNodePos = this._hierarchicalPoints[sourceNodeId];\n const targetNodePos = this._hierarchicalPoints[targetNodeId];\n\n const sourcePath = [];\n getPath(this.nestedTree, sourceNodeId, sourcePath);\n const targetPath = [];\n getPath(this.nestedTree, targetNodeId, targetPath);\n\n const totalLevels = sourcePath.length;\n let commonAncestorLevel = totalLevels - 1; // root\n for (let i = 0; i < totalLevels; i++) {\n if (sourcePath[i] === targetPath[i]) {\n commonAncestorLevel = i;\n break;\n }\n }\n\n const wayPoints = [];\n for (let i = 1; i <= commonAncestorLevel; i++) {\n const nodeId = sourcePath[i];\n wayPoints.push(this._hierarchicalPoints[nodeId]);\n }\n for (let i = commonAncestorLevel - 1; i > 0; i--) {\n const nodeId = targetPath[i];\n wayPoints.push(this._hierarchicalPoints[nodeId]);\n }\n\n return {\n type: 'spline-curve',\n sourcePosition: sourceNodePos,\n targetPosition: targetNodePos,\n controlPoints: wayPoints\n };\n };\n\n lockNodePosition = (node: NodeInterface, x: number, y: number) => {\n this._hierarchicalPoints[node.getId()] = [x, y];\n this._onLayoutChange();\n this._onLayoutDone();\n };\n\n protected override _updateBounds(): void {\n const positions = Object.values(this._hierarchicalPoints ?? {}).map((position) =>\n this._normalizePosition(position)\n );\n this._bounds = this._calculateBounds(positions);\n }\n}\n\nfunction rotate(cx, cy, x, y, angle) {\n const radians = (Math.PI / 180) * angle;\n const cos = Math.cos(radians);\n const sin = Math.sin(radians);\n const nx = cos * (x - cx) + sin * (y - cy) + cx;\n const ny = cos * (y - cy) - sin * (x - cx) + cy;\n return [nx, ny];\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {GraphLayout, GraphLayoutProps} from '../../core/graph-layout';\nimport type {Graph, NodeInterface, EdgeInterface} from '../../graph/graph';\nimport * as d3 from 'd3-force';\n\nexport type ForceMultiGraphLayoutProps = GraphLayoutProps & {\n alpha?: number;\n nBodyStrength?: number;\n nBodyDistanceMin?: number;\n nBodyDistanceMax?: number;\n};\n\nexport class ForceMultiGraphLayout extends GraphLayout<ForceMultiGraphLayoutProps> {\n static defaultProps = {\n ...GraphLayout.defaultProps,\n alpha: 3,\n nBodyStrength: -1200,\n nBodyDistanceMin: 100,\n nBodyDistanceMax: 1400\n } as const satisfies Readonly<Required<ForceMultiGraphLayoutProps>>;\n\n _name = 'ForceMultiGraphLayout';\n _graph: Graph | null = null;\n\n // d3 part\n // custom graph data\n _d3Graph: {nodes: any[]; edges: any[]} = {nodes: [], edges: []};\n _nodeMap = new Map<string | number, any>();\n _edgeMap = new Map<string | number, any>();\n _simulator: d3.Simulation<any, undefined> | null = null;\n\n constructor(props: ForceMultiGraphLayoutProps = {}) {\n super(props, ForceMultiGraphLayout.defaultProps);\n }\n\n initializeGraph(graph: Graph): void {\n this.updateGraph(graph);\n }\n\n _strength = (d3Edge) => {\n if (d3Edge.isVirtual) {\n return 1 / d3Edge.edgeCount;\n }\n const sourceNode = this._graph?.findNode(d3Edge.source.id);\n const targetNode = this._graph?.findNode(d3Edge.target.id);\n const sourceDegree = sourceNode?.getDegree() ?? 0;\n const targetDegree = targetNode?.getDegree() ?? 0;\n return 1 / Math.min(sourceDegree, targetDegree);\n };\n\n _generateSimulator() {\n if (this._simulator) {\n this._simulator.on('tick', null).on('end', null);\n this._simulator = null;\n }\n const {alpha, nBodyStrength, nBodyDistanceMin, nBodyDistanceMax} = this.props;\n\n const g = this._d3Graph;\n this._simulator = d3\n .forceSimulation(g.nodes)\n .force(\n 'edge',\n d3\n .forceLink(g.edges)\n // @ts-ignore TODO id not defined?\n .id((n) => n.id)\n .strength(this._strength)\n )\n .force(\n 'charge',\n d3\n .forceManyBody()\n .strength(nBodyStrength)\n .distanceMin(nBodyDistanceMin)\n .distanceMax(nBodyDistanceMax)\n )\n .force('center', d3.forceCenter())\n .alpha(alpha);\n // register event callbacks\n this._simulator.on('tick', this._onLayoutChange).on('end', this._onLayoutDone);\n }\n\n start() {\n this._generateSimulator();\n this._simulator.restart();\n }\n\n resume() {\n this._simulator.restart();\n }\n\n stop() {\n this._simulator.stop();\n }\n\n update(): void {}\n\n updateGraph(graph: Graph) {\n this._graph = graph;\n\n // nodes\n const newNodeMap = new Map<string | number, any>();\n const nodes = Array.from(graph.getNodes());\n const newD3Nodes = nodes.map((node) => {\n const id = node.getId();\n const oldD3Node = this._nodeMap.get(id);\n const newD3Node = oldD3Node ? oldD3Node : {id};\n newNodeMap.set(id, newD3Node);\n return newD3Node;\n });\n\n // edges\n // bucket edges between the same source/target node pairs.\n const edges = Array.from(graph.getEdges());\n const nodePairs = edges.reduce((res, edge) => {\n const endpoints = [edge.getSourceNodeId(), edge.getTargetNodeId()];\n // sort the node ids to count the edges with the same pair\n // but different direction (a -> b or b -> a)\n const pairId = endpoints.sort().toString();\n // push this edge into the bucket\n if (!res[pairId]) {\n res[pairId] = [edge];\n } else {\n res[pairId].push(edge);\n }\n return res;\n }, {});\n\n // go through each pair of edges,\n // if only one edge between two nodes, create a straight line\n // otherwise, create one virtual node and two edges for each edge\n const newD3Edges: any[] = [];\n const newEdgeMap = new Map<string | number, any>();\n\n Object.keys(nodePairs).forEach((pairId) => {\n const betweenEdges = nodePairs[pairId];\n const firstEdge = betweenEdges[0];\n if (betweenEdges.length === 1) {\n // do nothing, this is a real edge\n const newD3Edge = {\n type: 'line',\n id: firstEdge.getId(),\n source: newNodeMap.get(firstEdge.getSourceNodeId()),\n target: newNodeMap.get(firstEdge.getTargetNodeId()),\n isVirtual: false\n };\n newEdgeMap.set(firstEdge.getId(), newD3Edge);\n newD3Edges.push(newD3Edge);\n return;\n }\n\n // else reduce to one virtual edge\n const newD3Edge = {\n type: 'line',\n id: pairId,\n source: newNodeMap.get(firstEdge.getSourceNodeId()),\n target: newNodeMap.get(firstEdge.getTargetNodeId()),\n isVirtual: true,\n edgeCount: betweenEdges.length\n };\n newEdgeMap.set(pairId, newD3Edge);\n newD3Edges.push(newD3Edge);\n\n betweenEdges.forEach((e, idx) => {\n const edgeId = e.getId();\n newEdgeMap.set(edgeId, {\n type: 'spline-curve',\n id: edgeId,\n source: newNodeMap.get(e.getSourceNodeId()),\n target: newNodeMap.get(e.getTargetNodeId()),\n virtualEdgeId: pairId,\n isVirtual: true,\n index: idx\n });\n });\n });\n\n this._nodeMap = newNodeMap;\n this._d3Graph.nodes = newD3Nodes;\n this._edgeMap = newEdgeMap;\n this._d3Graph.edges = newD3Edges;\n }\n\n getNodePosition = (node: NodeInterface): [number, number] => {\n const d3Node = this._nodeMap.get(node.getId());\n if (d3Node) {\n return [d3Node.x, d3Node.y];\n }\n // default value\n return [0, 0];\n };\n\n getEdgePosition = (edge: EdgeInterface) => {\n const d3Edge = this._edgeMap.get(edge.getId());\n if (d3Edge) {\n if (!d3Edge.isVirtual) {\n return {\n type: 'line',\n sourcePosition: [d3Edge.source.x, d3Edge.source.y],\n targetPosition: [d3Edge.target.x, d3Edge.target.y],\n controlPoints: []\n };\n }\n // else, check the referenced virtual edge\n const virtualEdge = this._edgeMap.get(d3Edge.virtualEdgeId);\n if (!virtualEdge) {\n return null;\n }\n const edgeCount = virtualEdge.edgeCount;\n // get the position of source and target nodes\n const sourcePosition = [virtualEdge.source.x, virtualEdge.source.y];\n const targetPosition = [virtualEdge.target.x, virtualEdge.target.y];\n // calculate a symmetric curve\n const distance = Math.hypot(\n sourcePosition[0] - targetPosition[0],\n sourcePosition[1] - targetPosition[1]\n );\n const index = d3Edge.index;\n // curve direction: inward vs. outward\n const direction = index % 2 ? 1 : -1;\n // if the number of the parallel edges is an even number => symmetric shape\n // otherwise, the 0th node will be a staight line, and rest of them are symmetrical.\n const symmetricShape = edgeCount % 2 === 0;\n const offset =\n Math.max(distance / 10, 5) *\n (symmetricShape ? Math.floor(index / 2 + 1) : Math.ceil(index / 2));\n const controlPoint = computeControlPoint(sourcePosition, targetPosition, direction, offset);\n return {\n type: 'spline-curve',\n sourcePosition,\n targetPosition,\n controlPoints: [controlPoint]\n };\n }\n // default value\n return {\n type: 'line',\n sourcePosition: [0, 0],\n targetPosition: [0, 0],\n controlPoints: []\n };\n };\n\n lockNodePosition = (node: NodeInterface, x: number, y: number) => {\n const d3Node = this._nodeMap.get(node.getId());\n if (!d3Node) {\n return;\n }\n d3Node.x = x;\n d3Node.y = y;\n this._onLayoutChange();\n this._onLayoutDone();\n };\n\n protected override _updateBounds(): void {\n const positions = Array.from(this._nodeMap.values(), (node) => this._normalizePosition(node));\n this._bounds = this._calculateBounds(positions);\n }\n}\n\n/**\n * A helper function to compute the control point of a curve\n * @param {number[]} source - the coordinates of source point, ex: [x, y, z]\n * @param {number[]} target - the coordinates of target point, ex: [x, y, z]\n * @param {number} direction - the direction of the curve, 1 or -1\n * @param {number} offset - offset from the midpoint\n * @return {number[]} - the coordinates of the control point\n */\nfunction computeControlPoint(source, target, direction, offset) {\n const midPoint = [(source[0] + target[0]) / 2, (source[1] + target[1]) / 2];\n const dx = target[0] - source[0];\n const dy = target[1] - source[1];\n const normal = [dy, -dx];\n const length = Math.sqrt(Math.pow(normal[0], 2.0) + Math.pow(normal[1], 2.0));\n const normalized = [normal[0] / length, normal[1] / length];\n return [\n midPoint[0] + normalized[0] * offset * direction,\n midPoint[1] + normalized[1] * offset * direction\n ];\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {GraphLayout, GraphLayoutProps} from '../../core/graph-layout';\nimport type {Graph, NodeInterface, EdgeInterface} from '../../graph/graph';\n\nexport type HivePlotLayoutProps = GraphLayoutProps & {\n innerRadius?: number;\n outerRadius?: number;\n getNodeAxis?: (node: NodeInterface) => any;\n};\n\nexport class HivePlotLayout extends GraphLayout<HivePlotLayoutProps> {\n static defaultProps = {\n ...GraphLayout.defaultProps,\n innerRadius: 100,\n outerRadius: 500,\n getNodeAxis: (node: NodeInterface) => node.getPropertyValue('group')\n } as const satisfies Readonly<Required<HivePlotLayoutProps>>;\n\n _name = 'HivePlot';\n _graph: Graph | null = null;\n _totalAxis: number = 0;\n _axis: Record<string, NodeInterface[]> = {};\n _nodeMap = new Map<string | number, NodeInterface>();\n _nodePositionMap = new Map<string | number, [number, number]>();\n\n constructor(props: HivePlotLayoutProps = {}) {\n super(props, HivePlotLayout.defaultProps);\n }\n\n initializeGraph(graph: Graph) {\n this.updateGraph(graph);\n }\n\n updateGraph(graph: Graph) {\n const {getNodeAxis, innerRadius, outerRadius} = this.props;\n this._graph = graph;\n const nodes = Array.from(graph.getNodes());\n this._nodeMap = new Map(nodes.map((node) => [node.getId(), node]));\n\n // bucket nodes into few axis\n\n this._axis = nodes.reduce((res, node) => {\n const axis = getNodeAxis(node);\n if (!res[axis]) {\n res[axis] = [];\n }\n res[axis].push(node);\n return res;\n }, {});\n\n // sort nodes along the same axis by degree\n this._axis = Object.keys(this._axis).reduce((res, axis) => {\n const bucketedNodes = this._axis[axis];\n const sortedNodes = bucketedNodes.sort((a, b) => {\n if (a.getDegree() > b.getDegree()) {\n return 1;\n }\n if (a.getDegree() === b.getDegree()) {\n return 0;\n }\n return -1;\n });\n res[axis] = sortedNodes;\n return res;\n }, {});\n this._totalAxis = Object.keys(this._axis).length;\n const center = [0, 0];\n const angleInterval = 360 / Object.keys(this._axis).length;\n\n // calculate positions\n this._nodePositionMap = new Map();\n Object.keys(this._axis).forEach((axis, axisIdx) => {\n const axisAngle = angleInterval * axisIdx;\n const bucketedNodes = this._axis[axis];\n const interval = (outerRadius - innerRadius) / bucketedNodes.length;\n\n bucketedNodes.forEach((node, idx) => {\n const radius = innerRadius + idx * interval;\n const x = Math.cos((axisAngle / 180) * Math.PI) * radius + center[0];\n const y = Math.sin((axisAngle / 180) * Math.PI) * radius + center[1];\n this._nodePositionMap.set(node.getId(), [x, y]);\n });\n });\n }\n\n start() {\n this._onLayoutStart();\n this._onLayoutChange();\n this._onLayoutDone();\n }\n\n stop() {}\n\n update() {}\n\n resume() {}\n\n getNodePosition = (node: NodeInterface) => this._nodePositionMap.get(node.getId());\n\n getEdgePosition = (edge: EdgeInterface) => {\n const {getNodeAxis} = this.props;\n const sourceNodeId = edge.getSourceNodeId();\n const targetNodeId = edge.getTargetNodeId();\n\n const sourcePosition = this._nodePositionMap.get(sourceNodeId);\n const targetPosition = this._nodePositionMap.get(targetNodeId);\n\n if (!sourcePosition || !targetPosition) {\n return null;\n }\n\n const sourceNode = this._nodeMap.get(sourceNodeId);\n const targetNode = this._nodeMap.get(targetNodeId);\n\n const sourceNodeAxis = sourceNode ? getNodeAxis(sourceNode) : null;\n const targetNodeAxis = targetNode ? getNodeAxis(targetNode) : null;\n\n if (sourceNodeAxis !== null && sourceNodeAxis === targetNodeAxis) {\n return {\n type: 'line',\n sourcePosition,\n targetPosition,\n controlPoints: []\n };\n }\n\n const controlPoint = computeControlPoint({\n sourcePosition,\n sourceNodeAxis: sourceNodeAxis ?? 0,\n targetPosition,\n targetNodeAxis: targetNodeAxis ?? 0,\n totalAxis: this._totalAxis\n });\n\n return {\n type: 'spline-curve',\n sourcePosition,\n targetPosition,\n controlPoints: [controlPoint]\n };\n };\n\n lockNodePosition = (node: NodeInterface, x: number, y: number) => {\n this._nodePositionMap.set(node.getId(), [x, y]);\n this._onLayoutChange();\n this._onLayoutDone();\n };\n\n protected override _updateBounds(): void {\n const positions = Array.from(this._nodePositionMap.values(), (position) =>\n this._normalizePosition(position)\n );\n this._bounds = this._calculateBounds(positions);\n }\n}\n\nfunction computeControlPoint({\n sourcePosition,\n sourceNodeAxis,\n targetPosition,\n targetNodeAxis,\n totalAxis\n}): [number, number] {\n const halfAxis = (totalAxis - 1) / 2;\n // check whether the source/target are at the same side.\n const sameSide =\n (sourceNodeAxis <= halfAxis && targetNodeAxis <= halfAxis) ||\n (sourceNodeAxis > halfAxis && targetNodeAxis > halfAxis);\n // curve direction\n const direction = sameSide && sourceNodeAxis <= halfAxis && targetNodeAxis <= halfAxis ? 1 : -1;\n\n // flip the source/target to follow the clockwise diretion\n const source = sourceNodeAxis < targetNodeAxis && sameSide ? sourcePosition : targetPosition;\n const target = sourceNodeAxis < targetNodeAxis && sameSide ? targetPosition : sourcePosition;\n\n // calculate offset\n const distance = Math.hypot(source[0] - target[0], source[1] - target[1]);\n const offset = distance * 0.2;\n\n const midPoint = [(source[0] + target[0]) / 2, (source[1] + target[1]) / 2];\n const dx = target[0] - source[0];\n const dy = target[1] - source[1];\n const normal = [dy, -dx];\n const length = Math.hypot(dy, -dx);\n const normalized = [normal[0] / length, normal[1] / length];\n return [\n midPoint[0] + normalized[0] * offset * direction,\n midPoint[1] + normalized[1] * offset * direction\n ];\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable no-continue */\n\nimport type {CompositeLayerProps} from '@deck.gl/core';\nimport {COORDINATE_SYSTEM, CompositeLayer} from '@deck.gl/core';\nimport {PolygonLayer} from '@deck.gl/layers';\n\nimport type {Graph, NodeInterface} from '../graph/graph';\nimport {ClassicGraph} from '../graph/classic-graph';\nimport {GraphLayout, type GraphLayoutEventDetail} from '../core/graph-layout';\nimport {GraphEngine} from '../core/graph-engine';\n\nimport {\n GraphStylesheetEngine,\n type GraphStylesheet,\n type GraphStyleRule\n} from '../style/graph-style-engine';\n\nimport {\n DEFAULT_GRAPH_LAYER_STYLESHEET_INPUT,\n normalizeGraphLayerStylesheet,\n type GraphLayerEdgeStyle,\n type GraphLayerNodeStyle,\n type NormalizedGraphLayerStylesheet\n} from '../style/graph-layer-stylesheet';\n\n// node layers\nimport {CircleLayer} from './node-layers/circle-layer';\nimport {ImageLayer} from './node-layers/image-layer';\nimport {LabelLayer} from './node-layers/label-layer';\nimport {RectangleLayer} from './node-layers/rectangle-layer';\nimport {RoundedRectangleLayer} from './node-layers/rounded-rectangle-layer';\nimport {PathBasedRoundedRectangleLayer} from './node-layers/path-rounded-rectangle-layer';\nimport {ZoomableMarkerLayer} from './node-layers/zoomable-marker-layer';\n\n// edge layers\nimport {EdgeLayer} from './edge-layer';\nimport {EdgeLabelLayer} from './edge-layers/edge-label-layer';\nimport {FlowLayer} from './edge-layers/flow-layer';\nimport {EdgeArrowLayer} from './edge-layers/edge-arrow-layer';\nimport {EdgeAttachmentHelper} from './edge-attachment-helper';\nimport {GridLayer, type GridLayerProps} from './common-layers/grid-layer/grid-layer';\n\nimport {mixedGetPosition} from '../utils/layer-utils';\nimport {InteractionManager} from '../core/interaction-manager';\nimport {buildCollapsedChainLayers} from '../utils/collapsed-chains';\nimport {\n mapRanksToYPositions,\n selectRankLines,\n type LabelAccessor,\n type RankAccessor\n} from '../utils/rank-grid';\nimport {createGraphFromData} from '../graph/functions/create-graph-from-data';\n\nimport {warn} from '../utils/log';\n\nconst NODE_LAYER_MAP = {\n rectangle: RectangleLayer,\n 'rounded-rectangle': RoundedRectangleLayer,\n 'path-rounded-rectangle': PathBasedRoundedRectangleLayer,\n icon: ImageLayer,\n circle: CircleLayer,\n label: LabelLayer,\n marker: ZoomableMarkerLayer\n};\n\nconst EDGE_DECORATOR_LAYER_MAP = {\n 'edge-label': EdgeLabelLayer,\n flow: FlowLayer,\n arrow: EdgeArrowLayer\n};\n\ntype GridLayerOverrides = Partial<Omit<GridLayerProps, 'id' | 'data' | 'direction'>>;\n\nexport type RankGridConfig = {\n enabled?: boolean;\n direction?: 'horizontal' | 'vertical';\n maxLines?: number;\n rankAccessor?: RankAccessor;\n labelAccessor?: LabelAccessor;\n gridProps?: GridLayerOverrides;\n};\n\nconst SHARED_LAYER_PROPS = {\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n parameters: {\n depthTest: false\n }\n};\n\nconst NODE_STYLE_DEPRECATION_MESSAGE =\n 'GraphLayer: `nodeStyle` has been replaced by `stylesheet.nodes` and will be removed in a future release.';\nconst EDGE_STYLE_DEPRECATION_MESSAGE =\n 'GraphLayer: `edgeStyle` has been replaced by `stylesheet.edges` and will be removed in a future release.';\n\nconst GRAPH_PROP_DEPRECATION_MESSAGE =\n 'GraphLayer: `graph` prop is deprecated. Pass graphs via the `data` prop instead.';\nconst LAYOUT_REQUIRED_MESSAGE =\n 'GraphLayer: `layout` must be provided when supplying raw graph data.';\n\nlet NODE_STYLE_DEPRECATION_WARNED = false;\nlet EDGE_STYLE_DEPRECATION_WARNED = false;\nlet GRAPH_PROP_DEPRECATION_WARNED = false;\nlet LAYOUT_REQUIRED_WARNED = false;\nconst DEFAULT_GRAPH_LOADER = ({json}: {json: unknown}) => {\n if (!json || typeof json !== 'object') {\n return null;\n }\n\n return createGraphFromData(json as any);\n};\n\nexport type GraphLayerRawData = {\n name?: string;\n nodes?: unknown[] | null;\n edges?: unknown[] | null;\n};\n\nexport type GraphLayerDataInput =\n | GraphEngine\n | Graph\n | GraphLayerRawData\n | unknown[]\n | string\n | null;\n\nexport type GraphLayerProps = CompositeLayerProps &\n _GraphLayerProps & {\n data?: GraphLayerDataInput | Promise<GraphLayerDataInput>;\n };\n\ntype EngineResolutionFlags = {\n force: boolean;\n dataChanged: boolean;\n layoutChanged: boolean;\n graphChanged: boolean;\n engineChanged: boolean;\n loaderChanged: boolean;\n};\n\nexport type _GraphLayerProps = {\n graph?: Graph;\n layout?: GraphLayout;\n graphLoader?: (opts: {json: unknown}) => Graph | null;\n engine?: GraphEngine;\n\n onLayoutStart?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutChange?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutDone?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutError?: (error?: unknown) => void;\n\n stylesheet?: GraphStylesheet;\n /** @deprecated Use `stylesheet.nodes`. */\n nodeStyle?: GraphLayerNodeStyle[];\n /** @deprecated Use `stylesheet.edges`. */\n edgeStyle?: GraphLayerEdgeStyle | GraphLayerEdgeStyle[];\n nodeEvents?: {\n onMouseLeave?: () => void;\n onHover?: () => void;\n onMouseEnter?: () => void;\n onClick?: () => void;\n onDrag?: () => void;\n };\n edgeEvents?: {\n onClick: () => void;\n onHover: () => void;\n };\n enableDragging?: boolean;\n rankGrid?: boolean | RankGridConfig;\n resumeLayoutAfterDragging?: boolean;\n};\n\n/** Composite layer that renders graph nodes, edges, and decorators. */\nexport class GraphLayer extends CompositeLayer<GraphLayerProps> {\n static layerName = 'GraphLayer';\n\n static defaultProps: _GraphLayerProps &\n Pick<CompositeLayerProps, 'pickable'> & {\n data: {type: string; value: null; async: true};\n } = {\n // Composite layer props\n pickable: true,\n data: {type: 'object', value: null, async: true},\n\n // Graph props\n graphLoader: DEFAULT_GRAPH_LOADER,\n\n stylesheet: DEFAULT_GRAPH_LAYER_STYLESHEET_INPUT,\n nodeStyle: undefined as unknown as GraphLayerNodeStyle[],\n nodeEvents: {\n onMouseLeave: () => {},\n onHover: () => {},\n onMouseEnter: () => {},\n onClick: () => {},\n onDrag: () => {}\n },\n edgeStyle: undefined as unknown as GraphLayerEdgeStyle | GraphLayerEdgeStyle[],\n edgeEvents: {\n onClick: () => {},\n onHover: () => {}\n },\n enableDragging: false,\n rankGrid: false,\n resumeLayoutAfterDragging: true\n };\n\n // @ts-expect-error Some typescript confusion due to override of base class state\n state!: CompositeLayer<GraphLayerProps>['state'] & {\n interactionManager: InteractionManager;\n graphEngine?: GraphEngine | null;\n layoutVersion: number;\n layoutState?: string;\n interactionVersion: number;\n };\n\n private readonly _edgeAttachmentHelper = new EdgeAttachmentHelper();\n private _suppressNextDeckDataChange = false;\n\n forceUpdate = () => {\n if (!this.state) {\n return;\n }\n\n this.setNeedsRedraw();\n this.setState({interactionVersion: this.state.interactionVersion + 1});\n };\n\n constructor(props: GraphLayerProps & CompositeLayerProps) {\n super(props);\n }\n\n initializeState() {\n const interactionManager = new InteractionManager(\n {\n nodeEvents: this.props.nodeEvents,\n edgeEvents: this.props.edgeEvents,\n engine: undefined as any,\n enableDragging: Boolean(this.props.enableDragging),\n resumeLayoutAfterDragging: Boolean(\n this.props.resumeLayoutAfterDragging ?? GraphLayer.defaultProps.resumeLayoutAfterDragging\n )\n },\n () => this.forceUpdate()\n );\n\n this.state = {\n interactionManager,\n graphEngine: null,\n layoutVersion: 0,\n layoutState: undefined,\n interactionVersion: 0\n } as typeof this.state;\n\n this._syncInteractionManager(this.props, null);\n this._refreshEngineFromProps(this.props, {force: true});\n }\n\n shouldUpdateState({changeFlags}) {\n return changeFlags.dataChanged || changeFlags.propsChanged || changeFlags.stateChanged;\n }\n\n updateState({props, oldProps, changeFlags}) {\n const propsDataChanged = props.data !== oldProps.data;\n const deckDataChanged =\n changeFlags.dataChanged && !(this._suppressNextDeckDataChange && !propsDataChanged);\n const dataChanged = deckDataChanged || propsDataChanged;\n const layoutChanged = props.layout !== oldProps.layout;\n const graphChanged = props.graph !== oldProps.graph;\n const engineChanged = props.engine !== oldProps.engine;\n const loaderChanged = props.graphLoader !== oldProps.graphLoader;\n\n const engineRefreshed = this._refreshEngineFromProps(props, {\n dataChanged,\n layoutChanged,\n graphChanged,\n engineChanged,\n loaderChanged\n });\n\n if (!engineRefreshed && changeFlags.propsChanged) {\n const engine = this.state.graphEngine;\n if (engine) {\n this._applyGraphEngineCallbacks(engine);\n }\n }\n\n if (!engineRefreshed && (changeFlags.propsChanged || changeFlags.stateChanged)) {\n this._syncInteractionManager(props, this.state.graphEngine ?? null);\n }\n\n this._suppressNextDeckDataChange = false;\n }\n\n finalize() {\n this._removeGraphEngine();\n this._syncInteractionManager(this.props, null);\n }\n\n private _getResolvedStylesheet(): NormalizedGraphLayerStylesheet {\n const {stylesheet, nodeStyle, edgeStyle} = this.props;\n\n const usingNodeStyle = typeof nodeStyle !== 'undefined';\n if (usingNodeStyle && !NODE_STYLE_DEPRECATION_WARNED) {\n warn(NODE_STYLE_DEPRECATION_MESSAGE);\n NODE_STYLE_DEPRECATION_WARNED = true;\n }\n\n const usingEdgeStyle = typeof edgeStyle !== 'undefined';\n if (usingEdgeStyle && !EDGE_STYLE_DEPRECATION_WARNED) {\n warn(EDGE_STYLE_DEPRECATION_MESSAGE);\n EDGE_STYLE_DEPRECATION_WARNED = true;\n }\n\n return normalizeGraphLayerStylesheet({\n stylesheet,\n nodeStyle: usingNodeStyle ? nodeStyle : undefined,\n edgeStyle: usingEdgeStyle ? edgeStyle : undefined\n });\n }\n\n private _createStylesheetEngine(\n style: GraphStyleRule,\n context: string\n ): GraphStylesheetEngine | null {\n try {\n return new GraphStylesheetEngine(style, {\n stateUpdateTrigger: (this.state.interactionManager as any).getLastInteraction()\n });\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n warn(`GraphLayer: Failed to apply ${context}: ${message}`);\n return null;\n }\n }\n\n private _refreshEngineFromProps(\n props: GraphLayerProps,\n {\n force = false,\n dataChanged = false,\n layoutChanged = false,\n graphChanged = false,\n engineChanged = false,\n loaderChanged = false\n }: {\n force?: boolean;\n dataChanged?: boolean;\n layoutChanged?: boolean;\n graphChanged?: boolean;\n engineChanged?: boolean;\n loaderChanged?: boolean;\n }\n ): boolean {\n const {engine: nextEngine, shouldReplace} = this._resolveEngineCandidate(props, {\n force,\n dataChanged,\n layoutChanged,\n graphChanged,\n engineChanged,\n loaderChanged\n });\n\n if (nextEngine === undefined) {\n return false;\n }\n\n const currentEngine = this.state.graphEngine ?? null;\n if (!shouldReplace && nextEngine === currentEngine) {\n return false;\n }\n\n this._setGraphEngine(nextEngine);\n this._syncInteractionManager(props, nextEngine);\n return true;\n }\n\n private _resolveEngineCandidate(\n props: GraphLayerProps,\n flags: EngineResolutionFlags\n ): {engine: GraphEngine | null | undefined; shouldReplace: boolean} {\n const dataResult = this._getEngineFromData(props, flags);\n if (dataResult) {\n return dataResult;\n }\n\n const engineResult = this._getEngineFromEngineProp(props, flags);\n if (engineResult) {\n return engineResult;\n }\n\n const graphResult = this._getEngineFromGraphProp(props, flags);\n if (graphResult) {\n return graphResult;\n }\n\n if (props.data === null || props.graph === null || props.engine === null || flags.force) {\n return {engine: null, shouldReplace: true};\n }\n\n return {engine: undefined, shouldReplace: flags.force};\n }\n\n private _getEngineFromData(\n props: GraphLayerProps,\n {force, dataChanged, layoutChanged, loaderChanged}: EngineResolutionFlags\n ): {engine: GraphEngine | null | undefined; shouldReplace: boolean} | null {\n const dataValue = props.data as GraphLayerDataInput | null | undefined;\n if (dataValue === null || typeof dataValue === 'undefined') {\n return null;\n }\n\n const shouldRebuild = force || dataChanged || layoutChanged || loaderChanged;\n if (!shouldRebuild) {\n return {engine: undefined, shouldReplace: false};\n }\n\n const engine = this._deriveEngineFromData(dataValue, props);\n if (typeof engine === 'undefined') {\n return {engine: undefined, shouldReplace: false};\n }\n\n return {\n engine,\n shouldReplace: true\n };\n }\n\n private _getEngineFromEngineProp(\n props: GraphLayerProps,\n {force, engineChanged}: EngineResolutionFlags\n ): {engine: GraphEngine | null | undefined; shouldReplace: boolean} | null {\n if (typeof props.engine === 'undefined') {\n return null;\n }\n\n if (props.engine === null) {\n return {engine: null, shouldReplace: true};\n }\n\n return {\n engine: props.engine,\n shouldReplace: force || engineChanged\n };\n }\n\n private _getEngineFromGraphProp(\n props: GraphLayerProps,\n {force, graphChanged, layoutChanged}: EngineResolutionFlags\n ): {engine: GraphEngine | null | undefined; shouldReplace: boolean} | null {\n if (typeof props.graph === 'undefined') {\n return null;\n }\n\n if (props.graph === null) {\n return {engine: null, shouldReplace: true};\n }\n\n this._warnGraphProp();\n return {\n engine: this._buildEngineFromGraph(props.graph, props.layout),\n shouldReplace: force || graphChanged || layoutChanged\n };\n }\n\n private _deriveEngineFromData(\n data: GraphLayerDataInput,\n props: GraphLayerProps\n ): GraphEngine | null | undefined {\n if (data === null || typeof data === 'undefined') {\n return null;\n }\n\n if (typeof (data as PromiseLike<GraphLayerDataInput>)?.then === 'function') {\n return undefined;\n }\n\n if (data instanceof GraphEngine) {\n return data;\n }\n\n const graphCandidate = this._coerceGraph(data);\n if (graphCandidate) {\n return this._buildEngineFromGraph(graphCandidate, props.layout);\n }\n\n if (typeof data === 'string') {\n return undefined;\n }\n\n if (Array.isArray(data) || isPlainObject(data)) {\n const loader = props.graphLoader ?? DEFAULT_GRAPH_LOADER;\n const graph = loader({json: data});\n if (!graph) {\n return null;\n }\n return this._buildEngineFromGraph(graph, props.layout);\n }\n\n return null;\n }\n\n private _buildEngineFromGraph(\n graph: Graph | null,\n layout?: GraphLayout | null\n ): GraphEngine | null {\n if (!graph) {\n return null;\n }\n\n if (!layout) {\n this._warnLayoutRequired();\n return null;\n }\n\n if (graph instanceof ClassicGraph && layout instanceof GraphLayout) {\n return new GraphEngine({graph, layout});\n }\n\n if (layout instanceof GraphLayout && !(graph instanceof ClassicGraph)) {\n const legacyGraph = this._convertToClassicGraph(graph);\n if (legacyGraph) {\n return new GraphEngine({graph: legacyGraph, layout});\n }\n this._warnLayoutRequired();\n return null;\n }\n\n if (layout) {\n return new GraphEngine({graph, layout});\n }\n\n this._warnLayoutRequired();\n return null;\n }\n\n private _syncInteractionManager(props: GraphLayerProps, engine: GraphEngine | null) {\n const resumeLayoutAfterDragging =\n props.resumeLayoutAfterDragging ?? GraphLayer.defaultProps.resumeLayoutAfterDragging;\n\n this.state.interactionManager.updateProps({\n nodeEvents: props.nodeEvents ?? GraphLayer.defaultProps.nodeEvents,\n edgeEvents: props.edgeEvents ?? GraphLayer.defaultProps.edgeEvents,\n engine: (engine ?? props.engine ?? null) as any,\n enableDragging: Boolean(props.enableDragging),\n resumeLayoutAfterDragging: Boolean(resumeLayoutAfterDragging)\n });\n }\n\n private _warnGraphProp() {\n if (!GRAPH_PROP_DEPRECATION_WARNED) {\n warn(GRAPH_PROP_DEPRECATION_MESSAGE);\n GRAPH_PROP_DEPRECATION_WARNED = true;\n }\n }\n\n private _warnLayoutRequired() {\n if (!LAYOUT_REQUIRED_WARNED) {\n warn(LAYOUT_REQUIRED_MESSAGE);\n LAYOUT_REQUIRED_WARNED = true;\n }\n }\n\n private _isGraph(value: unknown): value is Graph {\n if (!value || typeof value !== 'object') {\n return false;\n }\n\n const candidate = value as Graph;\n return typeof candidate.getNodes === 'function' && typeof candidate.getEdges === 'function';\n }\n\n private _coerceGraph(value: unknown): Graph | null {\n if (value instanceof ClassicGraph) {\n return value;\n }\n\n if (this._isGraph(value)) {\n return value;\n }\n\n return null;\n }\n\n private _convertToClassicGraph(graph: Graph): ClassicGraph | null {\n if (graph instanceof ClassicGraph) {\n return graph;\n }\n\n const candidate = graph as Graph & {toClassicGraph?: () => ClassicGraph | null};\n if (typeof candidate.toClassicGraph === 'function') {\n try {\n return candidate.toClassicGraph() ?? null;\n } catch (error) {\n warn(\n 'GraphLayer: failed to convert graph to ClassicGraph for layout compatibility.',\n error\n );\n }\n }\n\n return null;\n }\n\n private _updateLayoutSnapshot(engine?: GraphEngine | null) {\n const activeEngine = engine ?? this.state.graphEngine ?? null;\n\n if (!activeEngine) {\n if (this.state.layoutVersion !== 0 || typeof this.state.layoutState !== 'undefined') {\n this._suppressNextDeckDataChange = true;\n this.setState({layoutVersion: 0, layoutState: undefined});\n }\n this.setNeedsRedraw();\n return;\n }\n\n const nextVersion = activeEngine.getLayoutLastUpdate();\n const nextState = activeEngine.getLayoutState();\n\n if (this.state.layoutVersion !== nextVersion || this.state.layoutState !== nextState) {\n this._suppressNextDeckDataChange = true;\n this.setState({layoutVersion: nextVersion, layoutState: nextState});\n }\n\n this.setNeedsRedraw();\n }\n\n private _handleLayoutEvent = () => {\n this._updateLayoutSnapshot();\n };\n\n _setGraphEngine(graphEngine: GraphEngine | null) {\n if (graphEngine === this.state.graphEngine) {\n if (graphEngine) {\n this._applyGraphEngineCallbacks(graphEngine);\n }\n this._updateLayoutSnapshot(graphEngine);\n return;\n }\n\n this._removeGraphEngine();\n\n if (graphEngine) {\n this.state.graphEngine = graphEngine;\n this._applyGraphEngineCallbacks(graphEngine);\n graphEngine.run();\n this._updateLayoutSnapshot(graphEngine);\n } else {\n this.state.graphEngine = null;\n this._updateLayoutSnapshot(null);\n }\n }\n\n _removeGraphEngine() {\n const engine = this.state.graphEngine;\n if (engine) {\n engine.setProps({\n onLayoutStart: undefined,\n onLayoutChange: undefined,\n onLayoutDone: undefined,\n onLayoutError: undefined\n });\n engine.clear();\n this.state.graphEngine = null;\n this._updateLayoutSnapshot(null);\n }\n }\n\n private _applyGraphEngineCallbacks(engine: GraphEngine) {\n engine.setProps({\n onLayoutStart: (detail) => {\n this._handleLayoutEvent();\n this.props.onLayoutStart?.(detail);\n },\n onLayoutChange: (detail) => {\n this._handleLayoutEvent();\n this.props.onLayoutChange?.(detail);\n },\n onLayoutDone: (detail) => {\n this._handleLayoutEvent();\n this.props.onLayoutDone?.(detail);\n },\n onLayoutError: (error) => {\n this._handleLayoutEvent();\n this.props.onLayoutError?.(error);\n }\n });\n }\n\n private _createRankGridLayer(): GridLayer | null {\n const engine = this.state.graphEngine;\n if (!engine) {\n return null;\n }\n\n const {enabled, config} = this._normalizeRankGridConfig(this.props.rankGrid);\n if (!enabled) {\n return null;\n }\n\n const bounds = this._resolveRankGridBounds(engine);\n if (!bounds) {\n return null;\n }\n\n const data = this._buildRankGridData(engine, config, bounds);\n if (!data) {\n return null;\n }\n\n const direction = config?.direction ?? 'horizontal';\n const gridProps = config?.gridProps ?? {};\n\n return new GridLayer({\n id: `${this.props.id}-rank-grid`,\n data,\n direction,\n xMin: bounds.xMin,\n xMax: bounds.xMax,\n yMin: bounds.yMin,\n yMax: bounds.yMax,\n pickable: false,\n ...gridProps\n });\n }\n\n private _normalizeRankGridConfig(value: GraphLayerProps['rankGrid']): {\n enabled: boolean;\n config?: RankGridConfig;\n } {\n if (typeof value === 'boolean') {\n return {enabled: value};\n }\n\n if (value && typeof value === 'object') {\n return {enabled: value.enabled ?? true, config: value};\n }\n\n return {enabled: false};\n }\n\n private _resolveRankGridBounds(\n engine: GraphEngine\n ): {xMin: number; xMax: number; yMin: number; yMax: number} | null {\n const bounds = engine.getLayoutBounds();\n if (!bounds) {\n return null;\n }\n\n const [[minXRaw, minYRaw], [maxXRaw, maxYRaw]] = bounds;\n const values = [minXRaw, minYRaw, maxXRaw, maxYRaw];\n if (!values.every((value) => typeof value === 'number' && Number.isFinite(value))) {\n return null;\n }\n\n return {\n xMin: Math.min(minXRaw, maxXRaw),\n xMax: Math.max(minXRaw, maxXRaw),\n yMin: Math.min(minYRaw, maxYRaw),\n yMax: Math.max(minYRaw, maxYRaw)\n };\n }\n\n private _buildRankGridData(\n engine: GraphEngine,\n config: RankGridConfig | undefined,\n bounds: {yMin: number; yMax: number}\n ): Array<{\n label: string;\n rank: number;\n originalLabel?: string | number;\n yPosition: number;\n }> | null {\n const rankLabelPrefix = this._resolveRankFieldLabel(config?.rankAccessor);\n // @ts-ignore iterator type\n const rankPositions = mapRanksToYPositions(engine.getNodes(), engine.getNodePosition, {\n rankAccessor: config?.rankAccessor,\n labelAccessor: config?.labelAccessor,\n yRange: {min: bounds.yMin, max: bounds.yMax}\n });\n\n if (rankPositions.length === 0) {\n return null;\n }\n\n const selectedRanks = selectRankLines(rankPositions, {\n yMin: bounds.yMin,\n yMax: bounds.yMax,\n maxCount: config?.maxLines ?? 8\n });\n\n if (selectedRanks.length === 0) {\n return null;\n }\n\n return selectedRanks.map(({rank, label, yPosition}) => ({\n label: `${rankLabelPrefix} ${rank}`,\n rank,\n originalLabel: label === undefined ? undefined : label,\n yPosition\n }));\n }\n\n private _resolveRankFieldLabel(rankAccessor: RankAccessor | undefined): string {\n if (!rankAccessor) {\n return 'srank';\n }\n if (typeof rankAccessor === 'string' && rankAccessor.length > 0) {\n return rankAccessor;\n }\n if (typeof rankAccessor === 'function' && rankAccessor.name) {\n return rankAccessor.name;\n }\n return 'rank';\n }\n\n createNodeLayers() {\n const engine = this.state.graphEngine;\n const {nodes: nodeStyles} = this._getResolvedStylesheet();\n\n if (!engine || !Array.isArray(nodeStyles) || nodeStyles.length === 0) {\n return [];\n }\n\n const baseLayers = nodeStyles\n .filter(Boolean)\n .map((style, idx) => {\n const {pickable = true, visible = true, data = (nodes) => nodes, ...restStyle} = style;\n const LayerType = NODE_LAYER_MAP[style.type];\n if (!LayerType) {\n warn(`GraphLayer: Invalid node type \"${style.type}\".`);\n return null;\n }\n const stylesheet = this._createStylesheetEngine(\n restStyle as unknown as GraphStyleRule,\n `node stylesheet \"${style.type}\"`\n );\n if (!stylesheet) {\n return null;\n }\n const getOffset = stylesheet.getDeckGLAccessor('getOffset');\n return new LayerType({\n ...SHARED_LAYER_PROPS,\n id: `node-rule-${idx}`,\n data: data(engine.getNodes()),\n getPosition: mixedGetPosition(engine.getNodePosition, getOffset),\n pickable,\n positionUpdateTrigger: [\n engine.getLayoutLastUpdate(),\n engine.getLayoutState(),\n stylesheet.getDeckGLAccessorUpdateTrigger('getOffset')\n ].join(),\n stylesheet,\n visible\n } as any);\n })\n .filter(Boolean) as any[];\n\n const chainLayers = this._createChainOverlayLayers(engine);\n\n return [...baseLayers, ...chainLayers];\n }\n\n createEdgeLayers() {\n const engine = this.state.graphEngine;\n const {edges: edgeStyles, nodes: nodeStyles} = this._getResolvedStylesheet();\n\n if (!engine || !edgeStyles) {\n return [];\n }\n\n const edgeStyleArray = Array.isArray(edgeStyles) ? edgeStyles : [edgeStyles];\n\n if (edgeStyleArray.length === 0) {\n return [];\n }\n\n const getLayoutInfo = this._edgeAttachmentHelper.getLayoutAccessor({\n engine,\n interactionManager: this.state.interactionManager,\n nodeStyle: nodeStyles\n });\n\n return edgeStyleArray.filter(Boolean).flatMap((style, idx) => {\n const {decorators, data = (edges) => edges, visible = true, ...restEdgeStyle} = style;\n const stylesheet = this._createStylesheetEngine(\n {\n type: 'edge',\n ...restEdgeStyle\n } as GraphStyleRule,\n 'edge stylesheet'\n );\n if (!stylesheet) {\n return [];\n }\n\n const edgeLayer = new EdgeLayer({\n ...SHARED_LAYER_PROPS,\n id: `edge-layer-${idx}`,\n data: data(engine.getEdges()),\n getLayoutInfo,\n pickable: true,\n positionUpdateTrigger: [engine.getLayoutLastUpdate(), engine.getLayoutState()].join(),\n stylesheet,\n visible\n } as any);\n\n if (!decorators || !Array.isArray(decorators) || decorators.length === 0) {\n return [edgeLayer];\n }\n\n const decoratorLayers = decorators\n .filter(Boolean)\n // @ts-ignore eslint-disable-next-line @typescript-eslint/no-unused-vars\n .map((decoratorStyle, idx2) => {\n const DecoratorLayer = EDGE_DECORATOR_LAYER_MAP[decoratorStyle.type];\n if (!DecoratorLayer) {\n warn(`GraphLayer: Invalid edge decorator type \"${decoratorStyle.type}\".`);\n return null;\n }\n const decoratorStylesheet = this._createStylesheetEngine(\n decoratorStyle as unknown as GraphStyleRule,\n `edge decorator stylesheet \"${decoratorStyle.type}\"`\n );\n if (!decoratorStylesheet) {\n return null;\n }\n return new DecoratorLayer({\n ...SHARED_LAYER_PROPS,\n id: `edge-decorator-${idx2}`,\n data: data(engine.getEdges()),\n getLayoutInfo,\n pickable: true,\n positionUpdateTrigger: [engine.getLayoutLastUpdate(), engine.getLayoutState()].join(),\n stylesheet: decoratorStylesheet\n } as any);\n })\n .filter(Boolean);\n\n return [edgeLayer, ...decoratorLayers];\n });\n }\n\n onClick(info, event): boolean {\n return (this.state.interactionManager.onClick(info, event) as unknown as boolean) || false;\n }\n\n onHover(info, event): boolean {\n return (this.state.interactionManager.onHover(info, event) as unknown as boolean) || false;\n }\n\n onDragStart(info, event) {\n this.state.interactionManager.onDragStart(info, event);\n }\n\n onDrag(info, event) {\n this.state.interactionManager.onDrag(info, event);\n }\n\n onDragEnd(info, event) {\n this.state.interactionManager.onDragEnd(info, event);\n }\n\n renderLayers() {\n const layers: any[] = [];\n const gridLayer = this._createRankGridLayer();\n if (gridLayer) {\n layers.push(gridLayer);\n }\n\n const edgeLayers = this.createEdgeLayers();\n if (Array.isArray(edgeLayers) && edgeLayers.length > 0) {\n layers.push(...edgeLayers);\n }\n\n const nodeLayers = this.createNodeLayers();\n if (Array.isArray(nodeLayers) && nodeLayers.length > 0) {\n layers.push(...nodeLayers);\n }\n\n return layers;\n }\n\n private _createChainOverlayLayers(engine: GraphEngine) {\n const chainData = buildCollapsedChainLayers(engine);\n if (!chainData) {\n return [];\n }\n\n const {\n collapsedNodes,\n collapsedOutlineNodes,\n expandedNodes,\n expandedOutlineNodes,\n getChainOutlinePolygon,\n outlineUpdateTrigger\n } = chainData;\n\n const layers: any[] = [];\n\n if (collapsedOutlineNodes.length > 0) {\n layers.push(\n new PolygonLayer({\n ...SHARED_LAYER_PROPS,\n id: 'collapsed-chain-outlines',\n data: collapsedOutlineNodes,\n getPolygon: (node: NodeInterface) => getChainOutlinePolygon(node),\n stroked: true,\n filled: false,\n getLineColor: [220, 64, 64, 220],\n getLineWidth: 2,\n lineWidthUnits: 'pixels',\n lineWidthMinPixels: 2,\n pickable: true,\n updateTriggers: {\n getPolygon: [outlineUpdateTrigger]\n }\n })\n );\n }\n\n const collapsedMarkerStylesheet = this._createStylesheetEngine(\n {\n type: 'marker',\n fill: [64, 96, 192, 255],\n size: 32,\n marker: 'circle-plus-filled',\n offset: [24, -24],\n scaleWithZoom: false\n } as GraphStyleRule,\n 'collapsed chain marker stylesheet'\n );\n\n if (collapsedMarkerStylesheet && collapsedNodes.length > 0) {\n const getOffset = collapsedMarkerStylesheet.getDeckGLAccessor('getOffset');\n layers.push(\n new ZoomableMarkerLayer({\n ...SHARED_LAYER_PROPS,\n id: 'collapsed-chain-markers',\n data: collapsedNodes,\n getPosition: mixedGetPosition(engine.getNodePosition, getOffset),\n pickable: true,\n positionUpdateTrigger: [\n engine.getLayoutLastUpdate(),\n engine.getLayoutState(),\n collapsedMarkerStylesheet.getDeckGLAccessorUpdateTrigger('getOffset')\n ].join(),\n stylesheet: collapsedMarkerStylesheet,\n visible: true\n } as any)\n );\n }\n\n if (expandedOutlineNodes.length > 0) {\n layers.push(\n new PolygonLayer({\n ...SHARED_LAYER_PROPS,\n id: 'expanded-chain-outlines',\n data: expandedOutlineNodes,\n getPolygon: (node: NodeInterface) => getChainOutlinePolygon(node),\n stroked: true,\n filled: false,\n getLineColor: [64, 96, 192, 200],\n getLineWidth: 2,\n lineWidthUnits: 'pixels',\n lineWidthMinPixels: 2,\n pickable: true,\n updateTriggers: {\n getPolygon: [outlineUpdateTrigger]\n }\n })\n );\n }\n\n const expandedMarkerStylesheet = this._createStylesheetEngine(\n {\n type: 'marker',\n fill: [64, 96, 192, 255],\n size: 32,\n marker: 'circle-minus-filled',\n offset: [24, -24],\n scaleWithZoom: false\n } as GraphStyleRule,\n 'expanded chain marker stylesheet'\n );\n\n if (expandedMarkerStylesheet && expandedNodes.length > 0) {\n const getOffset = expandedMarkerStylesheet.getDeckGLAccessor('getOffset');\n layers.push(\n new ZoomableMarkerLayer({\n ...SHARED_LAYER_PROPS,\n id: 'expanded-chain-markers',\n data: expandedNodes,\n getPosition: mixedGetPosition(engine.getNodePosition, getOffset),\n pickable: true,\n positionUpdateTrigger: [\n engine.getLayoutLastUpdate(),\n engine.getLayoutState(),\n expandedMarkerStylesheet.getDeckGLAccessorUpdateTrigger('getOffset')\n ].join(),\n stylesheet: expandedMarkerStylesheet,\n visible: true\n } as any)\n );\n }\n\n return layers;\n }\n}\n\nfunction isPlainObject(value: unknown): value is Record<string | number | symbol, unknown> {\n if (!value || typeof value !== 'object') {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {GraphStylesheet, GraphStyleRule, GraphStyleType} from './graph-style-engine';\n\nexport type GraphNodeStyleType = Exclude<\n GraphStyleType,\n 'Edge' | 'edge' | 'edge-label' | 'flow' | 'arrow'\n>;\n\nexport type GraphEdgeDecoratorType = Extract<GraphStyleType, 'edge-label' | 'flow' | 'arrow'>;\n\nexport type GraphLayerNodeStyle = Extract<GraphStyleRule, {type: GraphNodeStyleType}> & {\n pickable?: boolean;\n visible?: boolean;\n data?: (nodes: any[]) => any;\n};\n\nexport type GraphLayerEdgeDecoratorStyle = Extract<GraphStyleRule, {type: GraphEdgeDecoratorType}>;\n\ntype EdgeStyleType = Extract<GraphStyleType, 'Edge' | 'edge'>;\n\nexport type GraphLayerEdgeStyle = (\n | Extract<GraphStyleRule, {type: EdgeStyleType}>\n | (Omit<Extract<GraphStyleRule, {type: EdgeStyleType}>, 'type'> & {type?: EdgeStyleType})\n) & {\n decorators?: GraphLayerEdgeDecoratorStyle[];\n data?: (edges: any[]) => any;\n visible?: boolean;\n};\n\nexport type GraphLayerStylesheet = GraphStylesheet & {\n nodes?: GraphLayerNodeStyle[];\n edges?: GraphLayerEdgeStyle | GraphLayerEdgeStyle[];\n};\n\nexport type GraphLayerStylesheetInput = GraphLayerStylesheet | null | undefined;\n\nexport type NormalizedGraphLayerStylesheet = {\n nodes: GraphLayerNodeStyle[];\n edges: GraphLayerEdgeStyle[];\n};\n\nexport const DEFAULT_GRAPH_LAYER_STYLESHEET_INPUT: GraphLayerStylesheet = {\n nodes: [],\n edges: [\n {\n type: 'edge',\n stroke: 'black',\n strokeWidth: 1\n }\n ]\n};\n\nconst DEFAULT_EDGE_STYLE: GraphLayerEdgeStyle = {\n ...DEFAULT_GRAPH_LAYER_STYLESHEET_INPUT.edges[0],\n decorators: []\n};\n\nexport const DEFAULT_GRAPH_LAYER_STYLESHEET: NormalizedGraphLayerStylesheet = {\n nodes: [],\n edges: [DEFAULT_EDGE_STYLE]\n};\n\nexport type GraphLayerStylesheetSources = {\n stylesheet?: GraphLayerStylesheetInput;\n nodeStyle?: GraphLayerNodeStyle[];\n edgeStyle?: GraphLayerEdgeStyle | GraphLayerEdgeStyle[];\n};\n\nexport function normalizeGraphLayerStylesheet({\n stylesheet,\n nodeStyle,\n edgeStyle\n}: GraphLayerStylesheetSources): NormalizedGraphLayerStylesheet {\n const resolvedStylesheet = stylesheet ?? {};\n const resolvedNodeStyles = Array.isArray(resolvedStylesheet.nodes)\n ? resolvedStylesheet.nodes\n : nodeStyle;\n\n const resolvedEdgeStyles = resolvedStylesheet.edges ?? edgeStyle;\n\n const nodes = Array.isArray(resolvedNodeStyles)\n ? resolvedNodeStyles.filter(Boolean)\n : [...DEFAULT_GRAPH_LAYER_STYLESHEET.nodes];\n\n const edgeEntries = Array.isArray(resolvedEdgeStyles)\n ? resolvedEdgeStyles\n : resolvedEdgeStyles\n ? [resolvedEdgeStyles]\n : DEFAULT_GRAPH_LAYER_STYLESHEET.edges;\n\n const edges: GraphLayerEdgeStyle[] = edgeEntries.filter(Boolean).map((edgeStyleEntry) => ({\n ...edgeStyleEntry,\n type: edgeStyleEntry.type ?? 'edge',\n decorators: edgeStyleEntry.decorators ?? []\n })) as GraphLayerEdgeStyle[];\n\n return {\n nodes,\n edges\n };\n}\n\nexport type {GraphStyleValue, GraphStylesheet, GraphStyleType} from './graph-style-engine';\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {ScatterplotLayer} from '@deck.gl/layers';\n\nexport class CircleLayer extends CompositeLayer {\n static layerName = 'CircleLayer';\n\n renderLayers() {\n const {data, getPosition, stylesheet, positionUpdateTrigger = 0} = this.props as any;\n\n return [\n new ScatterplotLayer(\n this.getSubLayerProps({\n id: '__scatterplot-layer',\n data,\n getPosition,\n ...stylesheet.getDeckGLAccessors(),\n updateTriggers: {\n getPosition: positionUpdateTrigger,\n ...stylesheet.getDeckGLUpdateTriggers()\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {IconLayer} from '@deck.gl/layers';\n\nexport class ImageLayer extends CompositeLayer {\n static layerName = 'ImageLayer';\n\n renderLayers() {\n const {data, getPosition, stylesheet, positionUpdateTrigger = 0} = this.props as any;\n\n return [\n new IconLayer(\n this.getSubLayerProps({\n id: '__icon-layer',\n data,\n getPosition,\n ...stylesheet.getDeckGLAccessors(),\n updateTriggers: {\n getPosition: positionUpdateTrigger,\n ...stylesheet.getDeckGLUpdateTriggers()\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {ZoomableTextLayer} from '../common-layers/zoomable-text-layer/zoomable-text-layer';\n\nexport class LabelLayer extends CompositeLayer {\n static layerName = 'LabelLayer';\n\n renderLayers() {\n const {data, getPosition, stylesheet, positionUpdateTrigger = 0} = this.props as any;\n\n return [\n new ZoomableTextLayer(\n this.getSubLayerProps({\n id: '__text-layer',\n data,\n getPosition,\n ...stylesheet.getDeckGLAccessors(),\n updateTriggers: {\n ...stylesheet.getDeckGLUpdateTriggers(),\n getPosition: positionUpdateTrigger\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {TextLayer} from '@deck.gl/layers';\n\nexport class ZoomableTextLayer extends CompositeLayer {\n static layerName = 'ZoomableTextLayer';\n\n initializeState() {\n this.state = {characterSet: []};\n }\n\n shouldUpdateState({props, changeFlags}) {\n const {scaleWithZoom} = this.props as any;\n if (!scaleWithZoom) {\n return changeFlags.dataChanged || changeFlags.propsChanged;\n }\n return changeFlags.dataChanged || changeFlags.propsChanged || changeFlags.viewportChanged;\n }\n\n updateState({props, oldProps, changeFlags}) {\n super.updateState({props, oldProps, changeFlags} as any);\n if (changeFlags.propsOrDataChanged) {\n const {getText} = props;\n let textLabels = [];\n if (typeof getText === 'function') {\n textLabels = props.data.map(getText);\n } else {\n textLabels = [getText];\n }\n const characterSet = new Set(textLabels.join(''));\n const uniqueCharacters = Array.from(characterSet);\n this.setState({characterSet: uniqueCharacters});\n }\n }\n\n renderLayers() {\n const {\n data,\n getPosition,\n getColor,\n getText,\n getSize,\n getTextAnchor,\n getAlignmentBaseline,\n getAngle,\n scaleWithZoom,\n updateTriggers,\n fontFamily,\n textWordUnits,\n textWordBreak,\n textMaxWidth,\n textSizeMinPixels\n } = this.props as any;\n\n const sizeUpdateTrigger = scaleWithZoom ? [getSize, this.context.viewport.zoom] : false;\n // getText only expects function not plain value (string)\n const newGetText = typeof getText === 'function' ? getText : () => getText;\n\n return [\n new TextLayer(\n this.getSubLayerProps({\n id: '__text-layer',\n data,\n sizeScale: scaleWithZoom ? Math.pow(2, this.context.viewport.zoom - 1) : 1,\n characterSet: this.state.characterSet,\n getPosition,\n getColor,\n getSize,\n getTextAnchor,\n getAlignmentBaseline,\n getAngle,\n getText: newGetText,\n maxWidth: textMaxWidth ?? 12,\n wordBreak: textWordBreak ?? 'break-all',\n fontFamily: fontFamily ?? 'Red Hat Text',\n wordUnits: textWordUnits ?? 'pixels',\n sizeMinPixels: textSizeMinPixels ?? 9,\n updateTriggers: {\n getSize: sizeUpdateTrigger,\n getAngle: [sizeUpdateTrigger, updateTriggers.getPosition],\n ...updateTriggers\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {PolygonLayer} from '@deck.gl/layers';\n\nconst generateRectangle = (node, {getWidth, getHeight, getPosition}) => {\n const pos = getPosition(node);\n const width = typeof getWidth === 'function' ? getWidth(node._data.label.length * 12) : getWidth;\n const height = typeof getWidth === 'function' ? getHeight(node) : getHeight;\n const halfWidth = width / 2;\n const halfHeight = height / 2;\n return [\n [pos[0] - halfWidth, pos[1] - halfHeight],\n [pos[0] - halfWidth, pos[1] + halfHeight],\n [pos[0] + halfWidth, pos[1] + halfHeight],\n [pos[0] + halfWidth, pos[1] - halfHeight]\n ];\n};\n\nexport class RectangleLayer extends CompositeLayer {\n static layerName = 'RectangleLayer';\n\n renderLayers() {\n const {data, getPosition, stylesheet, positionUpdateTrigger = 0} = this.props as any;\n\n const getFillColor = stylesheet.getDeckGLAccessor('getFillColor');\n const getLineWidth = stylesheet.getDeckGLAccessor('getLineWidth');\n\n return [\n new PolygonLayer(\n this.getSubLayerProps({\n id: '__polygon-layer',\n data,\n getPolygon: (node) =>\n generateRectangle(node, {\n getPosition,\n getWidth: stylesheet.getDeckGLAccessor('getWidth'),\n getHeight: stylesheet.getDeckGLAccessor('getHeight')\n }),\n filled: Boolean(getFillColor),\n jointRounded: true,\n stroked: Boolean(getLineWidth),\n ...stylesheet.getDeckGLAccessors(),\n updateTriggers: {\n getPolygon: [\n positionUpdateTrigger,\n stylesheet.getDeckGLAccessorUpdateTrigger('getWidth'),\n stylesheet.getDeckGLAccessorUpdateTrigger('getHeight')\n ],\n ...stylesheet.getDeckGLUpdateTriggers()\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport const fs = /* glsl */ `\\\n#define SHADER_NAME rounded-rectangle-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vFillColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n\n float distToCenter = length(unitPosition);\n\n /* Calculate the cutoff radius for the rounded corners */\n float threshold = sqrt(2.0) * (1.0 - roundedRectangle.cornerRadius) + 1.0 * roundedRectangle.cornerRadius;\n if (distToCenter <= threshold) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n`;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// import {ScatterplotLayer} from '@deck.gl/layers';\nimport type {ShaderModule} from '@luma.gl/shadertools';\nimport type {Model} from '@luma.gl/engine';\nimport {fs} from './rounded-rectangle-layer-fragment';\nimport {RectangleLayer} from './rectangle-layer';\n\nconst uniformBlock = `\\\nuniform roundedRectangleUniforms {\n float cornerRadius;\n} roundedRectangle;\n`;\n\nexport type RoundedRectangleProps = {\n cornerRadius: number;\n};\n\nexport const roundedRectangleUniforms = {\n name: 'roundedRectangle',\n vs: uniformBlock,\n fs: uniformBlock,\n uniformTypes: {\n cornerRadius: 'f32'\n }\n} as const satisfies ShaderModule<RoundedRectangleProps>;\n\nexport class RoundedRectangleLayer extends RectangleLayer {\n static layerName = 'RoundedRectangleLayer';\n\n draw(props) {\n const {cornerRadius} = this.props as any;\n const roundedRectangleProps: RoundedRectangleProps = {cornerRadius};\n const model = this.state.model as Model;\n model.shaderInputs.setProps({roundedRectangle: roundedRectangleProps});\n super.draw(props);\n }\n\n getShaders() {\n // use object.assign to make sure we don't overwrite existing fields like `vs`, `modules`...\n const shaders = super.getShaders(undefined!);\n return {\n ...shaders,\n fs,\n modules: [...shaders.modules, roundedRectangleUniforms]\n };\n }\n}\n\nRoundedRectangleLayer.defaultProps = {\n // cornerRadius: the amount of rounding at the rectangle corners\n // 0 - rectangle. 1 - circle.\n cornerRadius: 0.1\n};\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {PolygonLayer} from '@deck.gl/layers';\nimport {generateRoundedCorners} from '../../utils/polygon-calculations';\n\nconst generateRoundedRectangle = (node, {getWidth, getHeight, getPosition, getCornerRadius}) => {\n const pos = getPosition(node);\n const width = typeof getWidth === 'function' ? getWidth(node) : getWidth;\n const height = typeof getWidth === 'function' ? getHeight(node) : getHeight;\n const cornerRadius =\n typeof getCornerRadius === 'function' ? getCornerRadius(node) : getCornerRadius;\n const factor = 20;\n return generateRoundedCorners(pos, width, height, cornerRadius, factor);\n};\n\nexport class PathBasedRoundedRectangleLayer extends CompositeLayer {\n static layerName = 'PathBasedRoundedRectangleLayer';\n\n renderLayers() {\n const {data, getPosition, stylesheet, positionUpdateTrigger = 0} = this.props as any;\n\n const getFillColor = stylesheet.getDeckGLAccessor('getFillColor');\n const getLineWidth = stylesheet.getDeckGLAccessor('getLineWidth');\n\n return [\n new PolygonLayer(\n this.getSubLayerProps({\n id: '__polygon-layer',\n data,\n getPolygon: (node) =>\n generateRoundedRectangle(node, {\n getPosition,\n getWidth: stylesheet.getDeckGLAccessor('getWidth'),\n getHeight: stylesheet.getDeckGLAccessor('getHeight'),\n getCornerRadius: stylesheet.getDeckGLAccessor('getCornerRadius')\n }),\n filled: Boolean(getFillColor),\n stroked: Boolean(getLineWidth),\n ...stylesheet.getDeckGLAccessors(),\n updateTriggers: {\n getPolygon: [\n positionUpdateTrigger,\n stylesheet.getDeckGLAccessorUpdateTrigger('getWidth'),\n stylesheet.getDeckGLAccessorUpdateTrigger('getHeight'),\n stylesheet.getDeckGLAccessorUpdateTrigger('getCornerRadius')\n ],\n ...stylesheet.getDeckGLUpdateTriggers()\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport function generateRoundedCorners(pos, width, height, radius, factor = 20) {\n const halfWidth = width / 2;\n const halfHeight = height / 2;\n const bottomLeft = {X: pos[0] - halfWidth, Y: pos[1] - halfHeight};\n const topLeft = {X: pos[0] - halfWidth, Y: pos[1] + halfHeight};\n const bottomRight = {X: pos[0] + halfWidth, Y: pos[1] - halfHeight};\n const topRight = {X: pos[0] + halfWidth, Y: pos[1] + halfHeight};\n\n const roundedPointsForBottomLeft = getRoundedCorner(\n bottomLeft,\n topLeft,\n bottomRight,\n radius,\n factor\n );\n const roundedPointsForTopLeft = getRoundedCorner(\n topLeft,\n topRight,\n bottomLeft,\n radius,\n factor\n ).reverse();\n const roundedPointsForTopRight = getRoundedCorner(\n topRight,\n bottomRight,\n topLeft,\n radius,\n factor\n ).reverse();\n const roundedPointsForBottomRight = getRoundedCorner(\n bottomRight,\n bottomLeft,\n topRight,\n radius,\n factor\n ).reverse();\n\n const result = [\n ...roundedPointsForBottomLeft,\n ...roundedPointsForTopLeft,\n ...roundedPointsForTopRight,\n ...roundedPointsForBottomRight\n ];\n\n return result;\n}\n\n/**\n *\n * @param {*} angularPoint = corner point\n * @param {*} p1 = edge one\n * @param {*} p2 = edge two\n * @param {*} radius = corner radius\n * @param {*} factor = affects the points used for curve\n * reference: https://stackoverflow.com/questions/24771828/how-to-calculate-rounded-corners-for-a-polygon\n */\n// eslint-disable-next-line max-statements\nfunction getRoundedCorner(angularPoint, p1, p2, radius, factor) {\n // Vector 1\n const dx1 = angularPoint.X - p1.X;\n const dy1 = angularPoint.Y - p1.Y;\n\n // Vector 2\n const dx2 = angularPoint.X - p2.X;\n const dy2 = angularPoint.Y - p2.Y;\n\n // Angle between vector 1 and vector 2 divided by 2\n const angle = (Math.atan2(dy1, dx1) - Math.atan2(dy2, dx2)) / 2;\n\n // The length of segment between angular point and the\n // points of intersection with the circle of a given radius\n const tan = Math.abs(Math.tan(angle));\n let segment = radius / tan;\n // var segment = 2;\n\n // Check the segment\n const length1 = getLength(dx1, dy1);\n const length2 = getLength(dx2, dy2);\n\n const length = Math.min(length1, length2);\n\n if (segment > length) {\n segment = length;\n radius = length * tan;\n }\n\n // Points of intersection are calculated by the proportion between\n // the coordinates of the vector, length of vector and the length of the segment.\n const p1Cross = getProportionPoint(angularPoint, segment, length1, dx1, dy1);\n const p2Cross = getProportionPoint(angularPoint, segment, length2, dx2, dy2);\n\n // Calculation of the coordinates of the circle\n // center by the addition of angular vectors.\n const dx = angularPoint.X * 2 - p1Cross.X - p2Cross.X;\n const dy = angularPoint.Y * 2 - p1Cross.Y - p2Cross.Y;\n\n const L = getLength(dx, dy);\n const d = getLength(segment, radius);\n\n const circlePoint = getProportionPoint(angularPoint, d, L, dx, dy);\n\n // StartAngle and EndAngle of arc\n let startAngle = Math.atan2(p1Cross.Y - circlePoint.Y, p1Cross.X - circlePoint.X);\n const endAngle = Math.atan2(p2Cross.Y - circlePoint.Y, p2Cross.X - circlePoint.X);\n\n // Sweep angle\n let sweepAngle = endAngle - startAngle;\n\n // Some additional checks\n if (sweepAngle < 0) {\n startAngle = endAngle;\n sweepAngle = -sweepAngle;\n }\n\n if (sweepAngle > Math.PI) sweepAngle = Math.PI - sweepAngle;\n\n const degreeFactor = factor / Math.PI;\n\n return getPointsForArc(sweepAngle, degreeFactor, startAngle, circlePoint, radius);\n}\n\nfunction getLength(dx, dy) {\n return Math.sqrt(dx * dx + dy * dy);\n}\n\nfunction getProportionPoint(point, segment, length, dx, dy) {\n const factor = segment / length;\n\n return {\n X: point.X - dx * factor,\n Y: point.Y - dy * factor\n };\n}\n\nfunction getPointsForArc(sweepAngle, degreeFactor, startAngle, circlePoint, radius) {\n const pointsCount = Math.abs(sweepAngle * degreeFactor);\n const sign = Math.sign(sweepAngle);\n\n const points = [];\n\n for (let i = 0; i < pointsCount; ++i) {\n const pointX = circlePoint.X + Math.cos(startAngle + (sign * i) / degreeFactor) * radius;\n\n const pointY = circlePoint.Y + Math.sin(startAngle + (sign * i) / degreeFactor) * radius;\n\n const point = [pointX, pointY];\n points.push(point);\n }\n return points;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {MarkerLayer} from '../common-layers/marker-layer/marker-layer';\n\nexport class ZoomableMarkerLayer extends CompositeLayer {\n static layerName = 'ZoomableMarkerLayer';\n\n shouldUpdateState({props, changeFlags}) {\n const {stylesheet} = this.props as any;\n const scaleWithZoom = stylesheet.getDeckGLAccessor('scaleWithZoom');\n if (!scaleWithZoom) {\n return changeFlags.somethingChanged;\n }\n return changeFlags.somethingChanged || changeFlags.viewportChanged;\n }\n\n renderLayers() {\n const {data, getPosition, stylesheet, positionUpdateTrigger = 0} = this.props as any;\n\n const getSize = stylesheet.getDeckGLAccessor('getSize');\n const scaleWithZoom = stylesheet.getDeckGLAccessor('scaleWithZoom');\n const sizeUpdateTrigger = scaleWithZoom ? [getSize, this.context.viewport.zoom] : false;\n const oiginalGetMarker = stylesheet.getDeckGLAccessor('getMarker');\n // getMarker only expects function not plain value (string)\n const getMarker =\n typeof oiginalGetMarker === 'function' ? oiginalGetMarker : () => oiginalGetMarker;\n\n return [\n new MarkerLayer(\n this.getSubLayerProps({\n id: 'zoomable-marker-layer',\n data,\n getPosition,\n sizeScale: scaleWithZoom ? Math.max(0, this.context.viewport.zoom) : 1,\n ...stylesheet.getDeckGLAccessors(),\n getMarker,\n updateTriggers: {\n ...stylesheet.getDeckGLUpdateTriggers(),\n getPosition: positionUpdateTrigger,\n getSize: sizeUpdateTrigger\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {IconLayer} from '@deck.gl/layers';\n\nimport {MarkerMapping} from './marker-mapping';\nimport {AtlasDataURL} from './atlas-data-url';\n\nexport class MarkerLayer extends CompositeLayer {\n static layerName = 'MarkerLayer';\n\n static defaultProps = {\n id: 'MarkerLayer',\n data: [],\n getMarker: (d) => d.marker,\n getColor: (d) => [0, 0, 0],\n getSize: (d) => 10\n };\n\n renderLayers() {\n const {getMarker, ...otherProps} = this.props as any;\n return [\n new IconLayer(\n this.getSubLayerProps({\n id: 'marker-layer',\n iconAtlas: AtlasDataURL.dataURL,\n iconMapping: MarkerMapping,\n getIcon: getMarker,\n ...otherProps\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable */\nexport const MarkerMapping = {\n 'bell-filled': {\n x: 0,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n bell: {\n x: 32,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n 'bookmark-filled': {\n x: 0,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n bookmark: {\n x: 32,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n 'cd-filled': {\n x: 64,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n cd: {\n x: 64,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n checkmark: {\n x: 0,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-check-filled': {\n x: 32,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-check': {\n x: 64,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-filled': {\n x: 96,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-i-filled': {\n x: 96,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-i': {\n x: 96,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-minus-filled': {\n x: 0,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-minus': {\n x: 32,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-plus-filled': {\n x: 64,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-plus': {\n x: 96,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-questionmark-filled': {\n x: 128,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-questionmark': {\n x: 128,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-slash-filled': {\n x: 128,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-slash': {\n x: 128,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-x-filled': {\n x: 0,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-x': {\n x: 32,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n circle: {\n x: 64,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n 'diamond-filled': {\n x: 96,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n diamond: {\n x: 128,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n 'flag-filled': {\n x: 160,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n flag: {\n x: 160,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n gear: {\n x: 160,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n 'heart-filled': {\n x: 160,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n heart: {\n x: 160,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n 'location-marker-filled': {\n x: 0,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n 'location-marker': {\n x: 32,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n 'octagonal-star-filled': {\n x: 64,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n 'octagonal-star': {\n x: 96,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n 'person-filled': {\n x: 128,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n person: {\n x: 160,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n 'pin-filled': {\n x: 192,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n pin: {\n x: 192,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n 'plus-small': {\n x: 192,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n plus: {\n x: 192,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n 'rectangle-filled': {\n x: 192,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n rectangle: {\n x: 192,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n 'star-filled': {\n x: 0,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n star: {\n x: 32,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n 'tag-filled': {\n x: 64,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n tag: {\n x: 96,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n 'thumb-down-filled': {\n x: 128,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n 'thumb-down': {\n x: 160,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n 'thumb-up': {\n x: 192,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n 'thumb_up-filled': {\n x: 224,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-down-filled': {\n x: 224,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-down': {\n x: 224,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-left-filled': {\n x: 224,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-left': {\n x: 224,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-right-filled': {\n x: 224,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-right': {\n x: 224,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-up-filled': {\n x: 0,\n y: 224,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-up': {\n x: 32,\n y: 224,\n width: 32,\n height: 32,\n mask: true\n },\n 'x-small': {\n x: 64,\n y: 224,\n width: 32,\n height: 32,\n mask: true\n },\n x: {\n x: 96,\n y: 224,\n width: 32,\n height: 32,\n mask: true\n }\n};\n/* eslint-enable */\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable */\nexport const AtlasDataURL = {\n dataURL:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAPoAAAD6AG1e1JrAAAgAElEQVR4nO1dB7ReVZU+f3lJaCJFARlQQSkRRcARKxJAUezUkaqIwihCKIKiqIAIiIQiRVwj2EZQdBRBIZAAIooNkTGQKE0UkCIQCMlrf5l119rfrM/tPveec8v//y/v32ud9V7y7r3fqfvss88uzoVTjcpC51zXOddyzk3K7+fIcw1XHdXl5zbOuTHnXEew/+C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eliGVJ7OIWZMhzSkgSRM9l6W4YIY0pCGNKQhuWlL/wdUHWPHyFPiYwAAAABJRU5ErkJggg=='\n};\n/* eslint-enable */\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {COORDINATE_SYSTEM, CompositeLayer} from '@deck.gl/core';\n\nimport {StraightLineEdgeLayer} from '../layers/edge-layers/straight-line-edge-layer';\nimport {PathEdgeLayer} from './edge-layers/path-edge-layer';\nimport {CurvedEdgeLayer} from './edge-layers/curved-edge-layer';\n\nconst EDGE_LAYER_MAP = {\n line: StraightLineEdgeLayer,\n path: PathEdgeLayer,\n 'spline-curve': CurvedEdgeLayer\n};\n\nexport class EdgeLayer extends CompositeLayer {\n static layerName = 'EdgeLayer';\n\n static defaultProps = {\n data: [],\n pickable: true,\n getLayoutInfo: (d) => ({\n type: d.type,\n sourcePosition: d.sourcePosition,\n targetPosition: d.targetPosition,\n controlPoints: []\n }),\n positionUpdateTrigger: 0\n };\n\n updateState({props, oldProps, changeFlags}) {\n super.updateState({props, oldProps, changeFlags} as any);\n if (changeFlags.dataChanged) {\n this.updateStateData();\n }\n }\n\n updateStateData() {\n const {data, getLayoutInfo} = this.props as any;\n // bucket edges by types\n const typedEdgeData = data.reduce(\n (res, d) => {\n const {type} = getLayoutInfo(d);\n res[type].push(d);\n return res;\n },\n {\n line: [],\n path: [],\n 'spline-curve': []\n }\n );\n this.setState({typedEdgeData});\n }\n\n renderLayers() {\n const {getLayoutInfo, pickable, positionUpdateTrigger, stylesheet, id} = this.props as any;\n\n const {typedEdgeData} = this.state;\n\n // render lines by types (straight line, path, curves)\n return Object.entries(typedEdgeData).map((e, idx) => {\n const [type, edgeData] = e;\n const Layer = EDGE_LAYER_MAP[type];\n // invalid edge layer type\n if (!Layer) {\n return null;\n }\n return new Layer({\n id: `${id}-${idx}`,\n data: edgeData,\n getLayoutInfo,\n getColor: stylesheet.getDeckGLAccessor('getColor'),\n getWidth: stylesheet.getDeckGLAccessor('getWidth'),\n colorUpdateTrigger: stylesheet.getDeckGLAccessorUpdateTrigger('getColor'),\n widthUpdateTrigger: stylesheet.getDeckGLAccessorUpdateTrigger('getWidth'),\n positionUpdateTrigger,\n pickable,\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n parameters: {\n depthCompare: 'always'\n }\n } as any);\n });\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {LineLayer} from '@deck.gl/layers';\n\nexport class StraightLineEdgeLayer extends CompositeLayer {\n static layerName = 'StraightLineEdgeLayer';\n\n renderLayers() {\n const {\n data,\n getLayoutInfo,\n positionUpdateTrigger = 0,\n colorUpdateTrigger = 0,\n widthUpdateTrigger = 0,\n ...otherProps\n } = this.props as any;\n return [\n new LineLayer(\n this.getSubLayerProps({\n id: '__line-layer',\n data,\n getSourcePosition: (e) => getLayoutInfo(e).sourcePosition,\n getTargetPosition: (e) => getLayoutInfo(e).targetPosition,\n updateTriggers: {\n getColor: colorUpdateTrigger,\n getSourcePosition: positionUpdateTrigger,\n getTargetPosition: positionUpdateTrigger,\n getWidth: widthUpdateTrigger\n },\n ...otherProps\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {PathLayer} from '@deck.gl/layers';\n\nexport class PathEdgeLayer extends CompositeLayer {\n static layerName = 'PathEdgeLayer';\n\n renderLayers() {\n const {\n data,\n getLayoutInfo,\n positionUpdateTrigger = 0,\n colorUpdateTrigger = 0,\n widthUpdateTrigger = 0,\n ...otherProps\n } = this.props as any;\n return [\n new PathLayer(\n this.getSubLayerProps({\n id: '__line-layer',\n data,\n getPath: (e) => {\n const {sourcePosition, targetPosition, controlPoints} = getLayoutInfo(e);\n return [sourcePosition, ...controlPoints, targetPosition];\n },\n updateTriggers: {\n getColor: colorUpdateTrigger,\n getPath: positionUpdateTrigger,\n getWidth: widthUpdateTrigger\n },\n ...otherProps\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {ScatterplotLayer, LineLayer} from '@deck.gl/layers';\nimport {SplineLayer} from '../common-layers/spline-layer/spline-layer';\n\nconst DEBUG = false;\n\nexport class CurvedEdgeLayer extends CompositeLayer {\n static layerName = 'CurvedEdgeLayer';\n\n // @ts-expect-error TODO\n renderLayers() {\n const {\n data,\n getLayoutInfo,\n positionUpdateTrigger = 0,\n colorUpdateTrigger = 0,\n widthUpdateTrigger = 0,\n ...otherProps\n } = this.props as any;\n return [\n DEBUG &&\n new ScatterplotLayer(\n this.getSubLayerProps({\n id: '__control-points',\n data,\n getPosition: (e) => getLayoutInfo(e).controlPoints[0],\n getColor: (d) => [190, 190, 190, 150],\n getRadius: (d) => 5,\n updateTriggers: {\n getPosition: positionUpdateTrigger\n },\n ...otherProps\n })\n ),\n DEBUG &&\n new LineLayer(\n this.getSubLayerProps({\n id: '__first_segment',\n data,\n getSourcePosition: (e) => getLayoutInfo(e).sourcePosition,\n getTargetPosition: (e) => getLayoutInfo(e).controlPoints[0],\n getColor: (e) => [210, 210, 210, 150],\n updateTriggers: {\n getSourcePosition: positionUpdateTrigger,\n getTargetPosition: positionUpdateTrigger\n },\n ...otherProps\n })\n ),\n DEBUG &&\n new LineLayer(\n this.getSubLayerProps({\n id: '__last_segment',\n data,\n getSourcePosition: (e) => getLayoutInfo(e).controlPoints[0],\n getTargetPosition: (e) => getLayoutInfo(e).targetPosition,\n getColor: (e) => [210, 210, 210, 150],\n updateTriggers: {\n getSourcePosition: positionUpdateTrigger,\n getTargetPosition: positionUpdateTrigger\n },\n ...otherProps\n })\n ),\n new SplineLayer(\n this.getSubLayerProps({\n id: '__spline_layer',\n data,\n getSourcePosition: (e) => getLayoutInfo(e).sourcePosition,\n getTargetPosition: (e) => getLayoutInfo(e).targetPosition,\n getControlPoints: (e) => getLayoutInfo(e).controlPoints,\n updateTriggers: {\n getSourcePosition: positionUpdateTrigger,\n getTargetPosition: positionUpdateTrigger,\n getControlPoints: positionUpdateTrigger,\n getColor: colorUpdateTrigger,\n getWidth: widthUpdateTrigger\n },\n ...otherProps\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {COORDINATE_SYSTEM, CompositeLayer} from '@deck.gl/core';\nimport {PathLayer} from '@deck.gl/layers';\nimport {getCurvePoints} from 'cardinal-spline-js';\n// const getCurvePoints = () => {};\n\n/* Constants */\nconst defaultProps = {\n id: 'spline-layer',\n getData: (d) => d.points,\n getAngle: (x) => 0,\n fontSize: 24,\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n fp64: false\n};\n\nexport class SplineLayer extends CompositeLayer {\n static layerName = 'SplineLayer';\n\n initializeState() {\n this.state = {typedEdgeData: []};\n }\n\n shouldUpdateState({changeFlags}) {\n return changeFlags.dataChanged || changeFlags.propsChanged;\n }\n\n updateState({props, oldProps, changeFlags}) {\n super.updateState({props, oldProps, changeFlags} as any);\n if (changeFlags.dataChanged || changeFlags.propsChanged) {\n this.updateSplineData();\n }\n }\n\n updateSplineData() {\n const {data} = this.props as any;\n const paths = data.reduce((res, d) => {\n const sourcePosition = (this.props as any).getSourcePosition(d);\n const targetPosition = (this.props as any).getTargetPosition(d);\n const controlPoints = (this.props as any).getControlPoints(d);\n\n // Catmull-Rom curve\n const serializedControlPoints = controlPoints.toString().split(',');\n\n // NOTE: we might change the number of points according to the length.\n // so we can render less segements.\n // points = [x1, y1, x2, y2, ...];\n const points = getCurvePoints(\n [...sourcePosition, ...serializedControlPoints, ...targetPosition],\n 0.5,\n 10\n );\n // convert points to [[x1, y1], [x2, y2], ...]\n const path = [];\n for (let idx = 0; idx < points.length; idx += 2) {\n path.push([points[idx], points[idx + 1]]);\n }\n res.push(path);\n return res;\n }, []);\n this.setState({paths});\n }\n\n renderLayers() {\n const {coordinateSystem, getColor, getWidth, id, updateTriggers} = this.props as any;\n const {paths} = this.state;\n return new PathLayer({\n id: `${id}-splines`,\n data: paths as any,\n getPath: (d) => d,\n getColor,\n getWidth,\n coordinateSystem,\n updateTriggers\n });\n }\n}\n\nSplineLayer.layerName = 'SplineLayer';\nSplineLayer.defaultProps = defaultProps;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {ZoomableTextLayer} from '../common-layers/zoomable-text-layer/zoomable-text-layer';\n\nexport class EdgeLabelLayer extends CompositeLayer {\n static layerName = 'EdgeLabelLayer';\n\n renderLayers() {\n const {data, getLayoutInfo, positionUpdateTrigger = 0, stylesheet} = this.props as any;\n return [\n new ZoomableTextLayer(\n this.getSubLayerProps({\n id: 'edge-label-layer',\n data,\n getPosition: (e) => {\n const {sourcePosition, targetPosition, controlPoints = []} = getLayoutInfo(e);\n // consider all the points on this edge\n const allPoints = [sourcePosition, targetPosition, ...controlPoints];\n const sumX = allPoints.reduce((res, p) => res + p[0], 0);\n const sumY = allPoints.reduce((res, p) => res + p[1], 0);\n // find the centroid of those points\n return [sumX / allPoints.length, sumY / allPoints.length];\n },\n getAngle: (e) => {\n const {sourcePosition, targetPosition} = getLayoutInfo(e);\n // sort the nodes from left to right\n const [newSourcePosition, newTargetPosition] =\n sourcePosition[0] < targetPosition[0]\n ? [sourcePosition, targetPosition]\n : [targetPosition, sourcePosition];\n // angle in degrees\n const deltaX = newTargetPosition[0] - newSourcePosition[0];\n const deltaY = newTargetPosition[1] - newSourcePosition[1];\n return (Math.atan2(deltaY, deltaX) * -180) / Math.PI;\n },\n ...stylesheet.getDeckGLAccessors(),\n updateTriggers: {\n ...stylesheet.getDeckGLUpdateTriggers(),\n getPosition: positionUpdateTrigger\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\n\nimport {FlowPathLayer} from '../common-layers/flow-path-layer/flow-path-layer';\n\nexport class FlowLayer extends CompositeLayer {\n static layerName = 'FlowLayer';\n\n renderLayers() {\n const {data, getLayoutInfo, positionUpdateTrigger = 0, stylesheet} = this.props as any;\n return [\n new FlowPathLayer(\n this.getSubLayerProps({\n id: '__flow-layer',\n data,\n ...stylesheet.getDeckGLAccessors(),\n getSourcePosition: (e) => getLayoutInfo(e).sourcePosition,\n getTargetPosition: (e) => getLayoutInfo(e).targetPosition,\n parameters: {\n depthTest: false\n },\n updateTriggers: {\n ...stylesheet.getDeckGLUpdateTriggers(),\n getSourcePosition: positionUpdateTrigger,\n getTargetPosition: positionUpdateTrigger\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// import {Buffer, Transform} from '@luma.gl/core';\nimport {LineLayer} from '@deck.gl/layers';\n\nimport {vs} from './flow-path-layer-vertex.glsl';\nimport {fs} from './flow-path-layer-fragment.glsl';\n// import {tfvs} from './flow-path-layer-vertex-tf.glsl';\n\nconst defaultProps = {\n ...LineLayer.defaultProps,\n getWidth: {type: 'accessor', value: 1},\n getSpeed: {type: 'accessor', value: 0}\n};\n\n/* eslint-disable camelcase */\nexport class FlowPathLayer extends LineLayer {\n getShaders() {\n const projectModule = this.use64bitPositions() ? 'project64' : 'project32';\n return {vs, fs, modules: [projectModule, 'picking']};\n }\n\n initializeState() {\n super.initializeState();\n this.getAttributeManager().addInstanced({\n instanceSpeeds: {\n size: 1,\n transition: true,\n accessor: 'getSpeed',\n defaultValue: 0\n },\n instanceTailLengths: {\n size: 1,\n transition: true,\n accessor: 'getTailLength',\n defaultValue: 1\n }\n });\n this.setupTransformFeedback();\n this.setState({\n ...this.state,\n animation: globalThis.window.requestAnimationFrame(this.animate.bind(this))\n });\n }\n\n animate() {\n const {transform} = this.state as any;\n if (transform) {\n transform.run();\n transform.swap();\n }\n this.setState({\n animation: window.requestAnimationFrame(this.animate.bind(this))\n });\n }\n\n updateState({props, oldProps, changeFlags}) {\n super.updateState({props, oldProps, changeFlags} as any);\n const {speedsBuffer} = this.state as any;\n\n const speedChanged =\n changeFlags.dataChanged ||\n props.fp64 !== oldProps.fp64 ||\n (changeFlags.updateTriggersChanged &&\n (changeFlags.updateTriggersChanged.all || changeFlags.updateTriggersChanged.getSpeed));\n\n if (speedChanged) {\n const speeds = new Float32Array(props.data.length);\n for (let i = 0; i < props.data.length; i++) {\n speeds[i] =\n typeof props.getSpeed === 'function' ? props.getSpeed(props.data[i]) : props.getSpeed;\n }\n speedsBuffer.subData({data: speeds});\n }\n\n if (props.fp64 !== oldProps.fp64) {\n if (this.state.model) {\n (this.state.model as any).delete();\n }\n this.setState({model: this._getModel()});\n this.getAttributeManager().invalidateAll();\n }\n }\n\n finalizeState() {\n super.finalizeState(this.context);\n window.cancelAnimationFrame((this.state as any).animation);\n }\n\n setupTransformFeedback() {\n throw new Error('Not implemented');\n // const {gl} = this.context;\n // const elementCount = this.props.data && this.props.data.length;\n // if (elementCount) {\n // const instanceOffsets = new Float32Array(elementCount);\n // const instanceSpeeds = new Float32Array(elementCount);\n // const offsetBuffer = new Buffer(gl, instanceOffsets);\n // const speedsBuffer = new Buffer(gl, instanceSpeeds);\n\n // this.setState({\n // speedsBuffer,\n // transform: new Transform(gl, {\n // id: 'transform-offset',\n // vs: tfvs,\n // elementCount,\n // sourceBuffers: {\n // a_offset: offsetBuffer,\n // a_speed: speedsBuffer\n // },\n // feedbackMap: {\n // a_offset: 'v_offset'\n // }\n // })\n // });\n // }\n }\n\n draw({uniforms}) {\n throw new Error('Not implemented');\n // const {transform} = this.state;\n // if (!transform) {\n // return;\n // }\n\n // const {viewport} = this.context;\n // const {widthUnits, widthScale, widthMinPixels, widthMaxPixels} = this.props;\n\n // const widthMultiplier = widthUnits === 'pixels' ? viewport.distanceScales.metersPerPixel[2] : 1;\n\n // const offsetBuffer = transform.getBuffer('v_offset');\n // offsetBuffer.setAccessor({divisor: 1});\n\n // this.state.model\n // .setAttributes({\n // instanceOffsets: offsetBuffer\n // })\n // .setUniforms(\n // Object.assign({}, uniforms, {\n // widthScale: widthScale * widthMultiplier,\n // widthMinPixels,\n // widthMaxPixels\n // })\n // )\n // .draw();\n\n // offsetBuffer.setAccessor({divisor: 0});\n }\n}\n\nFlowPathLayer.layerName = 'FlowPathLayer';\n(FlowPathLayer as any).defaultProps = defaultProps;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport const vs = /* glsl */ `\\\n#define SHADER_NAME flow-path-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceSpeeds;\nattribute float instanceOffsets;\nattribute float instanceTailLengths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying float segmentIndex;\nvarying float speed;\nvarying float pathLength;\nvarying float tailLength;\nvarying float offset;\n\n// offset vector by strokeWidth pixels\n// offset_direction is -1 (left) or 1 (right)\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_size_to_clipspace(offset_screenspace);\n\n return offset_clipspace;\n}\n\nvoid main(void) {\n // Position\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.));\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.));\n\n // Multiply out width and clamp to limits\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n\n // linear interpolation of source & target to pick right coord\n segmentIndex = positions.x;\n speed = instanceSpeeds;\n tailLength = project_size_to_pixel(instanceTailLengths * widthScale);\n offset = instanceOffsets;\n pathLength = distance(instanceSourcePositions, instanceTargetPositions);\n vec4 p = mix(source, target, segmentIndex);\n\n // extrude\n vec2 offset = getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels);\n gl_Position = p + vec4(offset, 0.0, 0.0);\n\n // Color\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n`;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport const fs = /* glsl */ `\\\n#define SHADER_NAME flow-path-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float segmentIndex;\nvarying float speed;\nvarying float offset;\nvarying float pathLength;\nvarying float tailLength;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n\n if (speed == 0.0) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n // the portion of the visible segment (0 to 1) , ex: 0.3\n // edge cases: pathLength = 0 or tailLength > pathLength\n float segFragment = 0.0;\n if (pathLength != 0.0) {\n segFragment = tailLength / pathLength;\n }\n if (tailLength > pathLength) {\n segFragment = 1.0;\n }\n float startSegmentIndex = mod(offset, 60.0) / 60.0;\n // the end offset, cap to 1.0 (end of the line)\n float endSegmentIndex = min(startSegmentIndex + segFragment, 1.0);\n if (segmentIndex < startSegmentIndex || segmentIndex > endSegmentIndex) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n // fading tail\n float portion = (segmentIndex - startSegmentIndex) / segFragment;\n gl_FragColor[3] = portion;\n }\n }\n}\n`;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {SimpleMeshLayer} from '@deck.gl/mesh-layers';\n\nimport {Arrow2DGeometry} from './arrow-2d-geometry';\n\nconst DEFAULT_ARROW_GEOMETRY = new Arrow2DGeometry({length: 1, headWidth: 0.6});\n\ntype LayoutInfo = {\n sourcePosition: number[];\n targetPosition: number[];\n controlPoints?: number[][];\n};\n\nconst DEFAULT_Z = 0;\n\nfunction resolveSize(value: unknown): number {\n const numeric = Number(value);\n return Number.isFinite(numeric) && numeric !== 0 ? numeric : 1;\n}\n\nfunction getOffsetComponents(offset: unknown): {along: number; perpendicular: number} {\n if (!Array.isArray(offset)) {\n return {along: 0, perpendicular: 0};\n }\n const along = Number(offset[0]);\n const perpendicular = Number(offset[1]);\n return {\n along: Number.isFinite(along) ? along : 0,\n perpendicular: Number.isFinite(perpendicular) ? perpendicular : 0\n };\n}\n\nexport function isEdgeDirected(edge: any): boolean {\n if (!edge) {\n return false;\n }\n if (typeof edge.isDirected === 'function') {\n return Boolean(edge.isDirected());\n }\n if (typeof edge.directed === 'boolean') {\n return edge.directed;\n }\n return false;\n}\n\nfunction normalizeVector(vector: number[]): number[] {\n const length = Math.hypot(vector[0] ?? 0, vector[1] ?? 0, vector[2] ?? 0);\n if (length === 0) {\n return [0, 0, 0];\n }\n return [(vector[0] ?? 0) / length, (vector[1] ?? 0) / length, (vector[2] ?? 0) / length];\n}\n\nfunction getTerminalDirection({sourcePosition, targetPosition, controlPoints = []}: LayoutInfo): {\n target: number[];\n direction: number[];\n} {\n const anchor = controlPoints.length ? controlPoints[controlPoints.length - 1] : sourcePosition;\n const direction = [\n (targetPosition[0] ?? 0) - (anchor?.[0] ?? 0),\n (targetPosition[1] ?? 0) - (anchor?.[1] ?? 0),\n (targetPosition[2] ?? DEFAULT_Z) - (anchor?.[2] ?? DEFAULT_Z)\n ];\n return {target: targetPosition, direction};\n}\n\nexport function getArrowTransform({\n layout,\n size,\n offset = null\n}: {\n layout: LayoutInfo;\n size: number;\n offset?: number[] | null;\n}): {position: [number, number, number]; angle: number} {\n const {target, direction} = getTerminalDirection(layout);\n const unit = normalizeVector(direction);\n\n const hasDirection = unit[0] !== 0 || unit[1] !== 0 || unit[2] !== 0;\n const resolvedSize = resolveSize(size);\n const basePosition: [number, number, number] = [\n target[0] ?? 0,\n target[1] ?? 0,\n target[2] ?? DEFAULT_Z\n ];\n\n if (!hasDirection) {\n return {position: basePosition, angle: 0};\n }\n\n const {along, perpendicular} = getOffsetComponents(offset);\n const alongDistance = resolvedSize * 0.5 + along;\n const position: [number, number, number] = [\n basePosition[0] - unit[0] * alongDistance,\n basePosition[1] - unit[1] * alongDistance,\n basePosition[2] - unit[2] * alongDistance\n ];\n\n if (perpendicular) {\n const perp = [-unit[1], unit[0], 0];\n position[0] += perp[0] * perpendicular;\n position[1] += perp[1] * perpendicular;\n position[2] += perp[2] * perpendicular;\n }\n\n const angle = (Math.atan2(unit[0], unit[1]) * 180) / Math.PI;\n\n return {position, angle};\n}\n\nexport class EdgeArrowLayer extends CompositeLayer {\n static layerName = 'EdgeArrowLayer';\n\n renderLayers() {\n const {data, getLayoutInfo, positionUpdateTrigger = 0, stylesheet} = this.props as any;\n const directedEdges = (data || []).filter(isEdgeDirected);\n\n if (!directedEdges.length) {\n return [];\n }\n\n const {getColor, getSize, getOffset} = stylesheet.getDeckGLAccessors();\n const updateTriggers = stylesheet.getDeckGLUpdateTriggers();\n\n return [\n new SimpleMeshLayer(\n this.getSubLayerProps({\n id: '__edge-arrow-layer',\n data: directedEdges,\n mesh: DEFAULT_ARROW_GEOMETRY,\n getColor,\n getScale: (edge) => {\n const size = resolveSize(getSize(edge));\n return [size, size, size];\n },\n getOrientation: (edge) => {\n const layout = getLayoutInfo(edge);\n const size = resolveSize(getSize(edge));\n const offset = getOffset ? getOffset(edge) : null;\n const {angle} = getArrowTransform({layout, size, offset});\n return [0, -angle, 0];\n },\n getPosition: (edge) => {\n const layout = getLayoutInfo(edge);\n const size = resolveSize(getSize(edge));\n const offset = getOffset ? getOffset(edge) : null;\n const {position} = getArrowTransform({layout, size, offset});\n return position;\n },\n parameters: {\n depthTest: false\n },\n updateTriggers: {\n getColor: updateTriggers.getColor,\n getScale: updateTriggers.getSize,\n getOrientation: [\n positionUpdateTrigger,\n updateTriggers.getSize,\n updateTriggers.getOffset\n ],\n getPosition: [positionUpdateTrigger, updateTriggers.getSize, updateTriggers.getOffset]\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Geometry} from '@luma.gl/engine';\n\n// Mirror of the arrow geometry used by PathMarkerLayer, but only the head triangle.\nexport class Arrow2DGeometry extends Geometry {\n constructor(opts = {}) {\n super(\n Object.assign({}, opts, {\n attributes: getArrowAttributes(opts),\n topology: 'triangle-list' as const\n })\n );\n }\n}\n\nfunction getArrowAttributes({length = 1, headWidth = 1}) {\n const halfLength = length / 2;\n const halfWidth = headWidth / 2;\n\n const positions = new Float32Array([\n 0,\n halfLength,\n 0,\n -halfWidth,\n -halfLength,\n 0,\n halfWidth,\n -halfLength,\n 0\n ]);\n\n const normals = new Float32Array([0, 0, 1, 0, 0, 1, 0, 0, 1]);\n\n const texCoords = new Float32Array([0.5, 1, 0, 0, 1, 0]);\n\n return {\n positions: {size: 3, value: positions},\n normals: {size: 3, value: normals},\n texCoords: {size: 2, value: texCoords}\n };\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport type GeometryNodeType =\n | 'circle'\n | 'rectangle'\n | 'rounded-rectangle'\n | 'path-rounded-rectangle'\n | 'marker';\n\nexport type NodeGeometry = {\n type?: GeometryNodeType;\n center: [number, number];\n radius?: number;\n width?: number;\n height?: number;\n cornerRadius?: number;\n};\n\nconst EPSILON = 1e-6;\n\nfunction normalizeDirection(\n center: [number, number],\n target: [number, number]\n): {unit: [number, number]; distance: number} | null {\n const dx = target[0] - center[0];\n const dy = target[1] - center[1];\n const length = Math.hypot(dx, dy);\n\n if (length <= EPSILON) {\n return null;\n }\n\n return {unit: [dx / length, dy / length], distance: length};\n}\n\nfunction projectFromCenter(\n center: [number, number],\n unit: [number, number],\n distance: number\n): [number, number] {\n return [center[0] + unit[0] * distance, center[1] + unit[1] * distance];\n}\n\nfunction projectToRectangle(\n center: [number, number],\n unit: [number, number],\n halfWidth: number,\n halfHeight: number\n): [number, number] {\n const absUx = Math.abs(unit[0]);\n const absUy = Math.abs(unit[1]);\n\n let distance = Number.POSITIVE_INFINITY;\n if (halfWidth > 0 && absUx > EPSILON) {\n distance = Math.min(distance, halfWidth / absUx);\n }\n if (halfHeight > 0 && absUy > EPSILON) {\n distance = Math.min(distance, halfHeight / absUy);\n }\n\n if (!Number.isFinite(distance)) {\n return [...center] as [number, number];\n }\n\n return [center[0] + unit[0] * distance, center[1] + unit[1] * distance];\n}\n\nfunction resolveCornerRadius(\n rawCornerRadius: number | undefined,\n halfWidth: number,\n halfHeight: number\n): number {\n if (!Number.isFinite(rawCornerRadius) || rawCornerRadius <= 0) {\n return 0;\n }\n\n let resolved = rawCornerRadius;\n if (resolved <= 1) {\n resolved *= Math.min(halfWidth, halfHeight);\n }\n\n return Math.min(resolved, halfWidth, halfHeight);\n}\n\n// eslint-disable-next-line max-params\nfunction intersectsInnerFaces(\n absX: number,\n absY: number,\n innerHalfWidth: number,\n innerHalfHeight: number,\n halfWidth: number,\n halfHeight: number\n) {\n const insideVerticalFace = absX <= innerHalfWidth + EPSILON && absY <= halfHeight + EPSILON;\n const insideHorizontalFace = absY <= innerHalfHeight + EPSILON && absX <= halfWidth + EPSILON;\n return insideVerticalFace || insideHorizontalFace;\n}\n\n// eslint-disable-next-line max-params\nfunction projectToCornerArc(\n geometry: NodeGeometry,\n unit: [number, number],\n innerHalfWidth: number,\n innerHalfHeight: number,\n cornerRadius: number,\n rectanglePoint: [number, number]\n) {\n const offsetX = rectanglePoint[0] - geometry.center[0];\n const offsetY = rectanglePoint[1] - geometry.center[1];\n\n const cornerCenter: [number, number] = [\n geometry.center[0] + Math.sign(offsetX || unit[0]) * innerHalfWidth,\n geometry.center[1] + Math.sign(offsetY || unit[1]) * innerHalfHeight\n ];\n const relativeCornerCenter: [number, number] = [\n cornerCenter[0] - geometry.center[0],\n cornerCenter[1] - geometry.center[1]\n ];\n\n const dot = unit[0] * relativeCornerCenter[0] + unit[1] * relativeCornerCenter[1];\n const centerDistanceSq =\n relativeCornerCenter[0] * relativeCornerCenter[0] +\n relativeCornerCenter[1] * relativeCornerCenter[1];\n const discriminant = dot * dot - (centerDistanceSq - cornerRadius * cornerRadius);\n\n if (discriminant < 0) {\n return rectanglePoint;\n }\n\n const distance = dot - Math.sqrt(Math.max(0, discriminant));\n return projectFromCenter(geometry.center, unit, distance);\n}\n\nfunction computeRectangleIntersection(\n geometry: NodeGeometry,\n unit: [number, number]\n): [number, number] {\n const halfWidth = (geometry.width ?? 0) / 2;\n const halfHeight = (geometry.height ?? 0) / 2;\n if (halfWidth <= EPSILON || halfHeight <= EPSILON) {\n return [...geometry.center];\n }\n return projectToRectangle(geometry.center, unit, halfWidth, halfHeight);\n}\n\n// eslint-disable-next-line max-statements, complexity\nfunction computeRoundedRectangleIntersection(\n geometry: NodeGeometry,\n unit: [number, number]\n): [number, number] {\n const halfWidth = (geometry.width ?? 0) / 2;\n const halfHeight = (geometry.height ?? 0) / 2;\n\n if (halfWidth <= EPSILON || halfHeight <= EPSILON) {\n const radius = geometry.radius ?? Math.min(halfWidth, halfHeight);\n return projectFromCenter(geometry.center, unit, radius);\n }\n\n const cornerRadius = resolveCornerRadius(geometry.cornerRadius, halfWidth, halfHeight);\n\n if (cornerRadius <= EPSILON) {\n return projectToRectangle(geometry.center, unit, halfWidth, halfHeight);\n }\n\n const innerHalfWidth = Math.max(halfWidth - cornerRadius, 0);\n const innerHalfHeight = Math.max(halfHeight - cornerRadius, 0);\n\n if (innerHalfWidth <= EPSILON || innerHalfHeight <= EPSILON) {\n const radius = Math.min(halfWidth, halfHeight);\n return projectFromCenter(geometry.center, unit, radius);\n }\n\n const rectanglePoint = projectToRectangle(geometry.center, unit, halfWidth, halfHeight);\n const absX = Math.abs(rectanglePoint[0] - geometry.center[0]);\n const absY = Math.abs(rectanglePoint[1] - geometry.center[1]);\n\n const touchesInnerFace = absX <= innerHalfWidth + EPSILON || absY <= innerHalfHeight + EPSILON;\n\n if (\n touchesInnerFace &&\n intersectsInnerFaces(absX, absY, innerHalfWidth, innerHalfHeight, halfWidth, halfHeight)\n ) {\n return rectanglePoint;\n }\n\n return projectToCornerArc(\n geometry,\n unit,\n innerHalfWidth,\n innerHalfHeight,\n cornerRadius,\n rectanglePoint\n );\n}\n\nfunction computeCircleIntersection(\n geometry: NodeGeometry,\n unit: [number, number],\n radius?: number\n) {\n const effectiveRadius = radius ?? geometry.radius ?? 0;\n return projectFromCenter(geometry.center, unit, Math.max(effectiveRadius, 0));\n}\n\nconst BOUNDARY_COMPUTERS: Record<\n GeometryNodeType,\n (geometry: NodeGeometry, unit: [number, number]) => [number, number]\n> = {\n circle: (geometry, unit) => computeCircleIntersection(geometry, unit),\n marker: (geometry, unit) => computeCircleIntersection(geometry, unit),\n rectangle: (geometry, unit) => computeRectangleIntersection(geometry, unit),\n 'rounded-rectangle': (geometry, unit) => computeRoundedRectangleIntersection(geometry, unit),\n 'path-rounded-rectangle': (geometry, unit) => computeRoundedRectangleIntersection(geometry, unit)\n};\n\nexport function getNodeBoundaryIntersection(\n geometry: NodeGeometry,\n targetCenter: [number, number]\n): [number, number] {\n const direction = normalizeDirection(geometry.center, targetCenter);\n if (!direction) {\n return [...geometry.center];\n }\n\n const handler = geometry.type ? BOUNDARY_COMPUTERS[geometry.type] : undefined;\n if (handler) {\n return handler(geometry, direction.unit);\n }\n\n if (geometry.radius && geometry.radius > EPSILON) {\n return projectFromCenter(geometry.center, direction.unit, geometry.radius);\n }\n\n return [...geometry.center];\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {InteractionManager} from '../core/interaction-manager';\nimport type {GraphEngine} from '../core/graph-engine';\nimport type {NodeInterface} from '../graph/graph';\n\nimport {GraphStylesheetEngine, type GraphStyleRule} from '../style/graph-style-engine';\nimport type {GraphLayerNodeStyle} from '../style/graph-layer-stylesheet';\nimport {\n getNodeBoundaryIntersection,\n type GeometryNodeType,\n type NodeGeometry\n} from '../utils/node-boundary';\nimport {warn} from '../utils/log';\n\ntype NumericAccessor = ((node: NodeInterface) => number) | number | null | undefined;\ntype OffsetAccessor =\n | ((node: NodeInterface) => [number, number])\n | [number, number]\n | null\n | undefined;\n\ntype NodeStyleAccessors = {\n type: GeometryNodeType;\n getOffset?: OffsetAccessor;\n getRadius?: NumericAccessor;\n getWidth?: NumericAccessor;\n getHeight?: NumericAccessor;\n getCornerRadius?: NumericAccessor;\n getSize?: NumericAccessor;\n};\n\nconst GEOMETRY_NODE_TYPES: GeometryNodeType[] = [\n 'circle',\n 'rectangle',\n 'rounded-rectangle',\n 'path-rounded-rectangle',\n 'marker'\n];\n\nfunction evaluateNumericAccessor(\n accessor: NumericAccessor,\n node: NodeInterface\n): number | undefined {\n if (typeof accessor === 'function') {\n const value = accessor(node);\n return typeof value === 'number' && Number.isFinite(value) ? value : undefined;\n }\n if (typeof accessor === 'number' && Number.isFinite(accessor)) {\n return accessor;\n }\n return undefined;\n}\n\nfunction evaluateOffsetAccessor(accessor: OffsetAccessor, node: NodeInterface): [number, number] {\n if (!accessor) {\n return [0, 0];\n }\n\n let value = accessor as [number, number];\n if (typeof accessor === 'function') {\n value = accessor(node);\n }\n\n if (Array.isArray(value) && value.length >= 2) {\n const offsetX = Number(value[0]);\n const offsetY = Number(value[1]);\n if (Number.isFinite(offsetX) && Number.isFinite(offsetY)) {\n return [offsetX, offsetY];\n }\n }\n\n return [0, 0];\n}\n\nfunction normalizePosition(value: any): [number, number] | null {\n if (!value || typeof value !== 'object') {\n return null;\n }\n\n const candidate = value as {length?: number; [index: number]: number};\n if (typeof candidate.length === 'number' && candidate.length >= 2) {\n const x = Number(candidate[0]);\n const y = Number(candidate[1]);\n if (Number.isFinite(x) && Number.isFinite(y)) {\n return [x, y];\n }\n }\n\n return null;\n}\n\nfunction resolveAccessorValue(accessor: NumericAccessor | undefined, node: NodeInterface) {\n if (!accessor) {\n return undefined;\n }\n return evaluateNumericAccessor(accessor, node);\n}\n\nfunction assignDimension(\n geometry: NodeGeometry,\n key: 'radius' | 'width' | 'height' | 'cornerRadius',\n value: number | undefined\n) {\n if (typeof value === 'number' && Number.isFinite(value)) {\n geometry[key] = Math.max(value, 0);\n }\n}\n\nfunction assignRectangleDimensions(\n node: NodeInterface,\n accessors: NodeStyleAccessors,\n geometry: NodeGeometry\n) {\n assignDimension(geometry, 'width', resolveAccessorValue(accessors.getWidth, node));\n assignDimension(geometry, 'height', resolveAccessorValue(accessors.getHeight, node));\n}\n\nconst GEOMETRY_APPLIERS: Record<\n GeometryNodeType,\n (node: NodeInterface, accessors: NodeStyleAccessors, geometry: NodeGeometry) => void\n> = {\n circle: (node, accessors, geometry) => {\n assignDimension(geometry, 'radius', resolveAccessorValue(accessors.getRadius, node));\n },\n marker: (node, accessors, geometry) => {\n const size = resolveAccessorValue(accessors.getSize, node);\n assignDimension(geometry, 'radius', typeof size === 'number' ? size / 2 : undefined);\n },\n rectangle: (node, accessors, geometry) => {\n assignRectangleDimensions(node, accessors, geometry);\n },\n 'rounded-rectangle': (node, accessors, geometry) => {\n assignRectangleDimensions(node, accessors, geometry);\n assignDimension(\n geometry,\n 'cornerRadius',\n resolveAccessorValue(accessors.getCornerRadius, node)\n );\n assignDimension(geometry, 'radius', resolveAccessorValue(accessors.getRadius, node));\n },\n 'path-rounded-rectangle': (node, accessors, geometry) => {\n assignRectangleDimensions(node, accessors, geometry);\n assignDimension(\n geometry,\n 'cornerRadius',\n resolveAccessorValue(accessors.getCornerRadius, node)\n );\n }\n};\n\nexport class EdgeAttachmentHelper {\n getLayoutAccessor({\n engine,\n interactionManager,\n nodeStyle\n }: {\n engine: GraphEngine;\n interactionManager: InteractionManager;\n nodeStyle?: GraphLayerNodeStyle[] | GraphLayerNodeStyle;\n }) {\n const nodeAccessorMap = this._buildNodeStyleAccessorMap({\n engine,\n interactionManager,\n nodeStyle\n });\n\n if (nodeAccessorMap.size === 0) {\n return (edge: any) => engine.getEdgePosition(edge);\n }\n\n const nodeMap = engine\n .getNodes()\n .reduce(\n (acc, node) => acc.set(node.getId(), node),\n new Map<string | number, NodeInterface>()\n );\n\n return (edge: any) => this._getAdjustedEdgeLayout(engine, nodeAccessorMap, nodeMap, edge);\n }\n\n private _buildNodeStyleAccessorMap({\n engine,\n interactionManager,\n nodeStyle\n }: {\n engine: GraphEngine;\n interactionManager: InteractionManager;\n nodeStyle?: GraphLayerNodeStyle[] | GraphLayerNodeStyle;\n }) {\n const nodeAccessorMap = new Map<string | number, NodeStyleAccessors>();\n\n if (!nodeStyle) {\n return nodeAccessorMap;\n }\n\n const styles = Array.isArray(nodeStyle) ? nodeStyle : [nodeStyle];\n\n styles.filter(Boolean).forEach((style) => {\n const {data = (nodes) => nodes, ...restStyle} = style;\n const type = restStyle.type;\n\n if (!type || !GEOMETRY_NODE_TYPES.includes(type as GeometryNodeType)) {\n return;\n }\n\n let stylesheet: GraphStylesheetEngine | null = null;\n try {\n stylesheet = engine.createStylesheetEngine(restStyle as GraphStyleRule, {\n stateUpdateTrigger: (interactionManager as any).getLastInteraction()\n });\n } catch (error) {\n warn(\n `GraphLayer: Failed to evaluate node stylesheet for edge attachment (${String(\n (error as Error).message ?? error\n )}).`\n );\n return;\n }\n\n const nodes = data(engine.getNodes());\n if (!Array.isArray(nodes)) {\n return;\n }\n\n const geometryType = type as GeometryNodeType;\n const accessors = this._createAccessorsForType(geometryType, stylesheet);\n\n nodes.forEach((node: NodeInterface) => {\n const id = node.getId();\n if (!nodeAccessorMap.has(id)) {\n nodeAccessorMap.set(id, accessors);\n }\n });\n });\n\n return nodeAccessorMap;\n }\n\n private _getAdjustedEdgeLayout(\n engine: GraphEngine,\n nodeAccessorMap: Map<string | number, NodeStyleAccessors>,\n nodeMap: Map<string | number, NodeInterface>,\n edge: any\n ) {\n const layoutInfo = engine.getEdgePosition(edge);\n if (!layoutInfo) {\n return layoutInfo;\n }\n\n const sourceNode = nodeMap.get(edge.getSourceNodeId());\n const targetNode = nodeMap.get(edge.getTargetNodeId());\n\n if (!sourceNode || !targetNode) {\n return layoutInfo;\n }\n\n const sourceGeometry = this._computeNodeGeometry(\n engine,\n sourceNode,\n nodeAccessorMap.get(sourceNode.getId())\n );\n const targetGeometry = this._computeNodeGeometry(\n engine,\n targetNode,\n nodeAccessorMap.get(targetNode.getId())\n );\n\n if (!sourceGeometry && !targetGeometry) {\n return layoutInfo;\n }\n\n return this._applyGeometryToLayout(layoutInfo, sourceGeometry, targetGeometry);\n }\n\n private _applyGeometryToLayout(\n layoutInfo: any,\n sourceGeometry: NodeGeometry | null,\n targetGeometry: NodeGeometry | null\n ) {\n const adjustedLayout = {...layoutInfo};\n\n const targetReference = targetGeometry?.center ?? normalizePosition(layoutInfo.targetPosition);\n const sourceReference = sourceGeometry?.center ?? normalizePosition(layoutInfo.sourcePosition);\n\n if (sourceGeometry) {\n adjustedLayout.sourcePosition = targetReference\n ? getNodeBoundaryIntersection(sourceGeometry, targetReference)\n : [...sourceGeometry.center];\n }\n\n if (targetGeometry) {\n adjustedLayout.targetPosition = sourceReference\n ? getNodeBoundaryIntersection(targetGeometry, sourceReference)\n : [...targetGeometry.center];\n }\n\n return adjustedLayout;\n }\n\n private _createAccessorsForType(\n geometryType: GeometryNodeType,\n stylesheet: GraphStylesheetEngine\n ): NodeStyleAccessors {\n const base: NodeStyleAccessors = {\n type: geometryType,\n getOffset: stylesheet.getDeckGLAccessor('getOffset')\n };\n\n switch (geometryType) {\n case 'circle':\n base.getRadius = stylesheet.getDeckGLAccessor('getRadius');\n break;\n case 'marker':\n base.getSize = stylesheet.getDeckGLAccessor('getSize');\n break;\n case 'rectangle':\n base.getWidth = stylesheet.getDeckGLAccessor('getWidth');\n base.getHeight = stylesheet.getDeckGLAccessor('getHeight');\n break;\n case 'rounded-rectangle':\n base.getWidth = stylesheet.getDeckGLAccessor('getWidth');\n base.getHeight = stylesheet.getDeckGLAccessor('getHeight');\n base.getCornerRadius = stylesheet.getDeckGLAccessor('getCornerRadius');\n base.getRadius = stylesheet.getDeckGLAccessor('getRadius');\n break;\n case 'path-rounded-rectangle':\n base.getWidth = stylesheet.getDeckGLAccessor('getWidth');\n base.getHeight = stylesheet.getDeckGLAccessor('getHeight');\n base.getCornerRadius = stylesheet.getDeckGLAccessor('getCornerRadius');\n break;\n default:\n break;\n }\n\n return base;\n }\n\n private _computeNodeGeometry(\n engine: GraphEngine,\n node: NodeInterface,\n accessors?: NodeStyleAccessors\n ): NodeGeometry | null {\n const basePosition = engine.getNodePosition(node);\n if (!basePosition) {\n return null;\n }\n\n const offset = evaluateOffsetAccessor(accessors?.getOffset, node);\n const center: [number, number] = [basePosition[0] + offset[0], basePosition[1] + offset[1]];\n\n const geometry: NodeGeometry = {\n type: accessors?.type,\n center\n };\n\n if (!accessors || !accessors.type) {\n return geometry;\n }\n\n const applier = GEOMETRY_APPLIERS[accessors.type];\n if (applier) {\n applier(node, accessors, geometry);\n }\n\n return geometry;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer, type CompositeLayerProps, type UpdateParameters} from '@deck.gl/core';\nimport {LineLayer, TextLayer} from '@deck.gl/layers';\n\nexport type GridLineDatum = {\n /** Optional label associated with the grid line. */\n label?: string | number;\n /** Horizontal grid lines use the yPosition value. */\n yPosition?: number | null;\n /** Vertical grid lines use the xPosition value. */\n xPosition?: number | null;\n};\n\nexport type GridLayerProps<DatumT extends GridLineDatum = GridLineDatum> = CompositeLayerProps & {\n /** Collection of grid line definitions. */\n data: readonly DatumT[];\n /** Direction in which to draw grid lines. */\n direction?: 'horizontal' | 'vertical';\n /** Minimum X coordinate for grid lines. */\n xMin?: number;\n /** Maximum X coordinate for grid lines. */\n xMax?: number;\n /** Minimum Y coordinate for grid lines. */\n yMin?: number;\n /** Maximum Y coordinate for grid lines. */\n yMax?: number;\n /** Width of the grid lines in screen pixels. */\n width?: number;\n /** RGBA color for grid lines. */\n color?: [number, number, number, number];\n /** Optional accessor for line labels. */\n getLabel?: (d: DatumT) => string | number | null | undefined;\n /** Optional accessor for per-datum colors. */\n getColor?: (d: DatumT) => [number, number, number, number] | null | undefined;\n /** Optional accessor for per-datum widths. */\n getWidth?: (d: DatumT) => number | null | undefined;\n /** Whether to render labels alongside the grid lines. */\n showLabels?: boolean;\n /** Pixel offset applied to rendered labels. */\n labelOffset?: [number, number];\n};\n\nconst DEFAULT_COLOR: [number, number, number, number] = [200, 200, 200, 255];\nconst DEFAULT_WIDTH = 1;\nconst DEFAULT_OFFSET: [number, number] = [8, 0];\nconst DEFAULT_MIN = -1e6;\nconst DEFAULT_MAX = 1e6;\n\nexport class GridLayer<DatumT extends GridLineDatum = GridLineDatum> extends CompositeLayer<\n GridLayerProps<DatumT>\n> {\n static override layerName = 'GridLayer';\n\n static override defaultProps: Required<\n Pick<\n GridLayerProps<GridLineDatum>,\n | 'direction'\n | 'width'\n | 'color'\n | 'xMin'\n | 'xMax'\n | 'yMin'\n | 'yMax'\n | 'showLabels'\n | 'labelOffset'\n >\n > = {\n direction: 'horizontal',\n width: DEFAULT_WIDTH,\n color: DEFAULT_COLOR,\n xMin: DEFAULT_MIN,\n xMax: DEFAULT_MAX,\n yMin: DEFAULT_MIN,\n yMax: DEFAULT_MAX,\n showLabels: true,\n labelOffset: DEFAULT_OFFSET\n } as const;\n\n override shouldUpdateState(params: UpdateParameters<this>): boolean {\n const {changeFlags} = params;\n return Boolean(\n changeFlags.dataChanged || changeFlags.propsChanged || changeFlags.viewportChanged\n );\n }\n\n override renderLayers() {\n const {\n data,\n direction = 'horizontal',\n xMin = DEFAULT_MIN,\n xMax = DEFAULT_MAX,\n yMin = DEFAULT_MIN,\n yMax = DEFAULT_MAX,\n color = DEFAULT_COLOR,\n width = DEFAULT_WIDTH,\n getLabel,\n getColor,\n getWidth,\n showLabels = true,\n labelOffset = DEFAULT_OFFSET\n } = this.props;\n\n const bounds = this._resolveViewportBounds({xMin, xMax, yMin, yMax});\n const lines = this._createLineSegments(data, direction, bounds);\n\n if (!lines.length) {\n return [];\n }\n\n const lineLayer = new LineLayer({\n id: `${this.props.id}-lines`,\n data: lines,\n getSourcePosition: (d) => d.sourcePosition,\n getTargetPosition: (d) => d.targetPosition,\n getColor: getColor ? (d) => getColor(d.datum) ?? color : () => color,\n getWidth: getWidth ? (d) => getWidth(d.datum) ?? width : () => width,\n widthUnits: 'pixels',\n parameters: {\n depthTest: false\n }\n });\n\n if (!showLabels) {\n return [lineLayer];\n }\n\n const textData = this._createLabelData(lines, direction, bounds, getLabel);\n\n if (!textData.length) {\n return [lineLayer];\n }\n\n const textLayer = new TextLayer({\n id: `${this.props.id}-labels`,\n data: textData,\n getPosition: (d) => d.position,\n getText: (d) => d.text,\n getColor: getColor ? (d) => getColor(d.datum) ?? color : () => color,\n getSize: 12,\n sizeUnits: 'pixels',\n getPixelOffset: labelOffset,\n getTextAnchor: () => 'start',\n getAlignmentBaseline: () => 'center',\n background: true,\n backgroundPadding: [4, 2],\n backgroundColor: [255, 255, 255, 200],\n parameters: {\n depthTest: false\n }\n });\n\n return [lineLayer, textLayer];\n }\n\n private _resolveViewportBounds(bounds: {\n xMin: number;\n xMax: number;\n yMin: number;\n yMax: number;\n }): {minX: number; maxX: number; minY: number; maxY: number} {\n const viewportBounds = this.context?.viewport?.getBounds?.();\n if (!Array.isArray(viewportBounds) || viewportBounds.length !== 4) {\n return {minX: bounds.xMin, maxX: bounds.xMax, minY: bounds.yMin, maxY: bounds.yMax};\n }\n\n const [bxMin, byMin, bxMax, byMax] = viewportBounds;\n const minX =\n Number.isFinite(bxMin) && Number.isFinite(bxMax) ? Math.min(bounds.xMin, bxMin) : bounds.xMin;\n const maxX =\n Number.isFinite(bxMin) && Number.isFinite(bxMax) ? Math.max(bounds.xMax, bxMax) : bounds.xMax;\n const minY =\n Number.isFinite(byMin) && Number.isFinite(byMax) ? Math.min(bounds.yMin, byMin) : bounds.yMin;\n const maxY =\n Number.isFinite(byMin) && Number.isFinite(byMax) ? Math.max(bounds.yMax, byMax) : bounds.yMax;\n\n return {minX, maxX, minY, maxY};\n }\n\n private _createLineSegments(\n data: readonly DatumT[],\n direction: 'horizontal' | 'vertical',\n bounds: {minX: number; maxX: number; minY: number; maxY: number}\n ): Array<{\n sourcePosition: [number, number];\n targetPosition: [number, number];\n datum: DatumT;\n }> {\n const segments: Array<{\n sourcePosition: [number, number];\n targetPosition: [number, number];\n datum: DatumT;\n }> = [];\n\n const isHorizontal = direction === 'horizontal';\n for (const datum of data) {\n const position = isHorizontal ? datum.yPosition : datum.xPosition;\n if (typeof position === 'number' && Number.isFinite(position)) {\n if (isHorizontal) {\n segments.push({\n sourcePosition: [bounds.minX, position],\n targetPosition: [bounds.maxX, position],\n datum\n });\n } else {\n segments.push({\n sourcePosition: [position, bounds.minY],\n targetPosition: [position, bounds.maxY],\n datum\n });\n }\n }\n }\n\n return segments;\n }\n\n private _createLabelData(\n lines: Array<{\n sourcePosition: [number, number];\n targetPosition: [number, number];\n datum: DatumT;\n }>,\n direction: 'horizontal' | 'vertical',\n bounds: {minX: number; maxX: number; minY: number; maxY: number},\n getLabel?: (datum: DatumT) => string | number | null | undefined\n ): Array<{position: [number, number]; text: string; datum: DatumT}> {\n const labels: Array<{position: [number, number]; text: string; datum: DatumT}> = [];\n const isHorizontal = direction === 'horizontal';\n\n for (const {datum, sourcePosition} of lines) {\n const rawLabel = getLabel ? getLabel(datum) : (datum.label ?? null);\n if (rawLabel !== null && rawLabel !== undefined && rawLabel !== '') {\n const [sx, sy] = sourcePosition;\n const position: [number, number] = isHorizontal ? [bounds.minX, sy] : [sx, bounds.minY];\n labels.push({position, text: String(rawLabel), datum});\n }\n }\n\n return labels;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport const mixedGetPosition = (getPosition, getOffset) => {\n if (!getOffset) {\n return getPosition;\n }\n\n if (typeof getOffset === 'function') {\n return (d) => {\n const [x, y] = getPosition(d);\n const [offX, offY] = getOffset(d);\n return [x + offX, y + offY];\n };\n }\n\n const [offX, offY] = getOffset;\n return (d) => {\n const [x, y] = getPosition(d);\n return [x + offX, y + offY];\n };\n};\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {GraphEngine} from '../core/graph-engine';\nimport type {NodeInterface} from '../graph/graph';\n\nconst OUTLINE_PADDING = 24;\nconst OUTLINE_CORNER_RADIUS = 16;\nconst OUTLINE_CORNER_SEGMENTS = 6;\n\nexport type ChainInteractionSource =\n | 'node'\n | 'collapsed-marker'\n | 'expanded-marker'\n | 'collapsed-outline'\n | 'expanded-outline';\n\nfunction resolveLayerId(layer: any): string {\n if (!layer) {\n return '';\n }\n if (typeof layer.id === 'string') {\n return layer.id;\n }\n if (typeof layer.props?.id === 'string') {\n return layer.props.id;\n }\n return '';\n}\n\nfunction classifyChainLayer(layer: any): ChainInteractionSource | null {\n let current = layer ?? null;\n while (current) {\n const layerId = resolveLayerId(current);\n if (layerId.includes('collapsed-chain-markers')) {\n return 'collapsed-marker';\n }\n if (layerId.includes('expanded-chain-markers')) {\n return 'expanded-marker';\n }\n if (layerId.includes('collapsed-chain-outlines')) {\n return 'collapsed-outline';\n }\n if (layerId.includes('expanded-chain-outlines')) {\n return 'expanded-outline';\n }\n current = current.parent ?? null;\n }\n return null;\n}\n\nexport function resolveChainInteractionSource(info: any): ChainInteractionSource {\n if (!info) {\n return 'node';\n }\n\n const layersToCheck = [] as any[];\n if (info.layer || info.sourceLayer) {\n if (info.layer) {\n layersToCheck.push(info.layer);\n }\n if (info.sourceLayer && info.sourceLayer !== info.layer) {\n layersToCheck.push(info.sourceLayer);\n }\n } else {\n layersToCheck.push(info);\n }\n\n for (const layer of layersToCheck) {\n const classification = classifyChainLayer(layer);\n if (classification) {\n return classification;\n }\n }\n\n return 'node';\n}\n\nfunction isChainRepresentative(node: NodeInterface): boolean {\n const chainId = node.getPropertyValue('collapsedChainId');\n const nodeIds = node.getPropertyValue('collapsedNodeIds');\n const representativeId = node.getPropertyValue('collapsedChainRepresentativeId');\n\n return (\n Boolean(chainId) &&\n Array.isArray(nodeIds) &&\n nodeIds.length > 1 &&\n representativeId === node.getId()\n );\n}\n\nexport function getRepresentativeNodes(engine: GraphEngine | null | undefined): NodeInterface[] {\n if (!engine) {\n return [];\n }\n\n return engine.getNodes().filter((node) => isChainRepresentative(node));\n}\n\nexport type ChainOutlineGetter = (node: NodeInterface) => [number, number][] | null;\n\nexport function createChainOutlineGetter(\n engine: GraphEngine | null | undefined\n): ChainOutlineGetter {\n if (!engine) {\n return () => null;\n }\n\n const cache = new Map<string, [number, number][] | null>();\n\n // eslint-disable-next-line max-statements, complexity\n return (node: NodeInterface): [number, number][] | null => {\n const chainId = node.getPropertyValue('collapsedChainId');\n if (!chainId) {\n return null;\n }\n\n const cacheKey = String(chainId);\n if (cache.has(cacheKey)) {\n return cache.get(cacheKey) ?? null;\n }\n\n const collapsedNodeIds = node.getPropertyValue('collapsedNodeIds');\n if (!Array.isArray(collapsedNodeIds) || collapsedNodeIds.length === 0) {\n cache.set(cacheKey, null);\n return null;\n }\n\n let minX = Number.POSITIVE_INFINITY;\n let maxX = Number.NEGATIVE_INFINITY;\n let minY = Number.POSITIVE_INFINITY;\n let maxY = Number.NEGATIVE_INFINITY;\n\n for (const nodeId of collapsedNodeIds) {\n const chainNode = engine.findNode(nodeId);\n if (chainNode) {\n const position = engine.getNodePosition(chainNode);\n if (position) {\n const [x, y] = position;\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n }\n }\n\n if (\n !Number.isFinite(minX) ||\n !Number.isFinite(maxX) ||\n !Number.isFinite(minY) ||\n !Number.isFinite(maxY)\n ) {\n cache.set(cacheKey, null);\n return null;\n }\n\n const paddedMinX = minX - OUTLINE_PADDING;\n const paddedMaxX = maxX + OUTLINE_PADDING;\n const paddedMinY = minY - OUTLINE_PADDING;\n const paddedMaxY = maxY + OUTLINE_PADDING;\n\n const width = paddedMaxX - paddedMinX;\n const height = paddedMaxY - paddedMinY;\n\n if (width <= 0 || height <= 0) {\n cache.set(cacheKey, null);\n return null;\n }\n\n const radius = Math.min(OUTLINE_CORNER_RADIUS, width / 2, height / 2);\n\n if (radius <= 0) {\n const polygon: [number, number][] = [\n [paddedMinX, paddedMinY],\n [paddedMinX, paddedMaxY],\n [paddedMaxX, paddedMaxY],\n [paddedMaxX, paddedMinY],\n [paddedMinX, paddedMinY]\n ];\n cache.set(cacheKey, polygon);\n return polygon;\n }\n\n const left = paddedMinX;\n const right = paddedMaxX;\n const top = paddedMinY;\n const bottom = paddedMaxY;\n\n const polygon: [number, number][] = [];\n const pushArc = (cx: number, cy: number, startAngle: number, endAngle: number) => {\n const step = (endAngle - startAngle) / OUTLINE_CORNER_SEGMENTS;\n for (let i = 1; i <= OUTLINE_CORNER_SEGMENTS; i++) {\n const angle = startAngle + step * i;\n polygon.push([cx + radius * Math.cos(angle), cy + radius * Math.sin(angle)]);\n }\n };\n\n polygon.push([right - radius, top]);\n pushArc(right - radius, top + radius, -Math.PI / 2, 0);\n polygon.push([right, bottom - radius]);\n pushArc(right - radius, bottom - radius, 0, Math.PI / 2);\n polygon.push([left + radius, bottom]);\n pushArc(left + radius, bottom - radius, Math.PI / 2, Math.PI);\n polygon.push([left, top + radius]);\n pushArc(left + radius, top + radius, Math.PI, (3 * Math.PI) / 2);\n polygon.push(polygon[0]);\n\n cache.set(cacheKey, polygon);\n return polygon;\n };\n}\n\nexport interface CollapsedChainLayerData {\n representativeNodes: NodeInterface[];\n collapsedNodes: NodeInterface[];\n collapsedOutlineNodes: NodeInterface[];\n expandedNodes: NodeInterface[];\n expandedOutlineNodes: NodeInterface[];\n getChainOutlinePolygon: ChainOutlineGetter;\n outlineUpdateTrigger: string;\n}\n\nexport function buildCollapsedChainLayers(\n engine: GraphEngine | null | undefined\n): CollapsedChainLayerData | null {\n if (!engine) {\n return null;\n }\n\n const representativeNodes = getRepresentativeNodes(engine);\n if (representativeNodes.length === 0) {\n return null;\n }\n\n const getChainOutlinePolygon = createChainOutlineGetter(engine);\n const outlineUpdateTrigger = [engine.getLayoutLastUpdate(), engine.getLayoutState()].join();\n\n const collapsedNodes = representativeNodes.filter((node) =>\n Boolean(node.getPropertyValue('isCollapsedChain'))\n );\n const collapsedOutlineNodes = collapsedNodes.filter((node) => getChainOutlinePolygon(node));\n\n const expandedNodes = representativeNodes.filter(\n (node) => !node.getPropertyValue('isCollapsedChain')\n );\n const expandedOutlineNodes = expandedNodes.filter((node) => getChainOutlinePolygon(node));\n\n return {\n representativeNodes,\n collapsedNodes,\n collapsedOutlineNodes,\n expandedNodes,\n expandedOutlineNodes,\n getChainOutlinePolygon,\n outlineUpdateTrigger\n };\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {EdgeState, NodeState} from './constants';\nimport {GraphEngine} from './graph-engine';\nimport type {EdgeInterface, NodeInterface} from '../graph/graph';\nimport {log} from '../utils/log';\nimport {\n resolveChainInteractionSource,\n type ChainInteractionSource\n} from '../utils/collapsed-chains';\n\nexport {resolveChainInteractionSource};\nexport type {ChainInteractionSource};\n\nexport function shouldToggleCollapsedChain(\n isCollapsed: boolean,\n source: ChainInteractionSource\n): boolean {\n if (isCollapsed) {\n return true;\n }\n return source === 'expanded-marker' || source === 'expanded-outline';\n}\n\nconst NODE_TO_EDGE_STATE_MAP: Record<NodeState, EdgeState> = {\n default: 'default',\n hover: 'hover',\n dragging: 'dragging',\n selected: 'selected'\n};\n\nfunction shouldEdgeBeSelected(edge: EdgeInterface): boolean {\n return edge\n .getConnectedNodes()\n .some((node) => node.getState() === 'selected' && node.shouldHighlightConnectedEdges());\n}\n\nfunction setNodeState(node: NodeInterface, state: NodeState) {\n node.setState(state);\n if (node.shouldHighlightConnectedEdges()) {\n node.getConnectedEdges().forEach((edge) => {\n let newEdgeState = NODE_TO_EDGE_STATE_MAP[state];\n if (shouldEdgeBeSelected(edge)) {\n newEdgeState = 'selected';\n }\n edge.setState(newEdgeState);\n });\n }\n}\n\ninterface EventMap {\n onClick?: (info: unknown, event: Event) => void;\n onHover?: (info: unknown) => void;\n onMouseEnter?: (info: unknown) => void;\n onMouseLeave?: (node: NodeInterface) => void;\n onDragStart?: (info: unknown) => void;\n onDrag?: (info: unknown) => void;\n onDragEnd?: (info: unknown) => void;\n}\n\nexport interface InteractionManagerProps {\n nodeEvents?: EventMap;\n edgeEvents?: EventMap;\n engine: GraphEngine;\n enableDragging: boolean;\n resumeLayoutAfterDragging: boolean;\n}\n\nexport class InteractionManager {\n public notifyCallback: Function;\n private _lastInteraction = 0;\n private _lastHoveredNode: NodeInterface | null = null;\n private _lastSelectedNode: NodeInterface | null = null;\n\n public nodeEvents: EventMap = undefined!;\n public edgeEvents: EventMap = undefined!;\n public engine: GraphEngine = undefined!;\n public enableDragging: boolean = undefined!;\n public resumeLayoutAfterDragging: boolean = undefined!;\n\n constructor(props: InteractionManagerProps, notifyCallback: Function) {\n this.updateProps(props);\n this.notifyCallback = notifyCallback;\n\n // internal state\n this._lastInteraction = 0;\n this._lastHoveredNode = null;\n this._lastSelectedNode = null;\n }\n\n updateProps({\n nodeEvents = {},\n edgeEvents = {},\n engine,\n enableDragging,\n resumeLayoutAfterDragging\n }: InteractionManagerProps): void {\n this.nodeEvents = nodeEvents;\n this.edgeEvents = edgeEvents;\n this.engine = engine;\n this.enableDragging = enableDragging;\n this.resumeLayoutAfterDragging = resumeLayoutAfterDragging;\n }\n\n getLastInteraction(): number {\n return this._lastInteraction;\n }\n\n // eslint-disable-next-line max-statements, complexity\n onClick(info, event): void {\n const {object} = info;\n\n if (!object) {\n return;\n }\n\n if (object.isNode) {\n const node = object as NodeInterface;\n const chainId = node.getPropertyValue('collapsedChainId');\n const collapsedNodeIds = node.getPropertyValue('collapsedNodeIds');\n const representativeId = node.getPropertyValue('collapsedChainRepresentativeId');\n const isCollapsed = Boolean(node.getPropertyValue('isCollapsedChain'));\n const hasChainMetadata =\n chainId !== null &&\n chainId !== undefined &&\n Array.isArray(collapsedNodeIds) &&\n collapsedNodeIds.length > 1 &&\n representativeId !== null &&\n representativeId !== undefined;\n const isRepresentative = hasChainMetadata && representativeId === node.getId();\n\n if (hasChainMetadata && isRepresentative) {\n const layout: any = this.engine?.props?.layout;\n if (layout && typeof layout.toggleCollapsedChain === 'function') {\n const interactionSource = resolveChainInteractionSource(info ?? null);\n\n // eslint-disable-next-line max-depth\n if (shouldToggleCollapsedChain(isCollapsed, interactionSource)) {\n const action = isCollapsed ? 'expand' : 'collapse';\n const chainIdStr = String(chainId);\n log.log(\n 0,\n `InteractionManager: ${action} chain ${chainIdStr} via ${interactionSource}`\n );\n // eslint-disable-next-line no-console\n console.log(\n `InteractionManager: ${action} chain ${chainIdStr} via ${interactionSource}`\n );\n layout.toggleCollapsedChain(chainIdStr);\n this._lastInteraction = Date.now();\n this.notifyCallback();\n // eslint-disable-next-line max-depth\n if (this.nodeEvents.onClick) {\n this.nodeEvents.onClick(info, event);\n }\n return;\n }\n }\n }\n\n if (node.isSelectable()) {\n if (this._lastSelectedNode) {\n setNodeState(this._lastSelectedNode, 'default');\n }\n setNodeState(node, 'selected');\n this._lastSelectedNode = node;\n this._lastInteraction = Date.now();\n this.notifyCallback();\n }\n\n if (this.nodeEvents.onClick) {\n this.nodeEvents.onClick(info, event);\n }\n }\n\n if ((object as EdgeInterface).isEdge && this.edgeEvents.onClick) {\n this.edgeEvents.onClick(info, event);\n }\n }\n\n _mouseLeaveNode(): void {\n const lastHoveredNode = this._lastHoveredNode;\n\n if (!(lastHoveredNode.isSelectable() && lastHoveredNode.getState() === 'selected')) {\n // reset the last hovered node's state\n const lastSelectedId = this._lastSelectedNode?.getId();\n const lastHoveredId = this._lastHoveredNode?.getId();\n const newState =\n lastSelectedId !== undefined && lastSelectedId === lastHoveredId ? 'selected' : 'default';\n setNodeState(lastHoveredNode, newState);\n }\n // trigger the callback if exists\n if (this.nodeEvents.onMouseLeave) {\n this.nodeEvents.onMouseLeave(lastHoveredNode);\n }\n }\n\n _mouseEnterNode(info): void {\n // set the node's state to hover\n setNodeState(info.object as NodeInterface, 'hover');\n // trigger the callback if exists\n if (this.nodeEvents.onMouseEnter) {\n this.nodeEvents.onMouseEnter(info);\n }\n if (this.nodeEvents.onHover) {\n this.nodeEvents.onHover(info);\n }\n }\n\n onHover(info, event) {\n if (!info.object) {\n if (this._lastHoveredNode) {\n this._mouseLeaveNode();\n this._lastInteraction = Date.now();\n this._lastHoveredNode = null;\n this.notifyCallback();\n }\n return;\n }\n\n // hover over on a node\n if (info.object.isNode) {\n const lastHoveredId = this._lastHoveredNode?.getId();\n const currentId = (info.object as NodeInterface).getId();\n const isSameNode = lastHoveredId !== undefined && lastHoveredId === currentId;\n // stay in the same node\n if (isSameNode) {\n return;\n }\n if (this._lastHoveredNode) {\n // reset the previous hovered node's state if not the same node\n this._mouseLeaveNode();\n }\n // enter new node\n this._mouseEnterNode(info);\n this._lastInteraction = Date.now();\n this._lastHoveredNode = info.object;\n this.notifyCallback();\n }\n if (info.object.isEdge && this.edgeEvents.onHover) {\n this.edgeEvents.onHover(info);\n }\n }\n\n onDragStart(info, event) {\n if (this.nodeEvents.onDragStart) {\n this.nodeEvents.onDragStart(info);\n }\n }\n\n onDrag(info, event) {\n if (!info.object.isNode || !this.enableDragging) {\n return;\n }\n event.stopImmediatePropagation();\n\n // info.viewport is undefined when the object is offscreen, so we use viewport from onDragStart\n const coordinates = info.layer.context.viewport.unproject([info.x, info.y]);\n\n // limit the node position to be within bounds of the viewport\n const bounds = info.layer.context.viewport.getBounds(); // [minX, minY, maxX, maxY]\n const x = Math.min(Math.max(coordinates[0], bounds[0]), bounds[2]);\n const y = Math.min(Math.max(coordinates[1], bounds[1]), bounds[3]);\n this.engine.lockNodePosition(info.object as NodeInterface, x, y);\n\n setNodeState(info.object as NodeInterface, 'dragging');\n this._lastInteraction = Date.now();\n this.notifyCallback();\n if (this.nodeEvents.onDrag) {\n this.nodeEvents.onDrag(info);\n }\n }\n\n onDragEnd(info, event) {\n if (!info.object.isNode || !this.enableDragging) {\n return;\n }\n if (this.resumeLayoutAfterDragging) {\n this.engine.resume();\n }\n setNodeState(info.object as NodeInterface, 'default');\n this.engine.unlockNodePosition(info.object as NodeInterface);\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Node} from '../graph/node';\n\nexport type RankAccessor = string | ((node: Node) => number | null | undefined);\nexport type LabelAccessor = string | ((node: Node) => string | number | null | undefined);\n\nexport type RankPosition = {\n rank: number;\n yPosition: number;\n label: string | number;\n};\n\nexport type MapRanksToYPositionsOptions = {\n rankAccessor?: RankAccessor;\n labelAccessor?: LabelAccessor;\n /** Optional target range for the computed y positions. */\n yRange?: {min?: number; max?: number};\n};\n\ntype RankAggregate = {sum: number; count: number; label: string | number | null};\n\ntype RankAggregateState = {\n aggregates: Map<number, RankAggregate>;\n range: {min: number; max: number};\n};\n\nfunction distributeEvenSpacing(positions: RankPosition[], start: number, end: number) {\n const count = positions.length;\n if (count === 0) {\n return;\n }\n\n if (count === 1) {\n positions[0].yPosition = start;\n return;\n }\n\n const step = (end - start) / (count - 1);\n for (let i = 0; i < count; i++) {\n positions[i].yPosition = start + step * i;\n }\n}\n\nfunction fallbackMonotonicSpacing(positions: RankPosition[]) {\n if (positions.length === 0) {\n return;\n }\n\n let previous = positions[0].yPosition;\n for (let i = 1; i < positions.length; i++) {\n const current = positions[i].yPosition;\n if (!(current > previous)) {\n previous += 1;\n positions[i].yPosition = previous;\n } else {\n previous = current;\n }\n }\n}\n\nfunction enforceMonotonicPositions(positions: RankPosition[], range: {min: number; max: number}) {\n if (positions.length === 0) {\n return;\n }\n\n const hasFiniteMin = Number.isFinite(range.min);\n const hasFiniteMax = Number.isFinite(range.max);\n\n if (positions.length === 1) {\n if (hasFiniteMin) {\n positions[0].yPosition = range.min;\n }\n return;\n }\n\n if (hasFiniteMin && hasFiniteMax && range.max > range.min) {\n distributeEvenSpacing(positions, range.min, range.max);\n return;\n }\n\n if (hasFiniteMin) {\n positions[0].yPosition = range.min;\n }\n\n fallbackMonotonicSpacing(positions);\n}\n\nfunction resolveTargetRange(\n range: {min: number; max: number},\n override?: {min?: number; max?: number}\n): {min: number; max: number} {\n const overrideMin =\n typeof override?.min === 'number' && Number.isFinite(override.min) ? override.min : undefined;\n const overrideMax =\n typeof override?.max === 'number' && Number.isFinite(override.max) ? override.max : undefined;\n\n const candidateMin = overrideMin ?? range.min;\n const candidateMax = overrideMax ?? range.max;\n\n const min = Number.isFinite(candidateMin) ? candidateMin : range.min;\n const max = Number.isFinite(candidateMax) ? candidateMax : range.max;\n\n return {min, max};\n}\n\nfunction accumulateRank(\n node: Node,\n getRank: (node: Node) => number | null,\n getLabel: (node: Node) => string | number | null,\n getPosition: (node: Node) => [number, number] | null | undefined,\n state: RankAggregateState\n) {\n const {aggregates, range} = state;\n const rank = getRank(node);\n if (typeof rank !== 'number' || !Number.isFinite(rank)) {\n return;\n }\n\n const position = getPosition(node);\n if (!position) {\n return;\n }\n\n const [, y] = position;\n if (typeof y !== 'number' || !Number.isFinite(y)) {\n return;\n }\n\n const entry = aggregates.get(rank) ?? {sum: 0, count: 0, label: null};\n entry.sum += y;\n entry.count += 1;\n\n if (entry.label === null) {\n const label = getLabel(node);\n if (label !== null) {\n entry.label = label;\n }\n }\n\n aggregates.set(rank, entry);\n range.min = Math.min(range.min, y);\n range.max = Math.max(range.max, y);\n}\n\nfunction normalizeRankAccessor(accessor: RankAccessor | undefined): (node: Node) => number | null {\n if (!accessor) {\n return (node: Node) => {\n const value = node.getPropertyValue('srank');\n if (typeof value === 'number' && Number.isFinite(value)) {\n return value;\n }\n if (typeof value === 'string') {\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : null;\n }\n return null;\n };\n }\n\n if (typeof accessor === 'function') {\n return (node: Node) => {\n const value = accessor(node);\n if (typeof value === 'number' && Number.isFinite(value)) {\n return value;\n }\n if (typeof value === 'string') {\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : null;\n }\n return null;\n };\n }\n\n return (node: Node) => {\n const value = node.getPropertyValue(accessor);\n if (typeof value === 'number' && Number.isFinite(value)) {\n return value;\n }\n if (typeof value === 'string') {\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : null;\n }\n return null;\n };\n}\n\nfunction normalizeLabelAccessor(\n accessor: LabelAccessor | undefined\n): (node: Node) => string | number | null {\n if (!accessor) {\n return (node: Node) => {\n const value = node.getPropertyValue('rankLabel');\n if (value === undefined || value === null || value === '') {\n return null;\n }\n if (typeof value === 'number' || typeof value === 'string') {\n return value;\n }\n return null;\n };\n }\n\n if (typeof accessor === 'function') {\n return (node: Node) => {\n const value = accessor(node);\n if (value === undefined || value === null || value === '') {\n return null;\n }\n if (typeof value === 'number' || typeof value === 'string') {\n return value;\n }\n return null;\n };\n }\n\n return (node: Node) => {\n const value = node.getPropertyValue(accessor);\n if (value === undefined || value === null || value === '') {\n return null;\n }\n if (typeof value === 'number' || typeof value === 'string') {\n return value;\n }\n return null;\n };\n}\n\n/**\n * Builds a mapping from rank identifiers to averaged y positions.\n */\nexport function mapRanksToYPositions(\n nodes: Iterable<Node>,\n getPosition: (node: Node) => [number, number] | null | undefined,\n options?: MapRanksToYPositionsOptions\n): RankPosition[] {\n const getRank = normalizeRankAccessor(options?.rankAccessor);\n const getLabel = normalizeLabelAccessor(options?.labelAccessor);\n\n const state: RankAggregateState = {\n aggregates: new Map<number, RankAggregate>(),\n range: {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY}\n };\n\n for (const node of nodes) {\n accumulateRank(node, getRank, getLabel, getPosition, state);\n }\n\n const {aggregates, range} = state;\n const positions: RankPosition[] = Array.from(aggregates.entries()).map(\n ([rank, {sum, count, label}]) => ({\n rank,\n yPosition: count ? sum / count : 0,\n label: label ?? rank\n })\n );\n\n positions.sort((a, b) => a.rank - b.rank);\n\n const needsRemap = positions.some(\n (entry, index) => index > 0 && entry.yPosition <= positions[index - 1].yPosition\n );\n if (needsRemap) {\n const targetRange = resolveTargetRange(range, options?.yRange);\n enforceMonotonicPositions(positions, targetRange);\n }\n\n return positions;\n}\n\nexport type SelectRankLinesOptions = {\n yMin: number;\n yMax: number;\n maxCount?: number;\n};\n\nfunction locateInsertionIndex(ranks: RankPosition[], target: number): number {\n let low = 0;\n let high = ranks.length - 1;\n\n while (low < high) {\n const mid = Math.floor((low + high) / 2);\n if (ranks[mid].yPosition < target) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n\n return low;\n}\n\nfunction pickNearestAvailableIndex(\n ranks: RankPosition[],\n target: number,\n startIndex: number,\n used: Set<number>\n): number {\n let bestIndex = -1;\n let bestDistance = Number.POSITIVE_INFINITY;\n\n const consider = (index: number) => {\n if (index < 0 || index >= ranks.length || used.has(index)) {\n return;\n }\n const distance = Math.abs(ranks[index].yPosition - target);\n const isCloser = distance < bestDistance;\n const isTie = distance === bestDistance && bestIndex !== -1;\n if (\n isCloser ||\n (isTie && (ranks[index].yPosition < ranks[bestIndex].yPosition || index < bestIndex))\n ) {\n bestDistance = distance;\n bestIndex = index;\n }\n };\n\n consider(startIndex);\n consider(startIndex - 1);\n\n for (\n let offset = 1;\n bestIndex === -1 && (startIndex - offset >= 0 || startIndex + offset < ranks.length);\n offset++\n ) {\n consider(startIndex - offset);\n consider(startIndex + offset);\n }\n\n return bestIndex;\n}\n\nfunction findFallbackIndex(ranks: RankPosition[], used: Set<number>): number {\n for (let i = 0; i < ranks.length; i++) {\n if (!used.has(i)) {\n return i;\n }\n }\n return -1;\n}\n\nfunction findClosestAvailableIndex(\n ranks: RankPosition[],\n target: number,\n used: Set<number>\n): number {\n if (ranks.length === 0) {\n return -1;\n }\n\n const insertionIndex = locateInsertionIndex(ranks, target);\n const nearest = pickNearestAvailableIndex(ranks, target, insertionIndex, used);\n if (nearest !== -1) {\n return nearest;\n }\n\n const fallback = findFallbackIndex(ranks, used);\n if (fallback !== -1) {\n return fallback;\n }\n\n return Math.min(Math.max(insertionIndex, 0), ranks.length - 1);\n}\n\nfunction computeTargetRatios(count: number): number[] {\n if (count <= 1) {\n return [0.5];\n }\n const step = 1 / (count - 1);\n return Array.from({length: count}, (_, index) => index * step);\n}\n\nfunction fillRemainingSelections(used: Set<number>, lastIndex: number, maxCount: number) {\n for (let i = 0; used.size < maxCount && i <= lastIndex; i++) {\n used.add(i);\n }\n}\n\nfunction chooseEvenlySpacedIndices(ranks: RankPosition[], maxCount: number): number[] {\n const lastIndex = ranks.length - 1;\n const start = ranks[0].yPosition;\n const end = ranks[lastIndex].yPosition;\n const span = end - start;\n const used = new Set<number>();\n\n for (const ratio of computeTargetRatios(maxCount)) {\n const target = span !== 0 ? start + ratio * span : start;\n const index = findClosestAvailableIndex(ranks, target, used);\n if (index !== -1) {\n used.add(index);\n }\n }\n\n fillRemainingSelections(used, lastIndex, maxCount);\n\n return Array.from(used)\n .sort((a, b) => a - b)\n .slice(0, maxCount);\n}\n\n/**\n * Selects a subset of rank positions that are evenly distributed within a range.\n */\nexport function selectRankLines(\n ranks: RankPosition[],\n {yMin, yMax, maxCount = 8}: SelectRankLinesOptions\n): RankPosition[] {\n if (!Number.isFinite(yMin) || !Number.isFinite(yMax) || maxCount <= 0) {\n return [];\n }\n\n const min = Math.min(yMin, yMax);\n const max = Math.max(yMin, yMax);\n\n const filtered = ranks\n .filter(\n (entry) =>\n Number.isFinite(entry.yPosition) && entry.yPosition >= min && entry.yPosition <= max\n )\n .sort((a, b) => a.yPosition - b.yPosition);\n\n if (filtered.length === 0) {\n return [];\n }\n\n if (filtered.length <= maxCount) {\n return filtered;\n }\n\n if (maxCount === 1) {\n const midpoint = (filtered[0].yPosition + filtered[filtered.length - 1].yPosition) / 2;\n const index = findClosestAvailableIndex(filtered, midpoint, new Set<number>());\n return index === -1 ? [filtered[0]] : [filtered[index]];\n }\n\n const selected = chooseEvenlySpacedIndices(filtered, maxCount);\n return selected.map((index) => filtered[index]);\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {NodeState, EdgeState} from '../core/constants';\nimport * as arrow from 'apache-arrow';\n\n/** Graph data types supported by this library */\nexport type GraphData = PlainGraphData | ArrowGraphData;\n\n/** Graph data stored in Apache Arrow binary columnar tables */\nexport type ArrowGraphData = {\n shape: 'arrow-graph-data';\n version: number;\n metadata?: Record<string, unknown>;\n nodes: arrow.Table;\n edges: arrow.Table;\n};\n\nexport type PlainGraphData = {\n shape: 'plain-graph-data';\n version?: number;\n metadata?: Record<string, unknown>;\n nodes?: GraphNodeData[] | null;\n edges?: GraphEdgeData[] | null;\n};\n\nexport type GraphNodeData = {\n id: string | number;\n label?: string;\n state?: NodeState;\n selectable?: boolean;\n highlightConnectedEdges?: boolean;\n weight?: number;\n attributes?: Record<string, unknown> | null | undefined;\n};\n\nexport type GraphEdgeData = {\n id: string | number;\n sourceId: string | number;\n targetId: string | number;\n label?: string;\n state?: EdgeState;\n directed?: boolean;\n weight?: number;\n attributes?: Record<string, unknown> | null | undefined;\n};\n\nexport function isArrowGraphData(value: unknown): value is ArrowGraphData {\n const candidate = value as ArrowGraphData;\n return typeof value === 'object' && candidate?.shape === 'arrow-graph-data';\n}\n\nexport function isPlainGraphData(value: unknown): value is PlainGraphData {\n const candidate = value as PlainGraphData;\n return typeof value === 'object' && candidate?.shape === 'plain-graph-data';\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Graph, GraphProps} from '../graph';\nimport {type GraphData, isArrowGraphData} from '../../graph-data/graph-data';\nimport {ArrowGraph} from '../arrow-graph';\nimport {ClassicGraph} from '../classic-graph';\n\nexport function createGraphFromData(data: GraphData, props: GraphProps = {}): Graph {\n if (isArrowGraphData(data)) {\n return new ArrowGraph({...props, data});\n }\n\n return new ClassicGraph({...props, data});\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\n\nimport type {PlainGraphData} from '../graph-data/graph-data';\n// import {PlainGraphDataBuilder} from '../graph-data/plain-graph-data-builder';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type JSONGraphLoaderOptions = LoaderOptions & {\n jsongraph?: {};\n};\n\nexport type JSONGraphParserOptions = NonNullable<JSONGraphLoaderOptions['jsongraph']>;\n\nexport const JSONGraphLoader = {\n dataType: null as unknown as PlainGraphData,\n batchType: null as never,\n\n name: 'DOT Graph',\n id: 'dot-graph',\n module: 'graph-layers',\n version: VERSION,\n worker: false,\n extensions: ['json'],\n mimeTypes: ['application/json'],\n text: true,\n options: {\n jsongraph: {}\n },\n\n parse: async (arrayBuffer: ArrayBuffer, options?: JSONGraphLoaderOptions) => {\n const text = new TextDecoder().decode(arrayBuffer);\n return Promise.resolve(JSONGraphLoader.parseTextSync(text, options));\n },\n\n parseTextSync: (text: string, options?: JSONGraphLoaderOptions) => {\n // const parseOptions = {...JSONGraphLoader.options.jsongraph, ...options?.jsongraph};\n throw new Error('JSONGraphLoader.parseTextSync not implemented');\n // return loadSimpleJSONGraph(text, parseOptions);\n }\n} as const satisfies LoaderWithParser<PlainGraphData, never, JSONGraphLoaderOptions>;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {ArrowGraphData} from '../graph-data/graph-data';\nimport {ArrowGraphDataBuilder} from '../graph-data/arrow-graph-data-builder';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\ntype DOTAttributeMap = Record<string, unknown>;\n\ntype ParsedNode = {\n id: string;\n attributes: DOTAttributeMap;\n subgraphs: Set<string>;\n};\n\ntype ParsedEdge = {\n id: string;\n sourceId: string;\n targetId: string;\n directed: boolean;\n attributes: DOTAttributeMap;\n subgraphs: string[];\n};\n\ntype ParsedSubgraph = {\n id: string;\n attributes: DOTAttributeMap;\n parentId?: string | null;\n};\n\ntype DOTParseResult = {\n id?: string;\n directed: boolean;\n strict: boolean;\n graphAttributes: DOTAttributeMap;\n nodes: Map<string, ParsedNode>;\n edges: ParsedEdge[];\n subgraphs: Map<string, ParsedSubgraph>;\n};\n\nexport type DOTGraphLoaderMetadata = {\n id?: string;\n directed: boolean;\n strict: boolean;\n attributes: DOTAttributeMap;\n subgraphs: ParsedSubgraph[];\n};\n\n// Loader definition\n\nexport type DOTGraphLoaderOptions = LoaderOptions & {\n dot?: {\n version?: number;\n };\n};\n\nexport type DOTGraphParserOptions = NonNullable<DOTGraphLoaderOptions['dot']>;\n\nexport const DOTGraphLoader = {\n dataType: null as unknown as ArrowGraphData,\n batchType: null as never,\n\n name: 'DOT Graph',\n id: 'dot-graph',\n module: 'graph-layers',\n version: VERSION,\n worker: false,\n extensions: ['dot'],\n mimeTypes: ['text/vnd.graphviz', 'text/x-graphviz', 'application/vnd.graphviz'],\n text: true,\n options: {\n dot: {\n version: 0\n }\n },\n parse: (arrayBuffer: ArrayBuffer, options?: DOTGraphLoaderOptions) => {\n const text = new TextDecoder().decode(arrayBuffer);\n return Promise.resolve(DOTGraphLoader.parseTextSync(text, options));\n },\n parseTextSync: (text: string, options?: DOTGraphLoaderOptions) => {\n const parseOptions = {...DOTGraphLoader.options.dot, ...options?.dot};\n return loadDOTGraph(text, parseOptions);\n }\n} as const satisfies LoaderWithParser<ArrowGraphData, never, DOTGraphLoaderOptions>;\n\nexport function loadDOTGraph(dot: string, options: DOTGraphParserOptions = {}): ArrowGraphData {\n const parsed = parseDOT(dot);\n return buildArrowGraphData(parsed, options);\n}\n\nexport function parseDOTToArrowGraphData(\n dot: string,\n options: DOTGraphParserOptions = {}\n): ArrowGraphData {\n const parsed = parseDOT(dot);\n return buildArrowGraphData(parsed, options);\n}\n\nfunction buildArrowGraphData(\n parsed: DOTParseResult,\n options: DOTGraphParserOptions\n): ArrowGraphData {\n const builder = new ArrowGraphDataBuilder({version: options.version});\n\n const subgraphDescriptors = new Map<string, ParsedSubgraph>();\n for (const [id, subgraph] of parsed.subgraphs.entries()) {\n subgraphDescriptors.set(id, {\n id,\n attributes: {...subgraph.attributes},\n parentId: subgraph.parentId\n });\n }\n\n for (const node of parsed.nodes.values()) {\n const attributes: DOTAttributeMap = {...node.attributes};\n if (node.subgraphs.size > 0) {\n attributes.subgraphs = Array.from(node.subgraphs, (id) =>\n describeSubgraph(id, subgraphDescriptors)\n );\n }\n builder.addNode({\n id: node.id,\n attributes\n });\n }\n\n parsed.edges.forEach((edge) => {\n const attributes: DOTAttributeMap = {...edge.attributes};\n if (edge.subgraphs.length > 0) {\n attributes.subgraphs = edge.subgraphs.map((id) => describeSubgraph(id, subgraphDescriptors));\n }\n builder.addEdge({\n id: edge.id,\n sourceId: edge.sourceId,\n targetId: edge.targetId,\n directed: edge.directed,\n attributes\n });\n });\n\n const metadata: DOTGraphLoaderMetadata = {\n id: parsed.id,\n directed: parsed.directed,\n strict: parsed.strict,\n attributes: {...parsed.graphAttributes},\n subgraphs: Array.from(parsed.subgraphs.values(), (subgraph) => ({\n id: subgraph.id,\n attributes: {...subgraph.attributes},\n parentId: subgraph.parentId\n }))\n };\n\n const data = builder.finish();\n data.metadata = metadata;\n return data;\n}\n\nfunction describeSubgraph(\n id: string,\n descriptors: Map<string, ParsedSubgraph>\n): {id: string; attributes: DOTAttributeMap; parentId?: string | null} {\n const subgraph = descriptors.get(id);\n if (!subgraph) {\n return {id, attributes: {}};\n }\n return {\n id,\n attributes: {...subgraph.attributes},\n parentId: subgraph.parentId\n };\n}\n\ntype TokenType =\n | 'identifier'\n | 'string'\n | 'html'\n | 'arrow'\n | 'lbrace'\n | 'rbrace'\n | 'lbrack'\n | 'rbrack'\n | 'equals'\n | 'comma'\n | 'semicolon';\n\ntype Token = {\n type: TokenType;\n value: string;\n};\n\ntype ScopeContext = {\n id?: string;\n nodeDefaults: DOTAttributeMap;\n edgeDefaults: DOTAttributeMap;\n graphAttributes: DOTAttributeMap;\n};\n\nclass DOTParser {\n private readonly tokens: Token[];\n private position = 0;\n private readonly result: DOTParseResult = {\n directed: false,\n strict: false,\n graphAttributes: {},\n nodes: new Map(),\n edges: [],\n subgraphs: new Map()\n };\n\n private readonly scopes: ScopeContext[] = [\n {nodeDefaults: {}, edgeDefaults: {}, graphAttributes: {}}\n ];\n\n private subgraphCounter = 0;\n private edgeCounter = 0;\n\n constructor(tokens: Token[]) {\n this.tokens = tokens;\n }\n\n parse(): DOTParseResult {\n this.parseGraph();\n return this.result;\n }\n\n private parseGraph(): void {\n const strictToken = this.peek();\n if (strictToken && isKeyword(strictToken, 'strict')) {\n this.consume();\n this.result.strict = true;\n }\n\n const typeToken = this.peek();\n if (!typeToken || !isGraphType(typeToken)) {\n throw new Error('DOT graph must start with graph or digraph keyword.');\n }\n this.consume();\n this.result.directed = isKeyword(typeToken, 'digraph');\n\n const idToken = this.peek();\n if (idToken && isIdentifierLike(idToken)) {\n if (!isStructuralToken(idToken)) {\n this.result.id = parseIdentifierValue(this.consume());\n }\n }\n\n this.expect('lbrace');\n while (!this.match('rbrace')) {\n if (!this.parseStatement()) {\n break;\n }\n }\n this.result.graphAttributes = {...this.scopes[0].graphAttributes};\n }\n\n private parseStatement(): boolean {\n if (this.consumeSemicolonIfPresent()) {\n return true;\n }\n\n const token = this.peek();\n if (!token) {\n return false;\n }\n\n if (this.tryParseSubgraphStatement(token)) {\n return true;\n }\n\n if (this.tryParseKeywordStatement(token)) {\n return true;\n }\n\n if (this.tryParseAssignmentStatement(token)) {\n return true;\n }\n\n if (isIdentifierLike(token)) {\n this.parseNodeOrEdgeStatement();\n this.consumeOptionalSemicolon();\n return true;\n }\n\n throw new Error(`Unexpected token: ${token.value}`);\n }\n\n private consumeSemicolonIfPresent(): boolean {\n const next = this.peek();\n if (next?.type === 'semicolon') {\n this.consume();\n return true;\n }\n return false;\n }\n\n private tryParseSubgraphStatement(token: Token): boolean {\n if (token.type !== 'lbrace' && !isKeyword(token, 'subgraph')) {\n return false;\n }\n this.parseSubgraph();\n return true;\n }\n\n private tryParseKeywordStatement(token: Token): boolean {\n if (!(isKeyword(token, 'graph') || isKeyword(token, 'node') || isKeyword(token, 'edge'))) {\n return false;\n }\n\n this.consume();\n const attrs = this.parseAttributeList();\n\n if (isKeyword(token, 'graph')) {\n Object.assign(this.currentScope().graphAttributes, attrs);\n } else if (isKeyword(token, 'node')) {\n Object.assign(this.currentScope().nodeDefaults, attrs);\n } else {\n Object.assign(this.currentScope().edgeDefaults, attrs);\n }\n\n this.consumeOptionalSemicolon();\n return true;\n }\n\n private tryParseAssignmentStatement(token: Token): boolean {\n if (!isIdentifierLike(token)) {\n return false;\n }\n const next = this.peek(1);\n if (next?.type !== 'equals') {\n return false;\n }\n\n const key = parseIdentifierValue(this.consume());\n this.consume();\n const valueToken = this.consume();\n const value = parseAttributeValue(valueToken);\n this.currentScope().graphAttributes[key] = value;\n this.consumeOptionalSemicolon();\n return true;\n }\n\n private parseNodeOrEdgeStatement(): void {\n const first = parseIdentifierValue(this.consume());\n const references: string[] = [first];\n const operators: string[] = [];\n\n let operatorToken = this.match('arrow');\n while (operatorToken) {\n operators.push(operatorToken.value);\n const referenceToken = this.consume();\n if (!isIdentifierLike(referenceToken)) {\n throw new Error('Expected node identifier in edge statement.');\n }\n references.push(parseIdentifierValue(referenceToken));\n operatorToken = this.match('arrow');\n }\n\n if (operators.length === 0) {\n const attrs = this.parseAttributeList();\n this.addNode(first, attrs);\n return;\n }\n\n const attrs = this.parseAttributeList();\n this.addEdgeChain(references, operators, attrs);\n }\n\n private addNode(id: string, attrs: DOTAttributeMap): void {\n const membership = this.getCurrentSubgraphChain();\n const node = this.ensureNode(id, membership);\n node.attributes = {...node.attributes, ...attrs};\n }\n\n private addEdgeChain(nodes: string[], operators: string[], attrs: DOTAttributeMap): void {\n const membership = this.getCurrentSubgraphChain();\n const defaults = this.currentScope().edgeDefaults;\n const attributes = {...defaults, ...attrs};\n\n for (let index = 0; index < nodes.length - 1; index++) {\n const sourceId = nodes[index];\n const targetId = nodes[index + 1];\n const operator = operators[index];\n const directed = operator === '->';\n\n const edgeId = deriveEdgeId(attributes, sourceId, targetId, ++this.edgeCounter);\n const edgeAttributes = {...attributes};\n this.ensureNode(sourceId, membership);\n this.ensureNode(targetId, membership);\n\n const directedOverride = deriveDirectedFlag(edgeAttributes, directed);\n this.result.edges.push({\n id: edgeId,\n sourceId,\n targetId,\n directed: directedOverride,\n attributes: edgeAttributes,\n subgraphs: membership\n });\n }\n }\n\n private parseSubgraph(): void {\n let idToken = this.peek();\n let subgraphId: string;\n\n if (idToken && isKeyword(idToken, 'subgraph')) {\n this.consume();\n idToken = this.peek();\n }\n\n if (idToken && isIdentifierLike(idToken) && idToken.type !== 'lbrace') {\n subgraphId = parseIdentifierValue(this.consume());\n } else {\n subgraphId = `subgraph_${++this.subgraphCounter}`;\n }\n\n this.expect('lbrace');\n const parentId = this.findCurrentSubgraphId();\n const context: ScopeContext = {\n id: subgraphId,\n nodeDefaults: {...this.currentScope().nodeDefaults},\n edgeDefaults: {...this.currentScope().edgeDefaults},\n graphAttributes: {}\n };\n this.scopes.push(context);\n this.result.subgraphs.set(subgraphId, {\n id: subgraphId,\n attributes: context.graphAttributes,\n parentId\n });\n\n let shouldContinue = true;\n while (shouldContinue) {\n if (this.match('rbrace')) {\n break;\n }\n shouldContinue = this.parseStatement();\n }\n\n this.scopes.pop();\n }\n\n private parseAttributeList(): DOTAttributeMap {\n const attributes: DOTAttributeMap = {};\n while (this.match('lbrack')) {\n while (!this.match('rbrack')) {\n const keyToken = this.consume();\n if (!isIdentifierLike(keyToken)) {\n throw new Error('Expected attribute name.');\n }\n const key = parseIdentifierValue(keyToken);\n let value: unknown = true;\n if (this.match('equals')) {\n const valueToken = this.consume();\n value = parseAttributeValue(valueToken);\n }\n attributes[key] = value;\n if (this.peek()?.type === 'comma' || this.peek()?.type === 'semicolon') {\n this.consume();\n }\n }\n }\n return attributes;\n }\n\n private ensureNode(id: string, membership: string[]): ParsedNode {\n let node = this.result.nodes.get(id);\n if (!node) {\n const defaults = this.currentScope().nodeDefaults;\n node = {id, attributes: {...defaults}, subgraphs: new Set()};\n this.result.nodes.set(id, node);\n }\n if (node) {\n membership.forEach((subgraphId) => node.subgraphs.add(subgraphId));\n }\n return node;\n }\n\n private getCurrentSubgraphChain(): string[] {\n const chain: string[] = [];\n for (const scope of this.scopes) {\n if (scope.id) {\n chain.push(scope.id);\n }\n }\n return chain;\n }\n\n private findCurrentSubgraphId(): string | undefined {\n for (let index = this.scopes.length - 1; index >= 0; index--) {\n const scope = this.scopes[index];\n if (scope.id) {\n return scope.id;\n }\n }\n return undefined;\n }\n\n private currentScope(): ScopeContext {\n return this.scopes[this.scopes.length - 1];\n }\n\n private consumeOptionalSemicolon(): void {\n const next = this.peek();\n if (next?.type === 'semicolon') {\n this.consume();\n }\n }\n\n private expect(type: TokenType): Token {\n const token = this.consume();\n if (!token || token.type !== type) {\n throw new Error(`Expected token ${type}.`);\n }\n return token;\n }\n\n private consume(): Token {\n const token = this.tokens[this.position];\n if (!token) {\n throw new Error('Unexpected end of DOT input.');\n }\n this.position++;\n return token;\n }\n\n private match(type: TokenType): Token | null {\n const token = this.peek();\n if (token && token.type === type) {\n this.position++;\n return token;\n }\n return null;\n }\n\n private peek(offset = 0): Token | null {\n return this.tokens[this.position + offset] ?? null;\n }\n}\n\nfunction parseDOT(input: string): DOTParseResult {\n const parser = new DOTParser(tokenize(input));\n return parser.parse();\n}\n\nconst IDENTIFIER_TERMINATORS = new Set(['{', '}', '[', ']', '=', ';', ',', '\"', '<', '#']);\n\nfunction tokenize(input: string): Token[] {\n const tokens: Token[] = [];\n let index = 0;\n\n while (index < input.length) {\n const {token, nextIndex} = readNextToken(input, index);\n if (nextIndex <= index) {\n throw new Error(`Tokenizer did not advance at position ${index}.`);\n }\n if (token) {\n tokens.push(token);\n }\n index = nextIndex;\n }\n\n return tokens;\n}\n\nfunction readNextToken(input: string, index: number): {token: Token | null; nextIndex: number} {\n if (index >= input.length) {\n return {token: null, nextIndex: input.length};\n }\n\n const char = input[index];\n\n if (isWhitespace(char)) {\n return {token: null, nextIndex: index + 1};\n }\n\n const commentEnd = skipComment(input, index);\n if (commentEnd !== null) {\n return {token: null, nextIndex: commentEnd};\n }\n\n const arrowToken = readArrowToken(input, index);\n if (arrowToken) {\n return arrowToken;\n }\n\n const punctuation = readPunctuationToken(char);\n if (punctuation) {\n return {token: punctuation, nextIndex: index + 1};\n }\n\n if (char === '\"') {\n const {value, nextIndex} = readQuotedString(input, index + 1);\n return {token: {type: 'string', value}, nextIndex};\n }\n\n if (char === '<') {\n const {value, nextIndex} = readHtmlString(input, index + 1);\n return {token: {type: 'html', value}, nextIndex};\n }\n\n const identifier = readIdentifier(input, index);\n if (identifier.value) {\n return {\n token: {type: 'identifier', value: identifier.value},\n nextIndex: identifier.nextIndex\n };\n }\n\n throw new Error(`Unexpected token at position ${index}.`);\n}\n\nfunction skipComment(input: string, index: number): number | null {\n const char = input[index];\n if (char === '/') {\n const next = input[index + 1];\n if (next === '/') {\n return skipLineComment(input, index + 2);\n }\n if (next === '*') {\n return skipBlockComment(input, index + 2);\n }\n return null;\n }\n\n if (char === '#') {\n return skipLineComment(input, index + 1);\n }\n\n return null;\n}\n\nfunction skipLineComment(input: string, startIndex: number): number {\n let cursor = startIndex;\n while (cursor < input.length && !isLineBreak(input[cursor])) {\n cursor++;\n }\n return cursor;\n}\n\nfunction skipBlockComment(input: string, startIndex: number): number {\n let cursor = startIndex;\n while (cursor < input.length) {\n if (input[cursor] === '*' && input[cursor + 1] === '/') {\n return cursor + 2;\n }\n cursor++;\n }\n throw new Error('Unterminated block comment in DOT source.');\n}\n\nfunction readArrowToken(input: string, index: number): {token: Token; nextIndex: number} | null {\n const next = input[index + 1];\n if (input[index] === '-' && next === '-') {\n return {token: {type: 'arrow', value: '--'}, nextIndex: index + 2};\n }\n if (input[index] === '-' && next === '>') {\n return {token: {type: 'arrow', value: '->'}, nextIndex: index + 2};\n }\n return null;\n}\n\nfunction readPunctuationToken(char: string): Token | null {\n switch (char) {\n case '{':\n return {type: 'lbrace', value: char};\n case '}':\n return {type: 'rbrace', value: char};\n case '[':\n return {type: 'lbrack', value: char};\n case ']':\n return {type: 'rbrack', value: char};\n case '=':\n return {type: 'equals', value: char};\n case ',':\n return {type: 'comma', value: char};\n case ';':\n return {type: 'semicolon', value: char};\n default:\n return null;\n }\n}\n\nfunction readQuotedString(input: string, startIndex: number): {value: string; nextIndex: number} {\n let value = '';\n let index = startIndex;\n while (index < input.length) {\n const char = input[index];\n if (char === '\"') {\n return {value, nextIndex: index + 1};\n }\n if (char === '\\\\') {\n const escape = readEscapedCharacter(input, index + 1);\n value += escape.value;\n index = escape.nextIndex;\n } else {\n value += char;\n index++;\n }\n }\n throw new Error('Unterminated string literal in DOT source.');\n}\n\nfunction readEscapedCharacter(\n input: string,\n startIndex: number\n): {value: string; nextIndex: number} {\n const next = input[startIndex];\n switch (next) {\n case 'n':\n case 'l':\n case 'L':\n return {value: '\\n', nextIndex: startIndex + 1};\n case 't':\n return {value: '\\t', nextIndex: startIndex + 1};\n case 'r':\n return {value: '\\r', nextIndex: startIndex + 1};\n case '\"':\n return {value: '\"', nextIndex: startIndex + 1};\n case '\\\\':\n return {value: '\\\\', nextIndex: startIndex + 1};\n default: {\n if (typeof next === 'undefined') {\n throw new Error('Unterminated escape sequence in DOT source.');\n }\n return {value: next, nextIndex: startIndex + 1};\n }\n }\n}\n\nfunction readHtmlString(input: string, startIndex: number): {value: string; nextIndex: number} {\n let value = '<';\n let depth = 1;\n let index = startIndex;\n while (index < input.length) {\n const char = input[index];\n value += char;\n if (char === '<') {\n depth++;\n } else if (char === '>') {\n depth--;\n if (depth === 0) {\n return {value, nextIndex: index + 1};\n }\n }\n index++;\n }\n throw new Error('Unterminated HTML-like string literal in DOT source.');\n}\n\nfunction readIdentifier(input: string, startIndex: number): {value: string; nextIndex: number} {\n let index = startIndex;\n let value = '';\n while (index < input.length && !isIdentifierTerminator(input, index)) {\n value += input[index];\n index++;\n }\n return {value, nextIndex: index};\n}\n\nfunction isIdentifierTerminator(input: string, index: number): boolean {\n const char = input[index];\n if (isWhitespace(char) || IDENTIFIER_TERMINATORS.has(char)) {\n return true;\n }\n if (isArrowOperatorStart(input, index)) {\n return true;\n }\n if (isCommentStart(input, index)) {\n return true;\n }\n return false;\n}\n\nfunction isArrowOperatorStart(input: string, index: number): boolean {\n if (input[index] !== '-') {\n return false;\n }\n const next = input[index + 1];\n return next === '-' || next === '>';\n}\n\nfunction isCommentStart(input: string, index: number): boolean {\n if (input[index] !== '/') {\n return false;\n }\n const next = input[index + 1];\n return next === '/' || next === '*';\n}\n\nfunction isWhitespace(char: string): boolean {\n return char === ' ' || char === '\\n' || char === '\\r' || char === '\\t' || char === '\\f';\n}\n\nfunction isLineBreak(char: string): boolean {\n return char === '\\n' || char === '\\r';\n}\n\nfunction isKeyword(token: Token, keyword: string): boolean {\n return token.type === 'identifier' && token.value.toLowerCase() === keyword.toLowerCase();\n}\n\nfunction isGraphType(token: Token): boolean {\n return isKeyword(token, 'graph') || isKeyword(token, 'digraph');\n}\n\nfunction isIdentifierLike(token: Token): boolean {\n return token.type === 'identifier' || token.type === 'string' || token.type === 'html';\n}\n\nfunction isStructuralToken(token: Token): boolean {\n return (\n token.type === 'lbrace' ||\n token.type === 'rbrace' ||\n token.type === 'lbrack' ||\n token.type === 'rbrack'\n );\n}\n\nfunction parseIdentifierValue(token: Token): string {\n return token.value;\n}\n\nfunction parseAttributeValue(token: Token): unknown {\n if (token.type === 'string' || token.type === 'html') {\n return token.value;\n }\n if (token.type === 'identifier') {\n const numeric = Number(token.value);\n if (!Number.isNaN(numeric)) {\n return numeric;\n }\n return token.value;\n }\n throw new Error('Invalid attribute value in DOT input.');\n}\n\nfunction deriveEdgeId(\n attributes: DOTAttributeMap,\n sourceId: string,\n targetId: string,\n counter: number\n): string {\n const candidate = attributes.id ?? attributes.Id ?? attributes.ID;\n if (typeof candidate === 'string' || typeof candidate === 'number') {\n return String(candidate);\n }\n return `${String(sourceId)}-${String(targetId)}-${counter}`;\n}\n\nfunction deriveDirectedFlag(attributes: DOTAttributeMap, defaultDirected: boolean): boolean {\n const candidate = attributes.directed;\n if (typeof candidate === 'boolean') {\n return candidate;\n }\n\n const dirAttr = attributes.dir;\n if (typeof dirAttr === 'string') {\n const normalized = dirAttr.toLowerCase();\n if (normalized === 'none') {\n return false;\n }\n return true;\n }\n\n return defaultDirected;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {\n EdgeDecoratorType,\n EdgeState,\n EdgeType,\n LayoutState,\n NodeState,\n NodeType\n} from '../core/constants';\nimport {Marker} from '../layers/common-layers/marker-layer/marker-list';\n\n/** Markers supported by graph-layers @deprecated v9.2: Use string literals */\nexport const MARKER_TYPE = {\n 'bell-filled': 'bell-filled',\n bell: 'bell',\n 'bookmark-filled': 'bookmark-filled',\n bookmark: 'bookmark',\n 'cd-filled': 'cd-filled',\n cd: 'cd',\n checkmark: 'checkmark',\n 'circle-check-filled': 'circle-check-filled',\n 'circle-check': 'circle-check',\n 'circle-filled': 'circle-filled',\n 'circle-i-filled': 'circle-i-filled',\n 'circle-i': 'circle-i',\n 'circle-minus-filled': 'circle-minus-filled',\n 'circle-minus': 'circle-minus',\n 'circle-plus-filled': 'circle-plus-filled',\n 'circle-plus': 'circle-plus',\n 'circle-questionmark-filled': 'circle-questionmark-filled',\n 'circle-questionmark': 'circle-questionmark',\n 'circle-slash-filled': 'circle-slash-filled',\n 'circle-slash': 'circle-slash',\n 'circle-x-filled': 'circle-x-filled',\n 'circle-x': 'circle-x',\n circle: 'circle',\n 'diamond-filled': 'diamond-filled',\n diamond: 'diamond',\n 'flag-filled': 'flag-filled',\n flag: 'flag',\n gear: 'gear',\n 'heart-filled': 'heart-filled',\n heart: 'heart',\n 'location-marker-filled': 'location-marker-filled',\n 'location-marker': 'location-marker',\n 'octagonal-star-filled': 'octagonal-star-filled',\n 'octagonal-star': 'octagonal-star',\n 'person-filled': 'person-filled',\n person: 'person',\n 'pin-filled': 'pin-filled',\n pin: 'pin',\n 'plus-small': 'plus-small',\n plus: 'plus',\n 'rectangle-filled': 'rectangle-filled',\n rectangle: 'rectangle',\n 'star-filled': 'star-filled',\n star: 'star',\n 'tag-filled': 'tag-filled',\n tag: 'tag',\n 'thumb-down-filled': 'thumb-down-filled',\n 'thumb-down': 'thumb-down',\n 'thumb-up': 'thumb-up',\n 'thumb_up-filled': 'thumb_up-filled',\n 'triangle-down-filled': 'triangle-down-filled',\n 'triangle-down': 'triangle-down',\n 'triangle-left-filled': 'triangle-left-filled',\n 'triangle-left': 'triangle-left',\n 'triangle-right-filled': 'triangle-right-filled',\n 'triangle-right': 'triangle-right',\n 'triangle-up-filled': 'triangle-up-filled',\n 'triangle-up': 'triangle-up',\n 'x-small': 'x-small',\n x: 'x'\n} as const satisfies Record<Marker, Marker>;\n/* eslint-enable */\n\n/** The interaction state of a node. @deprecated v9.2: Use string literals */\nexport const NODE_STATE = {\n DEFAULT: 'default',\n HOVER: 'hover',\n DRAGGING: 'dragging',\n SELECTED: 'selected'\n} as const satisfies Record<string, NodeState>;\n\n/** The interaction state of an edge. @deprecated v9.2: Use string literals */\nexport const EDGE_STATE = {\n DEFAULT: 'default',\n HOVER: 'hover',\n DRAGGING: 'dragging',\n SELECTED: 'selected'\n} as const satisfies Record<string, EdgeState>;\n\n/** The visual type of a node. @deprecated v9.2: Use string literals */\nexport const NODE_TYPE = {\n CIRCLE: 'circle',\n RECTANGLE: 'rectangle',\n ROUNDED_RECTANGLE: 'rounded-rectangle',\n PATH_ROUNDED_RECTANGLE: 'path-rounded-rectangle',\n ICON: 'icon',\n LABEL: 'label',\n MARKER: 'marker'\n} as const satisfies Record<string, NodeType>;\n\n/** The visual type of an edge. @deprecated v9.2: Use string literals */\nexport const EDGE_TYPE = {\n SPLINE_CURVE: 'spline',\n LINE: 'line',\n PATH: 'path'\n} as const satisfies Record<string, EdgeType>;\n\n/** Decorators on an edge. @deprecated v9.2: Use string literals */\nexport const EDGE_DECORATOR_TYPE = {\n LABEL: 'label',\n FLOW: 'flow',\n ARROW: 'arrow'\n} as const satisfies Record<string, EdgeDecoratorType>;\n\n/** the status of the layout. @deprecated v9.2: Use string literals */\nexport const LAYOUT_STATE = {\n INIT: 'init',\n START: 'start',\n CALCULATING: 'calculating',\n DONE: 'done',\n ERROR: 'error'\n} as const satisfies Record<string, LayoutState>;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACKA,YAAuB;;;ACCvB,IAAM,cAAsC,oBAAI,IAAI,CAAC,WAAW,SAAS,YAAY,UAAU,CAAC;AAChG,IAAM,cAAsC,oBAAI,IAAI,CAAC,WAAW,SAAS,YAAY,UAAU,CAAC;AAE1F,SAAU,mBAAmB,OAA4B;AAC7D,MAAI,SAAS,YAAY,IAAI,KAAK,GAAG;AACnC,WAAO;EACT;AACA,SAAO;AACT;AAEM,SAAU,mBAAmB,OAA4B;AA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EACxB,SAAS;EACT,OAAO;EACP,UAAU;EACV,UAAU;;AAIL,IAAM,aAAa;EACxB,SAAS;EACT,OAAO;EACP,UAAU;EACV,UAAU;;AAIL,IAAM,YAAY;EACvB,QAAQ;EACR,WAAW;EACX,mBAAmB;EACnB,wBAAwB;EACxB,MAAM;EACN,OAAO;EACP,QAAQ;;AAIH,IAAM,YAAY;EACvB,cAAc;EACd,MAAM;EACN,MAAM;;AAID,IAAM,sBAAsB;EACjC,OAAO;EACP,MAAM;EACN,OAAO;;AAIF,IAAM,eAAe;EAC1B,MAAM;EACN,OAAO;EACP,aAAa;EACb,MAAM;EACN,OAAO;;",
|
|
4
|
+
"sourcesContent": ["// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// Graph Data - output from loaders, input to writers\n\nexport type {\n GraphData,\n PlainGraphData,\n ArrowGraphData /* , GraphNodeData, GraphEdgeData */\n} from './graph-data/graph-data';\nexport type {\n GraphDataBuilder /* , GraphDataBuilderOptions */\n} from './graph-data/graph-data-builder';\nexport {\n ArrowGraphDataBuilder,\n type ArrowGraphDataBuilderOptions\n} from './graph-data/arrow-graph-data-builder';\n\n// core - Graph representation and layout\nexport type {Graph, NodeInterface, EdgeInterface} from './graph/graph';\nexport {Node} from './graph/node';\nexport {Edge} from './graph/edge';\n\nexport {ClassicGraph} from './graph/classic-graph';\nexport {ArrowGraph} from './graph/arrow-graph';\n// export {\n// TabularGraph,\n// TabularNode,\n// TabularEdge,\n// type NodeIndex,\n// type EdgeIndex,\n// type TabularGraphSource,\n// type TabularGraphAccessors,\n// type TabularNodeAccessors,\n// type TabularEdgeAccessors\n// } from './graph/tabular-graph';\n\n// Graph Engine\n\nexport {GraphEngine} from './core/graph-engine';\n\n// graph-layers layouts\nexport type {GraphLayoutProps, GraphLayoutState, GraphLayoutEventDetail} from './core/graph-layout';\nexport {GraphLayout} from './core/graph-layout';\n\nexport {SimpleLayout} from './layouts/simple-layout';\nexport {D3ForceLayout} from './layouts/d3-force/d3-force-layout';\nexport {D3DagLayout} from './layouts/d3-dag/d3-dag-layout';\nexport {CollapsableD3DagLayout} from './layouts/d3-dag/collapsable-d3-dag-layout';\nexport {GPUForceLayout} from './layouts/gpu-force/gpu-force-layout';\nexport {RadialLayout} from './layouts/experimental/radial-layout';\nexport {ForceMultiGraphLayout} from './layouts/experimental/force-multi-graph-layout';\nexport {HivePlotLayout} from './layouts/experimental/hive-plot-layout';\n\nexport type {\n Marker,\n NodeState,\n EdgeState,\n NodeType,\n EdgeType,\n EdgeDecoratorType,\n LayoutState\n} from './core/constants';\n\n// deck.gl components\nexport {GraphLayer} from './layers/graph-layer';\nexport type {GraphLayerProps, RankGridConfig} from './layers/graph-layer';\nexport {EdgeLayer} from './layers/edge-layer';\nexport {\n GridLayer,\n type GridLayerProps,\n type GridLineDatum\n} from './layers/common-layers/grid-layer/grid-layer';\nexport {StylesheetEngine} from './style/stylesheet-engine';\nexport {GraphStylesheetEngine, GraphStyleEngine} from './style/graph-style-engine';\nexport type {\n GraphStylesheet,\n GraphStyleRule,\n GraphStyleRuleParsed,\n GraphStylesheetParsed,\n GraphStyleAttributeReference,\n GraphStyleScale,\n GraphStyleScaleType,\n GraphStyleValue\n} from './style/graph-style-engine';\nexport {GraphStylesheetSchema} from './style/graph-style-engine';\nexport {\n DEFAULT_GRAPH_LAYER_STYLESHEET,\n type GraphLayerStylesheet,\n type GraphLayerEdgeStyle,\n type GraphLayerNodeStyle\n} from './style/graph-layer-stylesheet';\n\n// utils\nexport {mixedGetPosition} from './utils/layer-utils';\nexport {log} from './utils/log';\nexport {\n mapRanksToYPositions,\n selectRankLines,\n type RankAccessor,\n type LabelAccessor,\n type RankPosition,\n type MapRanksToYPositionsOptions,\n type SelectRankLinesOptions\n} from './utils/rank-grid';\n\n// graph format loaders\nexport {JSONGraphLoader, type JSONGraphLoaderOptions} from './loaders/json-graph-loader';\n\nexport {\n DOTGraphLoader,\n type DOTGraphLoaderOptions,\n type DOTGraphLoaderMetadata\n} from './loaders/dot-graph-loader';\n\n// Deprecated exports\nexport {\n MARKER_TYPE,\n NODE_STATE,\n EDGE_STATE,\n NODE_TYPE,\n EDGE_TYPE,\n EDGE_DECORATOR_TYPE,\n LAYOUT_STATE\n} from './_deprecated/old-constants';\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// eslint-disable-next-line import/no-unresolved\nimport * as arrow from 'apache-arrow';\n\nimport type {EdgeState, NodeState} from '../core/constants';\nimport type {GraphEdgeData, GraphNodeData, ArrowGraphData} from './graph-data';\nimport {\n cloneRecord,\n normalizeEdgeState,\n normalizeNodeState,\n normalizeVersion\n} from '../graph/graph-normalization';\n\ntype Builder = ReturnType<typeof arrow.makeBuilder>;\ntype ArrowVector = ReturnType<Builder['toVector']>;\ntype ColumnArray = ReturnType<ArrowVector['toArray']>;\ntype ColumnBuilderMap = Map<string, Builder>;\n\nexport type ArrowGraphDataBuilderOptions = {\n version?: number;\n};\n\nexport class ArrowGraphDataBuilder {\n private readonly nodeBuilders: ColumnBuilderMap = new Map();\n private readonly edgeBuilders: ColumnBuilderMap = new Map();\n\n private nodeLength = 0;\n private edgeLength = 0;\n\n private _version: number;\n\n constructor(options: ArrowGraphDataBuilderOptions = {}) {\n this._version = normalizeVersion(options.version);\n }\n\n get version(): number {\n return this._version;\n }\n\n setVersion(version: unknown): void {\n this._version = normalizeVersion(version);\n }\n\n addNode(node: GraphNodeData): number {\n if (typeof node?.id === 'undefined') {\n throw new Error('Graph node requires an \"id\" field.');\n }\n\n const index = this.nodeLength++;\n const attributes = cloneRecord(node.attributes);\n\n if (typeof node.label !== 'undefined') {\n attributes.label = node.label;\n }\n\n if (typeof node.weight !== 'undefined') {\n attributes.weight = node.weight;\n }\n\n const stateCandidate = node.state ?? (attributes.state as NodeState | undefined);\n const selectableCandidate = node.selectable ?? (attributes.selectable as boolean | undefined);\n const highlightCandidate =\n node.highlightConnectedEdges ?? (attributes.highlightConnectedEdges as boolean | undefined);\n\n this.appendUtf8(this.nodeBuilders, 'id', node.id);\n this.appendUtf8(this.nodeBuilders, 'state', normalizeNodeState(stateCandidate));\n this.appendBoolean(this.nodeBuilders, 'selectable', Boolean(selectableCandidate));\n this.appendBoolean(this.nodeBuilders, 'highlightConnectedEdges', Boolean(highlightCandidate));\n this.appendJson(this.nodeBuilders, 'data', attributes);\n\n return index;\n }\n\n addEdge(edge: GraphEdgeData): number {\n if (\n typeof edge?.id === 'undefined' ||\n typeof edge?.sourceId === 'undefined' ||\n typeof edge?.targetId === 'undefined'\n ) {\n throw new Error('Graph edge requires \"id\", \"sourceId\", and \"targetId\" fields.');\n }\n\n const index = this.edgeLength++;\n const attributes = cloneRecord(edge.attributes);\n\n if (typeof edge.label !== 'undefined') {\n attributes.label = edge.label;\n }\n\n if (typeof edge.weight !== 'undefined') {\n attributes.weight = edge.weight;\n }\n\n const stateCandidate = edge.state ?? (attributes.state as EdgeState | undefined);\n const directedCandidate = edge.directed ?? (attributes.directed as boolean | undefined);\n\n this.appendUtf8(this.edgeBuilders, 'id', edge.id);\n this.appendUtf8(this.edgeBuilders, 'sourceId', edge.sourceId);\n this.appendUtf8(this.edgeBuilders, 'targetId', edge.targetId);\n this.appendBoolean(this.edgeBuilders, 'directed', Boolean(directedCandidate));\n this.appendUtf8(this.edgeBuilders, 'state', normalizeEdgeState(stateCandidate));\n this.appendJson(this.edgeBuilders, 'data', attributes);\n\n return index;\n }\n\n finish(): ArrowGraphData {\n return {\n shape: 'arrow-graph-data',\n version: this._version,\n nodes: tableFromBuilders(this.nodeBuilders),\n edges: tableFromBuilders(this.edgeBuilders)\n };\n }\n\n private appendUtf8(builders: ColumnBuilderMap, columnName: string, value: string | number): void {\n const builder = this.getOrCreateBuilder(builders, columnName, () =>\n arrow.makeBuilder({type: new arrow.Utf8(), nullValues: [null, undefined]})\n );\n builder.append(typeof value === 'number' ? String(value) : value);\n }\n\n private appendBoolean(builders: ColumnBuilderMap, columnName: string, value: boolean): void {\n const builder = this.getOrCreateBuilder(builders, columnName, () =>\n arrow.makeBuilder({type: new arrow.Bool(), nullValues: [null, undefined]})\n );\n builder.append(value);\n }\n\n private appendJson(\n builders: ColumnBuilderMap,\n columnName: string,\n value: Record<string, unknown>\n ): void {\n const builder = this.getOrCreateBuilder(builders, columnName, () =>\n arrow.makeBuilder({type: new arrow.Utf8(), nullValues: [null, undefined]})\n );\n builder.append(JSON.stringify(value));\n }\n\n private getOrCreateBuilder(\n builders: ColumnBuilderMap,\n columnName: string,\n factory: () => Builder\n ): Builder {\n let builder = builders.get(columnName);\n if (!builder) {\n builder = factory();\n builders.set(columnName, builder);\n }\n return builder;\n }\n}\n\nfunction tableFromBuilders(builders: ColumnBuilderMap): arrow.Table {\n const columns: Record<string, ColumnArray> = {};\n\n for (const [columnName, builder] of builders.entries()) {\n builder.finish();\n const vector = builder.toVector();\n columns[columnName] = vector.toArray();\n }\n\n return arrow.tableFromArrays(columns);\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {NodeState, EdgeState} from '../core/constants';\n\nconst NODE_STATES: ReadonlySet<NodeState> = new Set(['default', 'hover', 'dragging', 'selected']);\nconst EDGE_STATES: ReadonlySet<EdgeState> = new Set(['default', 'hover', 'dragging', 'selected']);\n\nexport function normalizeNodeState(state: NodeState | undefined): NodeState {\n if (state && NODE_STATES.has(state)) {\n return state;\n }\n return 'default';\n}\n\nexport function normalizeEdgeState(state: EdgeState | undefined): EdgeState {\n if (state && EDGE_STATES.has(state)) {\n return state;\n }\n return 'default';\n}\n\nexport function normalizeNodeStateColumn(\n source: NodeState[] | undefined,\n length: number\n): NodeState[] {\n const result: NodeState[] = new Array(length);\n for (let i = 0; i < length; i++) {\n result[i] = normalizeNodeState(source?.[i]);\n }\n return result;\n}\n\nexport function normalizeEdgeStateColumn(\n source: EdgeState[] | undefined,\n length: number\n): EdgeState[] {\n const result: EdgeState[] = new Array(length);\n for (let i = 0; i < length; i++) {\n result[i] = normalizeEdgeState(source?.[i]);\n }\n return result;\n}\n\nexport function normalizeBooleanColumn(\n source: boolean[] | undefined,\n length: number,\n fallback: boolean\n): boolean[] {\n const result: boolean[] = new Array(length);\n for (let i = 0; i < length; i++) {\n const candidate = source?.[i];\n result[i] = typeof candidate === 'boolean' ? candidate : fallback;\n }\n return result;\n}\n\nexport function normalizeDataColumn(\n source: Record<string, unknown>[] | undefined,\n length: number\n): Record<string, unknown>[] {\n const result: Record<string, unknown>[] = new Array(length);\n for (let i = 0; i < length; i++) {\n result[i] = cloneRecord(source?.[i]);\n }\n return result;\n}\n\nexport function normalizeVersion(version: unknown): number {\n if (typeof version === 'number' && Number.isFinite(version)) {\n return version;\n }\n return 0;\n}\n\nexport function cloneRecord(value: unknown): Record<string, unknown> {\n if (value && typeof value === 'object') {\n return {...(value as Record<string, unknown>)};\n }\n return {};\n}\n\nexport function cloneDataColumn(\n source: Record<string, unknown>[],\n length: number\n): Record<string, unknown>[] {\n const result: Record<string, unknown>[] = new Array(length);\n for (let i = 0; i < length; i++) {\n result[i] = cloneRecord(source[i]);\n }\n return result;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {NodeState} from '../core/constants';\nimport type {EdgeInterface, NodeInterface} from './graph';\n\n/** Properties for creating a new node */\nexport interface NodeOptions {\n /** the unique ID of the node */\n id: number | string;\n selectable?: boolean;\n highlightConnectedEdges?: boolean;\n /* origin data reference */\n data?: Record<string, unknown>;\n}\n\n/** Basic data structure of a node */\nexport class Node implements NodeInterface {\n public readonly id: string | number;\n /** Keep a reference to origin data. */\n private _data: Record<string, unknown>;\n /** List edges. */\n private _connectedEdges: Record<string, EdgeInterface> = {};\n /** Interaction state of the node. */\n public state: NodeState = 'default';\n /** Can the node be selected? */\n private _selectable: boolean;\n /** Should the state of this node affect the state of the connected edges? */\n private _highlightConnectedEdges: boolean;\n /** Check the type of the object when picking engine gets it. */\n public readonly isNode = true;\n /**\n * The constructor of a node\n */\n constructor({id, selectable = false, highlightConnectedEdges = false, data = {}}: NodeOptions) {\n this.id = id;\n this._data = data;\n this._selectable = selectable;\n this._highlightConnectedEdges = highlightConnectedEdges;\n }\n\n /**\n * Return the ID of the node\n * @return - the ID of the node.\n */\n getId(): string | number {\n return this.id;\n }\n\n /**\n * Return the degree of the node -- includes in-degree and out-degree\n * @return {Number} - the degree of the node.\n */\n getDegree(): number {\n return Object.keys(this._connectedEdges).length;\n }\n\n /**\n * Return the in-degree of the node.\n * @return - the in-degree of the node.\n */\n getInDegree(): number {\n const nodeId = this.getId();\n return this.getConnectedEdges().reduce((count, e) => {\n const isDirected = e.isDirected();\n if (isDirected && e.getTargetNodeId() === nodeId) {\n count += 1;\n }\n return count;\n }, 0);\n }\n\n /**\n * Return the out-degree of the node.\n * @return - the out-degree of the node.\n */\n getOutDegree(): number {\n const nodeId = this.getId();\n return this.getConnectedEdges().reduce((count, e) => {\n const isDirected = e.isDirected();\n if (isDirected && e.getSourceNodeId() === nodeId) {\n count += 1;\n }\n return count;\n }, 0);\n }\n\n /**\n * Return all the IDs of the sibling nodes.\n * @return [description]\n */\n getSiblingIds(): (string | number)[] {\n const nodeId = this.getId();\n return this.getConnectedEdges().reduce(\n (siblings, e) => {\n if (e.getTargetNodeId() === nodeId) {\n siblings.push(e.getSourceNodeId());\n } else {\n siblings.push(e.getTargetNodeId());\n }\n return siblings;\n },\n [] as (string | number)[]\n );\n }\n\n /**\n * Return all the connected edges.\n * @return - an array of the connected edges.\n */\n getConnectedEdges(): EdgeInterface[] {\n return Object.values(this._connectedEdges);\n }\n\n /**\n * Return of the value of the selected property key.\n * @param key - property key.\n * @return - the value of the property or undefined (not found).\n */\n getPropertyValue(key: string): unknown {\n // try to search the key within this object\n if (this.hasOwnProperty(key)) {\n return this[key];\n }\n // try to search the key in the original data reference\n else if (this._data.hasOwnProperty(key)) {\n return this._data[key];\n }\n // otherwise, not found\n return undefined;\n }\n\n /**\n * Set the new node data.\n * @param data - the new data of the node\n */\n setData(data: Record<string, unknown>): void {\n this._data = data;\n }\n\n /**\n * Update a data property.\n * @param key - the key of the property\n * @param value - the value of the property.\n */\n setDataProperty(key: string, value: unknown): void {\n this._data[key] = value;\n }\n\n /**\n * Set node state\n * @param state - the new interaction state of the node\n */\n setState(state: NodeState): void {\n this.state = state;\n }\n\n /**\n * Get node state\n * @returns state - the current interaction state of the node\n */\n getState(): NodeState {\n return this.state;\n }\n\n /**\n * Add connected edges to the node\n * @param edge an edge or an array of edges to be added to this._connectedEdges\n */\n addConnectedEdges(edge: EdgeInterface | EdgeInterface[]): void {\n const iterableEdges = Array.isArray(edge) ? edge : [edge];\n iterableEdges.forEach((e) => {\n this._connectedEdges[e.getId()] = e;\n e.addNode(this);\n });\n }\n\n /**\n * Remove edges from this._connectedEdges\n * @param edge an edge or an array of edges to be removed from this._connectedEdges\n */\n removeConnectedEdges(edge: EdgeInterface | EdgeInterface[]): void {\n const iterableEdges = Array.isArray(edge) ? edge : [edge];\n iterableEdges.forEach((e) => {\n e.removeNode(this);\n delete this._connectedEdges[e.getId()];\n });\n }\n\n /**\n * Clear this._connectedEdges\n */\n clearConnectedEdges(): void {\n Object.values(this._connectedEdges).forEach((e) => e.removeNode(this));\n this._connectedEdges = {};\n }\n\n isSelectable(): boolean {\n return this._selectable;\n }\n\n shouldHighlightConnectedEdges(): boolean {\n return this._highlightConnectedEdges;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// Basic data structure of an edge\nimport type {EdgeState} from '../core/constants';\nimport type {EdgeInterface, NodeInterface} from './graph';\n\nexport interface EdgeOptions {\n /** the unique ID of the edge */\n id: string | number;\n /** the ID of the source node */\n sourceId: string | number;\n /** the ID of the target node */\n targetId: string | number;\n /** whether the edge is directed or not */\n directed?: boolean;\n /** origin data reference */\n data?: Record<string, unknown>;\n}\n\n/** Basic edge data structure */\nexport class Edge implements EdgeInterface {\n /** Unique uuid of the edge. */\n public readonly id: string | number;\n /** ID of the source node. */\n private _sourceId: string | number;\n /** ID of the target node. */\n private _targetId: string | number;\n /** Whether the edge is directed or not. */\n private _directed: boolean;\n /** Origin data reference of the edge. */\n private _data: Record<string, unknown>;\n /** Check the type of the object when picking engine gets it. */\n public readonly isEdge = true;\n /** Nodes at either end of this edge. */\n private readonly _connectedNodes: Record<string, NodeInterface> = {};\n /** Edge state. */\n public state: EdgeState = 'default';\n\n /**\n * The constructor\n * @param options.id - information about the edge\n */\n constructor({id, sourceId, targetId, data, directed = false}: EdgeOptions) {\n this.id = id;\n this._sourceId = sourceId;\n this._targetId = targetId;\n this._directed = directed;\n this._data = data;\n }\n\n /**\n * Return the ID of the edge\n * @return {String|Number} - the ID of the edge.\n */\n getId(): string | number {\n return this.id;\n }\n\n /**\n * Return whether the edge is directed or not.\n * @return {Boolean} true if the edge is directed.\n */\n isDirected(): boolean {\n return this._directed;\n }\n\n /**\n * Get the ID of the source node.\n * @return the ID of the source node.\n */\n getSourceNodeId(): string | number {\n return this._sourceId;\n }\n\n /**\n * Get the ID of the target node.\n * @return the ID of the target node.\n */\n getTargetNodeId(): string | number {\n return this._targetId;\n }\n\n /**\n * Return of the value of the selected property key.\n * @param key - property key.\n * @return - the value of the property.\n */\n getPropertyValue(key: string): unknown {\n // try to search the key within this object\n if (this.hasOwnProperty(key)) {\n return this[key];\n }\n // try to search the key in the original data reference\n else if (this._data.hasOwnProperty(key)) {\n return this._data[key];\n }\n // otherwise, not found\n return undefined;\n }\n\n /**\n * Set the origin data as a reference.\n * @param data - the origin data.\n */\n setData(data: Record<string, unknown>): void {\n this._data = data;\n }\n\n /**\n * Update a data property.\n * @param key - the key of the property\n * @param value - the value of the property.\n */\n setDataProperty(key: string, value: unknown): void {\n this._data[key] = value;\n }\n\n /**\n * Set edge state\n * @param state - the new interaction state for the edge\n */\n setState(state: EdgeState): void {\n this.state = state;\n }\n\n /**\n * Get edge state\n * @returns state - the current interaction state for the edge\n */\n getState(): EdgeState {\n return this.state;\n }\n\n addNode(node: NodeInterface): void {\n this._connectedNodes[node.getId()] = node;\n }\n\n removeNode(node: NodeInterface): void {\n delete this._connectedNodes[node.getId()];\n }\n\n getConnectedNodes(): NodeInterface[] {\n return Object.values(this._connectedNodes);\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Log, COLOR} from '@probe.gl/log';\n\nexport const log = new Log({id: 'graph-layers'}).enable();\n\nlog.log({color: COLOR.CYAN}, 'Initialize graph-layers logger.');\n\nfunction invokeLogFunction(result: unknown) {\n if (typeof result === 'function') {\n result();\n }\n}\n\nexport function warn(message: string, ...args: unknown[]) {\n invokeLogFunction(log.warn(message, ...args));\n}\n\nexport function error(message: string, ...args: unknown[]) {\n invokeLogFunction(log.error(message, ...args));\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport class Cache<K, V> {\n private readonly _keys = new Map<K, {value: V; version: number}>();\n\n /**\n * @param key The key of the cache\n * @returns {*} The value of the cache as set by the `set` method.\n */\n get(key: K): V | undefined {\n return this._keys.get(key)?.value;\n }\n\n /**\n * @param key The key of the cache\n * @param createValue A callback to create the value of the cache if it is needed.\n * @param version The version of the cache. If the version is smaller than the current version, the cache will not be updated.\n */\n set(key: K, createValue: (...args: unknown[]) => V, version: number): void {\n const cached = this._keys.get(key);\n\n const keyUpdated = cached === undefined || version > cached.version;\n if (!keyUpdated) {\n return;\n }\n\n this._keys.set(key, {version, value: createValue()});\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {NodeState, EdgeState} from '../core/constants';\n\n/** Shared interface for graph nodes used by the rendering runtime. */\nexport interface NodeInterface {\n readonly isNode: boolean;\n readonly id: string | number;\n getId(): string | number;\n getDegree(): number;\n getInDegree(): number;\n getOutDegree(): number;\n getSiblingIds(): (string | number)[];\n getConnectedEdges(): EdgeInterface[];\n addConnectedEdges(edge: EdgeInterface | EdgeInterface[]): void;\n removeConnectedEdges(edge: EdgeInterface | EdgeInterface[]): void;\n clearConnectedEdges(): void;\n getPropertyValue(key: string): unknown;\n setData(data: Record<string, unknown>): void;\n setDataProperty(key: string, value: unknown): void;\n setState(state: NodeState): void;\n getState(): NodeState;\n isSelectable(): boolean;\n shouldHighlightConnectedEdges(): boolean;\n}\n\n/** Shared interface for graph edges used by the rendering runtime. */\nexport interface EdgeInterface {\n readonly isEdge: boolean;\n readonly id: string | number;\n getId(): string | number;\n isDirected(): boolean;\n getSourceNodeId(): string | number;\n getTargetNodeId(): string | number;\n getConnectedNodes(): NodeInterface[];\n addNode(node: NodeInterface): void;\n removeNode(node: NodeInterface): void;\n getPropertyValue(key: string): unknown;\n setData(data: Record<string, unknown>): void;\n setDataProperty(key: string, value: unknown): void;\n setState(state: EdgeState): void;\n getState(): EdgeState;\n}\n\nexport type GraphProps = {\n onTransactionStart?: () => void;\n onTransactionEnd?: () => void;\n onNodeAdded?: (node: NodeInterface) => void;\n onNodeRemoved?: (node: NodeInterface) => void;\n onNodeUpdated?: (node: NodeInterface) => void;\n onEdgeAdded?: (edge: EdgeInterface) => void;\n onEdgeRemoved?: (edge: EdgeInterface) => void;\n onEdgeUpdated?: (edge: EdgeInterface) => void;\n};\n\n/** Runtime abstraction consumed by the rendering engine. */\nexport abstract class Graph<PropsT extends GraphProps = GraphProps> {\n private _props: PropsT;\n\n protected constructor(props: PropsT) {\n this._props = {...props};\n }\n\n get props(): PropsT {\n return {...this._props};\n }\n\n setProps(props: PropsT): void {\n this._props = {...props};\n }\n\n updateProps(props: PropsT): void {\n this._props = {...this._props, ...props};\n }\n\n abstract get version(): number;\n abstract getNodes(): Iterable<NodeInterface>;\n abstract getEdges(): Iterable<EdgeInterface>;\n abstract findNode(id: string | number): NodeInterface | undefined;\n findNodeById?(id: string | number): NodeInterface | undefined;\n getGraphName?(): string;\n triggerUpdate?(): void;\n abstract destroy?(): void;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {warn} from '../utils/log';\nimport {Cache} from '../core/cache';\nimport {Edge} from './edge';\nimport {Node} from './node';\nimport type {EdgeInterface, NodeInterface, GraphProps} from './graph';\nimport {Graph} from './graph';\nimport type {PlainGraphData, GraphNodeData, GraphEdgeData} from '../graph-data/graph-data';\nimport {\n cloneRecord,\n normalizeEdgeState,\n normalizeNodeState,\n normalizeVersion\n} from './graph-normalization';\n\nexport type ClassicGraphProps = GraphProps & {\n data: PlainGraphData;\n};\n\n/** Basic graph data structure */\nexport class ClassicGraph extends Graph {\n /** List object of nodes. */\n private _nodeMap: Record<string, Node> = {};\n /** List of object edges. */\n private _edgeMap: Record<string, Edge> = {};\n\n /**\n * Identifies whether performing dirty check when streaming new data. If\n * the name of the graph is not specified, will fall back to current time stamp.\n */\n private _name: string = Date.now().toString();\n /** Version the graph. A version is a number that is incremented every time the graph is updated. */\n public version = 0;\n /** Cached data: create array data from maps. */\n private _cache = new Cache<'nodes' | 'edges', Node[] | Edge[]>();\n private _suspendVersionUpdates = false;\n\n /**\n * The constructor of the graph class.\n * @param props -\n */\n constructor(props: ClassicGraphProps) {\n super(props);\n\n const data = props.data;\n const nodes = createNodesFromPlainGraphData(data?.nodes);\n const edges = createEdgesFromPlainGraphData(data?.edges);\n\n this._name = `unnamed-graph-${Date.now().toString()}`;\n this._suspendVersionUpdates = true;\n this.version = normalizeVersion(data?.version);\n try {\n this.batchAddNodes(nodes);\n this.batchAddEdges(edges);\n } finally {\n this._suspendVersionUpdates = false;\n }\n }\n\n /**\n * Set graph name\n * @param name\n */\n setGraphName(name: string): void {\n this._name = name;\n }\n\n /** Get the name of the graph. Default value is the time stamp when creating this graph.\n * @return graph name.\n */\n getGraphName(): string {\n return this._name.toString();\n }\n\n /**\n * Perform a batch of operations defined by cb before indicating graph is updated\n * @param {function} cb - a callback function containing the operations to perform\n */\n transaction<T>(cb: (...args: unknown[]) => T): T {\n try {\n this.props.onTransactionStart?.();\n return cb();\n } finally {\n this.props.onTransactionEnd?.();\n }\n }\n\n /**\n * Add a new node to the graph.\n * @paramnode - expect a Node object to be added to the graph.\n */\n addNode(node: Node): void {\n // add it to the list and map\n this._nodeMap[node.getId()] = node;\n // update last update time stamp\n this._bumpVersion();\n this.props.onNodeAdded?.(node);\n }\n\n /**\n * Batch add nodes to the graph.\n * @param nodes - a list of nodes to be added.\n */\n batchAddNodes(nodes: Node[]): void {\n // convert an array of objects to an object\n this._nodeMap = nodes.reduce(\n (res, node) => {\n res[node.getId()] = node;\n this.props.onNodeAdded?.(node);\n return res;\n },\n {...this._nodeMap}\n );\n this._bumpVersion();\n }\n\n /**\n * Get all the nodes of the graph.\n * @return {Node[]} - get all the nodes in the graph.\n */\n getNodes(): NodeInterface[] {\n this._updateCache('nodes', () => Object.values(this._nodeMap));\n\n return (this._cache.get('nodes') as Node[]) ?? [];\n }\n\n /**\n * Get the node map of the graph. The key of the map is the ID of the nodes.\n * @return - a map of nodes keyed by node IDs.\n */\n getNodeMap(): Record<string | number, Node> {\n return this._nodeMap;\n }\n\n /**\n * Find a node by id\n * @param nodeId The id of the node\n * @return Node\n */\n findNode(nodeId: string | number): Node | undefined {\n return this._nodeMap[nodeId];\n }\n\n findNodeById(nodeId: string | number): NodeInterface | undefined {\n return this.findNode(nodeId);\n }\n\n /**\n * Update the indicated node to the provided value\n * @param node\n */\n updateNode(node: Node): void {\n this._nodeMap[node.getId()] = node;\n this._bumpVersion();\n this.props.onNodeUpdated?.(node);\n }\n\n /**\n * Add a new edge to the graph.\n * @param edge - expect a Edge object to be added to the graph.\n */\n addEdge(edge: Edge): void {\n const sourceNode = this.findNode(edge.getSourceNodeId());\n const targetNode = this.findNode(edge.getTargetNodeId());\n\n if (!sourceNode || !targetNode) {\n warn(`Unable to add edge ${edge.id}, source or target node is missing.`);\n return;\n }\n\n this._edgeMap[edge.getId()] = edge;\n sourceNode.addConnectedEdges(edge);\n targetNode.addConnectedEdges(edge);\n this._bumpVersion();\n this.props.onEdgeAdded?.(edge);\n }\n\n /**\n * Batch add edges to the graph\n * @param edges - a list of edges to be added.\n */\n batchAddEdges(edges: Edge[]): void {\n edges.forEach((edge) => this.addEdge(edge));\n this._bumpVersion();\n }\n\n /**\n * Update the indicated edge to the provided value\n * @param edge\n */\n updateEdge(edge: Edge): void {\n this._edgeMap[edge.getId()] = edge;\n this._bumpVersion();\n this.props.onEdgeUpdated?.(edge);\n }\n\n /**\n * Remove a node from the graph by node ID\n * @param nodeId - the ID of the target node.\n */\n removeNode(nodeId: string | number): void {\n const node = this.findNode(nodeId);\n if (!node) {\n warn(`Unable to remove node ${nodeId} - doesn't exist`);\n return;\n }\n // remove all edges connect to this node from map\n node.getConnectedEdges().forEach((e) => {\n delete this._edgeMap[e.getId()];\n });\n // remove the node from map\n delete this._nodeMap[nodeId];\n this._bumpVersion();\n this.props.onNodeRemoved?.(node);\n }\n\n /**\n * Get all the edges of the graph.\n * @return get all the edges in the graph.\n */\n getEdges(): EdgeInterface[] {\n this._updateCache('edges', () => Object.values(this._edgeMap));\n\n return (this._cache.get('edges') as Edge[]) ?? [];\n }\n\n destroy(): void {\n // No additional teardown required for the legacy graph implementation.\n }\n\n /**\n * Get the edge map of the graph. The key of the map is the ID of the edges.\n * @return - a map of edges keyed by edge IDs.\n */\n getEdgeMap(): Record<string, Edge> {\n return this._edgeMap;\n }\n\n /**\n * Remove an edge from the graph by the edge ID\n * @param {String|Number} edgeId - the target edge ID.\n */\n removeEdge(edgeId: string | number): void {\n const edge = this.findEdge(edgeId);\n if (!edge) {\n warn(`Unable to remove edge ${edgeId} - doesn't exist`);\n return;\n }\n const sourceNode = this.findNode(edge.getSourceNodeId());\n const targetNode = this.findNode(edge.getTargetNodeId());\n\n delete this._edgeMap[edgeId];\n sourceNode.removeConnectedEdges(edge);\n targetNode.removeConnectedEdges(edge);\n this._bumpVersion();\n this.props.onEdgeRemoved?.(edge);\n }\n\n /**\n * Find the edge by edge ID.\n * @param id - the target edge ID\n * @return - the target edge.\n */\n findEdge(edgeId: string | number): Edge {\n return this._edgeMap[edgeId];\n }\n\n /**\n * Return all the connected edges of a node by nodeID.\n * @param nodeId - the target node ID\n * @return - an array of the connected edges.\n */\n getConnectedEdges(nodeId: string | number): EdgeInterface[] {\n const node = this.findNode(nodeId);\n if (!node) {\n warn(`Unable to find node ${nodeId} - doesn't exist`);\n return [];\n }\n return node.getConnectedEdges();\n }\n\n /**\n * Return all the sibling nodes of a node by nodeID.\n * @param nodeId - the target node ID\n * @return - an array of the sibling nodes.\n */\n getNodeSiblings(nodeId: string | number): Node[] {\n const node = this.findNode(nodeId);\n if (!node) {\n warn(`Unable to find node ${nodeId} - doesn't exist`);\n return [];\n }\n return node.getSiblingIds().map((siblingNodeId) => this.findNode(siblingNodeId));\n }\n\n /**\n * Get the degree of a node.\n * @param nodeId - the target node ID.\n * @return - the degree of the node.\n */\n getDegree(nodeId: string | number): number {\n const node = this.findNode(nodeId);\n if (!node) {\n warn(`Unable to find node ${nodeId} - doesn't exist`);\n return 0;\n }\n return node.getDegree();\n }\n\n /**\n * Clean up all the nodes in the graph.\n */\n resetNodes(): void {\n this._nodeMap = {};\n this._bumpVersion();\n }\n\n /**\n * Clean up all the edges in the graph.\n */\n resetEdges(): void {\n this._edgeMap = {};\n this._bumpVersion();\n }\n\n /**\n * Clean up everything in the graph.\n */\n reset(): void {\n this.resetNodes();\n this.resetEdges();\n this._bumpVersion();\n }\n\n /**\n * @deprecated Prefer interacting with this instance directly.\n */\n getClassicGraph(): ClassicGraph {\n return this;\n }\n\n /**\n * Trigger an update to the graph.\n */\n triggerUpdate(): void {\n this._bumpVersion();\n }\n\n /**\n * Return true if the graph is empty.\n * @return {Boolean} Return true if the graph is empty.\n */\n isEmpty(): boolean {\n return Object.keys(this._nodeMap).length === 0;\n }\n\n /**\n * Check the equality of two graphs data by checking last update time stamp\n * @param graph Another graph to be compared against itself\n * @return true if the graph is the same as itself.\n */\n equals(graph: ClassicGraph): boolean {\n if (!graph || !(graph instanceof ClassicGraph)) {\n return false;\n }\n return this.version === graph.version;\n }\n\n _bumpVersion(): void {\n if (this._suspendVersionUpdates) {\n return;\n }\n this.version += 1;\n }\n\n _updateCache(key: 'nodes' | 'edges', updateValue: unknown): void {\n this._cache.set(key, updateValue as any, this.version);\n }\n}\n\nfunction createNodesFromPlainGraphData(nodes?: GraphNodeData[] | null): Node[] {\n if (!nodes) {\n return [];\n }\n return nodes.map((nodeData) => {\n const nodeAttributes = createNodeAttributesFromPlainData(nodeData);\n const selectable =\n typeof nodeData.selectable === 'boolean'\n ? nodeData.selectable\n : Boolean(nodeAttributes.selectable);\n const highlightConnectedEdges =\n typeof nodeData.highlightConnectedEdges === 'boolean'\n ? nodeData.highlightConnectedEdges\n : Boolean(nodeAttributes.highlightConnectedEdges);\n\n const node = new Node({\n id: nodeData.id,\n selectable,\n highlightConnectedEdges,\n data: nodeAttributes\n });\n node.setState(normalizeNodeState(nodeData.state));\n return node;\n });\n}\n\nfunction createEdgesFromPlainGraphData(edges?: GraphEdgeData[] | null): Edge[] {\n if (!edges) {\n return [];\n }\n return edges.map((edgeData) => {\n const edgeAttributes = createEdgeAttributesFromPlainData(edgeData);\n const directed =\n typeof edgeData.directed === 'boolean' ? edgeData.directed : Boolean(edgeAttributes.directed);\n const edge = new Edge({\n id: edgeData.id,\n sourceId: edgeData.sourceId,\n targetId: edgeData.targetId,\n directed,\n data: edgeAttributes\n });\n edge.setState(normalizeEdgeState(edgeData.state));\n return edge;\n });\n}\n\nfunction createNodeAttributesFromPlainData(node: GraphNodeData): Record<string, unknown> {\n const attributes = cloneRecord(node.attributes);\n if (typeof node.label !== 'undefined') {\n attributes.label = node.label;\n }\n if (typeof node.weight !== 'undefined') {\n attributes.weight = node.weight;\n }\n return attributes;\n}\n\nfunction createEdgeAttributesFromPlainData(edge: GraphEdgeData): Record<string, unknown> {\n const attributes = cloneRecord(edge.attributes);\n if (typeof edge.label !== 'undefined') {\n attributes.label = edge.label;\n }\n if (typeof edge.weight !== 'undefined') {\n attributes.weight = edge.weight;\n }\n return attributes;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {PlainGraphData, GraphEdgeData, GraphNodeData} from './graph-data';\nimport {GraphDataBuilder} from './graph-data-builder';\nimport {cloneRecord, normalizeVersion} from '../graph/graph-normalization';\n\nexport type PlainGraphDataBuilderOptions = {\n version?: number;\n};\n\nexport class PlainGraphDataBuilder implements GraphDataBuilder {\n private readonly nodes: GraphNodeData[] = [];\n private readonly edges: GraphEdgeData[] = [];\n\n private _version: number;\n\n constructor(options: PlainGraphDataBuilderOptions = {}) {\n this._version = normalizeVersion(options.version);\n }\n\n get version(): number {\n return this._version;\n }\n\n setVersion(version: unknown): void {\n this._version = normalizeVersion(version);\n }\n\n get nodeCount(): number {\n return this.nodes.length;\n }\n\n get edgeCount(): number {\n return this.edges.length;\n }\n\n addNode(node: GraphNodeData): number {\n if (typeof node?.id === 'undefined') {\n throw new Error('Graph node requires an \"id\" field.');\n }\n\n const attributes = cloneRecord(node.attributes);\n this._assignNodeAttributes(attributes, node);\n const record: GraphNodeData = {\n ...node,\n attributes\n };\n\n this.nodes.push(record);\n return this.nodes.length - 1;\n }\n\n addEdge(edge: GraphEdgeData): number {\n if (\n typeof edge?.id === 'undefined' ||\n typeof edge?.sourceId === 'undefined' ||\n typeof edge?.targetId === 'undefined'\n ) {\n throw new Error('Graph edge requires \"id\", \"sourceId\", and \"targetId\" fields.');\n }\n\n const attributes = cloneRecord(edge.attributes);\n this._assignEdgeAttributes(attributes, edge);\n const record: GraphEdgeData = {\n ...edge,\n attributes\n };\n\n this.edges.push(record);\n return this.edges.length - 1;\n }\n\n private _assignNodeAttributes(target: Record<string, unknown>, node: GraphNodeData): void {\n if (typeof node.label !== 'undefined') {\n target.label = node.label;\n }\n if (typeof node.weight !== 'undefined') {\n target.weight = node.weight;\n }\n if (typeof node.state !== 'undefined') {\n target.state = node.state;\n }\n if (typeof node.selectable !== 'undefined') {\n target.selectable = node.selectable;\n }\n if (typeof node.highlightConnectedEdges !== 'undefined') {\n target.highlightConnectedEdges = node.highlightConnectedEdges;\n }\n }\n\n private _assignEdgeAttributes(target: Record<string, unknown>, edge: GraphEdgeData): void {\n if (typeof edge.label !== 'undefined') {\n target.label = edge.label;\n }\n if (typeof edge.weight !== 'undefined') {\n target.weight = edge.weight;\n }\n if (typeof edge.state !== 'undefined') {\n target.state = edge.state;\n }\n if (typeof edge.directed !== 'undefined') {\n target.directed = edge.directed;\n }\n }\n\n build(): PlainGraphData {\n return {\n shape: 'plain-graph-data',\n version: this._version,\n nodes: this.nodes.map(cloneNodeData),\n edges: this.edges.map(cloneEdgeData)\n };\n }\n}\n\nfunction cloneNodeData(node: GraphNodeData): GraphNodeData {\n const attributes = cloneRecord(node.attributes);\n return {\n ...node,\n attributes\n };\n}\n\nfunction cloneEdgeData(edge: GraphEdgeData): GraphEdgeData {\n const attributes = cloneRecord(edge.attributes);\n return {\n ...edge,\n attributes\n };\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport * as arrow from 'apache-arrow';\n\nexport function getVectorLength(vector: arrow.Vector | null): number {\n return vector?.length ?? 0;\n}\n\nexport function getVectorValue(vector: arrow.Vector | null, index: number): unknown {\n return vector ? (vector.get?.(index) ?? vector.toArray?.()[index]) : undefined;\n}\n\nexport function getColumnVector(table: arrow.Table, columnName: string): arrow.Vector | null {\n const candidate = (\n table as arrow.Table & {getColumn?: (name: string) => arrow.Vector | null}\n ).getColumn?.(columnName);\n if (candidate) {\n return candidate;\n }\n const childAccessor = (table as arrow.Table & {getChild?: (name: string) => arrow.Vector | null})\n .getChild;\n if (typeof childAccessor === 'function') {\n const vector = childAccessor.call(table, columnName);\n if (vector) {\n return vector;\n }\n }\n const getChildAt = (table as arrow.Table & {getChildAt?: (index: number) => arrow.Vector | null})\n .getChildAt;\n const schema = (table as arrow.Table & {schema?: {fields?: Array<{name: string}>}}).schema;\n if (schema && Array.isArray(schema.fields) && typeof getChildAt === 'function') {\n const index = schema.fields.findIndex((field) => field?.name === columnName);\n if (index >= 0) {\n return getChildAt.call(table, index) ?? null;\n }\n }\n return null;\n}\n\nexport function parseDataRecord(value: unknown): Record<string, unknown> {\n if (typeof value === 'string') {\n try {\n const parsed = JSON.parse(value);\n if (parsed && typeof parsed === 'object') {\n return {...(parsed as Record<string, unknown>)};\n }\n } catch {\n return {};\n }\n } else if (value && typeof value === 'object') {\n return {...(value as Record<string, unknown>)};\n }\n return {};\n}\n\nexport function coerceIdentifier(value: unknown): string | number {\n if (typeof value === 'number') {\n return value;\n }\n if (typeof value === 'string') {\n const trimmed = value.trim();\n if (trimmed !== '') {\n const numeric = Number(trimmed);\n if (!Number.isNaN(numeric) && String(numeric) === trimmed) {\n return numeric;\n }\n }\n return value;\n }\n if (value === null || typeof value === 'undefined') {\n throw new Error('Arrow graph encountered an undefined identifier.');\n }\n return String(value);\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport * as arrow from 'apache-arrow';\n\nimport type {NodeState, EdgeState} from '../core/constants';\nimport type {ArrowGraphData} from '../graph-data/graph-data';\nimport {PlainGraphDataBuilder} from '../graph-data/plain-graph-data-builder';\nimport type {GraphProps, NodeInterface, EdgeInterface} from './graph';\nimport {Graph} from './graph';\nimport {ClassicGraph} from './classic-graph';\nimport {cloneRecord, normalizeEdgeState, normalizeNodeState} from './graph-normalization';\n\nimport {\n getVectorLength,\n getVectorValue,\n getColumnVector,\n parseDataRecord,\n coerceIdentifier\n} from './functions/arrow-utils';\n\ntype NodeOverride = {\n state?: NodeState;\n selectable?: boolean;\n highlightConnectedEdges?: boolean;\n data?: Record<string, unknown>;\n};\n\ntype EdgeOverride = {\n state?: EdgeState;\n directed?: boolean;\n data?: Record<string, unknown>;\n};\n\ntype NodeVectors = {\n id: arrow.Vector | null;\n state: arrow.Vector | null;\n selectable: arrow.Vector | null;\n highlightConnectedEdges: arrow.Vector | null;\n data: arrow.Vector | null;\n};\n\ntype EdgeVectors = {\n id: arrow.Vector | null;\n sourceId: arrow.Vector | null;\n targetId: arrow.Vector | null;\n directed: arrow.Vector | null;\n state: arrow.Vector | null;\n data: arrow.Vector | null;\n};\n\nexport type ArrowGraphProps = GraphProps & {\n data: ArrowGraphData;\n};\n\nexport class ArrowGraph extends Graph<ArrowGraphProps> {\n private readonly nodeTable: arrow.Table;\n private readonly edgeTable: arrow.Table;\n\n private readonly nodeVectors: NodeVectors;\n private readonly edgeVectors: EdgeVectors;\n\n private readonly nodeOverrides: NodeOverride[];\n private readonly edgeOverrides: EdgeOverride[];\n\n private readonly nodeDataCache: Array<Record<string, unknown> | null>;\n private readonly edgeDataCache: Array<Record<string, unknown> | null>;\n\n private readonly nodeEdgeIndices: number[][];\n private nodeIndices: WeakMap<NodeInterface, number> = new WeakMap();\n private edgeIndices: WeakMap<EdgeInterface, number> = new WeakMap();\n\n private readonly nodes: ArrowGraphNode[];\n private readonly edges: ArrowGraphEdge[];\n private readonly nodeMap: Map<string | number, ArrowGraphNode> = new Map();\n\n private readonly _version: number;\n\n constructor(props: ArrowGraphProps) {\n super(props);\n\n this._version = props.data.version;\n this.nodeTable = props.data.nodes;\n this.edgeTable = props.data.edges;\n\n this.nodeVectors = this.extractNodeVectors();\n this.edgeVectors = this.extractEdgeVectors();\n this.assertRequiredColumns();\n\n const nodeCount = getVectorLength(this.nodeVectors.id);\n const edgeCount = getVectorLength(this.edgeVectors.id);\n\n this.nodeOverrides = new Array(nodeCount);\n this.edgeOverrides = new Array(edgeCount);\n this.nodeDataCache = new Array(nodeCount).fill(null);\n this.edgeDataCache = new Array(edgeCount).fill(null);\n this.nodeEdgeIndices = Array.from({length: nodeCount}, () => []);\n\n this.nodes = this.initializeNodes(nodeCount);\n this.edges = this.initializeEdges(edgeCount);\n\n this.registerNodes();\n this.registerEdges();\n }\n\n get version(): number {\n return this._version;\n }\n\n getNodes(): Iterable<NodeInterface> {\n return this.nodes;\n }\n\n getEdges(): Iterable<EdgeInterface> {\n return this.edges;\n }\n\n findNode(id: string | number): NodeInterface | undefined {\n return this.nodeMap.get(id) ?? this.nodeMap.get(String(id));\n }\n\n findNodeById(id: string | number): NodeInterface | undefined {\n return this.findNode(id);\n }\n\n destroy(): void {\n this.nodeMap.clear();\n this.nodeIndices = new WeakMap();\n this.edgeIndices = new WeakMap();\n this.nodeEdgeIndices.length = 0;\n this.nodes.length = 0;\n this.edges.length = 0;\n }\n\n getNodeIdByIndex(index: number): string | number {\n const value = getVectorValue(this.nodeVectors.id, index);\n if (typeof value === 'undefined') {\n throw new Error('Arrow graph requires an id column for nodes.');\n }\n return coerceIdentifier(value);\n }\n\n getNodeStateByIndex(index: number): NodeState {\n const override = this.nodeOverrides[index]?.state;\n if (override) {\n return override;\n }\n const value = getVectorValue(this.nodeVectors.state, index);\n return normalizeNodeState(typeof value === 'string' ? (value as NodeState) : undefined);\n }\n\n setNodeStateByIndex(index: number, state: NodeState): void {\n const override = (this.nodeOverrides[index] ??= {});\n override.state = state;\n }\n\n isNodeSelectableByIndex(index: number): boolean {\n const override = this.nodeOverrides[index]?.selectable;\n if (typeof override === 'boolean') {\n return override;\n }\n const value = getVectorValue(this.nodeVectors.selectable, index);\n return coerceBoolean(value, false);\n }\n\n shouldHighlightConnectedEdgesByIndex(index: number): boolean {\n const override = this.nodeOverrides[index]?.highlightConnectedEdges;\n if (typeof override === 'boolean') {\n return override;\n }\n const value = getVectorValue(this.nodeVectors.highlightConnectedEdges, index);\n return coerceBoolean(value, false);\n }\n\n getNodeDegreeByIndex(index: number): number {\n return this.nodeEdgeIndices[index]?.length ?? 0;\n }\n\n getNodeInDegreeByIndex(index: number): number {\n const id = this.getNodeIdByIndex(index);\n return (this.nodeEdgeIndices[index] ?? []).reduce((count, edgeIndex) => {\n if (this.getEdgeTargetIdByIndex(edgeIndex) === id && this.isEdgeDirectedByIndex(edgeIndex)) {\n return count + 1;\n }\n return count;\n }, 0);\n }\n\n getNodeOutDegreeByIndex(index: number): number {\n const id = this.getNodeIdByIndex(index);\n return (this.nodeEdgeIndices[index] ?? []).reduce((count, edgeIndex) => {\n if (this.getEdgeSourceIdByIndex(edgeIndex) === id && this.isEdgeDirectedByIndex(edgeIndex)) {\n return count + 1;\n }\n return count;\n }, 0);\n }\n\n getNodeSiblingIdsByIndex(index: number): (string | number)[] {\n const id = this.getNodeIdByIndex(index);\n const edges = this.nodeEdgeIndices[index] ?? [];\n const siblings: (string | number)[] = [];\n for (const edgeIndex of edges) {\n const source = this.getEdgeSourceIdByIndex(edgeIndex);\n const target = this.getEdgeTargetIdByIndex(edgeIndex);\n if (source === id) {\n siblings.push(target);\n } else {\n siblings.push(source);\n }\n }\n return siblings;\n }\n\n getNodeConnectedEdgesByIndex(index: number): EdgeInterface[] {\n return (this.nodeEdgeIndices[index] ?? [])\n .map((edgeIndex) => this.edges[edgeIndex])\n .filter((edge): edge is ArrowGraphEdge => Boolean(edge));\n }\n\n setNodeDataByIndex(index: number, data: Record<string, unknown>): void {\n const override = (this.nodeOverrides[index] ??= {});\n override.data = {...data};\n this.nodeDataCache[index] = {...data};\n }\n\n setNodeDataPropertyByIndex(index: number, key: string, value: unknown): void {\n const data = this.getNodeDataInternal(index);\n data[key] = value;\n const override = (this.nodeOverrides[index] ??= {});\n override.data = {...data};\n this.nodeDataCache[index] = {...data};\n }\n\n getNodeDataByIndex(index: number): Record<string, unknown> {\n return cloneRecord(this.getNodeDataInternal(index));\n }\n\n getNodePropertyValueByIndex(index: number, key: string): unknown {\n const data = this.getNodeDataInternal(index);\n if (key in data) {\n return data[key];\n }\n const accessors = this.nodeVectors.data;\n if (!accessors) {\n return undefined;\n }\n return undefined;\n }\n\n registerEdgeForNode(node: NodeInterface, edge: EdgeInterface): void {\n const nodeIndex = this.nodeIndices.get(node);\n const edgeIndex = this.edgeIndices.get(edge);\n if (nodeIndex === undefined || edgeIndex === undefined) {\n return;\n }\n const edges = this.nodeEdgeIndices[nodeIndex];\n if (!edges.includes(edgeIndex)) {\n edges.push(edgeIndex);\n }\n }\n\n unregisterEdgeForNode(node: NodeInterface, edge: EdgeInterface): void {\n const nodeIndex = this.nodeIndices.get(node);\n const edgeIndex = this.edgeIndices.get(edge);\n if (nodeIndex === undefined || edgeIndex === undefined) {\n return;\n }\n const edges = this.nodeEdgeIndices[nodeIndex];\n const next = edges.filter((candidate) => candidate !== edgeIndex);\n this.nodeEdgeIndices[nodeIndex] = next;\n }\n\n getEdgeIdByIndex(index: number): string | number {\n const value = getVectorValue(this.edgeVectors.id, index);\n if (typeof value === 'undefined') {\n throw new Error('Arrow graph requires an id column for edges.');\n }\n return coerceIdentifier(value);\n }\n\n getEdgeStateByIndex(index: number): EdgeState {\n const override = this.edgeOverrides[index]?.state;\n if (override) {\n return override;\n }\n const value = getVectorValue(this.edgeVectors.state, index);\n return normalizeEdgeState(typeof value === 'string' ? (value as EdgeState) : undefined);\n }\n\n setEdgeStateByIndex(index: number, state: EdgeState): void {\n const override = (this.edgeOverrides[index] ??= {});\n override.state = state;\n }\n\n isEdgeDirectedByIndex(index: number): boolean {\n const override = this.edgeOverrides[index]?.directed;\n if (typeof override === 'boolean') {\n return override;\n }\n const value = getVectorValue(this.edgeVectors.directed, index);\n return coerceBoolean(value, false);\n }\n\n getEdgeSourceIdByIndex(index: number): string | number {\n const value = getVectorValue(this.edgeVectors.sourceId, index);\n if (typeof value === 'undefined') {\n throw new Error('Arrow graph requires a sourceId column.');\n }\n return coerceIdentifier(value);\n }\n\n getEdgeTargetIdByIndex(index: number): string | number {\n const value = getVectorValue(this.edgeVectors.targetId, index);\n if (typeof value === 'undefined') {\n throw new Error('Arrow graph requires a targetId column.');\n }\n return coerceIdentifier(value);\n }\n\n getEdgePropertyValueByIndex(index: number, key: string): unknown {\n const data = this.getEdgeDataInternal(index);\n return data[key];\n }\n\n setEdgeDataByIndex(index: number, data: Record<string, unknown>): void {\n const override = (this.edgeOverrides[index] ??= {});\n override.data = {...data};\n this.edgeDataCache[index] = {...data};\n }\n\n setEdgeDataPropertyByIndex(index: number, key: string, value: unknown): void {\n const data = this.getEdgeDataInternal(index);\n data[key] = value;\n const override = (this.edgeOverrides[index] ??= {});\n override.data = {...data};\n this.edgeDataCache[index] = {...data};\n }\n\n getEdgeDataByIndex(index: number): Record<string, unknown> {\n return cloneRecord(this.getEdgeDataInternal(index));\n }\n\n getEdgeConnectedNodesByIndex(index: number): NodeInterface[] {\n return this.edges[index]?.getConnectedNodes() ?? [];\n }\n\n toClassicGraph(): ClassicGraph {\n const builder = new PlainGraphDataBuilder({version: this._version});\n\n const nodeCount = getVectorLength(this.nodeVectors.id);\n for (let index = 0; index < nodeCount; index++) {\n builder.addNode({\n id: this.getNodeIdByIndex(index),\n state: this.getNodeStateByIndex(index),\n selectable: this.isNodeSelectableByIndex(index),\n highlightConnectedEdges: this.shouldHighlightConnectedEdgesByIndex(index),\n attributes: this.getNodeDataByIndex(index)\n });\n }\n\n const edgeCount = getVectorLength(this.edgeVectors.id);\n for (let index = 0; index < edgeCount; index++) {\n builder.addEdge({\n id: this.getEdgeIdByIndex(index),\n sourceId: this.getEdgeSourceIdByIndex(index),\n targetId: this.getEdgeTargetIdByIndex(index),\n directed: this.isEdgeDirectedByIndex(index),\n state: this.getEdgeStateByIndex(index),\n attributes: this.getEdgeDataByIndex(index)\n });\n }\n\n return new ClassicGraph({data: builder.build()});\n }\n\n private getNodeDataInternal(index: number): Record<string, unknown> {\n const override = this.nodeOverrides[index]?.data;\n if (override) {\n return override;\n }\n const cached = this.nodeDataCache[index];\n if (cached) {\n return cached;\n }\n const value = getVectorValue(this.nodeVectors.data, index);\n const data = parseDataRecord(value);\n this.nodeDataCache[index] = data;\n return data;\n }\n\n private getEdgeDataInternal(index: number): Record<string, unknown> {\n const override = this.edgeOverrides[index]?.data;\n if (override) {\n return override;\n }\n const cached = this.edgeDataCache[index];\n if (cached) {\n return cached;\n }\n const value = getVectorValue(this.edgeVectors.data, index);\n const data = parseDataRecord(value);\n this.edgeDataCache[index] = data;\n return data;\n }\n private extractNodeVectors(): NodeVectors {\n return {\n id: getColumnVector(this.nodeTable, 'id'),\n state: getColumnVector(this.nodeTable, 'state'),\n selectable: getColumnVector(this.nodeTable, 'selectable'),\n highlightConnectedEdges: getColumnVector(this.nodeTable, 'highlightConnectedEdges'),\n data: getColumnVector(this.nodeTable, 'data')\n };\n }\n\n private extractEdgeVectors(): EdgeVectors {\n return {\n id: getColumnVector(this.edgeTable, 'id'),\n sourceId: getColumnVector(this.edgeTable, 'sourceId'),\n targetId: getColumnVector(this.edgeTable, 'targetId'),\n directed: getColumnVector(this.edgeTable, 'directed'),\n state: getColumnVector(this.edgeTable, 'state'),\n data: getColumnVector(this.edgeTable, 'data')\n };\n }\n\n private assertRequiredColumns(): void {\n if (!this.nodeVectors.id) {\n throw new Error('Arrow graph requires an \"id\" column for nodes.');\n }\n if (!this.edgeVectors.id || !this.edgeVectors.sourceId || !this.edgeVectors.targetId) {\n throw new Error('Arrow graph requires \"id\", \"sourceId\", and \"targetId\" columns for edges.');\n }\n }\n\n private initializeNodes(count: number): ArrowGraphNode[] {\n return Array.from({length: count}, (_, index) => new ArrowGraphNode(this, index));\n }\n\n private initializeEdges(count: number): ArrowGraphEdge[] {\n return Array.from({length: count}, (_, index) => new ArrowGraphEdge(this, index));\n }\n\n private registerNodes(): void {\n for (let index = 0; index < this.nodes.length; index++) {\n const node = this.nodes[index];\n const id = this.getNodeIdByIndex(index);\n registerNodeVariants(this.nodeMap, id, node);\n this.nodeIndices.set(node, index);\n }\n }\n\n private registerEdges(): void {\n for (let index = 0; index < this.edges.length; index++) {\n const edge = this.edges[index];\n this.edgeIndices.set(edge, index);\n\n const source = this.findNodeById(this.getEdgeSourceIdByIndex(index));\n if (source) {\n edge.addNode(source);\n }\n\n const target = this.findNodeById(this.getEdgeTargetIdByIndex(index));\n if (target) {\n edge.addNode(target);\n }\n }\n }\n}\n\nclass ArrowGraphNode implements NodeInterface {\n public readonly isNode = true;\n\n get id(): string | number {\n return this.getId();\n }\n\n constructor(\n private readonly graph: ArrowGraph,\n private readonly index: number\n ) {}\n\n getId(): string | number {\n return this.graph.getNodeIdByIndex(this.index);\n }\n\n getDegree(): number {\n return this.graph.getNodeDegreeByIndex(this.index);\n }\n\n getInDegree(): number {\n return this.graph.getNodeInDegreeByIndex(this.index);\n }\n\n getOutDegree(): number {\n return this.graph.getNodeOutDegreeByIndex(this.index);\n }\n\n getSiblingIds(): (string | number)[] {\n return this.graph.getNodeSiblingIdsByIndex(this.index);\n }\n\n getConnectedEdges(): EdgeInterface[] {\n return this.graph.getNodeConnectedEdgesByIndex(this.index);\n }\n\n addConnectedEdges(edge: EdgeInterface | EdgeInterface[]): void {\n const edges = Array.isArray(edge) ? edge : [edge];\n for (const candidate of edges) {\n candidate.addNode(this);\n }\n }\n\n removeConnectedEdges(edge: EdgeInterface | EdgeInterface[]): void {\n const edges = Array.isArray(edge) ? edge : [edge];\n for (const candidate of edges) {\n candidate.removeNode(this);\n }\n }\n\n clearConnectedEdges(): void {\n const edges = this.getConnectedEdges();\n for (const edge of edges) {\n edge.removeNode(this);\n }\n }\n\n getPropertyValue(key: string): unknown {\n return this.graph.getNodePropertyValueByIndex(this.index, key);\n }\n\n setData(data: Record<string, unknown>): void {\n this.graph.setNodeDataByIndex(this.index, data);\n }\n\n setDataProperty(key: string, value: unknown): void {\n this.graph.setNodeDataPropertyByIndex(this.index, key, value);\n }\n\n setState(state: NodeState): void {\n this.graph.setNodeStateByIndex(this.index, state);\n }\n\n getState(): NodeState {\n return this.graph.getNodeStateByIndex(this.index);\n }\n\n isSelectable(): boolean {\n return this.graph.isNodeSelectableByIndex(this.index);\n }\n\n shouldHighlightConnectedEdges(): boolean {\n return this.graph.shouldHighlightConnectedEdgesByIndex(this.index);\n }\n}\n\nclass ArrowGraphEdge implements EdgeInterface {\n public readonly isEdge = true;\n private readonly connectedNodes: Map<string | number, NodeInterface> = new Map();\n\n get id(): string | number {\n return this.getId();\n }\n\n constructor(\n private readonly graph: ArrowGraph,\n private readonly index: number\n ) {}\n\n getId(): string | number {\n return this.graph.getEdgeIdByIndex(this.index);\n }\n\n isDirected(): boolean {\n return this.graph.isEdgeDirectedByIndex(this.index);\n }\n\n getSourceNodeId(): string | number {\n return this.graph.getEdgeSourceIdByIndex(this.index);\n }\n\n getTargetNodeId(): string | number {\n return this.graph.getEdgeTargetIdByIndex(this.index);\n }\n\n getConnectedNodes(): NodeInterface[] {\n return [...this.connectedNodes.values()];\n }\n\n addNode(node: NodeInterface): void {\n this.connectedNodes.set(node.getId(), node);\n this.graph.registerEdgeForNode(node, this);\n }\n\n removeNode(node: NodeInterface): void {\n this.connectedNodes.delete(node.getId());\n this.graph.unregisterEdgeForNode(node, this);\n }\n\n getPropertyValue(key: string): unknown {\n return this.graph.getEdgePropertyValueByIndex(this.index, key);\n }\n\n setData(data: Record<string, unknown>): void {\n this.graph.setEdgeDataByIndex(this.index, data);\n }\n\n setDataProperty(key: string, value: unknown): void {\n this.graph.setEdgeDataPropertyByIndex(this.index, key, value);\n }\n\n setState(state: EdgeState): void {\n this.graph.setEdgeStateByIndex(this.index, state);\n }\n\n getState(): EdgeState {\n return this.graph.getEdgeStateByIndex(this.index);\n }\n}\n\nfunction registerNodeVariants(\n map: Map<string | number, ArrowGraphNode>,\n id: string | number,\n node: ArrowGraphNode\n): void {\n map.set(id, node);\n if (typeof id === 'string') {\n const numeric = Number(id);\n if (!Number.isNaN(numeric) && id.trim() !== '') {\n map.set(numeric, node);\n }\n } else {\n map.set(String(id), node);\n }\n}\n\nfunction coerceBoolean(value: unknown, fallback: boolean): boolean {\n if (typeof value === 'boolean') {\n return value;\n }\n if (typeof value === 'number') {\n return value !== 0;\n }\n if (typeof value === 'string') {\n const normalized = value.trim().toLowerCase();\n if (normalized === 'true' || normalized === '1') {\n return true;\n }\n if (normalized === 'false' || normalized === '0' || normalized === '') {\n return false;\n }\n }\n return fallback;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Bounds2D} from '@math.gl/types';\n\nimport type {Graph, NodeInterface, EdgeInterface} from '../graph/graph';\n\nimport isEqual from 'lodash.isequal';\nimport {log} from '../utils/log';\n\n// the status of the layout\nexport type GraphLayoutState = 'init' | 'start' | 'calculating' | 'done' | 'error';\n\nexport type GraphLayoutEventDetail = {\n bounds: Bounds2D | null;\n};\n\nexport type GraphLayoutProps = {\n onLayoutStart?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutChange?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutDone?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutError?: (error?: unknown) => void;\n};\n\nexport abstract class GraphLayout<PropsT extends GraphLayoutProps = GraphLayoutProps> {\n static defaultProps: Readonly<Required<GraphLayoutProps>> = {\n onLayoutStart: undefined,\n onLayoutChange: undefined,\n onLayoutDone: undefined,\n onLayoutError: undefined\n };\n\n get [Symbol.toStringTag](): string {\n return 'GraphLayout';\n }\n\n /** Extra configuration props of the layout. */\n protected props: Required<PropsT>;\n\n /**\n * Last computed layout bounds in local layout coordinates.\n *\n * Subclasses should update this value by overriding {@link _updateBounds}\n * so it reflects the latest geometry before layout lifecycle events fire.\n */\n protected _bounds: Bounds2D | null = null;\n\n public version = 0;\n public state: GraphLayoutState = 'init';\n\n /**\n * Constructor of GraphLayout\n * @param props extra configuration props of the layout\n */\n constructor(props: PropsT, defaultProps?: Required<PropsT>) {\n this.props = {\n ...GraphLayout.defaultProps,\n ...defaultProps,\n ...props\n };\n }\n\n getProps(): PropsT {\n return {...this.props};\n }\n\n setProps(props: Partial<PropsT>): void {\n this.props = {...this.props, ...props};\n }\n\n /**\n * Check the equality of two layouts\n * @param layout - The layout to be compared.\n * @return - True if the layout is the same as itself.\n */\n equals(layout: GraphLayout): boolean {\n if (!layout || !(layout instanceof GraphLayout)) {\n return false;\n }\n return this instanceof layout.constructor && isEqual(this.props, layout.props);\n }\n\n // Accessors\n\n /** access the position of the node in the layout */\n getNodePosition(node: NodeInterface): [number, number] {\n return [0, 0];\n }\n\n /** access the layout information of the edge */\n getEdgePosition(edge: EdgeInterface) {\n return {\n type: 'line',\n sourcePosition: [0, 0],\n targetPosition: [0, 0],\n controlPoints: []\n };\n }\n\n /**\n * Pin the node to a designated position, and the node won't move anymore\n * @param node Node to be locked\n * @param x x coordinate\n * @param y y coordinate\n */\n lockNodePosition(node: NodeInterface, x: number, y: number) {}\n\n /**\n * Unlock the node, the node will be able to move freely.\n * @param {Object} node Node to be unlocked\n */\n unlockNodePosition(node: NodeInterface) {}\n\n /** Returns the last computed layout bounds, if available. */\n getBounds(): Bounds2D | null {\n return this._bounds;\n }\n\n /** virtual functions: will be implemented in the child class */\n\n /** first time to pass the graph data into this layout */\n abstract initializeGraph(graph: Graph): void;\n /** update the existing graph */\n abstract updateGraph(graph: Graph): void;\n /** start the layout calculation */\n abstract start();\n /** update the layout calculation */\n abstract update();\n /** resume the layout calculation */\n abstract resume();\n /** stop the layout calculation */\n abstract stop();\n\n // INTERNAL METHODS\n\n /** Hook for subclasses to update bounds prior to emitting events. */\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n protected _updateBounds(): void {}\n\n /**\n * Utility for subclasses to derive layout bounds from an iterable of [x, y] positions.\n * @param positions Iterable of node positions.\n * @returns Layout bounds for the supplied positions or `null` if none are finite.\n */\n protected _calculateBounds(\n positions: Iterable<Readonly<[number, number]> | null | undefined>\n ): Bounds2D | null {\n let minX = Number.POSITIVE_INFINITY;\n let maxX = Number.NEGATIVE_INFINITY;\n let minY = Number.POSITIVE_INFINITY;\n let maxY = Number.NEGATIVE_INFINITY;\n\n for (const position of positions) {\n if (!position) {\n // eslint-disable-next-line no-continue\n continue;\n }\n const [x, y] = position;\n if (!Number.isFinite(x) || !Number.isFinite(y)) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n\n if (minX === Number.POSITIVE_INFINITY) {\n return null;\n }\n\n return [\n [minX, minY],\n [maxX, maxY]\n ];\n }\n\n /**\n * Attempt to coerce an arbitrary value into a finite 2D point.\n * @param value Candidate value that may represent a position.\n * @returns Finite [x, y] tuple or null if the value cannot be interpreted.\n */\n protected _normalizePosition(value: unknown): [number, number] | null {\n if (Array.isArray(value) && value.length >= 2) {\n const [x, y] = value as [unknown, unknown];\n if (this._isFiniteNumber(x) && this._isFiniteNumber(y)) {\n return [x, y];\n }\n return null;\n }\n\n if (value && typeof value === 'object') {\n const {x, y} = value as {x?: unknown; y?: unknown};\n if (this._isFiniteNumber(x) && this._isFiniteNumber(y)) {\n return [x, y];\n }\n }\n\n return null;\n }\n\n private _isFiniteNumber(value: unknown): value is number {\n return typeof value === 'number' && Number.isFinite(value);\n }\n\n protected _updateState(state: GraphLayoutState) {\n this.state = state;\n this.version += 1;\n }\n\n /** @fires GraphLayout#onLayoutStart */\n protected _onLayoutStart = (): void => {\n log.log(0, `GraphLayout(${this}): start`)();\n this._updateBounds();\n this._updateState('calculating');\n\n /**\n * Layout calculation start.\n * @event GraphLayout#onLayoutChange\n * @type {CustomEvent}\n */\n const detail: GraphLayoutEventDetail = {bounds: this._bounds};\n this.props.onLayoutStart?.(detail);\n };\n\n /** @fires GraphLayout#onLayoutChange */\n protected _onLayoutChange = (): void => {\n log.log(0, `GraphLayout(${this}): update`)();\n this._updateBounds();\n this._updateState('calculating');\n\n /**\n * Layout calculation iteration.\n * @event GraphLayout#onLayoutChange\n * @type {CustomEvent}\n */\n const detail: GraphLayoutEventDetail = {bounds: this._bounds};\n this.props.onLayoutChange?.(detail);\n };\n\n /** @fires GraphLayout#onLayoutDone */\n protected _onLayoutDone = (): void => {\n log.log(0, `GraphLayout(${this}): end`)();\n this._updateBounds();\n this._updateState('done');\n\n /**\n * Layout calculation is done.\n * @event GraphLayout#onLayoutDone\n * @type {CustomEvent}\n */\n const detail: GraphLayoutEventDetail = {bounds: this._bounds};\n this.props.onLayoutDone?.(detail);\n };\n\n /** @fires GraphLayout#onLayoutError */\n protected _onLayoutError = (): void => {\n this._updateState('error');\n\n /**\n * Layout calculation went wrong.\n * @event GraphLayout#onLayoutError\n * @type {CustomEvent}\n */\n this.props.onLayoutError?.();\n };\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable no-continue */\n\nimport {ZodError, type ZodIssue} from 'zod';\n\nimport {StylesheetEngine, type DeckGLUpdateTriggers} from './stylesheet-engine';\nimport {\n GraphStyleRuleSchema,\n type GraphStyleRule,\n type GraphStyleRuleParsed\n} from './graph-stylesheet-schema';\nimport {GRAPH_DECKGL_ACCESSOR_MAP} from './graph-style-accessor-map';\nimport {warn} from '../utils/log';\n\nconst GRAPH_DECKGL_UPDATE_TRIGGERS: DeckGLUpdateTriggers = {\n circle: ['getFillColor', 'getRadius', 'getLineColor', 'getLineWidth'],\n rectangle: ['getFillColor', 'getLineColor', 'getLineWidth'],\n 'rounded-rectangle': ['getFillColor', 'getLineColor', 'getLineWidth', 'getCornerRadius'],\n 'path-rounded-rectangle': ['getFillColor', 'getLineColor', 'getLineWidth', 'getCornerRadius'],\n label: ['getColor', 'getText', 'getSize', 'getTextAnchor', 'getAlignmentBaseline', 'getAngle'],\n marker: ['getColor', 'getSize', 'getMarker'],\n Edge: ['getColor', 'getWidth'],\n edge: ['getColor', 'getWidth'],\n 'edge-label': ['getColor', 'getText', 'getSize', 'getTextAnchor', 'getAlignmentBaseline'],\n flow: ['getColor', 'getWidth', 'getSpeed', 'getTailLength'],\n arrow: ['getColor', 'getSize', 'getOffset']\n};\n\nfunction formatStylesheetError(error: ZodError) {\n const details = error.issues\n .map((issue) => {\n const path = issue.path.length ? issue.path.join('.') : 'root';\n return ` \u2022 ${path}: ${issue.message}`;\n })\n .join('\\n');\n return `Invalid graph stylesheet:\\n${details}`;\n}\n\nexport class GraphStylesheetEngine extends StylesheetEngine {\n constructor(\n style: GraphStyleRule | GraphStyleRuleParsed,\n {stateUpdateTrigger}: {stateUpdateTrigger?: unknown} = {}\n ) {\n const result = GraphStyleRuleSchema.safeParse(style);\n const parsedStyle = result.success\n ? result.data\n : sanitizeStylesheet(style, result.error.issues);\n\n super(parsedStyle as GraphStyleRule, {\n deckglAccessorMap: GRAPH_DECKGL_ACCESSOR_MAP,\n deckglUpdateTriggers: GRAPH_DECKGL_UPDATE_TRIGGERS,\n stateUpdateTrigger\n });\n }\n}\n\nexport const GraphStyleEngine = GraphStylesheetEngine;\nexport type GraphStyleEngine = GraphStylesheetEngine;\n\nexport {\n GraphStyleScaleTypeEnum,\n GraphStyleScaleSchema,\n GraphStyleAttributeReferenceSchema,\n GraphStyleLeafValueSchema,\n GraphStyleStateMapSchema,\n GraphStyleValueSchema,\n GraphStylesheetSchema,\n GraphStyleRuleSchema\n} from './graph-stylesheet-schema';\n\nexport type {\n GraphStylesheet,\n GraphStyleRule,\n GraphStyleRuleParsed,\n GraphStylesheetParsed,\n GraphStyleSelector,\n GraphStyleType,\n GraphStyleAttributeReference,\n GraphStyleLeafValue,\n GraphStyleScale,\n GraphStyleScaleType,\n GraphStyleValue\n} from './graph-stylesheet-schema';\n\nexport {GRAPH_DECKGL_ACCESSOR_MAP} from './graph-style-accessor-map';\n\n// eslint-disable-next-line max-statements, complexity\nfunction sanitizeStylesheet(\n style: GraphStyleRule | GraphStyleRuleParsed,\n issues: ZodIssue[]\n): GraphStyleRuleParsed {\n if (issues.length) {\n const details = issues\n .map((issue) => {\n const path = issue.path.length ? issue.path.join('.') : 'root';\n return `${path}: ${issue.message}`;\n })\n .join('\\n \u2022 ');\n warn(`GraphStyleEngine: stylesheet issues detected:\\n \u2022 ${details}`);\n }\n\n const fallbackTypeCandidate =\n typeof (style as {type?: unknown}).type === 'string'\n ? (style as {type: string}).type\n : undefined;\n const fallbackCandidates = Array.from(\n new Set(\n [fallbackTypeCandidate, 'edge'].filter(\n (value): value is string => typeof value === 'string' && value.length > 0\n )\n )\n );\n\n for (const candidate of fallbackCandidates) {\n const sanitized = cloneValue(style) as Record<string, unknown>;\n sanitized.type = candidate;\n\n for (const issue of issues) {\n if (!Array.isArray(issue.path) || issue.path.length === 0) {\n continue;\n }\n\n const path = issue.path.filter(\n (segment): segment is string | number =>\n typeof segment === 'string' || typeof segment === 'number'\n );\n\n if (path.length === 0) {\n continue;\n }\n\n const [rootKey] = path;\n if (rootKey === undefined || rootKey === 'type') {\n continue;\n }\n\n if (typeof rootKey === 'string' && rootKey.startsWith(':')) {\n removeNestedProperty(sanitized, path);\n continue;\n }\n\n if (typeof rootKey !== 'string') {\n continue;\n }\n\n delete sanitized[rootKey];\n }\n\n const result = GraphStyleRuleSchema.safeParse(sanitized);\n if (result.success) {\n return result.data;\n }\n }\n\n // If every fallback failed, rethrow the detailed error so callers know parsing was impossible.\n throw new Error(formatStylesheetError(new ZodError(issues)));\n}\n\nfunction cloneValue<T>(value: T): T {\n if (Array.isArray(value)) {\n return value.map((item) => cloneValue(item)) as unknown as T;\n }\n if (value && typeof value === 'object') {\n if (value instanceof Date) {\n return new Date(value) as unknown as T;\n }\n if (value instanceof RegExp) {\n return new RegExp(value.source, value.flags) as unknown as T;\n }\n const cloned: Record<string, unknown> = {};\n for (const [key, entryValue] of Object.entries(value as Record<string, unknown>)) {\n cloned[key] = cloneValue(entryValue);\n }\n return cloned as unknown as T;\n }\n return value;\n}\n\n// eslint-disable-next-line max-statements, complexity\nfunction removeNestedProperty(\n target: Record<string, unknown> | unknown[],\n path: (string | number)[]\n) {\n if (path.length === 0) {\n return;\n }\n\n const [head, ...rest] = path;\n if (head === undefined) {\n return;\n }\n\n if (Array.isArray(target)) {\n const index = typeof head === 'number' ? head : Number(head);\n if (!Number.isInteger(index) || index < 0 || index >= target.length) {\n return;\n }\n if (rest.length === 0) {\n target.splice(index, 1);\n return;\n }\n const child = target[index];\n if (!child || typeof child !== 'object') {\n target.splice(index, 1);\n return;\n }\n removeNestedProperty(child as Record<string, unknown> | unknown[], rest);\n if (isEmptyObject(child)) {\n target.splice(index, 1);\n }\n return;\n }\n\n const recordTarget = target;\n\n if (rest.length === 0) {\n delete recordTarget[head as keyof typeof recordTarget];\n return;\n }\n\n const child = recordTarget[head as keyof typeof recordTarget];\n if (!child || typeof child !== 'object') {\n delete recordTarget[head as keyof typeof recordTarget];\n return;\n }\n\n removeNestedProperty(child as Record<string, unknown> | unknown[], rest);\n\n if (isEmptyObject(child)) {\n delete recordTarget[head as keyof typeof recordTarget];\n }\n}\n\nfunction isEmptyObject(value: unknown): boolean {\n if (Array.isArray(value)) {\n return value.length === 0;\n }\n if (!value || typeof value !== 'object') {\n return false;\n }\n return Object.keys(value as Record<string, unknown>).length === 0;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport Color from 'color';\nimport {\n scaleLinear,\n scaleLog,\n scaleOrdinal,\n scalePow,\n scaleQuantile,\n scaleQuantize,\n scaleSqrt\n} from 'd3-scale';\n\nimport {warn} from '../utils/log';\nimport type {\n GraphStyleAttributeReference,\n GraphStyleLeafValue,\n GraphStyleScale,\n GraphStyleScaleType\n} from './graph-style-engine';\n\n/* Utils for type check */\nfunction getColor(value) {\n if (typeof value === 'string') {\n try {\n const color = Color.rgb(value).array();\n if (Number.isFinite(color[3])) {\n color[3] *= 255;\n }\n return color;\n } catch (error) {\n return [0, 0, 0];\n }\n }\n if (Array.isArray(value) && Number.isFinite(value[0])) {\n return value;\n }\n return [0, 0, 0];\n}\n\nfunction getNumber(value) {\n switch (typeof value) {\n case 'string':\n value = Number(value);\n return isNaN(value) ? null : value;\n\n case 'number':\n return value;\n\n default:\n return null;\n }\n}\n\nfunction getBool(value) {\n switch (typeof value) {\n case 'boolean':\n return value;\n\n case 'string':\n return value.toLowerCase() !== 'false';\n\n case 'number':\n return Boolean(value);\n\n default:\n return null;\n }\n}\n\nfunction getOffset(value) {\n if (typeof value === 'function') {\n return value;\n }\n\n if (!Array.isArray(value) || value.length !== 2) {\n return null;\n }\n return value.map(getNumber);\n}\n\nconst IDENTITY = (x) => x;\nconst PROPERTY_FORMATTERS = {\n opacity: getNumber,\n zIndex: getNumber,\n\n width: getNumber,\n height: getNumber,\n radius: getNumber,\n\n fill: getColor,\n stroke: getColor,\n strokeWidth: getNumber,\n\n // for marker\n marker: String,\n size: getNumber,\n\n // text\n color: getColor,\n text: String,\n fontSize: getNumber,\n textAnchor: String,\n alignmentBaseline: String,\n angle: getNumber,\n textMaxWidth: getNumber,\n textWordBreak: String,\n textSizeMinPixels: getNumber,\n\n // edges\n speed: getNumber,\n tailLength: getNumber,\n\n offset: getOffset,\n scaleWithZoom: getBool\n};\n\nconst DEFAULT_STYLES = {\n opacity: 1,\n zIndex: 0,\n\n width: 0,\n height: 0,\n radius: 1,\n\n fill: [0, 0, 0],\n stroke: [0, 0, 0],\n strokeWidth: 0,\n\n marker: 'circle',\n size: 12,\n\n color: [0, 0, 0],\n text: '',\n fontSize: 12,\n textAnchor: 'middle',\n alignmentBaseline: 'center',\n angle: 0,\n textMaxWidth: -1,\n textWordBreak: 'break-all',\n textSizeMinPixels: 9,\n\n speed: 0,\n tailLength: 1,\n\n offset: null,\n scaleWithZoom: true\n};\n\n/** Union of supported D3 scale implementations. */\ntype SupportedScale =\n | ReturnType<typeof scaleLinear>\n | ReturnType<typeof scaleLog>\n | ReturnType<typeof scalePow>\n | ReturnType<typeof scaleQuantize>\n | ReturnType<typeof scaleQuantile>\n | ReturnType<typeof scaleOrdinal>;\n\nconst SCALE_FACTORIES: Record<GraphStyleScaleType, () => SupportedScale> = {\n linear: () => scaleLinear(),\n log: () => scaleLog(),\n pow: () => scalePow(),\n sqrt: () => scaleSqrt(),\n quantize: () => scaleQuantize(),\n quantile: () => scaleQuantile(),\n ordinal: () => scaleOrdinal()\n};\n\n/** Resolved attribute reference with guaranteed defaults. */\ntype NormalizedAttributeReference = {\n attribute: string;\n fallback: unknown;\n scale?: (value: unknown) => unknown;\n scaleConfig?: GraphStyleScale | ((value: unknown) => unknown);\n};\n\n/** Create a D3 scale instance based on a declarative configuration. */\n/* eslint-disable-next-line complexity */\nfunction createScaleFromConfig(config: GraphStyleScale): SupportedScale {\n const type = config.type ?? 'linear';\n const factory = SCALE_FACTORIES[type];\n if (!factory) {\n warn(`Invalid scale type: ${type}`);\n throw new Error(`Invalid scale type: ${type}`);\n }\n const scale = (factory as () => SupportedScale)();\n const anyScale = scale as any;\n if (config.domain && 'domain' in scale) {\n anyScale.domain(config.domain as never);\n }\n if (config.range && 'range' in scale) {\n anyScale.range(config.range as never);\n }\n if (\n typeof config.clamp === 'boolean' &&\n 'clamp' in scale &&\n typeof anyScale.clamp === 'function'\n ) {\n anyScale.clamp(config.clamp);\n }\n if (\n typeof config.nice !== 'undefined' &&\n 'nice' in scale &&\n typeof anyScale.nice === 'function'\n ) {\n anyScale.nice(config.nice as never);\n }\n if (\n type === 'pow' &&\n typeof config.exponent === 'number' &&\n 'exponent' in scale &&\n typeof anyScale.exponent === 'function'\n ) {\n anyScale.exponent(config.exponent);\n }\n if (\n type === 'log' &&\n typeof config.base === 'number' &&\n 'base' in scale &&\n typeof anyScale.base === 'function'\n ) {\n anyScale.base(config.base);\n }\n if (\n typeof config.unknown !== 'undefined' &&\n 'unknown' in scale &&\n typeof (scale as {unknown?: (value: unknown) => unknown}).unknown === 'function'\n ) {\n (scale as {unknown: (value: unknown) => unknown}).unknown(config.unknown);\n }\n return scale;\n}\n\n/** Normalize attribute reference definitions into a consistent structure. */\nfunction normalizeAttributeReference(\n key: string,\n reference: GraphStyleAttributeReference\n): NormalizedAttributeReference {\n if (typeof reference === 'string') {\n const attribute = reference.startsWith('@') ? reference.slice(1) : reference;\n if (!attribute) {\n throw new Error(`Invalid attribute reference for ${key}: ${reference}`);\n }\n return {\n attribute,\n fallback: DEFAULT_STYLES[key]\n };\n }\n\n const {attribute, fallback = DEFAULT_STYLES[key], scale} = reference;\n if (!attribute) {\n throw new Error(`Invalid attribute reference for ${key}: ${JSON.stringify(reference)}`);\n }\n\n let scaleFn: ((value: unknown) => unknown) | undefined;\n let scaleConfig: GraphStyleScale | ((value: unknown) => unknown) | undefined;\n\n if (scale) {\n if (typeof scale === 'function') {\n scaleFn = scale;\n scaleConfig = scale;\n } else {\n scaleFn = createScaleFromConfig(scale);\n scaleConfig = scale;\n }\n }\n\n return {\n attribute,\n fallback,\n scale: scaleFn,\n scaleConfig\n };\n}\n\n/** Determine whether a value points to a graph attribute reference. */\nfunction isAttributeReference(value: unknown): value is GraphStyleAttributeReference {\n if (typeof value === 'string') {\n return value.startsWith('@');\n }\n return (\n Boolean(value) &&\n typeof value === 'object' &&\n !Array.isArray(value) &&\n 'attribute' in (value as Record<string, unknown>)\n );\n}\n\n/** Determine whether a style value maps interaction states. */\nfunction isStatefulValue(value: unknown): value is Record<string, GraphStyleLeafValue> {\n return (\n Boolean(value) &&\n typeof value === 'object' &&\n !Array.isArray(value) &&\n !isAttributeReference(value)\n );\n}\n\n/** Resolve an attribute from a datum or `Graph` entity. */\nfunction getAttributeValue(datum: any, attribute: string) {\n if (datum && typeof datum.getPropertyValue === 'function') {\n return datum.getPropertyValue(attribute);\n }\n if (datum && typeof datum === 'object' && attribute in datum) {\n return datum[attribute];\n }\n return undefined;\n}\n\n/** Combine Deck.gl update triggers while filtering falsey entries. */\nfunction mergeUpdateTriggers(...triggers: unknown[]): unknown {\n const filtered = triggers.filter(\n (trigger) => !(trigger === false || trigger === undefined || trigger === null)\n );\n if (!filtered.length) {\n return false;\n }\n if (filtered.length === 1) {\n return filtered[0];\n }\n return filtered;\n}\n\n/** Build an accessor that reads and optionally scales an attribute. */\nfunction createAttributeAccessor(\n key: string,\n attributeRef: NormalizedAttributeReference,\n formatter: (value: unknown) => unknown\n) {\n const accessor = (datum: any) => {\n let raw = getAttributeValue(datum, attributeRef.attribute);\n if (raw === undefined || raw === null) {\n raw = attributeRef.fallback;\n }\n if (attributeRef.scale) {\n raw = attributeRef.scale(raw);\n }\n const formatted = formatter(raw);\n if (formatted === null) {\n warn(`Invalid ${key} value: ${raw}`);\n throw new Error(`Invalid ${key} value: ${raw}`);\n }\n return formatted;\n };\n\n const updateTrigger = {\n attribute: attributeRef.attribute,\n scale: attributeRef.scaleConfig ?? null\n };\n\n return {accessor, updateTrigger};\n}\n\n/** Result of parsing a leaf style value. */\ntype LeafParseResult = {\n value: any;\n isAccessor: boolean;\n updateTrigger: unknown;\n};\n\nfunction describeStyleValue(value: unknown): string {\n if (typeof value === 'string') {\n return value;\n }\n if (typeof value === 'number' || typeof value === 'boolean' || typeof value === 'undefined') {\n return String(value);\n }\n if (value === null) {\n return 'null';\n }\n if (typeof value === 'function') {\n return value.name ? `[Function ${value.name}]` : '[Function]';\n }\n if (Array.isArray(value)) {\n return `[${value.map((item) => describeStyleValue(item)).join(', ')}]`;\n }\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}\n\n/** Parse a non-stateful style value into deck.gl compatible form. */\nfunction parseLeafValue(key: string, value: GraphStyleLeafValue | undefined): LeafParseResult {\n const formatter = PROPERTY_FORMATTERS[key] || IDENTITY;\n\n if (typeof value === 'undefined') {\n const formatted = formatter(DEFAULT_STYLES[key]);\n if (formatted === null) {\n const description = describeStyleValue(value);\n warn(`Invalid ${key} value: ${description}`);\n throw new Error(`Invalid ${key} value: ${description}`);\n }\n return {value: formatted, isAccessor: false, updateTrigger: false};\n }\n\n if (isAttributeReference(value)) {\n const normalized = normalizeAttributeReference(key, value);\n const {accessor, updateTrigger} = createAttributeAccessor(key, normalized, formatter);\n return {value: accessor, isAccessor: true, updateTrigger};\n }\n\n if (typeof value === 'function') {\n return {\n value: (datum) => formatter(value(datum)),\n isAccessor: true,\n updateTrigger: value\n };\n }\n\n const formatted = formatter(value);\n if (formatted === null) {\n const description = describeStyleValue(value);\n warn(`Invalid ${key} value: ${description}`);\n throw new Error(`Invalid ${key} value: ${description}`);\n }\n\n return {value: formatted, isAccessor: false, updateTrigger: false};\n}\n\n/**\n * Create an accessor capable of handling interaction state overrides for a style property.\n */\nfunction createStatefulAccessor(\n key: string,\n value: Record<string, GraphStyleLeafValue>,\n stateUpdateTrigger: unknown\n) {\n const valueMap: Record<string, any> = {};\n const attributeTriggers: unknown[] = [];\n\n for (const state of Object.keys(value)) {\n const parsed = parseLeafValue(key, value[state]);\n valueMap[state] = parsed.value;\n if (parsed.updateTrigger) {\n attributeTriggers.push(parsed.updateTrigger);\n }\n }\n\n const defaultValue =\n typeof valueMap.default !== 'undefined'\n ? valueMap.default\n : parseLeafValue(key, undefined).value;\n\n const accessor = (datum: any) => {\n const stateValue = datum?.state ? valueMap[datum.state] : undefined;\n const candidate = typeof stateValue !== 'undefined' ? stateValue : defaultValue;\n return typeof candidate === 'function' ? candidate(datum) : candidate;\n };\n\n const updateTrigger = mergeUpdateTriggers(stateUpdateTrigger, ...attributeTriggers);\n\n return {accessor, updateTrigger};\n}\n\nconst VALUE_TYPE = {\n ACCESSOR: 'ACCESSOR',\n PLAIN_VALUE: 'PLAIN_VALUE'\n};\n\nexport class StyleProperty {\n key: any;\n _updateTrigger: unknown;\n _value: any;\n _valueType: any;\n\n // for getting default style\n static getDefault(key) {\n return DEFAULT_STYLES[key];\n }\n\n // pass the key and value of the property\n // and format the value properly.\n constructor({key, value, updateTrigger}) {\n this.key = key;\n this._updateTrigger = false;\n\n if (isStatefulValue(value)) {\n const {accessor, updateTrigger: triggers} = createStatefulAccessor(key, value, updateTrigger);\n this._value = accessor;\n this._valueType = VALUE_TYPE.ACCESSOR;\n this._updateTrigger = triggers;\n } else {\n const parsed = parseLeafValue(key, value as GraphStyleLeafValue | undefined);\n this._value = parsed.value;\n this._valueType = parsed.isAccessor ? VALUE_TYPE.ACCESSOR : VALUE_TYPE.PLAIN_VALUE;\n this._updateTrigger = mergeUpdateTriggers(parsed.updateTrigger);\n }\n\n if (this._value === null) {\n warn(`Invalid ${key} value: ${value}`);\n throw new Error(`Invalid ${key} value: ${value}`);\n }\n }\n\n // get the formatted value\n getValue() {\n return this._value;\n }\n\n getUpdateTrigger() {\n return this._updateTrigger;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {StyleProperty} from './style-property';\nimport {error} from '../utils/log';\n\nexport type DeckGLAccessorMap = Record<string, Record<string, string>>;\nexport type DeckGLUpdateTriggers = Record<string, string[]>;\n\nexport type StylePropertyConstructor<T extends StyleProperty = StyleProperty> = new (args: {\n key: string;\n value: unknown;\n updateTrigger: unknown;\n}) => T;\n\nexport type DefaultStyleValueFn = (property: string) => unknown;\n\nexport type StylesheetEngineOptions<T extends StyleProperty = StyleProperty> = {\n deckglAccessorMap: DeckGLAccessorMap;\n deckglUpdateTriggers?: DeckGLUpdateTriggers;\n stateUpdateTrigger?: unknown;\n StylePropertyClass?: StylePropertyConstructor<T>;\n getDefaultStyleValue?: DefaultStyleValueFn;\n};\n\nconst DEFAULT_UPDATE_TRIGGERS: DeckGLUpdateTriggers = {};\n\nexport class StylesheetEngine<TStyleProperty extends StyleProperty = StyleProperty> {\n type: string;\n properties: Record<string, TStyleProperty>;\n\n protected readonly deckglAccessorMap: DeckGLAccessorMap;\n protected readonly deckglUpdateTriggers: DeckGLUpdateTriggers;\n protected readonly stateUpdateTrigger: unknown;\n protected readonly StylePropertyClass: StylePropertyConstructor<TStyleProperty>;\n protected readonly getDefaultStyleValue: DefaultStyleValueFn;\n\n constructor(style: Record<string, any>, options: StylesheetEngineOptions<TStyleProperty>) {\n const {\n deckglAccessorMap,\n deckglUpdateTriggers = DEFAULT_UPDATE_TRIGGERS,\n stateUpdateTrigger = false,\n StylePropertyClass = StyleProperty as unknown as StylePropertyConstructor<TStyleProperty>,\n // eslint-disable-next-line @typescript-eslint/unbound-method\n getDefaultStyleValue = StyleProperty.getDefault\n } = options;\n\n const {type: layerType, ...restStyle} = style;\n\n if (!layerType || !(layerType in deckglAccessorMap)) {\n throw new Error(`illegal type: ${layerType}`);\n }\n\n this.type = layerType;\n this.deckglAccessorMap = deckglAccessorMap;\n this.deckglUpdateTriggers = deckglUpdateTriggers;\n this.stateUpdateTrigger = stateUpdateTrigger;\n this.StylePropertyClass = StylePropertyClass;\n this.getDefaultStyleValue = getDefaultStyleValue;\n\n const rules = Object.keys(restStyle).reduce(\n (res, key) => {\n const isSelector = key.startsWith(':');\n if (isSelector) {\n const state = key.substring(1);\n res[state] = restStyle[key];\n return res;\n }\n res.default[key] = restStyle[key];\n return res;\n },\n {default: {}} as Record<string, Record<string, unknown>>\n );\n\n const attributes = Object.values(rules).reduce<string[]>((res, rule) => {\n const attrs = Object.keys(rule || {});\n const set = new Set([...res, ...attrs]);\n return Array.from(set);\n }, []);\n\n const attrMap = attributes.reduce(\n (res, attr) => {\n res[attr] = Object.entries(rules).reduce(\n (acc, entry) => {\n const [state, rule] = entry;\n if (rule && typeof (rule as any)[attr] !== 'undefined') {\n (acc as any)[state] = (rule as any)[attr];\n }\n return acc;\n },\n {} as Record<string, unknown>\n );\n return res;\n },\n {} as Record<string, any>\n );\n\n const simplifiedStyleMap = Object.entries(attrMap).reduce(\n (res, entry) => {\n const [attr, valueMap] = entry as [string, Record<string, unknown>];\n const states = Object.keys(valueMap);\n const onlyDefault = states.length === 1 && valueMap.default !== undefined;\n if (onlyDefault) {\n res[attr] = valueMap.default;\n return res;\n }\n res[attr] = valueMap;\n return res;\n },\n {} as Record<string, unknown>\n );\n\n this.properties = {} as Record<string, TStyleProperty>;\n for (const key in simplifiedStyleMap) {\n this.properties[key] = new this.StylePropertyClass({\n key,\n value: simplifiedStyleMap[key],\n updateTrigger: this.stateUpdateTrigger\n });\n }\n }\n\n protected getDeckGLAccessorMapForType() {\n return this.deckglAccessorMap[this.type];\n }\n\n protected getDeckGLUpdateTriggersForType() {\n return this.deckglUpdateTriggers[this.type] || [];\n }\n\n protected _getProperty(deckglAccessor: string) {\n const map = this.getDeckGLAccessorMapForType();\n if (!map) {\n throw new Error(`illegal type: ${this.type}`);\n }\n const styleProp = map[deckglAccessor];\n if (!styleProp) {\n error(`Invalid DeckGL accessor: ${deckglAccessor}`);\n throw new Error(`Invalid DeckGL accessor: ${deckglAccessor}`);\n }\n return this.properties[styleProp];\n }\n\n getDeckGLAccessor(deckglAccessor: string) {\n const property = this._getProperty(deckglAccessor);\n if (property) {\n const value = property.getValue();\n return typeof value === 'function' ? value : () => value;\n }\n const styleProp = this.getDeckGLAccessorMapForType()?.[deckglAccessor];\n return this.getDefaultStyleValue(styleProp);\n }\n\n getDeckGLAccessorUpdateTrigger(deckglAccessor: string) {\n const property = this._getProperty(deckglAccessor);\n if (property) {\n return property.getUpdateTrigger();\n }\n return false;\n }\n\n getDeckGLAccessors() {\n const accessorMap = this.getDeckGLAccessorMapForType();\n return Object.keys(accessorMap).reduce(\n (res, accessor) => {\n res[accessor] = this.getDeckGLAccessor(accessor);\n return res;\n },\n {} as Record<string, (...args: any[]) => unknown>\n );\n }\n\n getDeckGLUpdateTriggers() {\n return this.getDeckGLUpdateTriggersForType().reduce(\n (res, accessor) => {\n res[accessor] = this.getDeckGLAccessorUpdateTrigger(accessor);\n return res;\n },\n {} as Record<string, unknown>\n );\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable no-continue */\n\nimport {z, type ZodTypeAny} from 'zod';\n\nimport {GRAPH_DECKGL_ACCESSOR_MAP} from './graph-style-accessor-map';\nexport {GRAPH_DECKGL_ACCESSOR_MAP};\n\nconst GraphStylePrimitiveSchema = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n z.array(z.union([z.string(), z.number(), z.boolean(), z.null()]))\n]);\n\nconst GraphStyleFunctionSchema = z.custom<(...args: unknown[]) => unknown>(\n (value) => typeof value === 'function',\n {\n message: 'Style functions must be callable.'\n }\n);\n\n/**\n * Supported scale identifiers for mapping data values to visual encodings.\n */\nexport const GraphStyleScaleTypeEnum = z.enum([\n 'linear',\n 'log',\n 'pow',\n 'sqrt',\n 'quantize',\n 'quantile',\n 'ordinal'\n]);\n\n/**\n * TypeScript union of {@link GraphStyleScaleTypeEnum} values.\n */\nexport type GraphStyleScaleType = z.infer<typeof GraphStyleScaleTypeEnum>;\n\n/**\n * Configuration for data-driven style scaling. Supports deck.gl compatible numeric and\n * categorical scaling with optional d3-scale like parameters.\n */\nexport const GraphStyleScaleSchema = z\n .object({\n type: GraphStyleScaleTypeEnum.optional(),\n domain: z.array(z.union([z.number(), z.string()])).optional(),\n range: z.array(z.any()).optional(),\n clamp: z.boolean().optional(),\n nice: z.union([z.boolean(), z.number()]).optional(),\n base: z.number().optional(),\n exponent: z.number().optional(),\n unknown: z.any().optional()\n })\n .strict();\n\n/**\n * TypeScript view of {@link GraphStyleScaleSchema} after parsing.\n */\nexport type GraphStyleScale = z.infer<typeof GraphStyleScaleSchema>;\n\n/**\n * Reference to node/edge attributes, optionally including fallback values and scale\n * configuration for data-driven styling.\n */\nexport const GraphStyleAttributeReferenceSchema = z.union([\n z\n .string()\n .regex(\n /^@.+/,\n 'Attribute reference strings must start with \"@\" and include an attribute name.'\n ),\n z\n .object({\n attribute: z.string().min(1, 'Attribute name is required.'),\n fallback: GraphStylePrimitiveSchema.optional(),\n scale: z.union([GraphStyleScaleSchema, GraphStyleFunctionSchema]).optional()\n })\n .strict()\n]);\n\n/**\n * Parsed value produced by {@link GraphStyleAttributeReferenceSchema}.\n */\nexport type GraphStyleAttributeReference = z.infer<typeof GraphStyleAttributeReferenceSchema>;\n\n/**\n * Primitive value allowed in stylesheet definitions. Supports literal values, attribute\n * references and imperative resolver functions.\n */\nexport const GraphStyleLeafValueSchema = z.union([\n GraphStylePrimitiveSchema,\n GraphStyleAttributeReferenceSchema,\n GraphStyleFunctionSchema\n]);\n\n/**\n * Union of literal, attribute-driven and functional style values.\n */\nexport type GraphStyleLeafValue = z.infer<typeof GraphStyleLeafValueSchema>;\n\nconst RESERVED_STATE_KEYS = new Set(['attribute', 'fallback', 'scale']);\n\n/**\n * Mapping of interaction or application state keys to leaf style values.\n */\nexport const GraphStyleStateMapSchema = z.record(\n z\n .string()\n .refine((key) => !RESERVED_STATE_KEYS.has(key), 'State overrides must not use reserved keys.'),\n GraphStyleLeafValueSchema\n);\n\n/**\n * Style value that may be either a simple leaf value or a keyed map of overrides.\n */\nexport const GraphStyleValueSchema = z.union([GraphStyleLeafValueSchema, GraphStyleStateMapSchema]);\n\n/**\n * Parsed style property value that may include state overrides.\n */\nexport type GraphStyleValue = z.infer<typeof GraphStyleValueSchema>;\n\nexport type GraphStyleType = keyof typeof GRAPH_DECKGL_ACCESSOR_MAP;\n\n/**\n * CSS-like pseudo selector supported by the stylesheet for state overrides.\n */\nexport type GraphStyleSelector = `:${string}`;\n\nconst GraphStyleSelectorKeySchema = z.string().regex(/^:[^\\s]+/, 'Selectors must start with \":\".');\n\nfunction createSelectorRefinement(allowedKeys: readonly string[], propertiesSchema: ZodTypeAny) {\n const allowedKeySet = new Set<string>(allowedKeys);\n\n return (value: unknown, ctx: z.RefinementCtx) => {\n if (typeof value !== 'object' || value === null) {\n return;\n }\n\n const record = value as Record<string, unknown>;\n\n for (const key of Object.keys(record)) {\n if (key === 'type') continue;\n if (allowedKeySet.has(key)) continue;\n\n if (!key.startsWith(':')) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [key],\n message: `Unknown style property \"${key}\".`\n });\n continue;\n }\n\n if (!GraphStyleSelectorKeySchema.safeParse(key).success) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [key],\n message: 'Selectors must start with \":\".'\n });\n continue;\n }\n\n const selectorResult = propertiesSchema.safeParse(record[key]);\n if (!selectorResult.success) {\n for (const issue of selectorResult.error.issues) {\n ctx.addIssue({\n ...issue,\n path: [key, ...(issue.path ?? [])]\n });\n }\n }\n }\n };\n}\n\nconst CircleShape = {\n offset: GraphStyleValueSchema.optional(),\n opacity: GraphStyleValueSchema.optional(),\n fill: GraphStyleValueSchema.optional(),\n stroke: GraphStyleValueSchema.optional(),\n strokeWidth: GraphStyleValueSchema.optional(),\n radius: GraphStyleValueSchema.optional()\n} as const;\n\nconst CirclePropertiesSchema = z.object(CircleShape).partial().strict();\n\nconst CircleStylesheetSchema = z\n .object({\n type: z.literal('circle'),\n ...CircleShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(CircleShape), CirclePropertiesSchema));\n\nconst RectangleShape = {\n offset: GraphStyleValueSchema.optional(),\n opacity: GraphStyleValueSchema.optional(),\n width: GraphStyleValueSchema.optional(),\n height: GraphStyleValueSchema.optional(),\n fill: GraphStyleValueSchema.optional(),\n stroke: GraphStyleValueSchema.optional(),\n strokeWidth: GraphStyleValueSchema.optional()\n} as const;\n\nconst RectanglePropertiesSchema = z.object(RectangleShape).partial().strict();\n\nconst RectangleStylesheetSchema = z\n .object({\n type: z.literal('rectangle'),\n ...RectangleShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(RectangleShape), RectanglePropertiesSchema));\n\nconst RoundedRectangleShape = {\n offset: GraphStyleValueSchema.optional(),\n opacity: GraphStyleValueSchema.optional(),\n cornerRadius: GraphStyleValueSchema.optional(),\n radius: GraphStyleValueSchema.optional(),\n width: GraphStyleValueSchema.optional(),\n height: GraphStyleValueSchema.optional(),\n fill: GraphStyleValueSchema.optional(),\n stroke: GraphStyleValueSchema.optional(),\n strokeWidth: GraphStyleValueSchema.optional()\n} as const;\n\nconst RoundedRectanglePropertiesSchema = z.object(RoundedRectangleShape).partial().strict();\n\nconst RoundedRectangleStylesheetSchema = z\n .object({\n type: z.literal('rounded-rectangle'),\n ...RoundedRectangleShape\n })\n .catchall(z.unknown())\n .superRefine(\n createSelectorRefinement(Object.keys(RoundedRectangleShape), RoundedRectanglePropertiesSchema)\n );\n\nconst PathRoundedRectangleShape = {\n offset: GraphStyleValueSchema.optional(),\n opacity: GraphStyleValueSchema.optional(),\n width: GraphStyleValueSchema.optional(),\n height: GraphStyleValueSchema.optional(),\n fill: GraphStyleValueSchema.optional(),\n stroke: GraphStyleValueSchema.optional(),\n strokeWidth: GraphStyleValueSchema.optional(),\n cornerRadius: GraphStyleValueSchema.optional()\n} as const;\n\nconst PathRoundedRectanglePropertiesSchema = z.object(PathRoundedRectangleShape).partial().strict();\n\nconst PathRoundedRectangleStylesheetSchema = z\n .object({\n type: z.literal('path-rounded-rectangle'),\n ...PathRoundedRectangleShape\n })\n .catchall(z.unknown())\n .superRefine(\n createSelectorRefinement(\n Object.keys(PathRoundedRectangleShape),\n PathRoundedRectanglePropertiesSchema\n )\n );\n\nconst LabelShape = {\n offset: GraphStyleValueSchema.optional(),\n opacity: GraphStyleValueSchema.optional(),\n color: GraphStyleValueSchema.optional(),\n text: GraphStyleValueSchema.optional(),\n fontSize: GraphStyleValueSchema.optional(),\n textAnchor: GraphStyleValueSchema.optional(),\n alignmentBaseline: GraphStyleValueSchema.optional(),\n angle: GraphStyleValueSchema.optional(),\n scaleWithZoom: GraphStyleValueSchema.optional(),\n textMaxWidth: GraphStyleValueSchema.optional(),\n textWordBreak: GraphStyleValueSchema.optional(),\n textSizeMinPixels: GraphStyleValueSchema.optional()\n} as const;\n\nconst LabelPropertiesSchema = z.object(LabelShape).partial().strict();\n\nconst LabelStylesheetSchema = z\n .object({\n type: z.literal('label'),\n ...LabelShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(LabelShape), LabelPropertiesSchema));\n\nconst MarkerShape = {\n offset: GraphStyleValueSchema.optional(),\n opacity: GraphStyleValueSchema.optional(),\n fill: GraphStyleValueSchema.optional(),\n size: GraphStyleValueSchema.optional(),\n marker: GraphStyleValueSchema.optional(),\n scaleWithZoom: GraphStyleValueSchema.optional()\n} as const;\n\nconst MarkerPropertiesSchema = z.object(MarkerShape).partial().strict();\n\nconst MarkerStylesheetSchema = z\n .object({\n type: z.literal('marker'),\n ...MarkerShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(MarkerShape), MarkerPropertiesSchema));\n\nconst EdgeUpperShape = {\n stroke: GraphStyleValueSchema.optional(),\n strokeWidth: GraphStyleValueSchema.optional()\n} as const;\n\nconst EdgeUpperPropertiesSchema = z.object(EdgeUpperShape).partial().strict();\n\nconst EdgeUpperStylesheetSchema = z\n .object({\n type: z.literal('Edge'),\n ...EdgeUpperShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(EdgeUpperShape), EdgeUpperPropertiesSchema));\n\nconst EdgeLowerShape = {\n stroke: GraphStyleValueSchema.optional(),\n strokeWidth: GraphStyleValueSchema.optional()\n} as const;\n\nconst EdgeLowerPropertiesSchema = z.object(EdgeLowerShape).partial().strict();\n\nconst EdgeLowerStylesheetSchema = z\n .object({\n type: z.literal('edge'),\n ...EdgeLowerShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(EdgeLowerShape), EdgeLowerPropertiesSchema));\n\nconst EdgeLabelShape = {\n color: GraphStyleValueSchema.optional(),\n text: GraphStyleValueSchema.optional(),\n fontSize: GraphStyleValueSchema.optional(),\n textAnchor: GraphStyleValueSchema.optional(),\n alignmentBaseline: GraphStyleValueSchema.optional(),\n scaleWithZoom: GraphStyleValueSchema.optional(),\n textMaxWidth: GraphStyleValueSchema.optional(),\n textWordBreak: GraphStyleValueSchema.optional(),\n textSizeMinPixels: GraphStyleValueSchema.optional()\n} as const;\n\nconst EdgeLabelPropertiesSchema = z.object(EdgeLabelShape).partial().strict();\n\nconst EdgeLabelStylesheetSchema = z\n .object({\n type: z.literal('edge-label'),\n ...EdgeLabelShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(EdgeLabelShape), EdgeLabelPropertiesSchema));\n\nconst FlowShape = {\n color: GraphStyleValueSchema.optional(),\n width: GraphStyleValueSchema.optional(),\n speed: GraphStyleValueSchema.optional(),\n tailLength: GraphStyleValueSchema.optional()\n} as const;\n\nconst FlowPropertiesSchema = z.object(FlowShape).partial().strict();\n\nconst FlowStylesheetSchema = z\n .object({\n type: z.literal('flow'),\n ...FlowShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(FlowShape), FlowPropertiesSchema));\n\nconst ArrowShape = {\n color: GraphStyleValueSchema.optional(),\n size: GraphStyleValueSchema.optional(),\n offset: GraphStyleValueSchema.optional()\n} as const;\n\nconst ArrowPropertiesSchema = z.object(ArrowShape).partial().strict();\n\nconst ArrowStylesheetSchema = z\n .object({\n type: z.literal('arrow'),\n ...ArrowShape\n })\n .catchall(z.unknown())\n .superRefine(createSelectorRefinement(Object.keys(ArrowShape), ArrowPropertiesSchema));\n\nconst GraphNodeStylesheetVariants = [\n CircleStylesheetSchema,\n RectangleStylesheetSchema,\n RoundedRectangleStylesheetSchema,\n PathRoundedRectangleStylesheetSchema,\n LabelStylesheetSchema,\n MarkerStylesheetSchema\n];\n\nconst GraphEdgeStylesheetVariants = [\n EdgeUpperStylesheetSchema,\n EdgeLowerStylesheetSchema,\n EdgeLabelStylesheetSchema,\n FlowStylesheetSchema,\n ArrowStylesheetSchema\n];\n\nconst GraphStyleRuleVariants = [...GraphNodeStylesheetVariants, ...GraphEdgeStylesheetVariants];\n\ntype GraphStyleRuleVariantSchema = (typeof GraphStyleRuleVariants)[number];\n\n/**\n * Schema that validates stylesheet definitions for all graph style primitives.\n */\nexport const GraphStyleRuleSchema = z.discriminatedUnion(\n 'type',\n GraphStyleRuleVariants as [GraphStyleRuleVariantSchema, ...GraphStyleRuleVariantSchema[]]\n);\n\n/**\n * Runtime type accepted by {@link GraphStyleRuleSchema} before validation.\n */\nexport type GraphStyleRule = z.input<typeof GraphStyleRuleSchema>;\n/**\n * Type returned by {@link GraphStyleRuleSchema} after successful parsing.\n */\nexport type GraphStyleRuleParsed = z.infer<typeof GraphStyleRuleSchema>;\n\nconst GraphNodeStyleRuleSchema = z.discriminatedUnion(\n 'type',\n GraphNodeStylesheetVariants as [\n (typeof GraphNodeStylesheetVariants)[number],\n ...(typeof GraphNodeStylesheetVariants)[number][]\n ]\n);\n\nconst GraphEdgeDecoratorRuleSchema = z.discriminatedUnion('type', [\n EdgeLabelStylesheetSchema,\n FlowStylesheetSchema,\n ArrowStylesheetSchema\n] as [\n typeof EdgeLabelStylesheetSchema,\n typeof FlowStylesheetSchema,\n typeof ArrowStylesheetSchema,\n ...Array<\n typeof EdgeLabelStylesheetSchema | typeof FlowStylesheetSchema | typeof ArrowStylesheetSchema\n >\n]);\n\nconst EdgeUpperWithDecoratorsSchema = EdgeUpperStylesheetSchema.safeExtend({\n decorators: z.array(GraphEdgeDecoratorRuleSchema).optional()\n});\n\nconst EdgeLowerWithDecoratorsSchema = EdgeLowerStylesheetSchema.safeExtend({\n decorators: z.array(GraphEdgeDecoratorRuleSchema).optional()\n});\n\nconst GraphEdgeRuleWithDecoratorsSchema = z.discriminatedUnion('type', [\n EdgeUpperWithDecoratorsSchema,\n EdgeLowerWithDecoratorsSchema\n] as [typeof EdgeUpperWithDecoratorsSchema, typeof EdgeLowerWithDecoratorsSchema]);\n\n/**\n * Schema that validates a full graph stylesheet including nodes, edges, and decorators.\n */\nexport const GraphStylesheetSchema = z\n .object({\n nodes: z.array(GraphNodeStyleRuleSchema).optional(),\n edges: z.array(GraphEdgeRuleWithDecoratorsSchema).optional()\n })\n .strict();\n\n/**\n * Runtime type accepted by {@link GraphStylesheetSchema} before validation.\n */\nexport type GraphStylesheet = z.input<typeof GraphStylesheetSchema>;\n/**\n * Type returned by {@link GraphStylesheetSchema} after successful parsing.\n */\nexport type GraphStylesheetParsed = z.infer<typeof GraphStylesheetSchema>;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nconst COMMON_DECKGL_PROPS = {\n getOffset: 'offset',\n opacity: 'opacity'\n} as const;\n\nexport const GRAPH_DECKGL_ACCESSOR_MAP = {\n circle: {\n ...COMMON_DECKGL_PROPS,\n getFillColor: 'fill',\n getLineColor: 'stroke',\n getLineWidth: 'strokeWidth',\n getRadius: 'radius'\n },\n\n rectangle: {\n ...COMMON_DECKGL_PROPS,\n getWidth: 'width',\n getHeight: 'height',\n getFillColor: 'fill',\n getLineColor: 'stroke',\n getLineWidth: 'strokeWidth'\n },\n\n 'rounded-rectangle': {\n ...COMMON_DECKGL_PROPS,\n getCornerRadius: 'cornerRadius',\n getRadius: 'radius',\n getWidth: 'width',\n getHeight: 'height',\n getFillColor: 'fill',\n getLineColor: 'stroke',\n getLineWidth: 'strokeWidth'\n },\n\n 'path-rounded-rectangle': {\n ...COMMON_DECKGL_PROPS,\n getWidth: 'width',\n getHeight: 'height',\n getFillColor: 'fill',\n getLineColor: 'stroke',\n getLineWidth: 'strokeWidth',\n getCornerRadius: 'cornerRadius'\n },\n\n label: {\n ...COMMON_DECKGL_PROPS,\n getColor: 'color',\n getText: 'text',\n getSize: 'fontSize',\n getTextAnchor: 'textAnchor',\n getAlignmentBaseline: 'alignmentBaseline',\n getAngle: 'angle',\n scaleWithZoom: 'scaleWithZoom',\n textMaxWidth: 'textMaxWidth',\n textWordBreak: 'textWordBreak',\n textSizeMinPixels: 'textSizeMinPixels'\n },\n\n marker: {\n ...COMMON_DECKGL_PROPS,\n getColor: 'fill',\n getSize: 'size',\n getMarker: 'marker',\n scaleWithZoom: 'scaleWithZoom'\n },\n\n Edge: {\n getColor: 'stroke',\n getWidth: 'strokeWidth'\n },\n edge: {\n getColor: 'stroke',\n getWidth: 'strokeWidth'\n },\n 'edge-label': {\n getColor: 'color',\n getText: 'text',\n getSize: 'fontSize',\n getTextAnchor: 'textAnchor',\n getAlignmentBaseline: 'alignmentBaseline',\n scaleWithZoom: 'scaleWithZoom',\n textMaxWidth: 'textMaxWidth',\n textWordBreak: 'textWordBreak',\n textSizeMinPixels: 'textSizeMinPixels'\n },\n flow: {\n getColor: 'color',\n getWidth: 'width',\n getSpeed: 'speed',\n getTailLength: 'tailLength'\n },\n arrow: {\n getColor: 'color',\n getSize: 'size',\n getOffset: 'offset'\n }\n} as const;\n\nexport type GraphDeckGLAccessorMap = typeof GRAPH_DECKGL_ACCESSOR_MAP;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Bounds2D} from '@math.gl/types';\n\nimport type {Graph, EdgeInterface, NodeInterface} from '../graph/graph';\nimport {ClassicGraph} from '../graph/classic-graph';\nimport {GraphLayout, type GraphLayoutEventDetail} from './graph-layout';\nimport {Cache} from './cache';\nimport {log} from '../utils/log';\nimport {\n GraphStylesheetEngine,\n type GraphStyleRule,\n type GraphStyleRuleParsed\n} from '../style/graph-style-engine';\n\ntype ClassicGraphEngineProps = {\n graph: ClassicGraph;\n layout: GraphLayout;\n onLayoutStart?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutChange?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutDone?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutError?: (error?: unknown) => void;\n onTransactionStart?: () => void;\n onTransactionEnd?: () => void;\n onNodeAdded?: (node: NodeInterface) => void;\n onNodeRemoved?: (node: NodeInterface) => void;\n onNodeUpdated?: (node: NodeInterface) => void;\n onEdgeAdded?: (edge: EdgeInterface) => void;\n onEdgeRemoved?: (edge: EdgeInterface) => void;\n onEdgeUpdated?: (edge: EdgeInterface) => void;\n};\n\ntype InterfaceGraphEngineProps = {\n graph: Graph;\n layout: GraphLayout;\n onLayoutStart?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutChange?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutDone?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutError?: (error?: unknown) => void;\n onTransactionStart?: () => void;\n onTransactionEnd?: () => void;\n onNodeAdded?: (node: NodeInterface) => void;\n onNodeRemoved?: (node: NodeInterface) => void;\n onNodeUpdated?: (node: NodeInterface) => void;\n onEdgeAdded?: (edge: EdgeInterface) => void;\n onEdgeRemoved?: (edge: EdgeInterface) => void;\n onEdgeUpdated?: (edge: EdgeInterface) => void;\n};\n\nexport type GraphEngineProps = ClassicGraphEngineProps | InterfaceGraphEngineProps;\n\n/** Graph engine controls the graph data and layout calculation */\nexport class GraphEngine {\n private _props: GraphEngineProps;\n private readonly _graph: Graph;\n private readonly _layout: GraphLayout;\n private readonly _cache = new Cache<'nodes' | 'edges', NodeInterface[] | EdgeInterface[]>();\n private _layoutDirty = false;\n private _transactionInProgress = false;\n private _graphCallbacksAttached = false;\n private _layoutCallbacksAttached = false;\n\n constructor(props: GraphEngineProps);\n /** @deprecated Use props constructor: new GraphEngine(props) */\n constructor(graph: ClassicGraph, layout: GraphLayout);\n\n constructor(props: GraphEngineProps | ClassicGraph, layout?: GraphLayout) {\n let normalizedProps: GraphEngineProps;\n if (props instanceof ClassicGraph) {\n if (!(layout instanceof GraphLayout)) {\n throw new Error('GraphEngine: legacy graphs require a GraphLayout instance.');\n }\n normalizedProps = {graph: props, layout};\n } else {\n normalizedProps = props;\n }\n\n this._props = {...normalizedProps};\n\n this._graph = normalizedProps.graph;\n this._layout = normalizedProps.layout;\n }\n\n get props(): GraphEngineProps {\n return {...this._props};\n }\n\n setProps(props: Partial<Omit<GraphEngineProps, 'graph' | 'layout'>>): void {\n this._props = {\n ...this._props,\n ...props,\n graph: this._props.graph,\n layout: this._props.layout\n } as GraphEngineProps;\n }\n\n /** Getters */\n\n getNodes = (): NodeInterface[] => {\n this._updateCache('nodes', () =>\n Array.from(this._graph.getNodes()).filter((node) => {\n const position = this.getNodePosition(node);\n return position !== null && position !== undefined;\n })\n );\n\n return (this._cache.get('nodes') as NodeInterface[]) ?? [];\n };\n\n getEdges = () => {\n this._updateCache('edges', () =>\n Array.from(this._graph.getEdges()).filter((edge) => {\n const layout = this.getEdgePosition(edge);\n return layout !== null && layout !== undefined;\n })\n );\n\n return (this._cache.get('edges') as EdgeInterface[]) ?? [];\n };\n\n getNodePosition = (node: NodeInterface) => {\n return this._layout.getNodePosition(node) ?? null;\n };\n\n getEdgePosition = (edge: EdgeInterface) => {\n return this._layout.getEdgePosition(edge) ?? null;\n };\n\n getGraphVersion = () => this._graph.version;\n\n getLayoutLastUpdate = () => this._layout.version;\n\n getLayoutState = () => this._layout.state;\n\n getLayoutBounds = (): Bounds2D | null => this._layout.getBounds() ?? null;\n\n /** Operations on the graph */\n\n lockNodePosition = (node: NodeInterface, x: number, y: number) => {\n this._layout.lockNodePosition(node, x, y);\n };\n\n unlockNodePosition = (node: NodeInterface) => {\n this._layout.unlockNodePosition(node);\n };\n\n findNode(nodeId: string | number): NodeInterface | undefined {\n return this._graph.findNode?.(nodeId) ?? this._graph.findNodeById?.(nodeId);\n }\n\n /** Creates a stylesheet engine for a single validated or raw style rule. */\n createStylesheetEngine(\n style: GraphStyleRule | GraphStyleRuleParsed,\n options: {stateUpdateTrigger?: unknown} = {}\n ): GraphStylesheetEngine {\n return new GraphStylesheetEngine(style, options);\n }\n\n /**\n * @fires GraphEngine#onLayoutStart\n */\n _onLayoutStart = (detail?: GraphLayoutEventDetail) => {\n log.log(0, 'GraphEngine: layout start')();\n this._props.onLayoutStart?.(detail);\n };\n\n /**\n * @fires GraphEngine#onLayoutChange\n */\n _onLayoutChange = (detail?: GraphLayoutEventDetail) => {\n log.log(0, 'GraphEngine: layout update event')();\n this._props.onLayoutChange?.(detail);\n };\n\n /**\n * @fires GraphEngine#onLayoutDone\n */\n _onLayoutDone = (detail?: GraphLayoutEventDetail) => {\n log.log(0, 'GraphEngine: layout end')();\n this._props.onLayoutDone?.(detail);\n };\n\n /**\n * @fires GraphEngine#onLayoutError\n */\n _onLayoutError = (error?: unknown) => {\n this._props.onLayoutError?.(error);\n };\n\n _onGraphStructureChanged = () => {\n this._layoutDirty = true;\n this._graphChanged();\n };\n\n _onTransactionStart = () => {\n this._transactionInProgress = true;\n this._props.onTransactionStart?.();\n };\n\n _onTransactionEnd = () => {\n this._transactionInProgress = false;\n this._graphChanged();\n this._props.onTransactionEnd?.();\n };\n\n /** Layout calculations */\n\n run = () => {\n log.log(1, 'GraphEngine: run');\n // TODO: throw if running on a cleared engine\n\n this._attachGraphCallbacks();\n this._attachLayoutCallbacks();\n\n this._layout.initializeGraph(this._graph);\n this._layout.start();\n };\n\n clear = () => {\n log.log(1, 'GraphEngine: end');\n this._detachGraphCallbacks();\n this._detachLayoutCallbacks();\n };\n\n resume = () => {\n this._layout.resume();\n };\n\n stop = () => {\n this._layout.stop();\n };\n\n _graphChanged = () => {\n if (this._layoutDirty && !this._transactionInProgress) {\n this._updateLayout();\n }\n };\n\n _updateLayout = () => {\n log.log(0, 'GraphEngine: layout update');\n this._layout.updateGraph(this._graph);\n this._layout.update();\n this._layoutDirty = false;\n };\n\n _updateCache(key, updateValue) {\n this._cache.set(key, updateValue, this.getGraphVersion() + this.getLayoutLastUpdate());\n }\n\n private _attachGraphCallbacks() {\n if (this._graphCallbacksAttached) {\n return;\n }\n this._graph.updateProps({\n onTransactionStart: this._onTransactionStart,\n onTransactionEnd: this._onTransactionEnd,\n onNodeAdded: (node) => {\n this._onGraphStructureChanged();\n this._props.onNodeAdded?.(node);\n },\n onNodeRemoved: (node) => {\n this._onGraphStructureChanged();\n this._props.onNodeRemoved?.(node);\n },\n onNodeUpdated: (node) => {\n this._props.onNodeUpdated?.(node);\n },\n onEdgeAdded: (edge) => {\n this._onGraphStructureChanged();\n this._props.onEdgeAdded?.(edge);\n },\n onEdgeRemoved: (edge) => {\n this._onGraphStructureChanged();\n this._props.onEdgeRemoved?.(edge);\n },\n onEdgeUpdated: (edge) => {\n this._props.onEdgeUpdated?.(edge);\n }\n });\n this._graphCallbacksAttached = true;\n }\n\n private _detachGraphCallbacks() {\n if (!this._graphCallbacksAttached) {\n return;\n }\n this._graph.updateProps({\n onTransactionStart: undefined,\n onTransactionEnd: undefined,\n onNodeAdded: undefined,\n onNodeRemoved: undefined,\n onNodeUpdated: undefined,\n onEdgeAdded: undefined,\n onEdgeRemoved: undefined,\n onEdgeUpdated: undefined\n });\n this._graphCallbacksAttached = false;\n }\n\n private _attachLayoutCallbacks() {\n if (this._layoutCallbacksAttached) {\n return;\n }\n this._layout.setProps({\n onLayoutStart: this._onLayoutStart,\n onLayoutChange: this._onLayoutChange,\n onLayoutDone: this._onLayoutDone,\n onLayoutError: this._onLayoutError\n });\n this._layoutCallbacksAttached = true;\n }\n\n private _detachLayoutCallbacks() {\n if (!this._layoutCallbacksAttached) {\n return;\n }\n this._layout.setProps({\n onLayoutStart: undefined,\n onLayoutChange: undefined,\n onLayoutDone: undefined,\n onLayoutError: undefined\n });\n this._layoutCallbacksAttached = false;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {GraphLayout, GraphLayoutProps} from '../core/graph-layout';\nimport type {Graph, NodeInterface, EdgeInterface} from '../graph/graph';\n\nexport type SimpleLayoutProps = GraphLayoutProps & {\n /** The accessor lets the application supply the position ([x, y]) of each node. */\n nodePositionAccessor?: (node: NodeInterface) => [number, number];\n};\n\n/** A basic layout where the application controls positions of each node */\nexport class SimpleLayout extends GraphLayout<SimpleLayoutProps> {\n static defaultProps: Required<SimpleLayoutProps> = {\n ...GraphLayout.defaultProps,\n nodePositionAccessor: (node) =>\n [node.getPropertyValue('x'), node.getPropertyValue('y')] as [number, number]\n };\n\n protected readonly _name = 'SimpleLayout';\n protected _graph: Graph | null = null;\n protected _nodeMap: Map<string | number, NodeInterface> = new Map();\n protected _nodePositionMap: Map<string | number, [number, number] | null> = new Map();\n\n constructor(options: SimpleLayoutProps = {}) {\n super(options, SimpleLayout.defaultProps);\n }\n\n initializeGraph(graph: Graph): void {\n this.updateGraph(graph);\n }\n\n start(): void {\n this._notifyLayoutComplete();\n }\n\n stop(): void {}\n\n update(): void {\n this._notifyLayoutComplete();\n }\n\n resume(): void {\n this._notifyLayoutComplete();\n }\n\n updateGraph(graph: Graph): void {\n this._graph = graph;\n const nodes = Array.from(graph.getNodes());\n this._nodeMap = new Map(nodes.map((node) => [node.getId(), node]));\n this._nodePositionMap = new Map(\n nodes.map((node) => [\n node.getId(),\n this._normalizePosition(this.props.nodePositionAccessor(node))\n ])\n );\n }\n\n setNodePositionAccessor = (accessor) => {\n (this.props as any).nodePositionAccessor = accessor;\n };\n\n getNodePosition = (node: NodeInterface | null): [number, number] => {\n if (!node) {\n return [0, 0] as [number, number];\n }\n const position = this._nodePositionMap.get(node.getId());\n return position ?? ([0, 0] as [number, number]);\n };\n\n getEdgePosition = (edge: EdgeInterface) => {\n const sourceNode = this._nodeMap.get(edge.getSourceNodeId());\n const targetNode = this._nodeMap.get(edge.getTargetNodeId());\n const sourcePos = sourceNode ? this.getNodePosition(sourceNode) : [0, 0];\n const targetPos = targetNode ? this.getNodePosition(targetNode) : [0, 0];\n return {\n type: 'line',\n sourcePosition: sourcePos,\n targetPosition: targetPos,\n controlPoints: []\n };\n };\n\n lockNodePosition = (node: NodeInterface, x: number, y: number) => {\n this._nodePositionMap.set(node.getId(), [x, y]);\n this._onLayoutChange();\n this._onLayoutDone();\n };\n\n _notifyLayoutComplete(): void {\n this._onLayoutStart();\n this._onLayoutChange();\n this._onLayoutDone();\n }\n\n protected override _updateBounds(): void {\n const positions = Array.from(this._nodePositionMap.values(), (position) =>\n this._normalizePosition(position)\n );\n this._bounds = this._calculateBounds(positions);\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {GraphLayout, GraphLayoutProps} from '../../core/graph-layout';\nimport type {Graph, NodeInterface, EdgeInterface} from '../../graph/graph';\nimport {log} from '../../utils/log';\n\nexport type D3ForceLayoutOptions = GraphLayoutProps & {\n alpha?: number;\n resumeAlpha?: number;\n nBodyStrength?: number;\n nBodyDistanceMin?: number;\n nBodyDistanceMax?: number;\n getCollisionRadius?: number;\n};\n\nexport class D3ForceLayout extends GraphLayout<D3ForceLayoutOptions> {\n static defaultProps = {\n ...GraphLayout.defaultProps,\n alpha: 0.3,\n resumeAlpha: 0.1,\n nBodyStrength: -900,\n nBodyDistanceMin: 100,\n nBodyDistanceMax: 400,\n getCollisionRadius: 0\n } as const satisfies Readonly<Required<D3ForceLayoutOptions>>;\n\n protected readonly _name = 'D3';\n private _positionsByNodeId = new Map<string | number, any>();\n private _graph: Graph | null = null;\n private _worker: Worker | null = null;\n\n constructor(props?: D3ForceLayoutOptions) {\n super(props, D3ForceLayout.defaultProps);\n }\n\n initializeGraph(graph: Graph) {\n this._graph = graph;\n }\n\n // for streaming new data on the same graph\n updateGraph(graph: Graph) {\n this._graph = graph;\n\n this._positionsByNodeId = new Map(\n Array.from(this._graph.getNodes(), (node) => {\n const id = node.getId();\n return [id, this._positionsByNodeId.get(id)];\n })\n );\n }\n\n start() {\n this._engageWorker();\n\n this._onLayoutStart();\n }\n\n update() {\n this._engageWorker();\n }\n\n _engageWorker() {\n // prevent multiple start\n if (this._worker) {\n this._worker.terminate();\n }\n\n this._worker = new Worker(new URL('./worker.js', import.meta.url).href);\n\n if (!this._graph) {\n return;\n }\n\n const options = {...this.props};\n delete options.onLayoutStart;\n delete options.onLayoutChange;\n delete options.onLayoutDone;\n delete options.onLayoutError;\n\n this._worker.postMessage({\n nodes: Array.from(this._graph.getNodes(), (node) => {\n const id = node.getId();\n return {\n id,\n ...this._positionsByNodeId.get(id)\n };\n }),\n edges: Array.from(this._graph.getEdges(), (edge) => ({\n id: edge.getId(),\n source: edge.getSourceNodeId(),\n target: edge.getTargetNodeId()\n })),\n options\n });\n\n this._worker.onmessage = (event) => {\n log.log(0, 'D3ForceLayout: worker message', event.data?.type, event.data);\n if (event.data.type !== 'end') {\n return;\n }\n\n event.data.nodes.forEach(({id, ...d3}) =>\n this._positionsByNodeId.set(id, {\n ...d3,\n // precompute so that when we return the node position we do not need to do the conversion\n coordinates: [d3.x, d3.y]\n })\n );\n\n this._onLayoutChange();\n this._onLayoutDone();\n };\n }\n\n resume() {\n throw new Error('Resume unavailable');\n }\n\n stop() {\n if (this._worker) {\n this._worker.terminate();\n this._worker = null;\n }\n }\n\n getEdgePosition = (edge: EdgeInterface) => {\n if (!this._graph) {\n return null;\n }\n\n const sourceNode = this._graph.findNode(edge.getSourceNodeId());\n const targetNode = this._graph.findNode(edge.getTargetNodeId());\n if (!sourceNode || !targetNode) {\n return null;\n }\n\n const sourcePosition = this.getNodePosition(sourceNode);\n const targetPosition = this.getNodePosition(targetNode);\n\n if (!sourcePosition || !targetPosition) {\n return null;\n }\n\n return {\n type: 'line',\n sourcePosition,\n targetPosition,\n controlPoints: []\n };\n };\n\n getNodePosition = (node: NodeInterface | null) => {\n if (!node) {\n return null;\n }\n\n const d3Node = this._positionsByNodeId.get(node.getId());\n if (d3Node) {\n return d3Node.coordinates;\n }\n\n return null;\n };\n\n lockNodePosition = (node: NodeInterface, x: number, y: number) => {\n const id = node.getId();\n const d3Node = this._positionsByNodeId.get(id);\n this._positionsByNodeId.set(id, {\n ...d3Node,\n x,\n y,\n fx: x,\n fy: y,\n coordinates: [x, y]\n });\n this._onLayoutChange();\n this._onLayoutDone();\n };\n\n unlockNodePosition = (node: NodeInterface) => {\n const id = node.getId();\n const d3Node = this._positionsByNodeId.get(id);\n if (!d3Node) {\n return;\n }\n d3Node.fx = null;\n d3Node.fy = null;\n };\n\n protected override _updateBounds(): void {\n const positions = Array.from(\n this._positionsByNodeId.values(),\n (data) => data?.coordinates as [number, number] | null | undefined\n );\n this._bounds = this._calculateBounds(positions);\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable no-continue, complexity, max-statements */\n\nimport {GraphLayout, GraphLayoutProps} from '../../core/graph-layout';\nimport type {Graph, NodeInterface, EdgeInterface} from '../../graph/graph';\nimport {Node} from '../../graph/node';\nimport {\n coordCenter,\n coordGreedy,\n coordQuad,\n coordSimplex,\n coordTopological,\n decrossDfs,\n decrossOpt,\n decrossTwoLayer,\n graph as createDagGraph,\n graphConnect,\n graphStratify,\n grid,\n layeringLongestPath,\n layeringSimplex,\n layeringTopological,\n sugiyama,\n zherebko,\n // type Coord,\n // type Decross,\n type DefaultGrid,\n type DefaultSugiyama,\n type DefaultZherebko,\n type LayoutResult,\n type MutGraph,\n type MutGraphNode,\n type MutGraphLink,\n type NodeSize\n} from 'd3-dag';\nimport {log} from '../../utils/log';\n\nexport type D3DagLayoutProps = GraphLayoutProps & {\n /** Which high-level layout operator to use. */\n layout?: 'sugiyama' | 'grid' | 'zherebko';\n /** Layering operator used by sugiyama layouts. */\n layering?: 'simplex' | 'longestPath' | 'topological';\n /** Accessor for node rank for layering */\n nodeRank?: string | ((node: NodeInterface) => number | undefined);\n /** Decrossing operator used by sugiyama layouts. */\n decross?: 'twoLayer' | 'opt' | 'dfs';\n /** Coordinate assignment operator used by sugiyama layouts. */\n coord?: 'simplex' | 'greedy' | 'quad' | 'center' | 'topological';\n /** Node sizing accessor passed to the active layout. */\n nodeSize?: NodeSize<NodeInterface, EdgeInterface>;\n /** Optional gap between nodes. Alias: separation. */\n gap?: readonly [number, number];\n /** Optional gap between nodes. */\n separation?: readonly [number, number];\n /** Orientation transform applied after the layout finishes. */\n orientation?: 'TB' | 'BT' | 'LR' | 'RL';\n /** Whether to center the layout along each axis. */\n center?: boolean | {x?: boolean; y?: boolean};\n /** How to convert the Graph into a DAG. */\n dagBuilder?: 'graph' | 'connect' | 'stratify';\n\n customDagBuilder?: DagBuilder;\n customLayout?: D3DagLayoutOperator;\n customLayering?: LayeringOperator;\n customDecross?: DecrossOperator;\n customCoord?: CoordOperator;\n};\n\nexport type D3DagLayoutOperator =\n | DefaultSugiyama\n | DefaultGrid\n | DefaultZherebko\n | ((dag: MutGraph<NodeInterface, EdgeInterface>) => LayoutResult);\n\ntype DagBuilder = (graph: Graph) => MutGraph<NodeInterface, EdgeInterface>;\n\ntype LayeringOperator =\n | ReturnType<typeof layeringSimplex>\n | ReturnType<typeof layeringLongestPath>\n | ReturnType<typeof layeringTopological>;\ntype DecrossOperator =\n | ReturnType<typeof decrossTwoLayer>\n | ReturnType<typeof decrossOpt>\n | ReturnType<typeof decrossDfs>;\ntype CoordOperator =\n | ReturnType<typeof coordCenter>\n | ReturnType<typeof coordGreedy>\n | ReturnType<typeof coordQuad>\n | ReturnType<typeof coordSimplex>\n | ReturnType<typeof coordTopological>;\n\ntype LayoutCallable = (dag: MutGraph<NodeInterface, EdgeInterface>) => LayoutResult;\n\ntype LayoutWithConfiguration = LayoutCallable & {\n layering?: (layer?: any) => any;\n decross?: (decross?: any) => any;\n coord?: (coord?: any) => any;\n nodeSize?: (size?: NodeSize<NodeInterface, EdgeInterface>) => any;\n gap?: (gap?: readonly [number, number]) => any;\n};\n\ntype DagBounds = {\n minX: number;\n maxX: number;\n minY: number;\n maxY: number;\n centerX: number;\n centerY: number;\n};\n\nconst DAG_ID_SEPARATOR = '::';\n\nconst DEFAULT_NODE_SIZE: readonly [number, number] = [140, 120];\nconst DEFAULT_GAP: readonly [number, number] = [0, 0];\n\nconst LAYERING_FACTORIES = {\n simplex: layeringSimplex,\n longestPath: layeringLongestPath,\n topological: layeringTopological\n} as const satisfies Record<string, () => LayeringOperator>;\n\nconst DECROSS_FACTORIES = {\n twoLayer: decrossTwoLayer,\n opt: decrossOpt,\n dfs: decrossDfs\n} as const satisfies Record<string, () => DecrossOperator>;\n\nconst COORD_FACTORIES = {\n simplex: coordSimplex,\n greedy: coordGreedy,\n quad: coordQuad,\n center: coordCenter,\n topological: coordTopological\n} as const satisfies Record<string, () => CoordOperator>;\n\nconst LAYOUT_FACTORIES = {\n sugiyama: () => sugiyama(),\n grid: () => grid(),\n zherebko: () => zherebko()\n} as const satisfies Record<string, () => LayoutWithConfiguration>;\n\nfunction isNodeInterface(value: unknown): value is NodeInterface {\n return Boolean(value) && typeof value === 'object' && (value as NodeInterface).isNode === true;\n}\n\nfunction isEdgeInterface(value: unknown): value is EdgeInterface {\n return Boolean(value) && typeof value === 'object' && (value as EdgeInterface).isEdge === true;\n}\n\n/**\n * Layout that orchestrates d3-dag operators from declarative options.\n */\nexport class D3DagLayout<\n PropsT extends D3DagLayoutProps = D3DagLayoutProps\n> extends GraphLayout<PropsT> {\n static defaultProps: Readonly<Required<D3DagLayoutProps>> = {\n ...GraphLayout.defaultProps,\n layout: 'sugiyama',\n layering: 'topological',\n decross: 'twoLayer',\n coord: 'greedy',\n nodeRank: undefined,\n nodeSize: DEFAULT_NODE_SIZE,\n gap: DEFAULT_GAP,\n separation: DEFAULT_GAP,\n orientation: 'TB',\n center: true,\n dagBuilder: 'graph',\n\n customLayout: undefined,\n customLayering: undefined,\n customDecross: undefined,\n customCoord: undefined,\n customDagBuilder: undefined\n } as const;\n\n protected readonly _name = 'D3DagLayout';\n\n protected _graph: Graph | null = null;\n private _dag: MutGraph<NodeInterface, EdgeInterface> | null = null;\n private _layoutOperator: LayoutWithConfiguration | null = null;\n private _rawNodePositions = new Map<string | number, [number, number]>();\n private _rawEdgePoints = new Map<string | number, [number, number][]>();\n private _nodePositions = new Map<string | number, [number, number]>();\n private _edgePoints = new Map<string | number, [number, number][]>();\n private _edgeControlPoints = new Map<string | number, [number, number][]>();\n private _lockedNodePositions = new Map<string | number, [number, number]>();\n private _dagBounds: DagBounds | null = null;\n\n protected _nodeLookup = new Map<string | number, NodeInterface>();\n protected _stringIdLookup = new Map<string, string | number>();\n protected _edgeLookup = new Map<string, EdgeInterface>();\n protected _incomingParentMap = new Map<string | number, (string | number)[]>();\n\n constructor(props: D3DagLayoutProps, defaultProps?: Required<PropsT>) {\n // @ts-expect-error TS2345 - Type 'Required<D3DagLayoutProps>' is not assignable to type 'Required<PropsT>'.\n super(props, defaultProps || D3DagLayout.defaultProps);\n }\n\n setProps(options: Partial<D3DagLayoutProps>): void {\n this.props = {...this.props, ...options};\n if (\n options.layout !== undefined ||\n options.layering !== undefined ||\n options.decross !== undefined ||\n options.coord !== undefined ||\n options.nodeSize !== undefined ||\n options.gap !== undefined ||\n options.separation !== undefined\n ) {\n this._layoutOperator = null;\n }\n }\n\n initializeGraph(graph: Graph): void {\n this.updateGraph(graph);\n }\n\n updateGraph(graph: Graph): void {\n this._graph = graph;\n this._nodeLookup = new Map();\n this._stringIdLookup = new Map();\n this._edgeLookup = new Map();\n this._incomingParentMap = new Map();\n\n for (const node of graph.getNodes()) {\n const id = node.getId();\n const key = this._toDagId(id);\n this._nodeLookup.set(id, node);\n this._stringIdLookup.set(key, id);\n }\n\n for (const edge of graph.getEdges()) {\n if (!edge.isDirected()) {\n continue;\n }\n const key = this._edgeKey(edge.getSourceNodeId(), edge.getTargetNodeId());\n this._edgeLookup.set(key, edge);\n\n const targetId = edge.getTargetNodeId();\n const parents = this._incomingParentMap.get(targetId) ?? [];\n parents.push(edge.getSourceNodeId());\n this._incomingParentMap.set(targetId, parents);\n }\n }\n\n start(): void {\n this._runLayout();\n }\n\n update(): void {\n this._runLayout();\n }\n\n resume(): void {\n this._runLayout();\n }\n\n stop(): void {}\n\n toggleCollapsedChain(chainId: string): void {\n log.log(1, `D3DagLayout: toggleCollapsedChain(${chainId}) ignored (collapsing disabled)`);\n }\n\n setCollapsedChains(chainIds: Iterable<string>): void {\n const desired = Array.isArray(chainIds) ? chainIds : Array.from(chainIds);\n log.log(1, `D3DagLayout: setCollapsedChains(${desired.length}) ignored (collapsing disabled)`);\n }\n\n getNodePosition(node: NodeInterface): [number, number] | null {\n if (this._shouldSkipNode(node.getId())) {\n return null;\n }\n const mappedId = this._mapNodeId(node.getId());\n return this._nodePositions.get(mappedId) || null;\n }\n\n getEdgePosition(edge: EdgeInterface): {\n type: string;\n sourcePosition: [number, number];\n targetPosition: [number, number];\n controlPoints: [number, number][];\n } | null {\n const mappedSourceId = this._mapNodeId(edge.getSourceNodeId());\n const mappedTargetId = this._mapNodeId(edge.getTargetNodeId());\n if (mappedSourceId === mappedTargetId) {\n return null;\n }\n\n const sourcePosition = this._nodePositions.get(mappedSourceId);\n const targetPosition = this._nodePositions.get(mappedTargetId);\n if (!sourcePosition || !targetPosition) {\n return null;\n }\n\n if (!this._edgePoints.has(edge.getId())) {\n return null;\n }\n\n // const points = this._edgePoints.get(edge.getId()) || [sourcePosition, targetPosition];\n const controlPoints = this._edgeControlPoints.get(edge.getId()) || [];\n const edgeType = controlPoints.length ? 'spline-curve' : 'line';\n\n return {\n type: edgeType,\n sourcePosition,\n targetPosition,\n controlPoints\n };\n }\n\n getLinkControlPoints(edge: EdgeInterface): [number, number][] {\n return this._edgeControlPoints.get(edge.getId()) || [];\n }\n\n lockNodePosition(node: NodeInterface, x: number, y: number): void {\n this._lockedNodePositions.set(node.getId(), [x, y]);\n this._nodePositions.set(node.getId(), [x, y]);\n this._onLayoutChange();\n this._onLayoutDone();\n }\n\n unlockNodePosition(node: NodeInterface): void {\n this._lockedNodePositions.delete(node.getId());\n }\n\n protected _runLayout(): void {\n if (!this._graph) {\n return;\n }\n this._refreshCollapsedChains();\n this._onLayoutStart();\n\n try {\n this._dag = this._buildDag();\n const layout = this._getLayoutOperator();\n layout(this._dag);\n this._cacheGeometry();\n this._onLayoutChange();\n this._onLayoutDone();\n } catch (error) {\n this._onLayoutError();\n throw error;\n }\n }\n\n protected _refreshCollapsedChains(): void {\n this._updateCollapsedChainNodeMetadata();\n }\n\n private _buildDag(): MutGraph<NodeInterface, EdgeInterface> {\n if (this.props.customDagBuilder) {\n const dag = this.props.customDagBuilder(this._graph);\n return this._ensureEdgeData(dag);\n }\n\n switch (this.props.dagBuilder) {\n case 'connect':\n return this._buildDagWithConnect();\n case 'stratify':\n return this._buildDagWithStratify();\n case 'graph':\n default:\n return this._buildDagWithGraph();\n }\n }\n\n private _buildDagWithGraph(): MutGraph<NodeInterface, EdgeInterface> {\n const dag = createDagGraph<NodeInterface, EdgeInterface>();\n const dagNodeLookup = new Map<string | number, MutGraphNode<NodeInterface, EdgeInterface>>();\n\n for (const node of this._graph.getNodes()) {\n if (this._shouldSkipNode(node.getId())) {\n continue;\n }\n const dagNode = dag.node(node);\n dagNodeLookup.set(node.getId(), dagNode);\n }\n\n for (const edge of this._graph.getEdges()) {\n if (!edge.isDirected()) {\n continue;\n }\n const sourceId = this._mapNodeId(edge.getSourceNodeId());\n const targetId = this._mapNodeId(edge.getTargetNodeId());\n if (sourceId === targetId) {\n continue;\n }\n const source = dagNodeLookup.get(sourceId);\n const target = dagNodeLookup.get(targetId);\n if (!source || !target) {\n continue;\n }\n dag.link(source, target, edge);\n }\n\n return dag;\n }\n\n private _buildDagWithConnect(): MutGraph<NodeInterface, EdgeInterface> {\n type ConnectDatum = {source: string; target: string; edge: EdgeInterface};\n\n const connect = graphConnect()\n .sourceId(({source}: ConnectDatum): string => source)\n .targetId(({target}: ConnectDatum): string => target)\n .nodeDatum(\n (id: string): NodeInterface => this._nodeLookup.get(this._fromDagId(id)) ?? new Node({id})\n )\n .single(true);\n\n const edges = Array.from(this._graph.getEdges());\n\n const data: ConnectDatum[] = edges\n .filter((edge) => edge.isDirected())\n .map((edge) => {\n const sourceId = this._mapNodeId(edge.getSourceNodeId());\n const targetId = this._mapNodeId(edge.getTargetNodeId());\n return {sourceId, targetId, edge};\n })\n .filter(({sourceId, targetId}) => sourceId !== targetId)\n .map(({sourceId, targetId, edge}) => ({\n source: this._toDagId(sourceId),\n target: this._toDagId(targetId),\n edge\n }));\n\n const dag = connect(data);\n\n const seenIds = new Set<string | number>();\n for (const dagNode of dag.nodes()) {\n const datum = dagNode.data;\n if (isNodeInterface(datum)) {\n seenIds.add(datum.getId());\n }\n }\n\n for (const node of this._graph.getNodes()) {\n if (this._shouldSkipNode(node.getId())) {\n continue;\n }\n if (!seenIds.has(node.getId())) {\n dag.node(node);\n }\n }\n\n return this._ensureEdgeData(dag);\n }\n\n private _buildDagWithStratify(): MutGraph<NodeInterface, EdgeInterface> {\n const stratify = graphStratify()\n .id((node: NodeInterface): string => this._toDagId(node.getId()))\n .parentIds((node: NodeInterface): Iterable<string> => {\n const parentIds = this._incomingParentMap.get(node.getId()) ?? [];\n const mapped = new Set<string>();\n for (const parentId of parentIds) {\n if (!this._nodeLookup.has(parentId)) {\n continue;\n }\n const mappedId = this._mapNodeId(parentId);\n if (mappedId === node.getId()) {\n continue;\n }\n mapped.add(this._toDagId(mappedId));\n }\n return mapped;\n });\n\n const nodes = Array.from(this._graph.getNodes());\n const dag = stratify(nodes.filter((node) => !this._shouldSkipNode(node.getId())));\n return this._ensureEdgeData(dag);\n }\n\n protected _shouldSkipNode(_nodeId: string | number): boolean {\n return false;\n }\n\n protected _mapNodeId(nodeId: string | number): string | number {\n return nodeId;\n }\n\n protected _updateCollapsedChainNodeMetadata(): void {\n if (!this._graph) {\n return;\n }\n for (const node of this._graph.getNodes()) {\n node.setDataProperty('collapsedChainId', null);\n node.setDataProperty('collapsedChainLength', 1);\n node.setDataProperty('collapsedNodeIds', []);\n node.setDataProperty('collapsedEdgeIds', []);\n node.setDataProperty('collapsedChainRepresentativeId', null);\n node.setDataProperty('isCollapsedChain', false);\n }\n }\n\n protected _getIncomingEdges(node: NodeInterface): EdgeInterface[] {\n const nodeId = node.getId();\n return node\n .getConnectedEdges()\n .filter((edge) => edge.isDirected() && edge.getTargetNodeId() === nodeId);\n }\n\n protected _getOutgoingEdges(node: NodeInterface): EdgeInterface[] {\n const nodeId = node.getId();\n return node\n .getConnectedEdges()\n .filter((edge) => edge.isDirected() && edge.getSourceNodeId() === nodeId);\n }\n\n private _ensureEdgeData<T>(\n dag: MutGraph<NodeInterface, T>\n ): MutGraph<NodeInterface, EdgeInterface> {\n for (const link of dag.links()) {\n if (isEdgeInterface(link.data)) {\n continue;\n }\n const sourceNode = link.source.data;\n const targetNode = link.target.data;\n if (!isNodeInterface(sourceNode) || !isNodeInterface(targetNode)) {\n continue;\n }\n const key = this._edgeKey(sourceNode.getId(), targetNode.getId());\n const edge = this._edgeLookup.get(key);\n if (edge) {\n (link as unknown as MutGraphLink<NodeInterface, EdgeInterface>).data = edge;\n }\n }\n\n return dag as unknown as MutGraph<NodeInterface, EdgeInterface>;\n }\n\n private _getLayoutOperator(): LayoutWithConfiguration {\n if (this._layoutOperator) {\n return this._layoutOperator;\n }\n\n const layoutOption = this.props.layout ?? D3DagLayout.defaultProps.layout;\n let layout: LayoutWithConfiguration;\n\n if (typeof layoutOption === 'string') {\n layout = LAYOUT_FACTORIES[layoutOption]();\n } else {\n layout = layoutOption as LayoutWithConfiguration;\n }\n\n // TODO - is 'none' operator an option in d3-dag?\n if (layout.layering && this.props.layering) {\n let layeringOperator = this.props.customLayering || LAYERING_FACTORIES[this.props.layering]();\n layout = layout.layering(layeringOperator);\n const {nodeRank} = this.props;\n if (nodeRank) {\n // @ts-expect-error TS2345 - Argument of type '(dagNode: MutGraphNode<NodeInterface, EdgeInterface>) => number | undefined' is not assignable to parameter of type '(dagNode: MutGraphNode<NodeInterface, EdgeInterface>) => number'.\n layeringOperator = layeringOperator.rank((dagNode) => {\n const node = dagNode.data as NodeInterface;\n const rank =\n typeof nodeRank === 'function'\n ? nodeRank?.(node)\n : node?.getPropertyValue(nodeRank) || undefined;\n // if (rank !== undefined) {\n // console.log(`Node ${node.getId()} assigned to rank ${rank}`);\n // }\n return rank;\n });\n }\n layout = layout.layering(layeringOperator);\n }\n\n if (layout.decross && this.props.decross) {\n const decrossOperator = this.props.customDecross || DECROSS_FACTORIES[this.props.decross]();\n layout = layout.decross(decrossOperator);\n }\n\n if (layout.coord && this.props.coord) {\n const coordOperator = this.props.customCoord || COORD_FACTORIES[this.props.coord]();\n layout = layout.coord(coordOperator);\n }\n\n const nodeSize = this.props.nodeSize ?? DEFAULT_NODE_SIZE;\n if (layout.nodeSize) {\n layout = layout.nodeSize(nodeSize);\n }\n\n const gap = this.props.separation ?? this.props.gap ?? DEFAULT_GAP;\n if (layout.gap) {\n layout = layout.gap(gap);\n }\n\n this._layoutOperator = layout;\n return layout;\n }\n\n private _cacheGeometry(): void {\n this._rawNodePositions.clear();\n this._rawEdgePoints.clear();\n\n if (!this._dag) {\n this._dagBounds = null;\n this._bounds = null;\n return;\n }\n\n let minX = Number.POSITIVE_INFINITY;\n let maxX = Number.NEGATIVE_INFINITY;\n let minY = Number.POSITIVE_INFINITY;\n let maxY = Number.NEGATIVE_INFINITY;\n\n for (const dagNode of this._dag.nodes()) {\n const node = dagNode.data;\n const id = node.getId();\n const x = dagNode.x ?? 0;\n const y = dagNode.y ?? 0;\n\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n\n this._rawNodePositions.set(id, [x, y]);\n }\n\n if (minX === Number.POSITIVE_INFINITY) {\n this._dagBounds = null;\n this._bounds = null;\n this._nodePositions.clear();\n this._edgePoints.clear();\n this._edgeControlPoints.clear();\n return;\n }\n\n this._dagBounds = {\n minX,\n maxX,\n minY,\n maxY,\n centerX: (minX + maxX) / 2,\n centerY: (minY + maxY) / 2\n };\n\n for (const link of this._dag.links()) {\n const source = link.source.data;\n const target = link.target.data;\n if (!isNodeInterface(source) || !isNodeInterface(target)) {\n continue;\n }\n const edge = isEdgeInterface(link.data)\n ? link.data\n : this._edgeLookup.get(this._edgeKey(source.getId(), target.getId()));\n if (!edge) {\n continue;\n }\n const points =\n link.points && link.points.length\n ? link.points\n : [\n [link.source.x ?? 0, link.source.y ?? 0],\n [link.target.x ?? 0, link.target.y ?? 0]\n ];\n this._rawEdgePoints.set(\n edge.getId(),\n points.map((point) => [...point] as [number, number])\n );\n }\n\n this._updateTransformedGeometry();\n }\n\n private _updateTransformedGeometry(): void {\n this._nodePositions.clear();\n this._edgePoints.clear();\n this._edgeControlPoints.clear();\n\n if (!this._dagBounds) {\n this._bounds = null;\n return;\n }\n\n const {offsetX, offsetY} = this._getOffsets();\n const orientation = this.props.orientation ?? D3DagLayout.defaultProps.orientation;\n\n const transform = (x: number, y: number): [number, number] => {\n const localX = x - offsetX;\n const localY = y - offsetY;\n switch (orientation) {\n case 'BT':\n return [localX, localY];\n case 'LR':\n return [localY, localX];\n case 'RL':\n return [-localY, localX];\n case 'TB':\n default:\n return [localX, -localY];\n }\n };\n\n for (const [id, [x, y]] of this._rawNodePositions) {\n this._nodePositions.set(id, transform(x, y));\n }\n\n for (const [edgeId, points] of this._rawEdgePoints) {\n const transformed = points.map(([x, y]) => transform(x, y));\n this._edgePoints.set(edgeId, transformed);\n this._edgeControlPoints.set(edgeId, transformed.length > 2 ? transformed.slice(1, -1) : []);\n }\n\n for (const [id, position] of this._lockedNodePositions) {\n this._nodePositions.set(id, position);\n }\n\n this._bounds = this._calculateBounds(this._nodePositions.values());\n }\n\n private _getOffsets(): {offsetX: number; offsetY: number} {\n if (!this._dagBounds) {\n return {offsetX: 0, offsetY: 0};\n }\n const centerOption = this.props.center ?? true;\n let offsetX = 0;\n let offsetY = 0;\n if (centerOption === true) {\n offsetX = this._dagBounds.centerX;\n offsetY = this._dagBounds.centerY;\n } else if (centerOption && typeof centerOption === 'object') {\n if (centerOption.x) {\n offsetX = this._dagBounds.centerX;\n }\n if (centerOption.y) {\n offsetY = this._dagBounds.centerY;\n }\n }\n return {offsetX, offsetY};\n }\n\n protected override _updateBounds(): void {\n this._bounds = this._calculateBounds(this._nodePositions.values());\n }\n\n protected _edgeKey(sourceId: string | number, targetId: string | number): string {\n return `${this._toDagId(sourceId)}${DAG_ID_SEPARATOR}${this._toDagId(targetId)}`;\n }\n\n protected _toDagId(id: string | number): string {\n return String(id);\n }\n\n protected _fromDagId(id: string): string | number {\n return this._stringIdLookup.get(id) ?? id;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable no-continue, complexity, max-statements */\n\nimport type {Graph, NodeInterface, EdgeInterface} from '../../graph/graph';\nimport {log} from '../../utils/log';\n\nimport {D3DagLayout, type D3DagLayoutProps} from './d3-dag-layout';\n\ntype CollapsedChainDescriptor = {\n id: string;\n nodeIds: (string | number)[];\n edgeIds: (string | number)[];\n representativeId: string | number;\n};\n\nexport type CollapsableD3DagLayoutProps = D3DagLayoutProps & {\n /** Whether to collapse linear chains of nodes into a single representative. */\n collapseLinearChains?: boolean;\n};\n\nexport class CollapsableD3DagLayout extends D3DagLayout<CollapsableD3DagLayoutProps> {\n static override defaultProps: Required<CollapsableD3DagLayoutProps> = {\n ...D3DagLayout.defaultProps,\n collapseLinearChains: false\n };\n\n private _chainDescriptors = new Map<string, CollapsedChainDescriptor>();\n private _nodeToChainId = new Map<string | number, string>();\n private _collapsedChainState = new Map<string, boolean>();\n private _hiddenNodeIds = new Set<string | number>();\n\n constructor(props: CollapsableD3DagLayoutProps = {}) {\n super(props, CollapsableD3DagLayout.defaultProps);\n }\n\n override setProps(props: Partial<CollapsableD3DagLayoutProps>): void {\n super.setProps(props);\n if (props.collapseLinearChains !== undefined && this._graph) {\n this._runLayout();\n }\n }\n\n override updateGraph(graph: Graph): void {\n super.updateGraph(graph);\n this._chainDescriptors.clear();\n this._nodeToChainId.clear();\n this._hiddenNodeIds.clear();\n }\n\n override toggleCollapsedChain(chainId: string): void {\n if (!this._graph) {\n log.log(1, `CollapsableD3DagLayout: toggleCollapsedChain(${chainId}) ignored (no graph)`);\n return;\n }\n\n if (!this._chainDescriptors.has(chainId)) {\n this._refreshCollapsedChains();\n }\n\n if (!this._chainDescriptors.has(chainId)) {\n log.log(\n 1,\n `CollapsableD3DagLayout: toggleCollapsedChain(${chainId}) skipped (unknown chain)`\n );\n return;\n }\n\n const collapsed = this._isChainCollapsed(chainId);\n const nextState = !collapsed;\n log.log(\n 0,\n `CollapsableD3DagLayout: toggleCollapsedChain(${chainId}) -> ${nextState ? 'collapsed' : 'expanded'}`\n );\n // eslint-disable-next-line no-console\n console.log(\n `CollapsableD3DagLayout: toggleCollapsedChain(${chainId}) -> ${nextState ? 'collapsed' : 'expanded'}`\n );\n this._collapsedChainState.set(chainId, nextState);\n this._runLayout();\n }\n\n override setCollapsedChains(chainIds: Iterable<string>): void {\n if (!this._graph) {\n log.log(1, 'CollapsableD3DagLayout: setCollapsedChains ignored (no graph)');\n return;\n }\n\n if (!this._chainDescriptors.size) {\n this._refreshCollapsedChains();\n }\n\n const desired = new Set(chainIds);\n log.log(0, `CollapsableD3DagLayout: setCollapsedChains(${desired.size}) requested`);\n\n let changed = false;\n for (const chainId of this._chainDescriptors.keys()) {\n const next = desired.has(chainId);\n if (this._isChainCollapsed(chainId) !== next) {\n this._collapsedChainState.set(chainId, next);\n changed = true;\n }\n }\n\n if (changed) {\n log.log(\n 0,\n 'CollapsableD3DagLayout: setCollapsedChains -> changes detected, rerunning layout'\n );\n // eslint-disable-next-line no-console\n console.log(\n 'CollapsableD3DagLayout: setCollapsedChains -> changes detected, rerunning layout'\n );\n this._runLayout();\n } else {\n log.log(1, 'CollapsableD3DagLayout: setCollapsedChains -> no changes');\n // eslint-disable-next-line no-console\n console.log('CollapsableD3DagLayout: setCollapsedChains -> no changes');\n }\n }\n\n protected override _refreshCollapsedChains(): void {\n const previousChainCount = this._chainDescriptors.size;\n\n if (!this._graph) {\n if (previousChainCount > 0) {\n log.log(0, 'CollapsableD3DagLayout: clearing collapsed chains (graph unavailable)');\n // eslint-disable-next-line no-console\n console.log('CollapsableD3DagLayout: clearing collapsed chains (graph unavailable)');\n }\n this._chainDescriptors.clear();\n this._nodeToChainId.clear();\n this._hiddenNodeIds.clear();\n this._updateCollapsedChainNodeMetadata();\n return;\n }\n\n log.log(\n 0,\n `CollapsableD3DagLayout: refreshing collapsed chains (previous=${previousChainCount})`\n );\n // eslint-disable-next-line no-console\n console.log(\n `CollapsableD3DagLayout: refreshing collapsed chains (previous=${previousChainCount})`\n );\n\n const collapseDefault = this.props.collapseLinearChains;\n\n const previousStates = new Map(this._collapsedChainState);\n\n this._chainDescriptors.clear();\n this._nodeToChainId.clear();\n this._hiddenNodeIds.clear();\n\n const nodes = this._graph.getNodes();\n const candidateNodes = new Set<string | number>();\n const incomingCache = new Map<string | number, EdgeInterface[]>();\n const outgoingCache = new Map<string | number, EdgeInterface[]>();\n\n for (const node of nodes) {\n const incoming = this._getIncomingEdges(node);\n const outgoing = this._getOutgoingEdges(node);\n incomingCache.set(node.getId(), incoming);\n outgoingCache.set(node.getId(), outgoing);\n if (incoming.length <= 1 && outgoing.length <= 1 && incoming.length + outgoing.length > 0) {\n candidateNodes.add(node.getId());\n }\n }\n\n const visited = new Set<string | number>();\n for (const node of nodes) {\n const nodeId = node.getId();\n if (!candidateNodes.has(nodeId) || visited.has(nodeId)) {\n continue;\n }\n\n const incoming = incomingCache.get(nodeId) ?? [];\n const hasCandidateParent =\n incoming.length === 1 && candidateNodes.has(incoming[0].getSourceNodeId());\n if (hasCandidateParent) {\n continue;\n }\n\n const chainNodeIds: (string | number)[] = [];\n const chainEdgeIds: (string | number)[] = [];\n let currentNode: NodeInterface | undefined = node;\n\n while (currentNode) {\n const currentId = currentNode.getId();\n if (!candidateNodes.has(currentId) || visited.has(currentId)) {\n break;\n }\n\n visited.add(currentId);\n chainNodeIds.push(currentId);\n\n const outgoing = outgoingCache.get(currentId) ?? [];\n if (outgoing.length !== 1) {\n break;\n }\n\n const nextEdge = outgoing[0];\n const nextNodeId = nextEdge.getTargetNodeId();\n if (!candidateNodes.has(nextNodeId)) {\n break;\n }\n\n const nextIncoming = incomingCache.get(nextNodeId) ?? [];\n if (nextIncoming.length !== 1) {\n break;\n }\n\n chainEdgeIds.push(nextEdge.getId());\n currentNode = this._nodeLookup.get(nextNodeId);\n }\n\n if (chainNodeIds.length > 1) {\n const chainId = this._createChainId(chainNodeIds);\n const collapsed = previousStates.has(chainId)\n ? Boolean(previousStates.get(chainId))\n : collapseDefault;\n this._chainDescriptors.set(chainId, {\n id: chainId,\n nodeIds: chainNodeIds,\n edgeIds: chainEdgeIds,\n representativeId: chainNodeIds[0]\n });\n this._collapsedChainState.set(chainId, collapsed);\n for (const chainNodeId of chainNodeIds) {\n this._nodeToChainId.set(chainNodeId, chainId);\n }\n }\n }\n\n for (const key of previousStates.keys()) {\n if (!this._chainDescriptors.has(key)) {\n this._collapsedChainState.delete(key);\n }\n }\n\n this._hiddenNodeIds.clear();\n for (const [chainId, descriptor] of this._chainDescriptors) {\n const collapsed = this._isChainCollapsed(chainId);\n if (collapsed) {\n for (const nodeId of descriptor.nodeIds) {\n // eslint-disable-next-line max-depth\n if (nodeId !== descriptor.representativeId) {\n this._hiddenNodeIds.add(nodeId);\n }\n }\n }\n }\n\n this._updateCollapsedChainNodeMetadata();\n\n let collapsedCount = 0;\n for (const chainId of this._chainDescriptors.keys()) {\n if (this._isChainCollapsed(chainId)) {\n collapsedCount++;\n }\n }\n\n log.log(\n 0,\n `CollapsableD3DagLayout: refreshed collapsed chains -> total=${this._chainDescriptors.size}, collapsed=${collapsedCount}`\n );\n }\n\n protected override _updateCollapsedChainNodeMetadata(): void {\n if (!this._graph) {\n return;\n }\n\n for (const node of this._graph.getNodes()) {\n const nodeId = node.getId();\n const chainId = this._nodeToChainId.get(nodeId);\n\n if (!chainId) {\n node.setDataProperty('collapsedChainId', null);\n node.setDataProperty('collapsedChainLength', 1);\n node.setDataProperty('collapsedNodeIds', []);\n node.setDataProperty('collapsedEdgeIds', []);\n node.setDataProperty('collapsedChainRepresentativeId', null);\n node.setDataProperty('isCollapsedChain', false);\n continue;\n }\n\n const descriptor = this._chainDescriptors.get(chainId);\n if (!descriptor) {\n node.setDataProperty('collapsedChainId', null);\n node.setDataProperty('collapsedChainLength', 1);\n node.setDataProperty('collapsedNodeIds', []);\n node.setDataProperty('collapsedEdgeIds', []);\n node.setDataProperty('collapsedChainRepresentativeId', null);\n node.setDataProperty('isCollapsedChain', false);\n continue;\n }\n\n const collapsed = this._isChainCollapsed(chainId);\n node.setDataProperty('collapsedChainId', chainId);\n node.setDataProperty('collapsedChainLength', collapsed ? descriptor.nodeIds.length : 1);\n node.setDataProperty('collapsedNodeIds', descriptor.nodeIds);\n node.setDataProperty('collapsedEdgeIds', descriptor.edgeIds);\n node.setDataProperty('collapsedChainRepresentativeId', descriptor.representativeId);\n node.setDataProperty('isCollapsedChain', collapsed);\n }\n }\n\n protected override _shouldSkipNode(nodeId: string | number): boolean {\n return this._hiddenNodeIds.has(nodeId);\n }\n\n protected override _mapNodeId(nodeId: string | number): string | number {\n const chainId = this._nodeToChainId.get(nodeId);\n if (!chainId) {\n return nodeId;\n }\n\n const descriptor = this._chainDescriptors.get(chainId);\n if (!descriptor) {\n return nodeId;\n }\n\n return this._isChainCollapsed(chainId) ? descriptor.representativeId : nodeId;\n }\n\n private _createChainId(nodeIds: (string | number)[]): string {\n return `chain:${nodeIds.map((id) => this._toDagId(id)).join('>')}`;\n }\n\n private _isChainCollapsed(chainId: string): boolean {\n const collapseDefault = this.props.collapseLinearChains;\n return this._collapsedChainState.get(chainId) ?? collapseDefault;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {GraphLayout, GraphLayoutProps} from '../../core/graph-layout';\nimport type {Graph, NodeInterface, EdgeInterface} from '../../graph/graph';\n\nexport type GPUForceLayoutOptions = GraphLayoutProps & {\n alpha?: number;\n resumeAlpha?: number;\n nBodyStrength?: number;\n nBodyDistanceMin?: number;\n nBodyDistanceMax?: number;\n getCollisionRadius?: number;\n};\n\n/**\n * @todo this layout should be updated with the organizational and logic improvements made in d3-force\n */\nexport class GPUForceLayout extends GraphLayout<GPUForceLayoutOptions> {\n static defaultProps: Required<GPUForceLayoutOptions> = {\n ...GraphLayout.defaultProps,\n alpha: 0.3,\n resumeAlpha: 0.1,\n nBodyStrength: -900,\n nBodyDistanceMin: 100,\n nBodyDistanceMax: 400,\n getCollisionRadius: 0\n };\n\n protected readonly _name: string = 'GPU';\n private _d3Graph: {nodes: any[]; edges: any[]};\n private _nodeMap: Map<string | number, any>;\n private _edgeMap: Map<string | number, any>;\n private _graph: Graph | null;\n private _worker: Worker | null = null;\n\n constructor(options: GPUForceLayoutOptions = {}) {\n super(options, GPUForceLayout.defaultProps);\n\n this._name = 'GPU';\n // store graph and prepare internal data\n this._d3Graph = {nodes: [], edges: []};\n this._nodeMap = new Map();\n this._edgeMap = new Map();\n this._graph = null;\n }\n\n initializeGraph(graph: Graph) {\n this._graph = graph;\n this._nodeMap = new Map();\n this._edgeMap = new Map();\n // nodes\n const d3Nodes = Array.from(graph.getNodes(), (node) => {\n const id = node.getId();\n const locked = node.getPropertyValue('locked') || false;\n const x = node.getPropertyValue('x') || 0;\n const y = node.getPropertyValue('y') || 0;\n const collisionRadius = node.getPropertyValue('collisionRadius') || 0;\n const d3Node = {\n id,\n x,\n y,\n fx: locked ? x : null,\n fy: locked ? y : null,\n collisionRadius,\n locked\n };\n this._nodeMap.set(id, d3Node);\n return d3Node;\n });\n // edges\n const d3Edges = Array.from(graph.getEdges(), (edge) => {\n const id = edge.getId();\n const d3Edge = {\n id,\n source: this._nodeMap.get(edge.getSourceNodeId()),\n target: this._nodeMap.get(edge.getTargetNodeId())\n };\n this._edgeMap.set(id, d3Edge);\n return d3Edge;\n });\n this._d3Graph = {\n nodes: d3Nodes,\n edges: d3Edges\n };\n }\n\n start() {\n this._engageWorker();\n }\n\n update() {\n this._engageWorker();\n }\n\n _engageWorker() {\n // prevent multiple start\n if (this._worker) {\n this._worker.terminate();\n }\n\n this._worker = new Worker(new URL('./worker.js', import.meta.url).href);\n const {alpha, nBodyStrength, nBodyDistanceMin, nBodyDistanceMax, getCollisionRadius} =\n this.props;\n this._worker.postMessage({\n nodes: this._d3Graph.nodes,\n edges: this._d3Graph.edges,\n options: {\n alpha,\n nBodyStrength,\n nBodyDistanceMin,\n nBodyDistanceMax,\n getCollisionRadius\n }\n });\n this._worker.onmessage = (event) => {\n switch (event.data.type) {\n case 'tick':\n this.ticked(event.data);\n break;\n case 'end':\n this.ended(event.data);\n break;\n default:\n break;\n }\n };\n }\n ticked(data) {}\n ended(data) {\n const {nodes, edges} = data;\n this.updateD3Graph({nodes, edges});\n this._onLayoutChange();\n this._onLayoutDone();\n }\n resume() {\n throw new Error('Resume unavailable');\n }\n stop() {\n if (this._worker) {\n this._worker.terminate();\n this._worker = null;\n }\n }\n\n // for steaming new data on the same graph\n updateGraph(graph: Graph) {\n const previousName = this._graph?.getGraphName?.();\n const nextName = graph.getGraphName?.();\n const isSameGraph =\n (previousName && nextName && previousName === nextName) || this._graph === graph;\n if (!isSameGraph) {\n // reset the maps\n this._nodeMap = new Map();\n this._edgeMap = new Map();\n }\n this._graph = graph;\n // update internal layout data\n // nodes\n const newNodeMap = new Map<string | number, any>();\n const newD3Nodes = Array.from(graph.getNodes(), (node) => {\n const id = node.getId();\n const locked = node.getPropertyValue('locked') || false;\n const x = node.getPropertyValue('x') || 0;\n const y = node.getPropertyValue('y') || 0;\n const fx = locked ? x : null;\n const fy = locked ? y : null;\n const collisionRadius = node.getPropertyValue('collisionRadius') || 0;\n\n const oldD3Node = this._nodeMap.get(id);\n const newD3Node = oldD3Node ? oldD3Node : {id, x, y, fx, fy, collisionRadius};\n newNodeMap.set(id, newD3Node);\n return newD3Node;\n });\n this._nodeMap = newNodeMap;\n this._d3Graph.nodes = newD3Nodes;\n // edges\n const newEdgeMap = new Map<string | number, any>();\n const newD3Edges = Array.from(graph.getEdges(), (edge) => {\n const id = edge.getId();\n const oldD3Edge = this._edgeMap.get(id);\n const newD3Edge = oldD3Edge || {\n id,\n source: newNodeMap.get(edge.getSourceNodeId()),\n target: newNodeMap.get(edge.getTargetNodeId())\n };\n newEdgeMap.set(id, newD3Edge);\n return newD3Edge;\n });\n this._edgeMap = newEdgeMap;\n this._d3Graph.edges = newD3Edges;\n }\n\n updateD3Graph(graph: {nodes: any[]; edges: any[]}): void {\n const existingNodes = this._graph ? Array.from(this._graph.getNodes()) : [];\n // update internal layout data\n // nodes\n const newNodeMap = new Map<string | number, any>();\n const newD3Nodes = graph.nodes.map((node) => {\n // Update existing _graph with the new values\n const existingNode = existingNodes.find((n) => n.getId() === node.id);\n existingNode?.setDataProperty('locked', node.locked);\n existingNode?.setDataProperty('x', node.x);\n existingNode?.setDataProperty('y', node.y);\n existingNode?.setDataProperty('collisionRadius', node.collisionRadius);\n\n newNodeMap.set(node.id, node);\n return node;\n });\n this._nodeMap = newNodeMap;\n this._d3Graph.nodes = newD3Nodes;\n // edges\n const newEdgeMap = new Map<string | number, any>();\n const newD3Edges = graph.edges.map((edge) => {\n newEdgeMap.set(edge.id, edge);\n return edge;\n });\n this._graph?.triggerUpdate?.();\n this._edgeMap = newEdgeMap;\n this._d3Graph.edges = newD3Edges;\n }\n\n getNodePosition = (node: NodeInterface): [number, number] => {\n const d3Node = this._nodeMap.get(node.getId());\n if (d3Node) {\n return [d3Node.x, d3Node.y];\n }\n return [0, 0];\n };\n\n getEdgePosition = (edge: EdgeInterface) => {\n const d3Edge = this._edgeMap.get(edge.getId());\n const sourcePosition = d3Edge && d3Edge.source;\n const targetPosition = d3Edge && d3Edge.target;\n if (d3Edge && sourcePosition && targetPosition) {\n return {\n type: 'line',\n sourcePosition: [sourcePosition.x, sourcePosition.y],\n targetPosition: [targetPosition.x, targetPosition.y],\n controlPoints: []\n };\n }\n return {\n type: 'line',\n sourcePosition: [0, 0],\n targetPosition: [0, 0],\n controlPoints: []\n };\n };\n\n lockNodePosition = (node: NodeInterface, x: number, y: number) => {\n const d3Node = this._nodeMap.get(node.getId());\n if (!d3Node) {\n return;\n }\n d3Node.x = x;\n d3Node.y = y;\n d3Node.fx = x;\n d3Node.fy = y;\n this._onLayoutChange();\n this._onLayoutDone();\n };\n\n unlockNodePosition = (node: NodeInterface) => {\n const d3Node = this._nodeMap.get(node.getId());\n if (!d3Node) {\n return;\n }\n d3Node.fx = null;\n d3Node.fy = null;\n };\n\n protected override _updateBounds(): void {\n const positions = Array.from(this._nodeMap.values(), (node) => this._normalizePosition(node));\n this._bounds = this._calculateBounds(positions);\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {GraphLayout, GraphLayoutProps} from '../../core/graph-layout';\nimport type {Graph, NodeInterface, EdgeInterface} from '../../graph/graph';\n\nexport type RadialLayoutProps = GraphLayoutProps & {\n radius?: number;\n tree?: any;\n};\n\nconst getTreeNode = (\n nodeId: string,\n nodeMap: Record<string, {children?: string[]; isLeaf?: boolean}>\n) => {\n const node = nodeMap[nodeId];\n if (node) {\n return node;\n }\n return {\n id: nodeId,\n children: [],\n isLeaf: true\n };\n};\n\nconst traverseTree = (nodeId, nodeMap) => {\n const node = getTreeNode(nodeId, nodeMap);\n if (node.isLeaf) {\n return node;\n }\n return {\n ...node,\n children: (node.children ?? []).map((nid) => traverseTree(nid, nodeMap))\n };\n};\n\nconst getLeafNodeCount = (node, count) => {\n if (!node.children || node.children.length === 0) {\n return count + 1;\n }\n const sum = node.children.reduce((res, c) => {\n return res + getLeafNodeCount(c, 0);\n }, 0);\n return count + sum;\n};\n\nconst getTreeDepth = (node, depth = 0) => {\n if (node.isLeaf) {\n return depth;\n }\n return getTreeDepth(node.children[0], depth + 1);\n};\n\nconst getPath = (node, targetId, path) => {\n if (!node) {\n return false;\n }\n if (node.id === targetId) {\n path.push(node.id);\n return true;\n }\n const inChildren = node.children && node.children.some((c) => getPath(c, targetId, path));\n if (inChildren) {\n path.push(node.id);\n return true;\n }\n return false;\n};\n\nexport class RadialLayout extends GraphLayout<RadialLayoutProps> {\n static defaultProps = {\n ...GraphLayout.defaultProps,\n radius: 500,\n tree: []\n } as const satisfies Readonly<Required<RadialLayoutProps>>;\n\n _name = 'RadialLayout';\n _graph: Graph | null = null;\n // custom layout data structure\n _hierarchicalPoints = {};\n nestedTree;\n\n constructor(props: RadialLayoutProps = {}) {\n super(props, RadialLayout.defaultProps);\n }\n\n initializeGraph(graph: Graph): void {\n this.updateGraph(graph);\n }\n\n updateGraph(graph: Graph): void {\n this._graph = graph;\n }\n\n start(): void {\n if (!this._graph) {\n return;\n }\n const nodes = Array.from(this._graph.getNodes());\n const nodeCount = nodes.length;\n if (nodeCount === 0) {\n return;\n }\n\n const {tree} = this.props;\n\n if (!tree || tree.length === 0) {\n return;\n }\n\n this._onLayoutStart();\n\n const {radius} = this.props;\n const unitAngle = 360 / nodeCount;\n\n // hierarchical positions\n const rootNode = tree[0];\n\n const nodeMap = tree.reduce((res, node) => {\n res[node.id] = {\n ...node,\n isLeaf: !node.children || node.children.length === 0\n };\n return res;\n }, {});\n // nested structure\n this.nestedTree = traverseTree(rootNode.id, nodeMap);\n\n const totalLevels = getTreeDepth(this.nestedTree, 0);\n const distanceBetweenLevels = radius / (totalLevels - 1);\n\n const calculatePosition = (node, level, startAngle, positionMap) => {\n const isRoot = node.id === rootNode.id;\n\n if (node.children && node.children.length !== 0) {\n const groupSize = getLeafNodeCount(node, 0);\n // center the pos\n positionMap[node.id] = isRoot\n ? [0, 0]\n : rotate(\n 0,\n 0,\n 0,\n distanceBetweenLevels * (level + 1),\n startAngle + unitAngle * (groupSize / 2)\n );\n // calculate children position\n let tempAngle = startAngle;\n node.children.forEach((n) => {\n calculatePosition(n, level + 1, tempAngle, positionMap);\n tempAngle += getLeafNodeCount(n, 0) * unitAngle;\n });\n } else {\n positionMap[node.id] = rotate(\n 0,\n 0,\n 0,\n distanceBetweenLevels * (level + 1),\n startAngle + unitAngle\n );\n }\n };\n\n this._hierarchicalPoints = {};\n calculatePosition(this.nestedTree, 0, 0, this._hierarchicalPoints);\n // layout completes: notifiy component to re-render\n this._onLayoutChange();\n this._onLayoutDone();\n }\n\n stop(): void {}\n\n resume() {}\n\n update() {}\n\n getNodePosition = (node: NodeInterface) => {\n return this._hierarchicalPoints[node.getId()];\n };\n\n // spline curve version\n getEdgePosition = (edge: EdgeInterface) => {\n const sourceNodeId = edge.getSourceNodeId();\n const targetNodeId = edge.getTargetNodeId();\n const sourceNodePos = this._hierarchicalPoints[sourceNodeId];\n const targetNodePos = this._hierarchicalPoints[targetNodeId];\n\n const sourcePath = [];\n getPath(this.nestedTree, sourceNodeId, sourcePath);\n const targetPath = [];\n getPath(this.nestedTree, targetNodeId, targetPath);\n\n const totalLevels = sourcePath.length;\n let commonAncestorLevel = totalLevels - 1; // root\n for (let i = 0; i < totalLevels; i++) {\n if (sourcePath[i] === targetPath[i]) {\n commonAncestorLevel = i;\n break;\n }\n }\n\n const wayPoints = [];\n for (let i = 1; i <= commonAncestorLevel; i++) {\n const nodeId = sourcePath[i];\n wayPoints.push(this._hierarchicalPoints[nodeId]);\n }\n for (let i = commonAncestorLevel - 1; i > 0; i--) {\n const nodeId = targetPath[i];\n wayPoints.push(this._hierarchicalPoints[nodeId]);\n }\n\n return {\n type: 'spline-curve',\n sourcePosition: sourceNodePos,\n targetPosition: targetNodePos,\n controlPoints: wayPoints\n };\n };\n\n lockNodePosition = (node: NodeInterface, x: number, y: number) => {\n this._hierarchicalPoints[node.getId()] = [x, y];\n this._onLayoutChange();\n this._onLayoutDone();\n };\n\n protected override _updateBounds(): void {\n const positions = Object.values(this._hierarchicalPoints ?? {}).map((position) =>\n this._normalizePosition(position)\n );\n this._bounds = this._calculateBounds(positions);\n }\n}\n\nfunction rotate(cx, cy, x, y, angle) {\n const radians = (Math.PI / 180) * angle;\n const cos = Math.cos(radians);\n const sin = Math.sin(radians);\n const nx = cos * (x - cx) + sin * (y - cy) + cx;\n const ny = cos * (y - cy) - sin * (x - cx) + cy;\n return [nx, ny];\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {GraphLayout, GraphLayoutProps} from '../../core/graph-layout';\nimport type {Graph, NodeInterface, EdgeInterface} from '../../graph/graph';\nimport * as d3 from 'd3-force';\n\nexport type ForceMultiGraphLayoutProps = GraphLayoutProps & {\n alpha?: number;\n nBodyStrength?: number;\n nBodyDistanceMin?: number;\n nBodyDistanceMax?: number;\n};\n\nexport class ForceMultiGraphLayout extends GraphLayout<ForceMultiGraphLayoutProps> {\n static defaultProps = {\n ...GraphLayout.defaultProps,\n alpha: 3,\n nBodyStrength: -1200,\n nBodyDistanceMin: 100,\n nBodyDistanceMax: 1400\n } as const satisfies Readonly<Required<ForceMultiGraphLayoutProps>>;\n\n _name = 'ForceMultiGraphLayout';\n _graph: Graph | null = null;\n\n // d3 part\n // custom graph data\n _d3Graph: {nodes: any[]; edges: any[]} = {nodes: [], edges: []};\n _nodeMap = new Map<string | number, any>();\n _edgeMap = new Map<string | number, any>();\n _simulator: d3.Simulation<any, undefined> | null = null;\n\n constructor(props: ForceMultiGraphLayoutProps = {}) {\n super(props, ForceMultiGraphLayout.defaultProps);\n }\n\n initializeGraph(graph: Graph): void {\n this.updateGraph(graph);\n }\n\n _strength = (d3Edge) => {\n if (d3Edge.isVirtual) {\n return 1 / d3Edge.edgeCount;\n }\n const sourceNode = this._graph?.findNode(d3Edge.source.id);\n const targetNode = this._graph?.findNode(d3Edge.target.id);\n const sourceDegree = sourceNode?.getDegree() ?? 0;\n const targetDegree = targetNode?.getDegree() ?? 0;\n return 1 / Math.min(sourceDegree, targetDegree);\n };\n\n _generateSimulator() {\n if (this._simulator) {\n this._simulator.on('tick', null).on('end', null);\n this._simulator = null;\n }\n const {alpha, nBodyStrength, nBodyDistanceMin, nBodyDistanceMax} = this.props;\n\n const g = this._d3Graph;\n this._simulator = d3\n .forceSimulation(g.nodes)\n .force(\n 'edge',\n d3\n .forceLink(g.edges)\n // @ts-ignore TODO id not defined?\n .id((n) => n.id)\n .strength(this._strength)\n )\n .force(\n 'charge',\n d3\n .forceManyBody()\n .strength(nBodyStrength)\n .distanceMin(nBodyDistanceMin)\n .distanceMax(nBodyDistanceMax)\n )\n .force('center', d3.forceCenter())\n .alpha(alpha);\n // register event callbacks\n this._simulator.on('tick', this._onLayoutChange).on('end', this._onLayoutDone);\n }\n\n start() {\n this._generateSimulator();\n this._simulator.restart();\n }\n\n resume() {\n this._simulator.restart();\n }\n\n stop() {\n this._simulator.stop();\n }\n\n update(): void {}\n\n updateGraph(graph: Graph) {\n this._graph = graph;\n\n // nodes\n const newNodeMap = new Map<string | number, any>();\n const nodes = Array.from(graph.getNodes());\n const newD3Nodes = nodes.map((node) => {\n const id = node.getId();\n const oldD3Node = this._nodeMap.get(id);\n const newD3Node = oldD3Node ? oldD3Node : {id};\n newNodeMap.set(id, newD3Node);\n return newD3Node;\n });\n\n // edges\n // bucket edges between the same source/target node pairs.\n const edges = Array.from(graph.getEdges());\n const nodePairs = edges.reduce((res, edge) => {\n const endpoints = [edge.getSourceNodeId(), edge.getTargetNodeId()];\n // sort the node ids to count the edges with the same pair\n // but different direction (a -> b or b -> a)\n const pairId = endpoints.sort().toString();\n // push this edge into the bucket\n if (!res[pairId]) {\n res[pairId] = [edge];\n } else {\n res[pairId].push(edge);\n }\n return res;\n }, {});\n\n // go through each pair of edges,\n // if only one edge between two nodes, create a straight line\n // otherwise, create one virtual node and two edges for each edge\n const newD3Edges: any[] = [];\n const newEdgeMap = new Map<string | number, any>();\n\n Object.keys(nodePairs).forEach((pairId) => {\n const betweenEdges = nodePairs[pairId];\n const firstEdge = betweenEdges[0];\n if (betweenEdges.length === 1) {\n // do nothing, this is a real edge\n const newD3Edge = {\n type: 'line',\n id: firstEdge.getId(),\n source: newNodeMap.get(firstEdge.getSourceNodeId()),\n target: newNodeMap.get(firstEdge.getTargetNodeId()),\n isVirtual: false\n };\n newEdgeMap.set(firstEdge.getId(), newD3Edge);\n newD3Edges.push(newD3Edge);\n return;\n }\n\n // else reduce to one virtual edge\n const newD3Edge = {\n type: 'line',\n id: pairId,\n source: newNodeMap.get(firstEdge.getSourceNodeId()),\n target: newNodeMap.get(firstEdge.getTargetNodeId()),\n isVirtual: true,\n edgeCount: betweenEdges.length\n };\n newEdgeMap.set(pairId, newD3Edge);\n newD3Edges.push(newD3Edge);\n\n betweenEdges.forEach((e, idx) => {\n const edgeId = e.getId();\n newEdgeMap.set(edgeId, {\n type: 'spline-curve',\n id: edgeId,\n source: newNodeMap.get(e.getSourceNodeId()),\n target: newNodeMap.get(e.getTargetNodeId()),\n virtualEdgeId: pairId,\n isVirtual: true,\n index: idx\n });\n });\n });\n\n this._nodeMap = newNodeMap;\n this._d3Graph.nodes = newD3Nodes;\n this._edgeMap = newEdgeMap;\n this._d3Graph.edges = newD3Edges;\n }\n\n getNodePosition = (node: NodeInterface): [number, number] => {\n const d3Node = this._nodeMap.get(node.getId());\n if (d3Node) {\n return [d3Node.x, d3Node.y];\n }\n // default value\n return [0, 0];\n };\n\n getEdgePosition = (edge: EdgeInterface) => {\n const d3Edge = this._edgeMap.get(edge.getId());\n if (d3Edge) {\n if (!d3Edge.isVirtual) {\n return {\n type: 'line',\n sourcePosition: [d3Edge.source.x, d3Edge.source.y],\n targetPosition: [d3Edge.target.x, d3Edge.target.y],\n controlPoints: []\n };\n }\n // else, check the referenced virtual edge\n const virtualEdge = this._edgeMap.get(d3Edge.virtualEdgeId);\n if (!virtualEdge) {\n return null;\n }\n const edgeCount = virtualEdge.edgeCount;\n // get the position of source and target nodes\n const sourcePosition = [virtualEdge.source.x, virtualEdge.source.y];\n const targetPosition = [virtualEdge.target.x, virtualEdge.target.y];\n // calculate a symmetric curve\n const distance = Math.hypot(\n sourcePosition[0] - targetPosition[0],\n sourcePosition[1] - targetPosition[1]\n );\n const index = d3Edge.index;\n // curve direction: inward vs. outward\n const direction = index % 2 ? 1 : -1;\n // if the number of the parallel edges is an even number => symmetric shape\n // otherwise, the 0th node will be a staight line, and rest of them are symmetrical.\n const symmetricShape = edgeCount % 2 === 0;\n const offset =\n Math.max(distance / 10, 5) *\n (symmetricShape ? Math.floor(index / 2 + 1) : Math.ceil(index / 2));\n const controlPoint = computeControlPoint(sourcePosition, targetPosition, direction, offset);\n return {\n type: 'spline-curve',\n sourcePosition,\n targetPosition,\n controlPoints: [controlPoint]\n };\n }\n // default value\n return {\n type: 'line',\n sourcePosition: [0, 0],\n targetPosition: [0, 0],\n controlPoints: []\n };\n };\n\n lockNodePosition = (node: NodeInterface, x: number, y: number) => {\n const d3Node = this._nodeMap.get(node.getId());\n if (!d3Node) {\n return;\n }\n d3Node.x = x;\n d3Node.y = y;\n this._onLayoutChange();\n this._onLayoutDone();\n };\n\n protected override _updateBounds(): void {\n const positions = Array.from(this._nodeMap.values(), (node) => this._normalizePosition(node));\n this._bounds = this._calculateBounds(positions);\n }\n}\n\n/**\n * A helper function to compute the control point of a curve\n * @param {number[]} source - the coordinates of source point, ex: [x, y, z]\n * @param {number[]} target - the coordinates of target point, ex: [x, y, z]\n * @param {number} direction - the direction of the curve, 1 or -1\n * @param {number} offset - offset from the midpoint\n * @return {number[]} - the coordinates of the control point\n */\nfunction computeControlPoint(source, target, direction, offset) {\n const midPoint = [(source[0] + target[0]) / 2, (source[1] + target[1]) / 2];\n const dx = target[0] - source[0];\n const dy = target[1] - source[1];\n const normal = [dy, -dx];\n const length = Math.sqrt(Math.pow(normal[0], 2.0) + Math.pow(normal[1], 2.0));\n const normalized = [normal[0] / length, normal[1] / length];\n return [\n midPoint[0] + normalized[0] * offset * direction,\n midPoint[1] + normalized[1] * offset * direction\n ];\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {GraphLayout, GraphLayoutProps} from '../../core/graph-layout';\nimport type {Graph, NodeInterface, EdgeInterface} from '../../graph/graph';\n\nexport type HivePlotLayoutProps = GraphLayoutProps & {\n innerRadius?: number;\n outerRadius?: number;\n getNodeAxis?: (node: NodeInterface) => any;\n};\n\nexport class HivePlotLayout extends GraphLayout<HivePlotLayoutProps> {\n static defaultProps = {\n ...GraphLayout.defaultProps,\n innerRadius: 100,\n outerRadius: 500,\n getNodeAxis: (node: NodeInterface) => node.getPropertyValue('group')\n } as const satisfies Readonly<Required<HivePlotLayoutProps>>;\n\n _name = 'HivePlot';\n _graph: Graph | null = null;\n _totalAxis: number = 0;\n _axis: Record<string, NodeInterface[]> = {};\n _nodeMap = new Map<string | number, NodeInterface>();\n _nodePositionMap = new Map<string | number, [number, number]>();\n\n constructor(props: HivePlotLayoutProps = {}) {\n super(props, HivePlotLayout.defaultProps);\n }\n\n initializeGraph(graph: Graph) {\n this.updateGraph(graph);\n }\n\n updateGraph(graph: Graph) {\n const {getNodeAxis, innerRadius, outerRadius} = this.props;\n this._graph = graph;\n const nodes = Array.from(graph.getNodes());\n this._nodeMap = new Map(nodes.map((node) => [node.getId(), node]));\n\n // bucket nodes into few axis\n\n this._axis = nodes.reduce((res, node) => {\n const axis = getNodeAxis(node);\n if (!res[axis]) {\n res[axis] = [];\n }\n res[axis].push(node);\n return res;\n }, {});\n\n // sort nodes along the same axis by degree\n this._axis = Object.keys(this._axis).reduce((res, axis) => {\n const bucketedNodes = this._axis[axis];\n const sortedNodes = bucketedNodes.sort((a, b) => {\n if (a.getDegree() > b.getDegree()) {\n return 1;\n }\n if (a.getDegree() === b.getDegree()) {\n return 0;\n }\n return -1;\n });\n res[axis] = sortedNodes;\n return res;\n }, {});\n this._totalAxis = Object.keys(this._axis).length;\n const center = [0, 0];\n const angleInterval = 360 / Object.keys(this._axis).length;\n\n // calculate positions\n this._nodePositionMap = new Map();\n Object.keys(this._axis).forEach((axis, axisIdx) => {\n const axisAngle = angleInterval * axisIdx;\n const bucketedNodes = this._axis[axis];\n const interval = (outerRadius - innerRadius) / bucketedNodes.length;\n\n bucketedNodes.forEach((node, idx) => {\n const radius = innerRadius + idx * interval;\n const x = Math.cos((axisAngle / 180) * Math.PI) * radius + center[0];\n const y = Math.sin((axisAngle / 180) * Math.PI) * radius + center[1];\n this._nodePositionMap.set(node.getId(), [x, y]);\n });\n });\n }\n\n start() {\n this._onLayoutStart();\n this._onLayoutChange();\n this._onLayoutDone();\n }\n\n stop() {}\n\n update() {}\n\n resume() {}\n\n getNodePosition = (node: NodeInterface) => this._nodePositionMap.get(node.getId());\n\n getEdgePosition = (edge: EdgeInterface) => {\n const {getNodeAxis} = this.props;\n const sourceNodeId = edge.getSourceNodeId();\n const targetNodeId = edge.getTargetNodeId();\n\n const sourcePosition = this._nodePositionMap.get(sourceNodeId);\n const targetPosition = this._nodePositionMap.get(targetNodeId);\n\n if (!sourcePosition || !targetPosition) {\n return null;\n }\n\n const sourceNode = this._nodeMap.get(sourceNodeId);\n const targetNode = this._nodeMap.get(targetNodeId);\n\n const sourceNodeAxis = sourceNode ? getNodeAxis(sourceNode) : null;\n const targetNodeAxis = targetNode ? getNodeAxis(targetNode) : null;\n\n if (sourceNodeAxis !== null && sourceNodeAxis === targetNodeAxis) {\n return {\n type: 'line',\n sourcePosition,\n targetPosition,\n controlPoints: []\n };\n }\n\n const controlPoint = computeControlPoint({\n sourcePosition,\n sourceNodeAxis: sourceNodeAxis ?? 0,\n targetPosition,\n targetNodeAxis: targetNodeAxis ?? 0,\n totalAxis: this._totalAxis\n });\n\n return {\n type: 'spline-curve',\n sourcePosition,\n targetPosition,\n controlPoints: [controlPoint]\n };\n };\n\n lockNodePosition = (node: NodeInterface, x: number, y: number) => {\n this._nodePositionMap.set(node.getId(), [x, y]);\n this._onLayoutChange();\n this._onLayoutDone();\n };\n\n protected override _updateBounds(): void {\n const positions = Array.from(this._nodePositionMap.values(), (position) =>\n this._normalizePosition(position)\n );\n this._bounds = this._calculateBounds(positions);\n }\n}\n\nfunction computeControlPoint({\n sourcePosition,\n sourceNodeAxis,\n targetPosition,\n targetNodeAxis,\n totalAxis\n}): [number, number] {\n const halfAxis = (totalAxis - 1) / 2;\n // check whether the source/target are at the same side.\n const sameSide =\n (sourceNodeAxis <= halfAxis && targetNodeAxis <= halfAxis) ||\n (sourceNodeAxis > halfAxis && targetNodeAxis > halfAxis);\n // curve direction\n const direction = sameSide && sourceNodeAxis <= halfAxis && targetNodeAxis <= halfAxis ? 1 : -1;\n\n // flip the source/target to follow the clockwise diretion\n const source = sourceNodeAxis < targetNodeAxis && sameSide ? sourcePosition : targetPosition;\n const target = sourceNodeAxis < targetNodeAxis && sameSide ? targetPosition : sourcePosition;\n\n // calculate offset\n const distance = Math.hypot(source[0] - target[0], source[1] - target[1]);\n const offset = distance * 0.2;\n\n const midPoint = [(source[0] + target[0]) / 2, (source[1] + target[1]) / 2];\n const dx = target[0] - source[0];\n const dy = target[1] - source[1];\n const normal = [dy, -dx];\n const length = Math.hypot(dy, -dx);\n const normalized = [normal[0] / length, normal[1] / length];\n return [\n midPoint[0] + normalized[0] * offset * direction,\n midPoint[1] + normalized[1] * offset * direction\n ];\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable no-continue */\n\nimport type {CompositeLayerProps} from '@deck.gl/core';\nimport {COORDINATE_SYSTEM, CompositeLayer} from '@deck.gl/core';\nimport {PolygonLayer} from '@deck.gl/layers';\n\nimport type {Graph, NodeInterface} from '../graph/graph';\nimport {ClassicGraph} from '../graph/classic-graph';\nimport {GraphLayout, type GraphLayoutEventDetail} from '../core/graph-layout';\nimport {GraphEngine} from '../core/graph-engine';\n\nimport {\n GraphStylesheetEngine,\n type GraphStylesheet,\n type GraphStyleRule\n} from '../style/graph-style-engine';\n\nimport {\n DEFAULT_GRAPH_LAYER_STYLESHEET_INPUT,\n normalizeGraphLayerStylesheet,\n type GraphLayerEdgeStyle,\n type GraphLayerNodeStyle,\n type NormalizedGraphLayerStylesheet\n} from '../style/graph-layer-stylesheet';\n\n// node layers\nimport {CircleLayer} from './node-layers/circle-layer';\nimport {ImageLayer} from './node-layers/image-layer';\nimport {LabelLayer} from './node-layers/label-layer';\nimport {RectangleLayer} from './node-layers/rectangle-layer';\nimport {RoundedRectangleLayer} from './node-layers/rounded-rectangle-layer';\nimport {PathBasedRoundedRectangleLayer} from './node-layers/path-rounded-rectangle-layer';\nimport {ZoomableMarkerLayer} from './node-layers/zoomable-marker-layer';\n\n// edge layers\nimport {EdgeLayer} from './edge-layer';\nimport {EdgeLabelLayer} from './edge-layers/edge-label-layer';\nimport {FlowLayer} from './edge-layers/flow-layer';\nimport {EdgeArrowLayer} from './edge-layers/edge-arrow-layer';\nimport {EdgeAttachmentHelper} from './edge-attachment-helper';\nimport {GridLayer, type GridLayerProps} from './common-layers/grid-layer/grid-layer';\n\nimport {mixedGetPosition} from '../utils/layer-utils';\nimport {InteractionManager} from '../core/interaction-manager';\nimport {buildCollapsedChainLayers} from '../utils/collapsed-chains';\nimport {\n mapRanksToYPositions,\n selectRankLines,\n type LabelAccessor,\n type RankAccessor\n} from '../utils/rank-grid';\nimport {createGraphFromData} from '../graph/functions/create-graph-from-data';\n\nimport {warn} from '../utils/log';\n\nconst NODE_LAYER_MAP = {\n rectangle: RectangleLayer,\n 'rounded-rectangle': RoundedRectangleLayer,\n 'path-rounded-rectangle': PathBasedRoundedRectangleLayer,\n icon: ImageLayer,\n circle: CircleLayer,\n label: LabelLayer,\n marker: ZoomableMarkerLayer\n};\n\nconst EDGE_DECORATOR_LAYER_MAP = {\n 'edge-label': EdgeLabelLayer,\n flow: FlowLayer,\n arrow: EdgeArrowLayer\n};\n\ntype GridLayerOverrides = Partial<Omit<GridLayerProps, 'id' | 'data' | 'direction'>>;\n\nexport type RankGridConfig = {\n enabled?: boolean;\n direction?: 'horizontal' | 'vertical';\n maxLines?: number;\n rankAccessor?: RankAccessor;\n labelAccessor?: LabelAccessor;\n gridProps?: GridLayerOverrides;\n};\n\nconst SHARED_LAYER_PROPS = {\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n parameters: {\n depthTest: false\n }\n};\n\nconst NODE_STYLE_DEPRECATION_MESSAGE =\n 'GraphLayer: `nodeStyle` has been replaced by `stylesheet.nodes` and will be removed in a future release.';\nconst EDGE_STYLE_DEPRECATION_MESSAGE =\n 'GraphLayer: `edgeStyle` has been replaced by `stylesheet.edges` and will be removed in a future release.';\n\nconst GRAPH_PROP_DEPRECATION_MESSAGE =\n 'GraphLayer: `graph` prop is deprecated. Pass graphs via the `data` prop instead.';\nconst LAYOUT_REQUIRED_MESSAGE =\n 'GraphLayer: `layout` must be provided when supplying raw graph data.';\n\nlet NODE_STYLE_DEPRECATION_WARNED = false;\nlet EDGE_STYLE_DEPRECATION_WARNED = false;\nlet GRAPH_PROP_DEPRECATION_WARNED = false;\nlet LAYOUT_REQUIRED_WARNED = false;\nconst DEFAULT_GRAPH_LOADER = ({json}: {json: unknown}) => {\n if (!json || typeof json !== 'object') {\n return null;\n }\n\n return createGraphFromData(json as any);\n};\n\nexport type GraphLayerRawData = {\n name?: string;\n nodes?: unknown[] | null;\n edges?: unknown[] | null;\n};\n\nexport type GraphLayerDataInput =\n | GraphEngine\n | Graph\n | GraphLayerRawData\n | unknown[]\n | string\n | null;\n\nexport type GraphLayerProps = CompositeLayerProps &\n _GraphLayerProps & {\n data?: GraphLayerDataInput | Promise<GraphLayerDataInput>;\n };\n\ntype EngineResolutionFlags = {\n force: boolean;\n dataChanged: boolean;\n layoutChanged: boolean;\n graphChanged: boolean;\n engineChanged: boolean;\n loaderChanged: boolean;\n};\n\nexport type _GraphLayerProps = {\n graph?: Graph;\n layout?: GraphLayout;\n graphLoader?: (opts: {json: unknown}) => Graph | null;\n engine?: GraphEngine;\n\n onLayoutStart?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutChange?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutDone?: (detail?: GraphLayoutEventDetail) => void;\n onLayoutError?: (error?: unknown) => void;\n\n stylesheet?: GraphStylesheet;\n /** @deprecated Use `stylesheet.nodes`. */\n nodeStyle?: GraphLayerNodeStyle[];\n /** @deprecated Use `stylesheet.edges`. */\n edgeStyle?: GraphLayerEdgeStyle | GraphLayerEdgeStyle[];\n nodeEvents?: {\n onMouseLeave?: () => void;\n onHover?: () => void;\n onMouseEnter?: () => void;\n onClick?: () => void;\n onDrag?: () => void;\n };\n edgeEvents?: {\n onClick: () => void;\n onHover: () => void;\n };\n enableDragging?: boolean;\n rankGrid?: boolean | RankGridConfig;\n resumeLayoutAfterDragging?: boolean;\n};\n\n/** Composite layer that renders graph nodes, edges, and decorators. */\nexport class GraphLayer extends CompositeLayer<GraphLayerProps> {\n static layerName = 'GraphLayer';\n\n static defaultProps: _GraphLayerProps &\n Pick<CompositeLayerProps, 'pickable'> & {\n data: {type: string; value: null; async: true};\n } = {\n // Composite layer props\n pickable: true,\n data: {type: 'object', value: null, async: true},\n\n // Graph props\n graphLoader: DEFAULT_GRAPH_LOADER,\n\n stylesheet: DEFAULT_GRAPH_LAYER_STYLESHEET_INPUT,\n nodeStyle: undefined as unknown as GraphLayerNodeStyle[],\n nodeEvents: {\n onMouseLeave: () => {},\n onHover: () => {},\n onMouseEnter: () => {},\n onClick: () => {},\n onDrag: () => {}\n },\n edgeStyle: undefined as unknown as GraphLayerEdgeStyle | GraphLayerEdgeStyle[],\n edgeEvents: {\n onClick: () => {},\n onHover: () => {}\n },\n enableDragging: false,\n rankGrid: false,\n resumeLayoutAfterDragging: true\n };\n\n // @ts-expect-error Some typescript confusion due to override of base class state\n state!: CompositeLayer<GraphLayerProps>['state'] & {\n interactionManager: InteractionManager;\n graphEngine?: GraphEngine | null;\n layoutVersion: number;\n layoutState?: string;\n interactionVersion: number;\n };\n\n private readonly _edgeAttachmentHelper = new EdgeAttachmentHelper();\n private _suppressNextDeckDataChange = false;\n\n forceUpdate = () => {\n if (!this.state) {\n return;\n }\n\n this.setNeedsRedraw();\n this.setState({interactionVersion: this.state.interactionVersion + 1});\n };\n\n constructor(props: GraphLayerProps & CompositeLayerProps) {\n super(props);\n }\n\n initializeState() {\n const interactionManager = new InteractionManager(\n {\n nodeEvents: this.props.nodeEvents,\n edgeEvents: this.props.edgeEvents,\n engine: undefined as any,\n enableDragging: Boolean(this.props.enableDragging),\n resumeLayoutAfterDragging: Boolean(\n this.props.resumeLayoutAfterDragging ?? GraphLayer.defaultProps.resumeLayoutAfterDragging\n )\n },\n () => this.forceUpdate()\n );\n\n this.state = {\n interactionManager,\n graphEngine: null,\n layoutVersion: 0,\n layoutState: undefined,\n interactionVersion: 0\n } as typeof this.state;\n\n this._syncInteractionManager(this.props, null);\n this._refreshEngineFromProps(this.props, {force: true});\n }\n\n shouldUpdateState({changeFlags}) {\n return changeFlags.dataChanged || changeFlags.propsChanged || changeFlags.stateChanged;\n }\n\n updateState({props, oldProps, changeFlags}) {\n const propsDataChanged = props.data !== oldProps.data;\n const deckDataChanged =\n changeFlags.dataChanged && !(this._suppressNextDeckDataChange && !propsDataChanged);\n const dataChanged = deckDataChanged || propsDataChanged;\n const layoutChanged = props.layout !== oldProps.layout;\n const graphChanged = props.graph !== oldProps.graph;\n const engineChanged = props.engine !== oldProps.engine;\n const loaderChanged = props.graphLoader !== oldProps.graphLoader;\n\n const engineRefreshed = this._refreshEngineFromProps(props, {\n dataChanged,\n layoutChanged,\n graphChanged,\n engineChanged,\n loaderChanged\n });\n\n if (!engineRefreshed && changeFlags.propsChanged) {\n const engine = this.state.graphEngine;\n if (engine) {\n this._applyGraphEngineCallbacks(engine);\n }\n }\n\n if (!engineRefreshed && (changeFlags.propsChanged || changeFlags.stateChanged)) {\n this._syncInteractionManager(props, this.state.graphEngine ?? null);\n }\n\n this._suppressNextDeckDataChange = false;\n }\n\n finalize() {\n this._removeGraphEngine();\n this._syncInteractionManager(this.props, null);\n }\n\n private _getResolvedStylesheet(): NormalizedGraphLayerStylesheet {\n const {stylesheet, nodeStyle, edgeStyle} = this.props;\n\n const usingNodeStyle = typeof nodeStyle !== 'undefined';\n if (usingNodeStyle && !NODE_STYLE_DEPRECATION_WARNED) {\n warn(NODE_STYLE_DEPRECATION_MESSAGE);\n NODE_STYLE_DEPRECATION_WARNED = true;\n }\n\n const usingEdgeStyle = typeof edgeStyle !== 'undefined';\n if (usingEdgeStyle && !EDGE_STYLE_DEPRECATION_WARNED) {\n warn(EDGE_STYLE_DEPRECATION_MESSAGE);\n EDGE_STYLE_DEPRECATION_WARNED = true;\n }\n\n return normalizeGraphLayerStylesheet({\n stylesheet,\n nodeStyle: usingNodeStyle ? nodeStyle : undefined,\n edgeStyle: usingEdgeStyle ? edgeStyle : undefined\n });\n }\n\n private _createStylesheetEngine(\n style: GraphStyleRule,\n context: string\n ): GraphStylesheetEngine | null {\n try {\n return new GraphStylesheetEngine(style, {\n stateUpdateTrigger: (this.state.interactionManager as any).getLastInteraction()\n });\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n warn(`GraphLayer: Failed to apply ${context}: ${message}`);\n return null;\n }\n }\n\n private _refreshEngineFromProps(\n props: GraphLayerProps,\n {\n force = false,\n dataChanged = false,\n layoutChanged = false,\n graphChanged = false,\n engineChanged = false,\n loaderChanged = false\n }: {\n force?: boolean;\n dataChanged?: boolean;\n layoutChanged?: boolean;\n graphChanged?: boolean;\n engineChanged?: boolean;\n loaderChanged?: boolean;\n }\n ): boolean {\n const {engine: nextEngine, shouldReplace} = this._resolveEngineCandidate(props, {\n force,\n dataChanged,\n layoutChanged,\n graphChanged,\n engineChanged,\n loaderChanged\n });\n\n if (nextEngine === undefined) {\n return false;\n }\n\n const currentEngine = this.state.graphEngine ?? null;\n if (!shouldReplace && nextEngine === currentEngine) {\n return false;\n }\n\n this._setGraphEngine(nextEngine);\n this._syncInteractionManager(props, nextEngine);\n return true;\n }\n\n private _resolveEngineCandidate(\n props: GraphLayerProps,\n flags: EngineResolutionFlags\n ): {engine: GraphEngine | null | undefined; shouldReplace: boolean} {\n const dataResult = this._getEngineFromData(props, flags);\n if (dataResult) {\n return dataResult;\n }\n\n const engineResult = this._getEngineFromEngineProp(props, flags);\n if (engineResult) {\n return engineResult;\n }\n\n const graphResult = this._getEngineFromGraphProp(props, flags);\n if (graphResult) {\n return graphResult;\n }\n\n if (props.data === null || props.graph === null || props.engine === null || flags.force) {\n return {engine: null, shouldReplace: true};\n }\n\n return {engine: undefined, shouldReplace: flags.force};\n }\n\n private _getEngineFromData(\n props: GraphLayerProps,\n {force, dataChanged, layoutChanged, loaderChanged}: EngineResolutionFlags\n ): {engine: GraphEngine | null | undefined; shouldReplace: boolean} | null {\n const dataValue = props.data as GraphLayerDataInput | null | undefined;\n if (dataValue === null || typeof dataValue === 'undefined') {\n return null;\n }\n\n const shouldRebuild = force || dataChanged || layoutChanged || loaderChanged;\n if (!shouldRebuild) {\n return {engine: undefined, shouldReplace: false};\n }\n\n const engine = this._deriveEngineFromData(dataValue, props);\n if (typeof engine === 'undefined') {\n return {engine: undefined, shouldReplace: false};\n }\n\n return {\n engine,\n shouldReplace: true\n };\n }\n\n private _getEngineFromEngineProp(\n props: GraphLayerProps,\n {force, engineChanged}: EngineResolutionFlags\n ): {engine: GraphEngine | null | undefined; shouldReplace: boolean} | null {\n if (typeof props.engine === 'undefined') {\n return null;\n }\n\n if (props.engine === null) {\n return {engine: null, shouldReplace: true};\n }\n\n return {\n engine: props.engine,\n shouldReplace: force || engineChanged\n };\n }\n\n private _getEngineFromGraphProp(\n props: GraphLayerProps,\n {force, graphChanged, layoutChanged}: EngineResolutionFlags\n ): {engine: GraphEngine | null | undefined; shouldReplace: boolean} | null {\n if (typeof props.graph === 'undefined') {\n return null;\n }\n\n if (props.graph === null) {\n return {engine: null, shouldReplace: true};\n }\n\n this._warnGraphProp();\n return {\n engine: this._buildEngineFromGraph(props.graph, props.layout),\n shouldReplace: force || graphChanged || layoutChanged\n };\n }\n\n private _deriveEngineFromData(\n data: GraphLayerDataInput,\n props: GraphLayerProps\n ): GraphEngine | null | undefined {\n if (data === null || typeof data === 'undefined') {\n return null;\n }\n\n if (typeof (data as PromiseLike<GraphLayerDataInput>)?.then === 'function') {\n return undefined;\n }\n\n if (data instanceof GraphEngine) {\n return data;\n }\n\n const graphCandidate = this._coerceGraph(data);\n if (graphCandidate) {\n return this._buildEngineFromGraph(graphCandidate, props.layout);\n }\n\n if (typeof data === 'string') {\n return undefined;\n }\n\n if (Array.isArray(data) || isPlainObject(data)) {\n const loader = props.graphLoader ?? DEFAULT_GRAPH_LOADER;\n const graph = loader({json: data});\n if (!graph) {\n return null;\n }\n return this._buildEngineFromGraph(graph, props.layout);\n }\n\n return null;\n }\n\n private _buildEngineFromGraph(\n graph: Graph | null,\n layout?: GraphLayout | null\n ): GraphEngine | null {\n if (!graph) {\n return null;\n }\n\n if (!layout) {\n this._warnLayoutRequired();\n return null;\n }\n\n if (graph instanceof ClassicGraph && layout instanceof GraphLayout) {\n return new GraphEngine({graph, layout});\n }\n\n if (layout instanceof GraphLayout && !(graph instanceof ClassicGraph)) {\n const legacyGraph = this._convertToClassicGraph(graph);\n if (legacyGraph) {\n return new GraphEngine({graph: legacyGraph, layout});\n }\n this._warnLayoutRequired();\n return null;\n }\n\n if (layout) {\n return new GraphEngine({graph, layout});\n }\n\n this._warnLayoutRequired();\n return null;\n }\n\n private _syncInteractionManager(props: GraphLayerProps, engine: GraphEngine | null) {\n const resumeLayoutAfterDragging =\n props.resumeLayoutAfterDragging ?? GraphLayer.defaultProps.resumeLayoutAfterDragging;\n\n this.state.interactionManager.updateProps({\n nodeEvents: props.nodeEvents ?? GraphLayer.defaultProps.nodeEvents,\n edgeEvents: props.edgeEvents ?? GraphLayer.defaultProps.edgeEvents,\n engine: (engine ?? props.engine ?? null) as any,\n enableDragging: Boolean(props.enableDragging),\n resumeLayoutAfterDragging: Boolean(resumeLayoutAfterDragging)\n });\n }\n\n private _warnGraphProp() {\n if (!GRAPH_PROP_DEPRECATION_WARNED) {\n warn(GRAPH_PROP_DEPRECATION_MESSAGE);\n GRAPH_PROP_DEPRECATION_WARNED = true;\n }\n }\n\n private _warnLayoutRequired() {\n if (!LAYOUT_REQUIRED_WARNED) {\n warn(LAYOUT_REQUIRED_MESSAGE);\n LAYOUT_REQUIRED_WARNED = true;\n }\n }\n\n private _isGraph(value: unknown): value is Graph {\n if (!value || typeof value !== 'object') {\n return false;\n }\n\n const candidate = value as Graph;\n return typeof candidate.getNodes === 'function' && typeof candidate.getEdges === 'function';\n }\n\n private _coerceGraph(value: unknown): Graph | null {\n if (value instanceof ClassicGraph) {\n return value;\n }\n\n if (this._isGraph(value)) {\n return value;\n }\n\n return null;\n }\n\n private _convertToClassicGraph(graph: Graph): ClassicGraph | null {\n if (graph instanceof ClassicGraph) {\n return graph;\n }\n\n const candidate = graph as Graph & {toClassicGraph?: () => ClassicGraph | null};\n if (typeof candidate.toClassicGraph === 'function') {\n try {\n return candidate.toClassicGraph() ?? null;\n } catch (error) {\n warn(\n 'GraphLayer: failed to convert graph to ClassicGraph for layout compatibility.',\n error\n );\n }\n }\n\n return null;\n }\n\n private _updateLayoutSnapshot(engine?: GraphEngine | null) {\n const activeEngine = engine ?? this.state.graphEngine ?? null;\n\n if (!activeEngine) {\n if (this.state.layoutVersion !== 0 || typeof this.state.layoutState !== 'undefined') {\n this._suppressNextDeckDataChange = true;\n this.setState({layoutVersion: 0, layoutState: undefined});\n }\n this.setNeedsRedraw();\n return;\n }\n\n const nextVersion = activeEngine.getLayoutLastUpdate();\n const nextState = activeEngine.getLayoutState();\n\n if (this.state.layoutVersion !== nextVersion || this.state.layoutState !== nextState) {\n this._suppressNextDeckDataChange = true;\n this.setState({layoutVersion: nextVersion, layoutState: nextState});\n }\n\n this.setNeedsRedraw();\n }\n\n private _handleLayoutEvent = () => {\n this._updateLayoutSnapshot();\n };\n\n _setGraphEngine(graphEngine: GraphEngine | null) {\n if (graphEngine === this.state.graphEngine) {\n if (graphEngine) {\n this._applyGraphEngineCallbacks(graphEngine);\n }\n this._updateLayoutSnapshot(graphEngine);\n return;\n }\n\n this._removeGraphEngine();\n\n if (graphEngine) {\n this.state.graphEngine = graphEngine;\n this._applyGraphEngineCallbacks(graphEngine);\n graphEngine.run();\n this._updateLayoutSnapshot(graphEngine);\n } else {\n this.state.graphEngine = null;\n this._updateLayoutSnapshot(null);\n }\n }\n\n _removeGraphEngine() {\n const engine = this.state.graphEngine;\n if (engine) {\n engine.setProps({\n onLayoutStart: undefined,\n onLayoutChange: undefined,\n onLayoutDone: undefined,\n onLayoutError: undefined\n });\n engine.clear();\n this.state.graphEngine = null;\n this._updateLayoutSnapshot(null);\n }\n }\n\n private _applyGraphEngineCallbacks(engine: GraphEngine) {\n engine.setProps({\n onLayoutStart: (detail) => {\n this._handleLayoutEvent();\n this.props.onLayoutStart?.(detail);\n },\n onLayoutChange: (detail) => {\n this._handleLayoutEvent();\n this.props.onLayoutChange?.(detail);\n },\n onLayoutDone: (detail) => {\n this._handleLayoutEvent();\n this.props.onLayoutDone?.(detail);\n },\n onLayoutError: (error) => {\n this._handleLayoutEvent();\n this.props.onLayoutError?.(error);\n }\n });\n }\n\n private _createRankGridLayer(): GridLayer | null {\n const engine = this.state.graphEngine;\n if (!engine) {\n return null;\n }\n\n const {enabled, config} = this._normalizeRankGridConfig(this.props.rankGrid);\n if (!enabled) {\n return null;\n }\n\n const bounds = this._resolveRankGridBounds(engine);\n if (!bounds) {\n return null;\n }\n\n const data = this._buildRankGridData(engine, config, bounds);\n if (!data) {\n return null;\n }\n\n const direction = config?.direction ?? 'horizontal';\n const gridProps = config?.gridProps ?? {};\n\n return new GridLayer({\n id: `${this.props.id}-rank-grid`,\n data,\n direction,\n xMin: bounds.xMin,\n xMax: bounds.xMax,\n yMin: bounds.yMin,\n yMax: bounds.yMax,\n pickable: false,\n ...gridProps\n });\n }\n\n private _normalizeRankGridConfig(value: GraphLayerProps['rankGrid']): {\n enabled: boolean;\n config?: RankGridConfig;\n } {\n if (typeof value === 'boolean') {\n return {enabled: value};\n }\n\n if (value && typeof value === 'object') {\n return {enabled: value.enabled ?? true, config: value};\n }\n\n return {enabled: false};\n }\n\n private _resolveRankGridBounds(\n engine: GraphEngine\n ): {xMin: number; xMax: number; yMin: number; yMax: number} | null {\n const bounds = engine.getLayoutBounds();\n if (!bounds) {\n return null;\n }\n\n const [[minXRaw, minYRaw], [maxXRaw, maxYRaw]] = bounds;\n const values = [minXRaw, minYRaw, maxXRaw, maxYRaw];\n if (!values.every((value) => typeof value === 'number' && Number.isFinite(value))) {\n return null;\n }\n\n return {\n xMin: Math.min(minXRaw, maxXRaw),\n xMax: Math.max(minXRaw, maxXRaw),\n yMin: Math.min(minYRaw, maxYRaw),\n yMax: Math.max(minYRaw, maxYRaw)\n };\n }\n\n private _buildRankGridData(\n engine: GraphEngine,\n config: RankGridConfig | undefined,\n bounds: {yMin: number; yMax: number}\n ): Array<{\n label: string;\n rank: number;\n originalLabel?: string | number;\n yPosition: number;\n }> | null {\n const rankLabelPrefix = this._resolveRankFieldLabel(config?.rankAccessor);\n // @ts-ignore iterator type\n const rankPositions = mapRanksToYPositions(engine.getNodes(), engine.getNodePosition, {\n rankAccessor: config?.rankAccessor,\n labelAccessor: config?.labelAccessor,\n yRange: {min: bounds.yMin, max: bounds.yMax}\n });\n\n if (rankPositions.length === 0) {\n return null;\n }\n\n const selectedRanks = selectRankLines(rankPositions, {\n yMin: bounds.yMin,\n yMax: bounds.yMax,\n maxCount: config?.maxLines ?? 8\n });\n\n if (selectedRanks.length === 0) {\n return null;\n }\n\n return selectedRanks.map(({rank, label, yPosition}) => ({\n label: `${rankLabelPrefix} ${rank}`,\n rank,\n originalLabel: label === undefined ? undefined : label,\n yPosition\n }));\n }\n\n private _resolveRankFieldLabel(rankAccessor: RankAccessor | undefined): string {\n if (!rankAccessor) {\n return 'srank';\n }\n if (typeof rankAccessor === 'string' && rankAccessor.length > 0) {\n return rankAccessor;\n }\n if (typeof rankAccessor === 'function' && rankAccessor.name) {\n return rankAccessor.name;\n }\n return 'rank';\n }\n\n createNodeLayers() {\n const engine = this.state.graphEngine;\n const {nodes: nodeStyles} = this._getResolvedStylesheet();\n\n if (!engine || !Array.isArray(nodeStyles) || nodeStyles.length === 0) {\n return [];\n }\n\n const baseLayers = nodeStyles\n .filter(Boolean)\n .map((style, idx) => {\n const {pickable = true, visible = true, data = (nodes) => nodes, ...restStyle} = style;\n const LayerType = NODE_LAYER_MAP[style.type];\n if (!LayerType) {\n warn(`GraphLayer: Invalid node type \"${style.type}\".`);\n return null;\n }\n const stylesheet = this._createStylesheetEngine(\n restStyle as unknown as GraphStyleRule,\n `node stylesheet \"${style.type}\"`\n );\n if (!stylesheet) {\n return null;\n }\n const getOffset = stylesheet.getDeckGLAccessor('getOffset');\n return new LayerType({\n ...SHARED_LAYER_PROPS,\n id: `node-rule-${idx}`,\n data: data(engine.getNodes()),\n getPosition: mixedGetPosition(engine.getNodePosition, getOffset),\n pickable,\n positionUpdateTrigger: [\n engine.getLayoutLastUpdate(),\n engine.getLayoutState(),\n stylesheet.getDeckGLAccessorUpdateTrigger('getOffset')\n ].join(),\n stylesheet,\n visible\n } as any);\n })\n .filter(Boolean) as any[];\n\n const chainLayers = this._createChainOverlayLayers(engine);\n\n return [...baseLayers, ...chainLayers];\n }\n\n createEdgeLayers() {\n const engine = this.state.graphEngine;\n const {edges: edgeStyles, nodes: nodeStyles} = this._getResolvedStylesheet();\n\n if (!engine || !edgeStyles) {\n return [];\n }\n\n const edgeStyleArray = Array.isArray(edgeStyles) ? edgeStyles : [edgeStyles];\n\n if (edgeStyleArray.length === 0) {\n return [];\n }\n\n const getLayoutInfo = this._edgeAttachmentHelper.getLayoutAccessor({\n engine,\n interactionManager: this.state.interactionManager,\n nodeStyle: nodeStyles\n });\n\n return edgeStyleArray.filter(Boolean).flatMap((style, idx) => {\n const {decorators, data = (edges) => edges, visible = true, ...restEdgeStyle} = style;\n const stylesheet = this._createStylesheetEngine(\n {\n type: 'edge',\n ...restEdgeStyle\n } as GraphStyleRule,\n 'edge stylesheet'\n );\n if (!stylesheet) {\n return [];\n }\n\n const edgeLayer = new EdgeLayer({\n ...SHARED_LAYER_PROPS,\n id: `edge-layer-${idx}`,\n data: data(engine.getEdges()),\n getLayoutInfo,\n pickable: true,\n positionUpdateTrigger: [engine.getLayoutLastUpdate(), engine.getLayoutState()].join(),\n stylesheet,\n visible\n } as any);\n\n if (!decorators || !Array.isArray(decorators) || decorators.length === 0) {\n return [edgeLayer];\n }\n\n const decoratorLayers = decorators\n .filter(Boolean)\n // @ts-ignore eslint-disable-next-line @typescript-eslint/no-unused-vars\n .map((decoratorStyle, idx2) => {\n const DecoratorLayer = EDGE_DECORATOR_LAYER_MAP[decoratorStyle.type];\n if (!DecoratorLayer) {\n warn(`GraphLayer: Invalid edge decorator type \"${decoratorStyle.type}\".`);\n return null;\n }\n const decoratorStylesheet = this._createStylesheetEngine(\n decoratorStyle as unknown as GraphStyleRule,\n `edge decorator stylesheet \"${decoratorStyle.type}\"`\n );\n if (!decoratorStylesheet) {\n return null;\n }\n return new DecoratorLayer({\n ...SHARED_LAYER_PROPS,\n id: `edge-decorator-${idx2}`,\n data: data(engine.getEdges()),\n getLayoutInfo,\n pickable: true,\n positionUpdateTrigger: [engine.getLayoutLastUpdate(), engine.getLayoutState()].join(),\n stylesheet: decoratorStylesheet\n } as any);\n })\n .filter(Boolean);\n\n return [edgeLayer, ...decoratorLayers];\n });\n }\n\n onClick(info, event): boolean {\n return (this.state.interactionManager.onClick(info, event) as unknown as boolean) || false;\n }\n\n onHover(info, event): boolean {\n return (this.state.interactionManager.onHover(info, event) as unknown as boolean) || false;\n }\n\n onDragStart(info, event) {\n this.state.interactionManager.onDragStart(info, event);\n }\n\n onDrag(info, event) {\n this.state.interactionManager.onDrag(info, event);\n }\n\n onDragEnd(info, event) {\n this.state.interactionManager.onDragEnd(info, event);\n }\n\n renderLayers() {\n const layers: any[] = [];\n const gridLayer = this._createRankGridLayer();\n if (gridLayer) {\n layers.push(gridLayer);\n }\n\n const edgeLayers = this.createEdgeLayers();\n if (Array.isArray(edgeLayers) && edgeLayers.length > 0) {\n layers.push(...edgeLayers);\n }\n\n const nodeLayers = this.createNodeLayers();\n if (Array.isArray(nodeLayers) && nodeLayers.length > 0) {\n layers.push(...nodeLayers);\n }\n\n return layers;\n }\n\n private _createChainOverlayLayers(engine: GraphEngine) {\n const chainData = buildCollapsedChainLayers(engine);\n if (!chainData) {\n return [];\n }\n\n const {\n collapsedNodes,\n collapsedOutlineNodes,\n expandedNodes,\n expandedOutlineNodes,\n getChainOutlinePolygon,\n outlineUpdateTrigger\n } = chainData;\n\n const layers: any[] = [];\n\n if (collapsedOutlineNodes.length > 0) {\n layers.push(\n new PolygonLayer({\n ...SHARED_LAYER_PROPS,\n id: 'collapsed-chain-outlines',\n data: collapsedOutlineNodes,\n getPolygon: (node: NodeInterface) => getChainOutlinePolygon(node),\n stroked: true,\n filled: false,\n getLineColor: [220, 64, 64, 220],\n getLineWidth: 2,\n lineWidthUnits: 'pixels',\n lineWidthMinPixels: 2,\n pickable: true,\n updateTriggers: {\n getPolygon: [outlineUpdateTrigger]\n }\n })\n );\n }\n\n const collapsedMarkerStylesheet = this._createStylesheetEngine(\n {\n type: 'marker',\n fill: [64, 96, 192, 255],\n size: 32,\n marker: 'circle-plus-filled',\n offset: [24, -24],\n scaleWithZoom: false\n } as GraphStyleRule,\n 'collapsed chain marker stylesheet'\n );\n\n if (collapsedMarkerStylesheet && collapsedNodes.length > 0) {\n const getOffset = collapsedMarkerStylesheet.getDeckGLAccessor('getOffset');\n layers.push(\n new ZoomableMarkerLayer({\n ...SHARED_LAYER_PROPS,\n id: 'collapsed-chain-markers',\n data: collapsedNodes,\n getPosition: mixedGetPosition(engine.getNodePosition, getOffset),\n pickable: true,\n positionUpdateTrigger: [\n engine.getLayoutLastUpdate(),\n engine.getLayoutState(),\n collapsedMarkerStylesheet.getDeckGLAccessorUpdateTrigger('getOffset')\n ].join(),\n stylesheet: collapsedMarkerStylesheet,\n visible: true\n } as any)\n );\n }\n\n if (expandedOutlineNodes.length > 0) {\n layers.push(\n new PolygonLayer({\n ...SHARED_LAYER_PROPS,\n id: 'expanded-chain-outlines',\n data: expandedOutlineNodes,\n getPolygon: (node: NodeInterface) => getChainOutlinePolygon(node),\n stroked: true,\n filled: false,\n getLineColor: [64, 96, 192, 200],\n getLineWidth: 2,\n lineWidthUnits: 'pixels',\n lineWidthMinPixels: 2,\n pickable: true,\n updateTriggers: {\n getPolygon: [outlineUpdateTrigger]\n }\n })\n );\n }\n\n const expandedMarkerStylesheet = this._createStylesheetEngine(\n {\n type: 'marker',\n fill: [64, 96, 192, 255],\n size: 32,\n marker: 'circle-minus-filled',\n offset: [24, -24],\n scaleWithZoom: false\n } as GraphStyleRule,\n 'expanded chain marker stylesheet'\n );\n\n if (expandedMarkerStylesheet && expandedNodes.length > 0) {\n const getOffset = expandedMarkerStylesheet.getDeckGLAccessor('getOffset');\n layers.push(\n new ZoomableMarkerLayer({\n ...SHARED_LAYER_PROPS,\n id: 'expanded-chain-markers',\n data: expandedNodes,\n getPosition: mixedGetPosition(engine.getNodePosition, getOffset),\n pickable: true,\n positionUpdateTrigger: [\n engine.getLayoutLastUpdate(),\n engine.getLayoutState(),\n expandedMarkerStylesheet.getDeckGLAccessorUpdateTrigger('getOffset')\n ].join(),\n stylesheet: expandedMarkerStylesheet,\n visible: true\n } as any)\n );\n }\n\n return layers;\n }\n}\n\nfunction isPlainObject(value: unknown): value is Record<string | number | symbol, unknown> {\n if (!value || typeof value !== 'object') {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {GraphStylesheet, GraphStyleRule, GraphStyleType} from './graph-style-engine';\n\nexport type GraphNodeStyleType = Exclude<\n GraphStyleType,\n 'Edge' | 'edge' | 'edge-label' | 'flow' | 'arrow'\n>;\n\nexport type GraphEdgeDecoratorType = Extract<GraphStyleType, 'edge-label' | 'flow' | 'arrow'>;\n\nexport type GraphLayerNodeStyle = Extract<GraphStyleRule, {type: GraphNodeStyleType}> & {\n pickable?: boolean;\n visible?: boolean;\n data?: (nodes: any[]) => any;\n};\n\nexport type GraphLayerEdgeDecoratorStyle = Extract<GraphStyleRule, {type: GraphEdgeDecoratorType}>;\n\ntype EdgeStyleType = Extract<GraphStyleType, 'Edge' | 'edge'>;\n\nexport type GraphLayerEdgeStyle = (\n | Extract<GraphStyleRule, {type: EdgeStyleType}>\n | (Omit<Extract<GraphStyleRule, {type: EdgeStyleType}>, 'type'> & {type?: EdgeStyleType})\n) & {\n decorators?: GraphLayerEdgeDecoratorStyle[];\n data?: (edges: any[]) => any;\n visible?: boolean;\n};\n\nexport type GraphLayerStylesheet = GraphStylesheet & {\n nodes?: GraphLayerNodeStyle[];\n edges?: GraphLayerEdgeStyle | GraphLayerEdgeStyle[];\n};\n\nexport type GraphLayerStylesheetInput = GraphLayerStylesheet | null | undefined;\n\nexport type NormalizedGraphLayerStylesheet = {\n nodes: GraphLayerNodeStyle[];\n edges: GraphLayerEdgeStyle[];\n};\n\nexport const DEFAULT_GRAPH_LAYER_STYLESHEET_INPUT: GraphLayerStylesheet = {\n nodes: [],\n edges: [\n {\n type: 'edge',\n stroke: 'black',\n strokeWidth: 1\n }\n ]\n};\n\nconst DEFAULT_EDGE_STYLE: GraphLayerEdgeStyle = {\n ...DEFAULT_GRAPH_LAYER_STYLESHEET_INPUT.edges[0],\n decorators: []\n};\n\nexport const DEFAULT_GRAPH_LAYER_STYLESHEET: NormalizedGraphLayerStylesheet = {\n nodes: [],\n edges: [DEFAULT_EDGE_STYLE]\n};\n\nexport type GraphLayerStylesheetSources = {\n stylesheet?: GraphLayerStylesheetInput;\n nodeStyle?: GraphLayerNodeStyle[];\n edgeStyle?: GraphLayerEdgeStyle | GraphLayerEdgeStyle[];\n};\n\nexport function normalizeGraphLayerStylesheet({\n stylesheet,\n nodeStyle,\n edgeStyle\n}: GraphLayerStylesheetSources): NormalizedGraphLayerStylesheet {\n const resolvedStylesheet = stylesheet ?? {};\n const resolvedNodeStyles = Array.isArray(resolvedStylesheet.nodes)\n ? resolvedStylesheet.nodes\n : nodeStyle;\n\n const resolvedEdgeStyles = resolvedStylesheet.edges ?? edgeStyle;\n\n const nodes = Array.isArray(resolvedNodeStyles)\n ? resolvedNodeStyles.filter(Boolean)\n : [...DEFAULT_GRAPH_LAYER_STYLESHEET.nodes];\n\n const edgeEntries = Array.isArray(resolvedEdgeStyles)\n ? resolvedEdgeStyles\n : resolvedEdgeStyles\n ? [resolvedEdgeStyles]\n : DEFAULT_GRAPH_LAYER_STYLESHEET.edges;\n\n const edges: GraphLayerEdgeStyle[] = edgeEntries.filter(Boolean).map((edgeStyleEntry) => ({\n ...edgeStyleEntry,\n type: edgeStyleEntry.type ?? 'edge',\n decorators: edgeStyleEntry.decorators ?? []\n })) as GraphLayerEdgeStyle[];\n\n return {\n nodes,\n edges\n };\n}\n\nexport type {GraphStyleValue, GraphStylesheet, GraphStyleType} from './graph-style-engine';\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {ScatterplotLayer} from '@deck.gl/layers';\n\nexport class CircleLayer extends CompositeLayer {\n static layerName = 'CircleLayer';\n\n renderLayers() {\n const {data, getPosition, stylesheet, positionUpdateTrigger = 0} = this.props as any;\n\n return [\n new ScatterplotLayer(\n this.getSubLayerProps({\n id: '__scatterplot-layer',\n data,\n getPosition,\n ...stylesheet.getDeckGLAccessors(),\n updateTriggers: {\n getPosition: positionUpdateTrigger,\n ...stylesheet.getDeckGLUpdateTriggers()\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {IconLayer} from '@deck.gl/layers';\n\nexport class ImageLayer extends CompositeLayer {\n static layerName = 'ImageLayer';\n\n renderLayers() {\n const {data, getPosition, stylesheet, positionUpdateTrigger = 0} = this.props as any;\n\n return [\n new IconLayer(\n this.getSubLayerProps({\n id: '__icon-layer',\n data,\n getPosition,\n ...stylesheet.getDeckGLAccessors(),\n updateTriggers: {\n getPosition: positionUpdateTrigger,\n ...stylesheet.getDeckGLUpdateTriggers()\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {ZoomableTextLayer} from '../common-layers/zoomable-text-layer/zoomable-text-layer';\n\nexport class LabelLayer extends CompositeLayer {\n static layerName = 'LabelLayer';\n\n renderLayers() {\n const {data, getPosition, stylesheet, positionUpdateTrigger = 0} = this.props as any;\n\n return [\n new ZoomableTextLayer(\n this.getSubLayerProps({\n id: '__text-layer',\n data,\n getPosition,\n ...stylesheet.getDeckGLAccessors(),\n updateTriggers: {\n ...stylesheet.getDeckGLUpdateTriggers(),\n getPosition: positionUpdateTrigger\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {TextLayer} from '@deck.gl/layers';\n\nexport class ZoomableTextLayer extends CompositeLayer {\n static layerName = 'ZoomableTextLayer';\n\n shouldUpdateState({props, changeFlags}) {\n const {scaleWithZoom} = this.props as any;\n if (!scaleWithZoom) {\n return changeFlags.dataChanged || changeFlags.propsChanged;\n }\n return changeFlags.dataChanged || changeFlags.propsChanged || changeFlags.viewportChanged;\n }\n\n // eslint-disable-next-line complexity\n renderLayers() {\n const {\n data,\n getPosition,\n getColor,\n getText,\n getSize,\n getTextAnchor,\n getAlignmentBaseline,\n getAngle,\n scaleWithZoom,\n updateTriggers,\n fontFamily,\n textWordUnits,\n textWordBreak,\n textMaxWidth,\n textSizeMinPixels\n } = this.props as any;\n\n const sizeUpdateTrigger = scaleWithZoom ? [getSize, this.context.viewport.zoom] : false;\n // getText only expects function not plain value (string)\n const newGetText = typeof getText === 'function' ? getText : () => getText;\n\n // Filter data to items that have non-empty text to avoid deck.gl 9.3\n // MultiIconLayer attribute validation errors with undefined/empty labels\n const filteredData = data\n ? data.filter((d: any) => {\n const t = newGetText(d);\n return t !== null && t !== undefined && t !== '';\n })\n : [];\n\n if (filteredData.length === 0) {\n return [];\n }\n\n // Defensive getText wrapper that guarantees a non-empty string.\n // TextLayer's internal MultiIconLayer generates NaN in instanceIconDefs\n // when a character is missing from the font atlas.\n const safeGetText = (d: any) => String(newGetText(d) ?? '') || ' ';\n\n return [\n new TextLayer(\n this.getSubLayerProps({\n id: '__text-layer',\n data: filteredData,\n sizeScale: scaleWithZoom ? Math.pow(2, this.context.viewport.zoom - 1) : 1,\n characterSet: 'auto',\n getPosition,\n getColor,\n getSize,\n getTextAnchor,\n getAlignmentBaseline,\n getAngle,\n getText: safeGetText,\n maxWidth: textMaxWidth ?? 12,\n wordBreak: textWordBreak ?? 'break-all',\n fontFamily: fontFamily ?? 'sans-serif',\n wordUnits: textWordUnits ?? 'pixels',\n sizeMinPixels: textSizeMinPixels ?? 9,\n updateTriggers: {\n getSize: sizeUpdateTrigger,\n getAngle: [sizeUpdateTrigger, updateTriggers.getPosition],\n ...updateTriggers\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {PolygonLayer} from '@deck.gl/layers';\n\nconst generateRectangle = (node, {getWidth, getHeight, getPosition}) => {\n const pos = getPosition(node);\n const width = typeof getWidth === 'function' ? getWidth(node._data.label.length * 12) : getWidth;\n const height = typeof getWidth === 'function' ? getHeight(node) : getHeight;\n const halfWidth = width / 2;\n const halfHeight = height / 2;\n return [\n [pos[0] - halfWidth, pos[1] - halfHeight],\n [pos[0] - halfWidth, pos[1] + halfHeight],\n [pos[0] + halfWidth, pos[1] + halfHeight],\n [pos[0] + halfWidth, pos[1] - halfHeight]\n ];\n};\n\nexport class RectangleLayer extends CompositeLayer {\n static layerName = 'RectangleLayer';\n\n renderLayers() {\n const {data, getPosition, stylesheet, positionUpdateTrigger = 0} = this.props as any;\n\n const getFillColor = stylesheet.getDeckGLAccessor('getFillColor');\n const getLineWidth = stylesheet.getDeckGLAccessor('getLineWidth');\n\n return [\n new PolygonLayer(\n this.getSubLayerProps({\n id: '__polygon-layer',\n data,\n getPolygon: (node) =>\n generateRectangle(node, {\n getPosition,\n getWidth: stylesheet.getDeckGLAccessor('getWidth'),\n getHeight: stylesheet.getDeckGLAccessor('getHeight')\n }),\n filled: Boolean(getFillColor),\n jointRounded: true,\n stroked: Boolean(getLineWidth),\n ...stylesheet.getDeckGLAccessors(),\n updateTriggers: {\n getPolygon: [\n positionUpdateTrigger,\n stylesheet.getDeckGLAccessorUpdateTrigger('getWidth'),\n stylesheet.getDeckGLAccessorUpdateTrigger('getHeight')\n ],\n ...stylesheet.getDeckGLUpdateTriggers()\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport const fs = /* glsl */ `\\\n#define SHADER_NAME rounded-rectangle-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vFillColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n\n float distToCenter = length(unitPosition);\n\n /* Calculate the cutoff radius for the rounded corners */\n float threshold = sqrt(2.0) * (1.0 - roundedRectangle.cornerRadius) + 1.0 * roundedRectangle.cornerRadius;\n if (distToCenter <= threshold) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n`;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// import {ScatterplotLayer} from '@deck.gl/layers';\nimport type {ShaderModule} from '@luma.gl/shadertools';\nimport type {Model} from '@luma.gl/engine';\nimport {fs} from './rounded-rectangle-layer-fragment';\nimport {RectangleLayer} from './rectangle-layer';\n\nconst uniformBlock = `\\\nuniform roundedRectangleUniforms {\n float cornerRadius;\n} roundedRectangle;\n`;\n\nexport type RoundedRectangleProps = {\n cornerRadius: number;\n};\n\nexport const roundedRectangleUniforms = {\n name: 'roundedRectangle',\n vs: uniformBlock,\n fs: uniformBlock,\n uniformTypes: {\n cornerRadius: 'f32'\n }\n} as const satisfies ShaderModule<RoundedRectangleProps>;\n\nexport class RoundedRectangleLayer extends RectangleLayer {\n static layerName = 'RoundedRectangleLayer';\n\n draw(props) {\n const {cornerRadius} = this.props as any;\n const roundedRectangleProps: RoundedRectangleProps = {cornerRadius};\n const model = this.state.model as Model;\n model.shaderInputs.setProps({roundedRectangle: roundedRectangleProps});\n super.draw(props);\n }\n\n getShaders() {\n // use object.assign to make sure we don't overwrite existing fields like `vs`, `modules`...\n const shaders = super.getShaders(undefined!);\n return {\n ...shaders,\n fs,\n modules: [...shaders.modules, roundedRectangleUniforms]\n };\n }\n}\n\nRoundedRectangleLayer.defaultProps = {\n // cornerRadius: the amount of rounding at the rectangle corners\n // 0 - rectangle. 1 - circle.\n cornerRadius: 0.1\n};\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {PolygonLayer} from '@deck.gl/layers';\nimport {generateRoundedCorners} from '../../utils/polygon-calculations';\n\nconst generateRoundedRectangle = (node, {getWidth, getHeight, getPosition, getCornerRadius}) => {\n const pos = getPosition(node);\n const width = typeof getWidth === 'function' ? getWidth(node) : getWidth;\n const height = typeof getWidth === 'function' ? getHeight(node) : getHeight;\n const cornerRadius =\n typeof getCornerRadius === 'function' ? getCornerRadius(node) : getCornerRadius;\n const factor = 20;\n return generateRoundedCorners(pos, width, height, cornerRadius, factor);\n};\n\nexport class PathBasedRoundedRectangleLayer extends CompositeLayer {\n static layerName = 'PathBasedRoundedRectangleLayer';\n\n renderLayers() {\n const {data, getPosition, stylesheet, positionUpdateTrigger = 0} = this.props as any;\n\n const getFillColor = stylesheet.getDeckGLAccessor('getFillColor');\n const getLineWidth = stylesheet.getDeckGLAccessor('getLineWidth');\n\n return [\n new PolygonLayer(\n this.getSubLayerProps({\n id: '__polygon-layer',\n data,\n getPolygon: (node) =>\n generateRoundedRectangle(node, {\n getPosition,\n getWidth: stylesheet.getDeckGLAccessor('getWidth'),\n getHeight: stylesheet.getDeckGLAccessor('getHeight'),\n getCornerRadius: stylesheet.getDeckGLAccessor('getCornerRadius')\n }),\n filled: Boolean(getFillColor),\n stroked: Boolean(getLineWidth),\n ...stylesheet.getDeckGLAccessors(),\n updateTriggers: {\n getPolygon: [\n positionUpdateTrigger,\n stylesheet.getDeckGLAccessorUpdateTrigger('getWidth'),\n stylesheet.getDeckGLAccessorUpdateTrigger('getHeight'),\n stylesheet.getDeckGLAccessorUpdateTrigger('getCornerRadius')\n ],\n ...stylesheet.getDeckGLUpdateTriggers()\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport function generateRoundedCorners(pos, width, height, radius, factor = 20) {\n const halfWidth = width / 2;\n const halfHeight = height / 2;\n const bottomLeft = {X: pos[0] - halfWidth, Y: pos[1] - halfHeight};\n const topLeft = {X: pos[0] - halfWidth, Y: pos[1] + halfHeight};\n const bottomRight = {X: pos[0] + halfWidth, Y: pos[1] - halfHeight};\n const topRight = {X: pos[0] + halfWidth, Y: pos[1] + halfHeight};\n\n const roundedPointsForBottomLeft = getRoundedCorner(\n bottomLeft,\n topLeft,\n bottomRight,\n radius,\n factor\n );\n const roundedPointsForTopLeft = getRoundedCorner(\n topLeft,\n topRight,\n bottomLeft,\n radius,\n factor\n ).reverse();\n const roundedPointsForTopRight = getRoundedCorner(\n topRight,\n bottomRight,\n topLeft,\n radius,\n factor\n ).reverse();\n const roundedPointsForBottomRight = getRoundedCorner(\n bottomRight,\n bottomLeft,\n topRight,\n radius,\n factor\n ).reverse();\n\n const result = [\n ...roundedPointsForBottomLeft,\n ...roundedPointsForTopLeft,\n ...roundedPointsForTopRight,\n ...roundedPointsForBottomRight\n ];\n\n return result;\n}\n\n/**\n *\n * @param {*} angularPoint = corner point\n * @param {*} p1 = edge one\n * @param {*} p2 = edge two\n * @param {*} radius = corner radius\n * @param {*} factor = affects the points used for curve\n * reference: https://stackoverflow.com/questions/24771828/how-to-calculate-rounded-corners-for-a-polygon\n */\n// eslint-disable-next-line max-statements\nfunction getRoundedCorner(angularPoint, p1, p2, radius, factor) {\n // Vector 1\n const dx1 = angularPoint.X - p1.X;\n const dy1 = angularPoint.Y - p1.Y;\n\n // Vector 2\n const dx2 = angularPoint.X - p2.X;\n const dy2 = angularPoint.Y - p2.Y;\n\n // Angle between vector 1 and vector 2 divided by 2\n const angle = (Math.atan2(dy1, dx1) - Math.atan2(dy2, dx2)) / 2;\n\n // The length of segment between angular point and the\n // points of intersection with the circle of a given radius\n const tan = Math.abs(Math.tan(angle));\n let segment = radius / tan;\n // var segment = 2;\n\n // Check the segment\n const length1 = getLength(dx1, dy1);\n const length2 = getLength(dx2, dy2);\n\n const length = Math.min(length1, length2);\n\n if (segment > length) {\n segment = length;\n radius = length * tan;\n }\n\n // Points of intersection are calculated by the proportion between\n // the coordinates of the vector, length of vector and the length of the segment.\n const p1Cross = getProportionPoint(angularPoint, segment, length1, dx1, dy1);\n const p2Cross = getProportionPoint(angularPoint, segment, length2, dx2, dy2);\n\n // Calculation of the coordinates of the circle\n // center by the addition of angular vectors.\n const dx = angularPoint.X * 2 - p1Cross.X - p2Cross.X;\n const dy = angularPoint.Y * 2 - p1Cross.Y - p2Cross.Y;\n\n const L = getLength(dx, dy);\n const d = getLength(segment, radius);\n\n const circlePoint = getProportionPoint(angularPoint, d, L, dx, dy);\n\n // StartAngle and EndAngle of arc\n let startAngle = Math.atan2(p1Cross.Y - circlePoint.Y, p1Cross.X - circlePoint.X);\n const endAngle = Math.atan2(p2Cross.Y - circlePoint.Y, p2Cross.X - circlePoint.X);\n\n // Sweep angle\n let sweepAngle = endAngle - startAngle;\n\n // Some additional checks\n if (sweepAngle < 0) {\n startAngle = endAngle;\n sweepAngle = -sweepAngle;\n }\n\n if (sweepAngle > Math.PI) sweepAngle = Math.PI - sweepAngle;\n\n const degreeFactor = factor / Math.PI;\n\n return getPointsForArc(sweepAngle, degreeFactor, startAngle, circlePoint, radius);\n}\n\nfunction getLength(dx, dy) {\n return Math.sqrt(dx * dx + dy * dy);\n}\n\nfunction getProportionPoint(point, segment, length, dx, dy) {\n const factor = segment / length;\n\n return {\n X: point.X - dx * factor,\n Y: point.Y - dy * factor\n };\n}\n\nfunction getPointsForArc(sweepAngle, degreeFactor, startAngle, circlePoint, radius) {\n const pointsCount = Math.abs(sweepAngle * degreeFactor);\n const sign = Math.sign(sweepAngle);\n\n const points = [];\n\n for (let i = 0; i < pointsCount; ++i) {\n const pointX = circlePoint.X + Math.cos(startAngle + (sign * i) / degreeFactor) * radius;\n\n const pointY = circlePoint.Y + Math.sin(startAngle + (sign * i) / degreeFactor) * radius;\n\n const point = [pointX, pointY];\n points.push(point);\n }\n return points;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {MarkerLayer} from '../common-layers/marker-layer/marker-layer';\n\nexport class ZoomableMarkerLayer extends CompositeLayer {\n static layerName = 'ZoomableMarkerLayer';\n\n shouldUpdateState({props, changeFlags}) {\n const {stylesheet} = this.props as any;\n const scaleWithZoom = stylesheet.getDeckGLAccessor('scaleWithZoom');\n if (!scaleWithZoom) {\n return changeFlags.somethingChanged;\n }\n return changeFlags.somethingChanged || changeFlags.viewportChanged;\n }\n\n renderLayers() {\n const {data, getPosition, stylesheet, positionUpdateTrigger = 0} = this.props as any;\n\n const getSize = stylesheet.getDeckGLAccessor('getSize');\n const scaleWithZoom = stylesheet.getDeckGLAccessor('scaleWithZoom');\n const sizeUpdateTrigger = scaleWithZoom ? [getSize, this.context.viewport.zoom] : false;\n const oiginalGetMarker = stylesheet.getDeckGLAccessor('getMarker');\n // getMarker only expects function not plain value (string)\n const getMarker =\n typeof oiginalGetMarker === 'function' ? oiginalGetMarker : () => oiginalGetMarker;\n\n return [\n new MarkerLayer(\n this.getSubLayerProps({\n id: 'zoomable-marker-layer',\n data,\n getPosition,\n sizeScale: scaleWithZoom ? Math.max(0, this.context.viewport.zoom) : 1,\n ...stylesheet.getDeckGLAccessors(),\n getMarker,\n updateTriggers: {\n ...stylesheet.getDeckGLUpdateTriggers(),\n getPosition: positionUpdateTrigger,\n getSize: sizeUpdateTrigger\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {IconLayer} from '@deck.gl/layers';\n\nimport {MarkerMapping} from './marker-mapping';\nimport {AtlasDataURL} from './atlas-data-url';\n\nexport class MarkerLayer extends CompositeLayer {\n static layerName = 'MarkerLayer';\n\n static defaultProps = {\n id: 'MarkerLayer',\n data: [],\n getMarker: (d) => d.marker,\n getColor: (d) => [0, 0, 0],\n getSize: (d) => 10\n };\n\n renderLayers() {\n const {getMarker, ...otherProps} = this.props as any;\n return [\n new IconLayer(\n this.getSubLayerProps({\n id: 'marker-layer',\n iconAtlas: AtlasDataURL.dataURL,\n iconMapping: MarkerMapping,\n getIcon: getMarker,\n ...otherProps\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable */\nexport const MarkerMapping = {\n 'bell-filled': {\n x: 0,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n bell: {\n x: 32,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n 'bookmark-filled': {\n x: 0,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n bookmark: {\n x: 32,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n 'cd-filled': {\n x: 64,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n cd: {\n x: 64,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n checkmark: {\n x: 0,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-check-filled': {\n x: 32,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-check': {\n x: 64,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-filled': {\n x: 96,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-i-filled': {\n x: 96,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-i': {\n x: 96,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-minus-filled': {\n x: 0,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-minus': {\n x: 32,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-plus-filled': {\n x: 64,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-plus': {\n x: 96,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-questionmark-filled': {\n x: 128,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-questionmark': {\n x: 128,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-slash-filled': {\n x: 128,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-slash': {\n x: 128,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-x-filled': {\n x: 0,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n 'circle-x': {\n x: 32,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n circle: {\n x: 64,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n 'diamond-filled': {\n x: 96,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n diamond: {\n x: 128,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n 'flag-filled': {\n x: 160,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n flag: {\n x: 160,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n gear: {\n x: 160,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n 'heart-filled': {\n x: 160,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n heart: {\n x: 160,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n 'location-marker-filled': {\n x: 0,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n 'location-marker': {\n x: 32,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n 'octagonal-star-filled': {\n x: 64,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n 'octagonal-star': {\n x: 96,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n 'person-filled': {\n x: 128,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n person: {\n x: 160,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n 'pin-filled': {\n x: 192,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n pin: {\n x: 192,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n 'plus-small': {\n x: 192,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n plus: {\n x: 192,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n 'rectangle-filled': {\n x: 192,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n rectangle: {\n x: 192,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n 'star-filled': {\n x: 0,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n star: {\n x: 32,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n 'tag-filled': {\n x: 64,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n tag: {\n x: 96,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n 'thumb-down-filled': {\n x: 128,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n 'thumb-down': {\n x: 160,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n 'thumb-up': {\n x: 192,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n 'thumb_up-filled': {\n x: 224,\n y: 0,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-down-filled': {\n x: 224,\n y: 32,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-down': {\n x: 224,\n y: 64,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-left-filled': {\n x: 224,\n y: 96,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-left': {\n x: 224,\n y: 128,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-right-filled': {\n x: 224,\n y: 160,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-right': {\n x: 224,\n y: 192,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-up-filled': {\n x: 0,\n y: 224,\n width: 32,\n height: 32,\n mask: true\n },\n 'triangle-up': {\n x: 32,\n y: 224,\n width: 32,\n height: 32,\n mask: true\n },\n 'x-small': {\n x: 64,\n y: 224,\n width: 32,\n height: 32,\n mask: true\n },\n x: {\n x: 96,\n y: 224,\n width: 32,\n height: 32,\n mask: true\n }\n};\n/* eslint-enable */\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable */\nexport const AtlasDataURL = {\n dataURL:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAPoAAAD6AG1e1JrAAAgAElEQVR4nO1dB7Re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0khMmdbI7/ErE5AUVlfmCkXjROUqfxGfesnQPVsG3TyL8QSGfzmFOjvN7U0UW6spVJmjIAIbk9XrrBWms14vt/nIpKyoqy+V485hKwjgopHUOSQJQl3NswASOy6mTGNI0pHoPijUBXyAuv1uIA1GVZXNJw5xkYh1EitE5ZFFRncSQphHVeliGVJ7OIWZMhzSkgSRM9l6W4YIY0pCGNKQhuWlL/wdUHWPHyFPiYwAAAABJRU5ErkJggg=='\n};\n/* eslint-enable */\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {COORDINATE_SYSTEM, CompositeLayer} from '@deck.gl/core';\n\nimport {StraightLineEdgeLayer} from '../layers/edge-layers/straight-line-edge-layer';\nimport {PathEdgeLayer} from './edge-layers/path-edge-layer';\nimport {CurvedEdgeLayer} from './edge-layers/curved-edge-layer';\n\nconst EDGE_LAYER_MAP = {\n line: StraightLineEdgeLayer,\n path: PathEdgeLayer,\n 'spline-curve': CurvedEdgeLayer\n};\n\nexport class EdgeLayer extends CompositeLayer {\n static layerName = 'EdgeLayer';\n\n static defaultProps = {\n data: [],\n pickable: true,\n getLayoutInfo: (d) => ({\n type: d.type,\n sourcePosition: d.sourcePosition,\n targetPosition: d.targetPosition,\n controlPoints: []\n }),\n positionUpdateTrigger: 0\n };\n\n updateState({props, oldProps, changeFlags}) {\n super.updateState({props, oldProps, changeFlags} as any);\n if (changeFlags.dataChanged) {\n this.updateStateData();\n }\n }\n\n updateStateData() {\n const {data, getLayoutInfo} = this.props as any;\n // bucket edges by types\n const typedEdgeData = data.reduce(\n (res, d) => {\n const {type} = getLayoutInfo(d);\n res[type].push(d);\n return res;\n },\n {\n line: [],\n path: [],\n 'spline-curve': []\n }\n );\n this.setState({typedEdgeData});\n }\n\n renderLayers() {\n const {getLayoutInfo, pickable, positionUpdateTrigger, stylesheet, id} = this.props as any;\n\n const {typedEdgeData} = this.state;\n\n // render lines by types (straight line, path, curves)\n return Object.entries(typedEdgeData).map((e, idx) => {\n const [type, edgeData] = e;\n const Layer = EDGE_LAYER_MAP[type];\n // invalid edge layer type\n if (!Layer) {\n return null;\n }\n return new Layer({\n id: `${id}-${idx}`,\n data: edgeData,\n getLayoutInfo,\n getColor: stylesheet.getDeckGLAccessor('getColor'),\n getWidth: stylesheet.getDeckGLAccessor('getWidth'),\n colorUpdateTrigger: stylesheet.getDeckGLAccessorUpdateTrigger('getColor'),\n widthUpdateTrigger: stylesheet.getDeckGLAccessorUpdateTrigger('getWidth'),\n positionUpdateTrigger,\n pickable,\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n parameters: {\n depthCompare: 'always'\n }\n } as any);\n });\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {LineLayer} from '@deck.gl/layers';\n\nexport class StraightLineEdgeLayer extends CompositeLayer {\n static layerName = 'StraightLineEdgeLayer';\n\n renderLayers() {\n const {\n data,\n getLayoutInfo,\n positionUpdateTrigger = 0,\n colorUpdateTrigger = 0,\n widthUpdateTrigger = 0,\n ...otherProps\n } = this.props as any;\n return [\n new LineLayer(\n this.getSubLayerProps({\n id: '__line-layer',\n data,\n getSourcePosition: (e) => getLayoutInfo(e).sourcePosition,\n getTargetPosition: (e) => getLayoutInfo(e).targetPosition,\n updateTriggers: {\n getColor: colorUpdateTrigger,\n getSourcePosition: positionUpdateTrigger,\n getTargetPosition: positionUpdateTrigger,\n getWidth: widthUpdateTrigger\n },\n ...otherProps\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {PathLayer} from '@deck.gl/layers';\n\nexport class PathEdgeLayer extends CompositeLayer {\n static layerName = 'PathEdgeLayer';\n\n renderLayers() {\n const {\n data,\n getLayoutInfo,\n positionUpdateTrigger = 0,\n colorUpdateTrigger = 0,\n widthUpdateTrigger = 0,\n ...otherProps\n } = this.props as any;\n return [\n new PathLayer(\n this.getSubLayerProps({\n id: '__line-layer',\n data,\n getPath: (e) => {\n const {sourcePosition, targetPosition, controlPoints} = getLayoutInfo(e);\n return [sourcePosition, ...controlPoints, targetPosition];\n },\n updateTriggers: {\n getColor: colorUpdateTrigger,\n getPath: positionUpdateTrigger,\n getWidth: widthUpdateTrigger\n },\n ...otherProps\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {ScatterplotLayer, LineLayer} from '@deck.gl/layers';\nimport {SplineLayer} from '../common-layers/spline-layer/spline-layer';\n\nconst DEBUG = false;\n\nexport class CurvedEdgeLayer extends CompositeLayer {\n static layerName = 'CurvedEdgeLayer';\n\n // @ts-expect-error TODO\n renderLayers() {\n const {\n data,\n getLayoutInfo,\n positionUpdateTrigger = 0,\n colorUpdateTrigger = 0,\n widthUpdateTrigger = 0,\n ...otherProps\n } = this.props as any;\n return [\n DEBUG &&\n new ScatterplotLayer(\n this.getSubLayerProps({\n id: '__control-points',\n data,\n getPosition: (e) => getLayoutInfo(e).controlPoints[0],\n getColor: (d) => [190, 190, 190, 150],\n getRadius: (d) => 5,\n updateTriggers: {\n getPosition: positionUpdateTrigger\n },\n ...otherProps\n })\n ),\n DEBUG &&\n new LineLayer(\n this.getSubLayerProps({\n id: '__first_segment',\n data,\n getSourcePosition: (e) => getLayoutInfo(e).sourcePosition,\n getTargetPosition: (e) => getLayoutInfo(e).controlPoints[0],\n getColor: (e) => [210, 210, 210, 150],\n updateTriggers: {\n getSourcePosition: positionUpdateTrigger,\n getTargetPosition: positionUpdateTrigger\n },\n ...otherProps\n })\n ),\n DEBUG &&\n new LineLayer(\n this.getSubLayerProps({\n id: '__last_segment',\n data,\n getSourcePosition: (e) => getLayoutInfo(e).controlPoints[0],\n getTargetPosition: (e) => getLayoutInfo(e).targetPosition,\n getColor: (e) => [210, 210, 210, 150],\n updateTriggers: {\n getSourcePosition: positionUpdateTrigger,\n getTargetPosition: positionUpdateTrigger\n },\n ...otherProps\n })\n ),\n new SplineLayer(\n this.getSubLayerProps({\n id: '__spline_layer',\n data,\n getSourcePosition: (e) => getLayoutInfo(e).sourcePosition,\n getTargetPosition: (e) => getLayoutInfo(e).targetPosition,\n getControlPoints: (e) => getLayoutInfo(e).controlPoints,\n updateTriggers: {\n getSourcePosition: positionUpdateTrigger,\n getTargetPosition: positionUpdateTrigger,\n getControlPoints: positionUpdateTrigger,\n getColor: colorUpdateTrigger,\n getWidth: widthUpdateTrigger\n },\n ...otherProps\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {COORDINATE_SYSTEM, CompositeLayer} from '@deck.gl/core';\nimport {PathLayer} from '@deck.gl/layers';\nimport {getCurvePoints} from 'cardinal-spline-js';\n// const getCurvePoints = () => {};\n\n/* Constants */\nconst defaultProps = {\n id: 'spline-layer',\n getData: (d) => d.points,\n getAngle: (x) => 0,\n fontSize: 24,\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n fp64: false\n};\n\nexport class SplineLayer extends CompositeLayer {\n static layerName = 'SplineLayer';\n\n initializeState() {\n this.state = {typedEdgeData: []};\n }\n\n shouldUpdateState({changeFlags}) {\n return changeFlags.dataChanged || changeFlags.propsChanged;\n }\n\n updateState({props, oldProps, changeFlags}) {\n super.updateState({props, oldProps, changeFlags} as any);\n if (changeFlags.dataChanged || changeFlags.propsChanged) {\n this.updateSplineData();\n }\n }\n\n updateSplineData() {\n const {data} = this.props as any;\n const paths = data.reduce((res, d) => {\n const sourcePosition = (this.props as any).getSourcePosition(d);\n const targetPosition = (this.props as any).getTargetPosition(d);\n const controlPoints = (this.props as any).getControlPoints(d);\n\n // Catmull-Rom curve\n const serializedControlPoints = controlPoints.toString().split(',');\n\n // NOTE: we might change the number of points according to the length.\n // so we can render less segements.\n // points = [x1, y1, x2, y2, ...];\n const points = getCurvePoints(\n [...sourcePosition, ...serializedControlPoints, ...targetPosition],\n 0.5,\n 10\n );\n // convert points to [[x1, y1], [x2, y2], ...]\n const path = [];\n for (let idx = 0; idx < points.length; idx += 2) {\n path.push([points[idx], points[idx + 1]]);\n }\n res.push(path);\n return res;\n }, []);\n this.setState({paths});\n }\n\n renderLayers() {\n const {coordinateSystem, getColor, getWidth, id, updateTriggers} = this.props as any;\n const {paths} = this.state;\n return new PathLayer({\n id: `${id}-splines`,\n data: paths as any,\n getPath: (d) => d,\n getColor,\n getWidth,\n coordinateSystem,\n updateTriggers\n });\n }\n}\n\nSplineLayer.layerName = 'SplineLayer';\nSplineLayer.defaultProps = defaultProps;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {ZoomableTextLayer} from '../common-layers/zoomable-text-layer/zoomable-text-layer';\n\nexport class EdgeLabelLayer extends CompositeLayer {\n static layerName = 'EdgeLabelLayer';\n\n renderLayers() {\n const {data, getLayoutInfo, positionUpdateTrigger = 0, stylesheet} = this.props as any;\n return [\n new ZoomableTextLayer(\n this.getSubLayerProps({\n id: 'edge-label-layer',\n data,\n getPosition: (e) => {\n const {sourcePosition, targetPosition, controlPoints = []} = getLayoutInfo(e);\n // consider all the points on this edge\n const allPoints = [sourcePosition, targetPosition, ...controlPoints];\n const sumX = allPoints.reduce((res, p) => res + p[0], 0);\n const sumY = allPoints.reduce((res, p) => res + p[1], 0);\n // find the centroid of those points\n return [sumX / allPoints.length, sumY / allPoints.length];\n },\n getAngle: (e) => {\n const {sourcePosition, targetPosition} = getLayoutInfo(e);\n // sort the nodes from left to right\n const [newSourcePosition, newTargetPosition] =\n sourcePosition[0] < targetPosition[0]\n ? [sourcePosition, targetPosition]\n : [targetPosition, sourcePosition];\n // angle in degrees\n const deltaX = newTargetPosition[0] - newSourcePosition[0];\n const deltaY = newTargetPosition[1] - newSourcePosition[1];\n return (Math.atan2(deltaY, deltaX) * -180) / Math.PI;\n },\n ...stylesheet.getDeckGLAccessors(),\n updateTriggers: {\n ...stylesheet.getDeckGLUpdateTriggers(),\n getPosition: positionUpdateTrigger\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\n\nimport {FlowPathLayer} from '../common-layers/flow-path-layer/flow-path-layer';\n\nexport class FlowLayer extends CompositeLayer {\n static layerName = 'FlowLayer';\n\n renderLayers() {\n const {data, getLayoutInfo, positionUpdateTrigger = 0, stylesheet} = this.props as any;\n return [\n new FlowPathLayer(\n this.getSubLayerProps({\n id: '__flow-layer',\n data,\n ...stylesheet.getDeckGLAccessors(),\n getSourcePosition: (e) => getLayoutInfo(e).sourcePosition,\n getTargetPosition: (e) => getLayoutInfo(e).targetPosition,\n parameters: {\n depthTest: false\n },\n updateTriggers: {\n ...stylesheet.getDeckGLUpdateTriggers(),\n getSourcePosition: positionUpdateTrigger,\n getTargetPosition: positionUpdateTrigger\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// import {Buffer, Transform} from '@luma.gl/core';\nimport {LineLayer} from '@deck.gl/layers';\n\nimport {vs} from './flow-path-layer-vertex.glsl';\nimport {fs} from './flow-path-layer-fragment.glsl';\n// import {tfvs} from './flow-path-layer-vertex-tf.glsl';\n\nconst defaultProps = {\n ...LineLayer.defaultProps,\n getWidth: {type: 'accessor', value: 1},\n getSpeed: {type: 'accessor', value: 0}\n};\n\n/* eslint-disable camelcase */\nexport class FlowPathLayer extends LineLayer {\n getShaders() {\n const projectModule = this.use64bitPositions() ? 'project64' : 'project32';\n return {vs, fs, modules: [projectModule, 'picking']};\n }\n\n initializeState() {\n super.initializeState();\n this.getAttributeManager().addInstanced({\n instanceSpeeds: {\n size: 1,\n transition: true,\n accessor: 'getSpeed',\n defaultValue: 0\n },\n instanceTailLengths: {\n size: 1,\n transition: true,\n accessor: 'getTailLength',\n defaultValue: 1\n }\n });\n this.setupTransformFeedback();\n this.setState({\n ...this.state,\n animation: globalThis.window.requestAnimationFrame(this.animate.bind(this))\n });\n }\n\n animate() {\n const {transform} = this.state as any;\n if (transform) {\n transform.run();\n transform.swap();\n }\n this.setState({\n animation: window.requestAnimationFrame(this.animate.bind(this))\n });\n }\n\n updateState({props, oldProps, changeFlags}) {\n super.updateState({props, oldProps, changeFlags} as any);\n const {speedsBuffer} = this.state as any;\n\n const speedChanged =\n changeFlags.dataChanged ||\n props.fp64 !== oldProps.fp64 ||\n (changeFlags.updateTriggersChanged &&\n (changeFlags.updateTriggersChanged.all || changeFlags.updateTriggersChanged.getSpeed));\n\n if (speedChanged) {\n const speeds = new Float32Array(props.data.length);\n for (let i = 0; i < props.data.length; i++) {\n speeds[i] =\n typeof props.getSpeed === 'function' ? props.getSpeed(props.data[i]) : props.getSpeed;\n }\n speedsBuffer.subData({data: speeds});\n }\n\n if (props.fp64 !== oldProps.fp64) {\n if (this.state.model) {\n (this.state.model as any).delete();\n }\n this.setState({model: this._getModel()});\n this.getAttributeManager().invalidateAll();\n }\n }\n\n finalizeState() {\n super.finalizeState(this.context);\n window.cancelAnimationFrame((this.state as any).animation);\n }\n\n setupTransformFeedback() {\n throw new Error('Not implemented');\n // const {gl} = this.context;\n // const elementCount = this.props.data && this.props.data.length;\n // if (elementCount) {\n // const instanceOffsets = new Float32Array(elementCount);\n // const instanceSpeeds = new Float32Array(elementCount);\n // const offsetBuffer = new Buffer(gl, instanceOffsets);\n // const speedsBuffer = new Buffer(gl, instanceSpeeds);\n\n // this.setState({\n // speedsBuffer,\n // transform: new Transform(gl, {\n // id: 'transform-offset',\n // vs: tfvs,\n // elementCount,\n // sourceBuffers: {\n // a_offset: offsetBuffer,\n // a_speed: speedsBuffer\n // },\n // feedbackMap: {\n // a_offset: 'v_offset'\n // }\n // })\n // });\n // }\n }\n\n draw({uniforms}) {\n throw new Error('Not implemented');\n // const {transform} = this.state;\n // if (!transform) {\n // return;\n // }\n\n // const {viewport} = this.context;\n // const {widthUnits, widthScale, widthMinPixels, widthMaxPixels} = this.props;\n\n // const widthMultiplier = widthUnits === 'pixels' ? viewport.distanceScales.metersPerPixel[2] : 1;\n\n // const offsetBuffer = transform.getBuffer('v_offset');\n // offsetBuffer.setAccessor({divisor: 1});\n\n // this.state.model\n // .setAttributes({\n // instanceOffsets: offsetBuffer\n // })\n // .setUniforms(\n // Object.assign({}, uniforms, {\n // widthScale: widthScale * widthMultiplier,\n // widthMinPixels,\n // widthMaxPixels\n // })\n // )\n // .draw();\n\n // offsetBuffer.setAccessor({divisor: 0});\n }\n}\n\nFlowPathLayer.layerName = 'FlowPathLayer';\n(FlowPathLayer as any).defaultProps = defaultProps;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport const vs = /* glsl */ `\\\n#define SHADER_NAME flow-path-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceSpeeds;\nattribute float instanceOffsets;\nattribute float instanceTailLengths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying float segmentIndex;\nvarying float speed;\nvarying float pathLength;\nvarying float tailLength;\nvarying float offset;\n\n// offset vector by strokeWidth pixels\n// offset_direction is -1 (left) or 1 (right)\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_size_to_clipspace(offset_screenspace);\n\n return offset_clipspace;\n}\n\nvoid main(void) {\n // Position\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.));\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.));\n\n // Multiply out width and clamp to limits\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n\n // linear interpolation of source & target to pick right coord\n segmentIndex = positions.x;\n speed = instanceSpeeds;\n tailLength = project_size_to_pixel(instanceTailLengths * widthScale);\n offset = instanceOffsets;\n pathLength = distance(instanceSourcePositions, instanceTargetPositions);\n vec4 p = mix(source, target, segmentIndex);\n\n // extrude\n vec2 offset = getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels);\n gl_Position = p + vec4(offset, 0.0, 0.0);\n\n // Color\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n`;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport const fs = /* glsl */ `\\\n#define SHADER_NAME flow-path-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float segmentIndex;\nvarying float speed;\nvarying float offset;\nvarying float pathLength;\nvarying float tailLength;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n\n if (speed == 0.0) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n // the portion of the visible segment (0 to 1) , ex: 0.3\n // edge cases: pathLength = 0 or tailLength > pathLength\n float segFragment = 0.0;\n if (pathLength != 0.0) {\n segFragment = tailLength / pathLength;\n }\n if (tailLength > pathLength) {\n segFragment = 1.0;\n }\n float startSegmentIndex = mod(offset, 60.0) / 60.0;\n // the end offset, cap to 1.0 (end of the line)\n float endSegmentIndex = min(startSegmentIndex + segFragment, 1.0);\n if (segmentIndex < startSegmentIndex || segmentIndex > endSegmentIndex) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n // fading tail\n float portion = (segmentIndex - startSegmentIndex) / segFragment;\n gl_FragColor[3] = portion;\n }\n }\n}\n`;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\nimport {SimpleMeshLayer} from '@deck.gl/mesh-layers';\n\nimport {Arrow2DGeometry} from './arrow-2d-geometry';\n\nconst DEFAULT_ARROW_GEOMETRY = new Arrow2DGeometry({length: 1, headWidth: 0.6});\n\ntype LayoutInfo = {\n sourcePosition: number[];\n targetPosition: number[];\n controlPoints?: number[][];\n};\n\nconst DEFAULT_Z = 0;\n\nfunction resolveSize(value: unknown): number {\n const numeric = Number(value);\n return Number.isFinite(numeric) && numeric !== 0 ? numeric : 1;\n}\n\nfunction getOffsetComponents(offset: unknown): {along: number; perpendicular: number} {\n if (!Array.isArray(offset)) {\n return {along: 0, perpendicular: 0};\n }\n const along = Number(offset[0]);\n const perpendicular = Number(offset[1]);\n return {\n along: Number.isFinite(along) ? along : 0,\n perpendicular: Number.isFinite(perpendicular) ? perpendicular : 0\n };\n}\n\nexport function isEdgeDirected(edge: any): boolean {\n if (!edge) {\n return false;\n }\n if (typeof edge.isDirected === 'function') {\n return Boolean(edge.isDirected());\n }\n if (typeof edge.directed === 'boolean') {\n return edge.directed;\n }\n return false;\n}\n\nfunction normalizeVector(vector: number[]): number[] {\n const length = Math.hypot(vector[0] ?? 0, vector[1] ?? 0, vector[2] ?? 0);\n if (length === 0) {\n return [0, 0, 0];\n }\n return [(vector[0] ?? 0) / length, (vector[1] ?? 0) / length, (vector[2] ?? 0) / length];\n}\n\nfunction getTerminalDirection({sourcePosition, targetPosition, controlPoints = []}: LayoutInfo): {\n target: number[];\n direction: number[];\n} {\n const anchor = controlPoints.length ? controlPoints[controlPoints.length - 1] : sourcePosition;\n const direction = [\n (targetPosition[0] ?? 0) - (anchor?.[0] ?? 0),\n (targetPosition[1] ?? 0) - (anchor?.[1] ?? 0),\n (targetPosition[2] ?? DEFAULT_Z) - (anchor?.[2] ?? DEFAULT_Z)\n ];\n return {target: targetPosition, direction};\n}\n\nexport function getArrowTransform({\n layout,\n size,\n offset = null\n}: {\n layout: LayoutInfo;\n size: number;\n offset?: number[] | null;\n}): {position: [number, number, number]; angle: number} {\n const {target, direction} = getTerminalDirection(layout);\n const unit = normalizeVector(direction);\n\n const hasDirection = unit[0] !== 0 || unit[1] !== 0 || unit[2] !== 0;\n const resolvedSize = resolveSize(size);\n const basePosition: [number, number, number] = [\n target[0] ?? 0,\n target[1] ?? 0,\n target[2] ?? DEFAULT_Z\n ];\n\n if (!hasDirection) {\n return {position: basePosition, angle: 0};\n }\n\n const {along, perpendicular} = getOffsetComponents(offset);\n const alongDistance = resolvedSize * 0.5 + along;\n const position: [number, number, number] = [\n basePosition[0] - unit[0] * alongDistance,\n basePosition[1] - unit[1] * alongDistance,\n basePosition[2] - unit[2] * alongDistance\n ];\n\n if (perpendicular) {\n const perp = [-unit[1], unit[0], 0];\n position[0] += perp[0] * perpendicular;\n position[1] += perp[1] * perpendicular;\n position[2] += perp[2] * perpendicular;\n }\n\n const angle = (Math.atan2(unit[0], unit[1]) * 180) / Math.PI;\n\n return {position, angle};\n}\n\nexport class EdgeArrowLayer extends CompositeLayer {\n static layerName = 'EdgeArrowLayer';\n\n renderLayers() {\n const {data, getLayoutInfo, positionUpdateTrigger = 0, stylesheet} = this.props as any;\n const directedEdges = (data || []).filter(isEdgeDirected);\n\n if (!directedEdges.length) {\n return [];\n }\n\n const {getColor, getSize, getOffset} = stylesheet.getDeckGLAccessors();\n const updateTriggers = stylesheet.getDeckGLUpdateTriggers();\n\n return [\n new SimpleMeshLayer(\n this.getSubLayerProps({\n id: '__edge-arrow-layer',\n data: directedEdges,\n mesh: DEFAULT_ARROW_GEOMETRY,\n getColor,\n getScale: (edge) => {\n const size = resolveSize(getSize(edge));\n return [size, size, size];\n },\n getOrientation: (edge) => {\n const layout = getLayoutInfo(edge);\n const size = resolveSize(getSize(edge));\n const offset = getOffset ? getOffset(edge) : null;\n const {angle} = getArrowTransform({layout, size, offset});\n return [0, -angle, 0];\n },\n getPosition: (edge) => {\n const layout = getLayoutInfo(edge);\n const size = resolveSize(getSize(edge));\n const offset = getOffset ? getOffset(edge) : null;\n const {position} = getArrowTransform({layout, size, offset});\n return position;\n },\n parameters: {\n depthTest: false\n },\n updateTriggers: {\n getColor: updateTriggers.getColor,\n getScale: updateTriggers.getSize,\n getOrientation: [\n positionUpdateTrigger,\n updateTriggers.getSize,\n updateTriggers.getOffset\n ],\n getPosition: [positionUpdateTrigger, updateTriggers.getSize, updateTriggers.getOffset]\n }\n })\n )\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Geometry} from '@luma.gl/engine';\n\n// Mirror of the arrow geometry used by PathMarkerLayer, but only the head triangle.\nexport class Arrow2DGeometry extends Geometry {\n constructor(opts = {}) {\n super(\n Object.assign({}, opts, {\n attributes: getArrowAttributes(opts),\n topology: 'triangle-list' as const\n })\n );\n }\n}\n\nfunction getArrowAttributes({length = 1, headWidth = 1}) {\n const halfLength = length / 2;\n const halfWidth = headWidth / 2;\n\n const positions = new Float32Array([\n 0,\n halfLength,\n 0,\n -halfWidth,\n -halfLength,\n 0,\n halfWidth,\n -halfLength,\n 0\n ]);\n\n const normals = new Float32Array([0, 0, 1, 0, 0, 1, 0, 0, 1]);\n\n const texCoords = new Float32Array([0.5, 1, 0, 0, 1, 0]);\n\n return {\n positions: {size: 3, value: positions},\n normals: {size: 3, value: normals},\n texCoords: {size: 2, value: texCoords}\n };\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport type GeometryNodeType =\n | 'circle'\n | 'rectangle'\n | 'rounded-rectangle'\n | 'path-rounded-rectangle'\n | 'marker';\n\nexport type NodeGeometry = {\n type?: GeometryNodeType;\n center: [number, number];\n radius?: number;\n width?: number;\n height?: number;\n cornerRadius?: number;\n};\n\nconst EPSILON = 1e-6;\n\nfunction normalizeDirection(\n center: [number, number],\n target: [number, number]\n): {unit: [number, number]; distance: number} | null {\n const dx = target[0] - center[0];\n const dy = target[1] - center[1];\n const length = Math.hypot(dx, dy);\n\n if (length <= EPSILON) {\n return null;\n }\n\n return {unit: [dx / length, dy / length], distance: length};\n}\n\nfunction projectFromCenter(\n center: [number, number],\n unit: [number, number],\n distance: number\n): [number, number] {\n return [center[0] + unit[0] * distance, center[1] + unit[1] * distance];\n}\n\nfunction projectToRectangle(\n center: [number, number],\n unit: [number, number],\n halfWidth: number,\n halfHeight: number\n): [number, number] {\n const absUx = Math.abs(unit[0]);\n const absUy = Math.abs(unit[1]);\n\n let distance = Number.POSITIVE_INFINITY;\n if (halfWidth > 0 && absUx > EPSILON) {\n distance = Math.min(distance, halfWidth / absUx);\n }\n if (halfHeight > 0 && absUy > EPSILON) {\n distance = Math.min(distance, halfHeight / absUy);\n }\n\n if (!Number.isFinite(distance)) {\n return [...center] as [number, number];\n }\n\n return [center[0] + unit[0] * distance, center[1] + unit[1] * distance];\n}\n\nfunction resolveCornerRadius(\n rawCornerRadius: number | undefined,\n halfWidth: number,\n halfHeight: number\n): number {\n if (!Number.isFinite(rawCornerRadius) || rawCornerRadius <= 0) {\n return 0;\n }\n\n let resolved = rawCornerRadius;\n if (resolved <= 1) {\n resolved *= Math.min(halfWidth, halfHeight);\n }\n\n return Math.min(resolved, halfWidth, halfHeight);\n}\n\n// eslint-disable-next-line max-params\nfunction intersectsInnerFaces(\n absX: number,\n absY: number,\n innerHalfWidth: number,\n innerHalfHeight: number,\n halfWidth: number,\n halfHeight: number\n) {\n const insideVerticalFace = absX <= innerHalfWidth + EPSILON && absY <= halfHeight + EPSILON;\n const insideHorizontalFace = absY <= innerHalfHeight + EPSILON && absX <= halfWidth + EPSILON;\n return insideVerticalFace || insideHorizontalFace;\n}\n\n// eslint-disable-next-line max-params\nfunction projectToCornerArc(\n geometry: NodeGeometry,\n unit: [number, number],\n innerHalfWidth: number,\n innerHalfHeight: number,\n cornerRadius: number,\n rectanglePoint: [number, number]\n) {\n const offsetX = rectanglePoint[0] - geometry.center[0];\n const offsetY = rectanglePoint[1] - geometry.center[1];\n\n const cornerCenter: [number, number] = [\n geometry.center[0] + Math.sign(offsetX || unit[0]) * innerHalfWidth,\n geometry.center[1] + Math.sign(offsetY || unit[1]) * innerHalfHeight\n ];\n const relativeCornerCenter: [number, number] = [\n cornerCenter[0] - geometry.center[0],\n cornerCenter[1] - geometry.center[1]\n ];\n\n const dot = unit[0] * relativeCornerCenter[0] + unit[1] * relativeCornerCenter[1];\n const centerDistanceSq =\n relativeCornerCenter[0] * relativeCornerCenter[0] +\n relativeCornerCenter[1] * relativeCornerCenter[1];\n const discriminant = dot * dot - (centerDistanceSq - cornerRadius * cornerRadius);\n\n if (discriminant < 0) {\n return rectanglePoint;\n }\n\n const distance = dot - Math.sqrt(Math.max(0, discriminant));\n return projectFromCenter(geometry.center, unit, distance);\n}\n\nfunction computeRectangleIntersection(\n geometry: NodeGeometry,\n unit: [number, number]\n): [number, number] {\n const halfWidth = (geometry.width ?? 0) / 2;\n const halfHeight = (geometry.height ?? 0) / 2;\n if (halfWidth <= EPSILON || halfHeight <= EPSILON) {\n return [...geometry.center];\n }\n return projectToRectangle(geometry.center, unit, halfWidth, halfHeight);\n}\n\n// eslint-disable-next-line max-statements, complexity\nfunction computeRoundedRectangleIntersection(\n geometry: NodeGeometry,\n unit: [number, number]\n): [number, number] {\n const halfWidth = (geometry.width ?? 0) / 2;\n const halfHeight = (geometry.height ?? 0) / 2;\n\n if (halfWidth <= EPSILON || halfHeight <= EPSILON) {\n const radius = geometry.radius ?? Math.min(halfWidth, halfHeight);\n return projectFromCenter(geometry.center, unit, radius);\n }\n\n const cornerRadius = resolveCornerRadius(geometry.cornerRadius, halfWidth, halfHeight);\n\n if (cornerRadius <= EPSILON) {\n return projectToRectangle(geometry.center, unit, halfWidth, halfHeight);\n }\n\n const innerHalfWidth = Math.max(halfWidth - cornerRadius, 0);\n const innerHalfHeight = Math.max(halfHeight - cornerRadius, 0);\n\n if (innerHalfWidth <= EPSILON || innerHalfHeight <= EPSILON) {\n const radius = Math.min(halfWidth, halfHeight);\n return projectFromCenter(geometry.center, unit, radius);\n }\n\n const rectanglePoint = projectToRectangle(geometry.center, unit, halfWidth, halfHeight);\n const absX = Math.abs(rectanglePoint[0] - geometry.center[0]);\n const absY = Math.abs(rectanglePoint[1] - geometry.center[1]);\n\n const touchesInnerFace = absX <= innerHalfWidth + EPSILON || absY <= innerHalfHeight + EPSILON;\n\n if (\n touchesInnerFace &&\n intersectsInnerFaces(absX, absY, innerHalfWidth, innerHalfHeight, halfWidth, halfHeight)\n ) {\n return rectanglePoint;\n }\n\n return projectToCornerArc(\n geometry,\n unit,\n innerHalfWidth,\n innerHalfHeight,\n cornerRadius,\n rectanglePoint\n );\n}\n\nfunction computeCircleIntersection(\n geometry: NodeGeometry,\n unit: [number, number],\n radius?: number\n) {\n const effectiveRadius = radius ?? geometry.radius ?? 0;\n return projectFromCenter(geometry.center, unit, Math.max(effectiveRadius, 0));\n}\n\nconst BOUNDARY_COMPUTERS: Record<\n GeometryNodeType,\n (geometry: NodeGeometry, unit: [number, number]) => [number, number]\n> = {\n circle: (geometry, unit) => computeCircleIntersection(geometry, unit),\n marker: (geometry, unit) => computeCircleIntersection(geometry, unit),\n rectangle: (geometry, unit) => computeRectangleIntersection(geometry, unit),\n 'rounded-rectangle': (geometry, unit) => computeRoundedRectangleIntersection(geometry, unit),\n 'path-rounded-rectangle': (geometry, unit) => computeRoundedRectangleIntersection(geometry, unit)\n};\n\nexport function getNodeBoundaryIntersection(\n geometry: NodeGeometry,\n targetCenter: [number, number]\n): [number, number] {\n const direction = normalizeDirection(geometry.center, targetCenter);\n if (!direction) {\n return [...geometry.center];\n }\n\n const handler = geometry.type ? BOUNDARY_COMPUTERS[geometry.type] : undefined;\n if (handler) {\n return handler(geometry, direction.unit);\n }\n\n if (geometry.radius && geometry.radius > EPSILON) {\n return projectFromCenter(geometry.center, direction.unit, geometry.radius);\n }\n\n return [...geometry.center];\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {InteractionManager} from '../core/interaction-manager';\nimport type {GraphEngine} from '../core/graph-engine';\nimport type {NodeInterface} from '../graph/graph';\n\nimport {GraphStylesheetEngine, type GraphStyleRule} from '../style/graph-style-engine';\nimport type {GraphLayerNodeStyle} from '../style/graph-layer-stylesheet';\nimport {\n getNodeBoundaryIntersection,\n type GeometryNodeType,\n type NodeGeometry\n} from '../utils/node-boundary';\nimport {warn} from '../utils/log';\n\ntype NumericAccessor = ((node: NodeInterface) => number) | number | null | undefined;\ntype OffsetAccessor =\n | ((node: NodeInterface) => [number, number])\n | [number, number]\n | null\n | undefined;\n\ntype NodeStyleAccessors = {\n type: GeometryNodeType;\n getOffset?: OffsetAccessor;\n getRadius?: NumericAccessor;\n getWidth?: NumericAccessor;\n getHeight?: NumericAccessor;\n getCornerRadius?: NumericAccessor;\n getSize?: NumericAccessor;\n};\n\nconst GEOMETRY_NODE_TYPES: GeometryNodeType[] = [\n 'circle',\n 'rectangle',\n 'rounded-rectangle',\n 'path-rounded-rectangle',\n 'marker'\n];\n\nfunction evaluateNumericAccessor(\n accessor: NumericAccessor,\n node: NodeInterface\n): number | undefined {\n if (typeof accessor === 'function') {\n const value = accessor(node);\n return typeof value === 'number' && Number.isFinite(value) ? value : undefined;\n }\n if (typeof accessor === 'number' && Number.isFinite(accessor)) {\n return accessor;\n }\n return undefined;\n}\n\nfunction evaluateOffsetAccessor(accessor: OffsetAccessor, node: NodeInterface): [number, number] {\n if (!accessor) {\n return [0, 0];\n }\n\n let value = accessor as [number, number];\n if (typeof accessor === 'function') {\n value = accessor(node);\n }\n\n if (Array.isArray(value) && value.length >= 2) {\n const offsetX = Number(value[0]);\n const offsetY = Number(value[1]);\n if (Number.isFinite(offsetX) && Number.isFinite(offsetY)) {\n return [offsetX, offsetY];\n }\n }\n\n return [0, 0];\n}\n\nfunction normalizePosition(value: any): [number, number] | null {\n if (!value || typeof value !== 'object') {\n return null;\n }\n\n const candidate = value as {length?: number; [index: number]: number};\n if (typeof candidate.length === 'number' && candidate.length >= 2) {\n const x = Number(candidate[0]);\n const y = Number(candidate[1]);\n if (Number.isFinite(x) && Number.isFinite(y)) {\n return [x, y];\n }\n }\n\n return null;\n}\n\nfunction resolveAccessorValue(accessor: NumericAccessor | undefined, node: NodeInterface) {\n if (!accessor) {\n return undefined;\n }\n return evaluateNumericAccessor(accessor, node);\n}\n\nfunction assignDimension(\n geometry: NodeGeometry,\n key: 'radius' | 'width' | 'height' | 'cornerRadius',\n value: number | undefined\n) {\n if (typeof value === 'number' && Number.isFinite(value)) {\n geometry[key] = Math.max(value, 0);\n }\n}\n\nfunction assignRectangleDimensions(\n node: NodeInterface,\n accessors: NodeStyleAccessors,\n geometry: NodeGeometry\n) {\n assignDimension(geometry, 'width', resolveAccessorValue(accessors.getWidth, node));\n assignDimension(geometry, 'height', resolveAccessorValue(accessors.getHeight, node));\n}\n\nconst GEOMETRY_APPLIERS: Record<\n GeometryNodeType,\n (node: NodeInterface, accessors: NodeStyleAccessors, geometry: NodeGeometry) => void\n> = {\n circle: (node, accessors, geometry) => {\n assignDimension(geometry, 'radius', resolveAccessorValue(accessors.getRadius, node));\n },\n marker: (node, accessors, geometry) => {\n const size = resolveAccessorValue(accessors.getSize, node);\n assignDimension(geometry, 'radius', typeof size === 'number' ? size / 2 : undefined);\n },\n rectangle: (node, accessors, geometry) => {\n assignRectangleDimensions(node, accessors, geometry);\n },\n 'rounded-rectangle': (node, accessors, geometry) => {\n assignRectangleDimensions(node, accessors, geometry);\n assignDimension(\n geometry,\n 'cornerRadius',\n resolveAccessorValue(accessors.getCornerRadius, node)\n );\n assignDimension(geometry, 'radius', resolveAccessorValue(accessors.getRadius, node));\n },\n 'path-rounded-rectangle': (node, accessors, geometry) => {\n assignRectangleDimensions(node, accessors, geometry);\n assignDimension(\n geometry,\n 'cornerRadius',\n resolveAccessorValue(accessors.getCornerRadius, node)\n );\n }\n};\n\nexport class EdgeAttachmentHelper {\n getLayoutAccessor({\n engine,\n interactionManager,\n nodeStyle\n }: {\n engine: GraphEngine;\n interactionManager: InteractionManager;\n nodeStyle?: GraphLayerNodeStyle[] | GraphLayerNodeStyle;\n }) {\n const nodeAccessorMap = this._buildNodeStyleAccessorMap({\n engine,\n interactionManager,\n nodeStyle\n });\n\n if (nodeAccessorMap.size === 0) {\n return (edge: any) => engine.getEdgePosition(edge);\n }\n\n const nodeMap = engine\n .getNodes()\n .reduce(\n (acc, node) => acc.set(node.getId(), node),\n new Map<string | number, NodeInterface>()\n );\n\n return (edge: any) => this._getAdjustedEdgeLayout(engine, nodeAccessorMap, nodeMap, edge);\n }\n\n private _buildNodeStyleAccessorMap({\n engine,\n interactionManager,\n nodeStyle\n }: {\n engine: GraphEngine;\n interactionManager: InteractionManager;\n nodeStyle?: GraphLayerNodeStyle[] | GraphLayerNodeStyle;\n }) {\n const nodeAccessorMap = new Map<string | number, NodeStyleAccessors>();\n\n if (!nodeStyle) {\n return nodeAccessorMap;\n }\n\n const styles = Array.isArray(nodeStyle) ? nodeStyle : [nodeStyle];\n\n styles.filter(Boolean).forEach((style) => {\n const {data = (nodes) => nodes, ...restStyle} = style;\n const type = restStyle.type;\n\n if (!type || !GEOMETRY_NODE_TYPES.includes(type as GeometryNodeType)) {\n return;\n }\n\n let stylesheet: GraphStylesheetEngine | null = null;\n try {\n stylesheet = engine.createStylesheetEngine(restStyle as GraphStyleRule, {\n stateUpdateTrigger: (interactionManager as any).getLastInteraction()\n });\n } catch (error) {\n warn(\n `GraphLayer: Failed to evaluate node stylesheet for edge attachment (${String(\n (error as Error).message ?? error\n )}).`\n );\n return;\n }\n\n const nodes = data(engine.getNodes());\n if (!Array.isArray(nodes)) {\n return;\n }\n\n const geometryType = type as GeometryNodeType;\n const accessors = this._createAccessorsForType(geometryType, stylesheet);\n\n nodes.forEach((node: NodeInterface) => {\n const id = node.getId();\n if (!nodeAccessorMap.has(id)) {\n nodeAccessorMap.set(id, accessors);\n }\n });\n });\n\n return nodeAccessorMap;\n }\n\n private _getAdjustedEdgeLayout(\n engine: GraphEngine,\n nodeAccessorMap: Map<string | number, NodeStyleAccessors>,\n nodeMap: Map<string | number, NodeInterface>,\n edge: any\n ) {\n const layoutInfo = engine.getEdgePosition(edge);\n if (!layoutInfo) {\n return layoutInfo;\n }\n\n const sourceNode = nodeMap.get(edge.getSourceNodeId());\n const targetNode = nodeMap.get(edge.getTargetNodeId());\n\n if (!sourceNode || !targetNode) {\n return layoutInfo;\n }\n\n const sourceGeometry = this._computeNodeGeometry(\n engine,\n sourceNode,\n nodeAccessorMap.get(sourceNode.getId())\n );\n const targetGeometry = this._computeNodeGeometry(\n engine,\n targetNode,\n nodeAccessorMap.get(targetNode.getId())\n );\n\n if (!sourceGeometry && !targetGeometry) {\n return layoutInfo;\n }\n\n return this._applyGeometryToLayout(layoutInfo, sourceGeometry, targetGeometry);\n }\n\n private _applyGeometryToLayout(\n layoutInfo: any,\n sourceGeometry: NodeGeometry | null,\n targetGeometry: NodeGeometry | null\n ) {\n const adjustedLayout = {...layoutInfo};\n\n const targetReference = targetGeometry?.center ?? normalizePosition(layoutInfo.targetPosition);\n const sourceReference = sourceGeometry?.center ?? normalizePosition(layoutInfo.sourcePosition);\n\n if (sourceGeometry) {\n adjustedLayout.sourcePosition = targetReference\n ? getNodeBoundaryIntersection(sourceGeometry, targetReference)\n : [...sourceGeometry.center];\n }\n\n if (targetGeometry) {\n adjustedLayout.targetPosition = sourceReference\n ? getNodeBoundaryIntersection(targetGeometry, sourceReference)\n : [...targetGeometry.center];\n }\n\n return adjustedLayout;\n }\n\n private _createAccessorsForType(\n geometryType: GeometryNodeType,\n stylesheet: GraphStylesheetEngine\n ): NodeStyleAccessors {\n const base: NodeStyleAccessors = {\n type: geometryType,\n getOffset: stylesheet.getDeckGLAccessor('getOffset')\n };\n\n switch (geometryType) {\n case 'circle':\n base.getRadius = stylesheet.getDeckGLAccessor('getRadius');\n break;\n case 'marker':\n base.getSize = stylesheet.getDeckGLAccessor('getSize');\n break;\n case 'rectangle':\n base.getWidth = stylesheet.getDeckGLAccessor('getWidth');\n base.getHeight = stylesheet.getDeckGLAccessor('getHeight');\n break;\n case 'rounded-rectangle':\n base.getWidth = stylesheet.getDeckGLAccessor('getWidth');\n base.getHeight = stylesheet.getDeckGLAccessor('getHeight');\n base.getCornerRadius = stylesheet.getDeckGLAccessor('getCornerRadius');\n base.getRadius = stylesheet.getDeckGLAccessor('getRadius');\n break;\n case 'path-rounded-rectangle':\n base.getWidth = stylesheet.getDeckGLAccessor('getWidth');\n base.getHeight = stylesheet.getDeckGLAccessor('getHeight');\n base.getCornerRadius = stylesheet.getDeckGLAccessor('getCornerRadius');\n break;\n default:\n break;\n }\n\n return base;\n }\n\n private _computeNodeGeometry(\n engine: GraphEngine,\n node: NodeInterface,\n accessors?: NodeStyleAccessors\n ): NodeGeometry | null {\n const basePosition = engine.getNodePosition(node);\n if (!basePosition) {\n return null;\n }\n\n const offset = evaluateOffsetAccessor(accessors?.getOffset, node);\n const center: [number, number] = [basePosition[0] + offset[0], basePosition[1] + offset[1]];\n\n const geometry: NodeGeometry = {\n type: accessors?.type,\n center\n };\n\n if (!accessors || !accessors.type) {\n return geometry;\n }\n\n const applier = GEOMETRY_APPLIERS[accessors.type];\n if (applier) {\n applier(node, accessors, geometry);\n }\n\n return geometry;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer, type CompositeLayerProps, type UpdateParameters} from '@deck.gl/core';\nimport {LineLayer, TextLayer} from '@deck.gl/layers';\n\nexport type GridLineDatum = {\n /** Optional label associated with the grid line. */\n label?: string | number;\n /** Horizontal grid lines use the yPosition value. */\n yPosition?: number | null;\n /** Vertical grid lines use the xPosition value. */\n xPosition?: number | null;\n};\n\nexport type GridLayerProps<DatumT extends GridLineDatum = GridLineDatum> = CompositeLayerProps & {\n /** Collection of grid line definitions. */\n data: readonly DatumT[];\n /** Direction in which to draw grid lines. */\n direction?: 'horizontal' | 'vertical';\n /** Minimum X coordinate for grid lines. */\n xMin?: number;\n /** Maximum X coordinate for grid lines. */\n xMax?: number;\n /** Minimum Y coordinate for grid lines. */\n yMin?: number;\n /** Maximum Y coordinate for grid lines. */\n yMax?: number;\n /** Width of the grid lines in screen pixels. */\n width?: number;\n /** RGBA color for grid lines. */\n color?: [number, number, number, number];\n /** Optional accessor for line labels. */\n getLabel?: (d: DatumT) => string | number | null | undefined;\n /** Optional accessor for per-datum colors. */\n getColor?: (d: DatumT) => [number, number, number, number] | null | undefined;\n /** Optional accessor for per-datum widths. */\n getWidth?: (d: DatumT) => number | null | undefined;\n /** Whether to render labels alongside the grid lines. */\n showLabels?: boolean;\n /** Pixel offset applied to rendered labels. */\n labelOffset?: [number, number];\n};\n\nconst DEFAULT_COLOR: [number, number, number, number] = [200, 200, 200, 255];\nconst DEFAULT_WIDTH = 1;\nconst DEFAULT_OFFSET: [number, number] = [8, 0];\nconst DEFAULT_MIN = -1e6;\nconst DEFAULT_MAX = 1e6;\n\nexport class GridLayer<DatumT extends GridLineDatum = GridLineDatum> extends CompositeLayer<\n GridLayerProps<DatumT>\n> {\n static override layerName = 'GridLayer';\n\n static override defaultProps: Required<\n Pick<\n GridLayerProps<GridLineDatum>,\n | 'direction'\n | 'width'\n | 'color'\n | 'xMin'\n | 'xMax'\n | 'yMin'\n | 'yMax'\n | 'showLabels'\n | 'labelOffset'\n >\n > = {\n direction: 'horizontal',\n width: DEFAULT_WIDTH,\n color: DEFAULT_COLOR,\n xMin: DEFAULT_MIN,\n xMax: DEFAULT_MAX,\n yMin: DEFAULT_MIN,\n yMax: DEFAULT_MAX,\n showLabels: true,\n labelOffset: DEFAULT_OFFSET\n } as const;\n\n override shouldUpdateState(params: UpdateParameters<this>): boolean {\n const {changeFlags} = params;\n return Boolean(\n changeFlags.dataChanged || changeFlags.propsChanged || changeFlags.viewportChanged\n );\n }\n\n override renderLayers() {\n const {\n data,\n direction = 'horizontal',\n xMin = DEFAULT_MIN,\n xMax = DEFAULT_MAX,\n yMin = DEFAULT_MIN,\n yMax = DEFAULT_MAX,\n color = DEFAULT_COLOR,\n width = DEFAULT_WIDTH,\n getLabel,\n getColor,\n getWidth,\n showLabels = true,\n labelOffset = DEFAULT_OFFSET\n } = this.props;\n\n const bounds = this._resolveViewportBounds({xMin, xMax, yMin, yMax});\n const lines = this._createLineSegments(data, direction, bounds);\n\n if (!lines.length) {\n return [];\n }\n\n const lineLayer = new LineLayer({\n id: `${this.props.id}-lines`,\n data: lines,\n getSourcePosition: (d) => d.sourcePosition,\n getTargetPosition: (d) => d.targetPosition,\n getColor: getColor ? (d) => getColor(d.datum) ?? color : () => color,\n getWidth: getWidth ? (d) => getWidth(d.datum) ?? width : () => width,\n widthUnits: 'pixels',\n parameters: {\n depthTest: false\n }\n });\n\n if (!showLabels) {\n return [lineLayer];\n }\n\n const textData = this._createLabelData(lines, direction, bounds, getLabel);\n\n if (!textData.length) {\n return [lineLayer];\n }\n\n const textLayer = new TextLayer({\n id: `${this.props.id}-labels`,\n data: textData,\n characterSet: 'auto',\n getPosition: (d) => d.position,\n getText: (d) => d.text,\n getColor: getColor ? (d) => getColor(d.datum) ?? color : () => color,\n getSize: 12,\n sizeUnits: 'pixels',\n getPixelOffset: labelOffset,\n getTextAnchor: () => 'start',\n getAlignmentBaseline: () => 'center',\n background: true,\n backgroundPadding: [4, 2],\n backgroundColor: [255, 255, 255, 200],\n parameters: {\n depthTest: false\n }\n });\n\n return [lineLayer, textLayer];\n }\n\n private _resolveViewportBounds(bounds: {\n xMin: number;\n xMax: number;\n yMin: number;\n yMax: number;\n }): {minX: number; maxX: number; minY: number; maxY: number} {\n const viewportBounds = this.context?.viewport?.getBounds?.();\n if (!Array.isArray(viewportBounds) || viewportBounds.length !== 4) {\n return {minX: bounds.xMin, maxX: bounds.xMax, minY: bounds.yMin, maxY: bounds.yMax};\n }\n\n const [bxMin, byMin, bxMax, byMax] = viewportBounds;\n const minX =\n Number.isFinite(bxMin) && Number.isFinite(bxMax) ? Math.min(bounds.xMin, bxMin) : bounds.xMin;\n const maxX =\n Number.isFinite(bxMin) && Number.isFinite(bxMax) ? Math.max(bounds.xMax, bxMax) : bounds.xMax;\n const minY =\n Number.isFinite(byMin) && Number.isFinite(byMax) ? Math.min(bounds.yMin, byMin) : bounds.yMin;\n const maxY =\n Number.isFinite(byMin) && Number.isFinite(byMax) ? Math.max(bounds.yMax, byMax) : bounds.yMax;\n\n return {minX, maxX, minY, maxY};\n }\n\n private _createLineSegments(\n data: readonly DatumT[],\n direction: 'horizontal' | 'vertical',\n bounds: {minX: number; maxX: number; minY: number; maxY: number}\n ): Array<{\n sourcePosition: [number, number];\n targetPosition: [number, number];\n datum: DatumT;\n }> {\n const segments: Array<{\n sourcePosition: [number, number];\n targetPosition: [number, number];\n datum: DatumT;\n }> = [];\n\n const isHorizontal = direction === 'horizontal';\n for (const datum of data) {\n const position = isHorizontal ? datum.yPosition : datum.xPosition;\n if (typeof position === 'number' && Number.isFinite(position)) {\n if (isHorizontal) {\n segments.push({\n sourcePosition: [bounds.minX, position],\n targetPosition: [bounds.maxX, position],\n datum\n });\n } else {\n segments.push({\n sourcePosition: [position, bounds.minY],\n targetPosition: [position, bounds.maxY],\n datum\n });\n }\n }\n }\n\n return segments;\n }\n\n private _createLabelData(\n lines: Array<{\n sourcePosition: [number, number];\n targetPosition: [number, number];\n datum: DatumT;\n }>,\n direction: 'horizontal' | 'vertical',\n bounds: {minX: number; maxX: number; minY: number; maxY: number},\n getLabel?: (datum: DatumT) => string | number | null | undefined\n ): Array<{position: [number, number]; text: string; datum: DatumT}> {\n const labels: Array<{position: [number, number]; text: string; datum: DatumT}> = [];\n const isHorizontal = direction === 'horizontal';\n\n for (const {datum, sourcePosition} of lines) {\n const rawLabel = getLabel ? getLabel(datum) : (datum.label ?? null);\n if (rawLabel !== null && rawLabel !== undefined && rawLabel !== '') {\n const [sx, sy] = sourcePosition;\n const position: [number, number] = isHorizontal ? [bounds.minX, sy] : [sx, bounds.minY];\n labels.push({position, text: String(rawLabel), datum});\n }\n }\n\n return labels;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport const mixedGetPosition = (getPosition, getOffset) => {\n if (!getOffset) {\n return getPosition;\n }\n\n if (typeof getOffset === 'function') {\n return (d) => {\n const [x, y] = getPosition(d);\n const [offX, offY] = getOffset(d);\n return [x + offX, y + offY];\n };\n }\n\n const [offX, offY] = getOffset;\n return (d) => {\n const [x, y] = getPosition(d);\n return [x + offX, y + offY];\n };\n};\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {GraphEngine} from '../core/graph-engine';\nimport type {NodeInterface} from '../graph/graph';\n\nconst OUTLINE_PADDING = 24;\nconst OUTLINE_CORNER_RADIUS = 16;\nconst OUTLINE_CORNER_SEGMENTS = 6;\n\nexport type ChainInteractionSource =\n | 'node'\n | 'collapsed-marker'\n | 'expanded-marker'\n | 'collapsed-outline'\n | 'expanded-outline';\n\nfunction resolveLayerId(layer: any): string {\n if (!layer) {\n return '';\n }\n if (typeof layer.id === 'string') {\n return layer.id;\n }\n if (typeof layer.props?.id === 'string') {\n return layer.props.id;\n }\n return '';\n}\n\nfunction classifyChainLayer(layer: any): ChainInteractionSource | null {\n let current = layer ?? null;\n while (current) {\n const layerId = resolveLayerId(current);\n if (layerId.includes('collapsed-chain-markers')) {\n return 'collapsed-marker';\n }\n if (layerId.includes('expanded-chain-markers')) {\n return 'expanded-marker';\n }\n if (layerId.includes('collapsed-chain-outlines')) {\n return 'collapsed-outline';\n }\n if (layerId.includes('expanded-chain-outlines')) {\n return 'expanded-outline';\n }\n current = current.parent ?? null;\n }\n return null;\n}\n\nexport function resolveChainInteractionSource(info: any): ChainInteractionSource {\n if (!info) {\n return 'node';\n }\n\n const layersToCheck = [] as any[];\n if (info.layer || info.sourceLayer) {\n if (info.layer) {\n layersToCheck.push(info.layer);\n }\n if (info.sourceLayer && info.sourceLayer !== info.layer) {\n layersToCheck.push(info.sourceLayer);\n }\n } else {\n layersToCheck.push(info);\n }\n\n for (const layer of layersToCheck) {\n const classification = classifyChainLayer(layer);\n if (classification) {\n return classification;\n }\n }\n\n return 'node';\n}\n\nfunction isChainRepresentative(node: NodeInterface): boolean {\n const chainId = node.getPropertyValue('collapsedChainId');\n const nodeIds = node.getPropertyValue('collapsedNodeIds');\n const representativeId = node.getPropertyValue('collapsedChainRepresentativeId');\n\n return (\n Boolean(chainId) &&\n Array.isArray(nodeIds) &&\n nodeIds.length > 1 &&\n representativeId === node.getId()\n );\n}\n\nexport function getRepresentativeNodes(engine: GraphEngine | null | undefined): NodeInterface[] {\n if (!engine) {\n return [];\n }\n\n return engine.getNodes().filter((node) => isChainRepresentative(node));\n}\n\nexport type ChainOutlineGetter = (node: NodeInterface) => [number, number][] | null;\n\nexport function createChainOutlineGetter(\n engine: GraphEngine | null | undefined\n): ChainOutlineGetter {\n if (!engine) {\n return () => null;\n }\n\n const cache = new Map<string, [number, number][] | null>();\n\n // eslint-disable-next-line max-statements, complexity\n return (node: NodeInterface): [number, number][] | null => {\n const chainId = node.getPropertyValue('collapsedChainId');\n if (!chainId) {\n return null;\n }\n\n const cacheKey = String(chainId);\n if (cache.has(cacheKey)) {\n return cache.get(cacheKey) ?? null;\n }\n\n const collapsedNodeIds = node.getPropertyValue('collapsedNodeIds');\n if (!Array.isArray(collapsedNodeIds) || collapsedNodeIds.length === 0) {\n cache.set(cacheKey, null);\n return null;\n }\n\n let minX = Number.POSITIVE_INFINITY;\n let maxX = Number.NEGATIVE_INFINITY;\n let minY = Number.POSITIVE_INFINITY;\n let maxY = Number.NEGATIVE_INFINITY;\n\n for (const nodeId of collapsedNodeIds) {\n const chainNode = engine.findNode(nodeId);\n if (chainNode) {\n const position = engine.getNodePosition(chainNode);\n if (position) {\n const [x, y] = position;\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n }\n }\n\n if (\n !Number.isFinite(minX) ||\n !Number.isFinite(maxX) ||\n !Number.isFinite(minY) ||\n !Number.isFinite(maxY)\n ) {\n cache.set(cacheKey, null);\n return null;\n }\n\n const paddedMinX = minX - OUTLINE_PADDING;\n const paddedMaxX = maxX + OUTLINE_PADDING;\n const paddedMinY = minY - OUTLINE_PADDING;\n const paddedMaxY = maxY + OUTLINE_PADDING;\n\n const width = paddedMaxX - paddedMinX;\n const height = paddedMaxY - paddedMinY;\n\n if (width <= 0 || height <= 0) {\n cache.set(cacheKey, null);\n return null;\n }\n\n const radius = Math.min(OUTLINE_CORNER_RADIUS, width / 2, height / 2);\n\n if (radius <= 0) {\n const polygon: [number, number][] = [\n [paddedMinX, paddedMinY],\n [paddedMinX, paddedMaxY],\n [paddedMaxX, paddedMaxY],\n [paddedMaxX, paddedMinY],\n [paddedMinX, paddedMinY]\n ];\n cache.set(cacheKey, polygon);\n return polygon;\n }\n\n const left = paddedMinX;\n const right = paddedMaxX;\n const top = paddedMinY;\n const bottom = paddedMaxY;\n\n const polygon: [number, number][] = [];\n const pushArc = (cx: number, cy: number, startAngle: number, endAngle: number) => {\n const step = (endAngle - startAngle) / OUTLINE_CORNER_SEGMENTS;\n for (let i = 1; i <= OUTLINE_CORNER_SEGMENTS; i++) {\n const angle = startAngle + step * i;\n polygon.push([cx + radius * Math.cos(angle), cy + radius * Math.sin(angle)]);\n }\n };\n\n polygon.push([right - radius, top]);\n pushArc(right - radius, top + radius, -Math.PI / 2, 0);\n polygon.push([right, bottom - radius]);\n pushArc(right - radius, bottom - radius, 0, Math.PI / 2);\n polygon.push([left + radius, bottom]);\n pushArc(left + radius, bottom - radius, Math.PI / 2, Math.PI);\n polygon.push([left, top + radius]);\n pushArc(left + radius, top + radius, Math.PI, (3 * Math.PI) / 2);\n polygon.push(polygon[0]);\n\n cache.set(cacheKey, polygon);\n return polygon;\n };\n}\n\nexport interface CollapsedChainLayerData {\n representativeNodes: NodeInterface[];\n collapsedNodes: NodeInterface[];\n collapsedOutlineNodes: NodeInterface[];\n expandedNodes: NodeInterface[];\n expandedOutlineNodes: NodeInterface[];\n getChainOutlinePolygon: ChainOutlineGetter;\n outlineUpdateTrigger: string;\n}\n\nexport function buildCollapsedChainLayers(\n engine: GraphEngine | null | undefined\n): CollapsedChainLayerData | null {\n if (!engine) {\n return null;\n }\n\n const representativeNodes = getRepresentativeNodes(engine);\n if (representativeNodes.length === 0) {\n return null;\n }\n\n const getChainOutlinePolygon = createChainOutlineGetter(engine);\n const outlineUpdateTrigger = [engine.getLayoutLastUpdate(), engine.getLayoutState()].join();\n\n const collapsedNodes = representativeNodes.filter((node) =>\n Boolean(node.getPropertyValue('isCollapsedChain'))\n );\n const collapsedOutlineNodes = collapsedNodes.filter((node) => getChainOutlinePolygon(node));\n\n const expandedNodes = representativeNodes.filter(\n (node) => !node.getPropertyValue('isCollapsedChain')\n );\n const expandedOutlineNodes = expandedNodes.filter((node) => getChainOutlinePolygon(node));\n\n return {\n representativeNodes,\n collapsedNodes,\n collapsedOutlineNodes,\n expandedNodes,\n expandedOutlineNodes,\n getChainOutlinePolygon,\n outlineUpdateTrigger\n };\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {EdgeState, NodeState} from './constants';\nimport {GraphEngine} from './graph-engine';\nimport type {EdgeInterface, NodeInterface} from '../graph/graph';\nimport {log} from '../utils/log';\nimport {\n resolveChainInteractionSource,\n type ChainInteractionSource\n} from '../utils/collapsed-chains';\n\nexport {resolveChainInteractionSource};\nexport type {ChainInteractionSource};\n\nexport function shouldToggleCollapsedChain(\n isCollapsed: boolean,\n source: ChainInteractionSource\n): boolean {\n if (isCollapsed) {\n return true;\n }\n return source === 'expanded-marker' || source === 'expanded-outline';\n}\n\nconst NODE_TO_EDGE_STATE_MAP: Record<NodeState, EdgeState> = {\n default: 'default',\n hover: 'hover',\n dragging: 'dragging',\n selected: 'selected'\n};\n\nfunction shouldEdgeBeSelected(edge: EdgeInterface): boolean {\n return edge\n .getConnectedNodes()\n .some((node) => node.getState() === 'selected' && node.shouldHighlightConnectedEdges());\n}\n\nfunction setNodeState(node: NodeInterface, state: NodeState) {\n node.setState(state);\n if (node.shouldHighlightConnectedEdges()) {\n node.getConnectedEdges().forEach((edge) => {\n let newEdgeState = NODE_TO_EDGE_STATE_MAP[state];\n if (shouldEdgeBeSelected(edge)) {\n newEdgeState = 'selected';\n }\n edge.setState(newEdgeState);\n });\n }\n}\n\ninterface EventMap {\n onClick?: (info: unknown, event: Event) => void;\n onHover?: (info: unknown) => void;\n onMouseEnter?: (info: unknown) => void;\n onMouseLeave?: (node: NodeInterface) => void;\n onDragStart?: (info: unknown) => void;\n onDrag?: (info: unknown) => void;\n onDragEnd?: (info: unknown) => void;\n}\n\nexport interface InteractionManagerProps {\n nodeEvents?: EventMap;\n edgeEvents?: EventMap;\n engine: GraphEngine;\n enableDragging: boolean;\n resumeLayoutAfterDragging: boolean;\n}\n\nexport class InteractionManager {\n public notifyCallback: Function;\n private _lastInteraction = 0;\n private _lastHoveredNode: NodeInterface | null = null;\n private _lastSelectedNode: NodeInterface | null = null;\n\n public nodeEvents: EventMap = undefined!;\n public edgeEvents: EventMap = undefined!;\n public engine: GraphEngine = undefined!;\n public enableDragging: boolean = undefined!;\n public resumeLayoutAfterDragging: boolean = undefined!;\n\n constructor(props: InteractionManagerProps, notifyCallback: Function) {\n this.updateProps(props);\n this.notifyCallback = notifyCallback;\n\n // internal state\n this._lastInteraction = 0;\n this._lastHoveredNode = null;\n this._lastSelectedNode = null;\n }\n\n updateProps({\n nodeEvents = {},\n edgeEvents = {},\n engine,\n enableDragging,\n resumeLayoutAfterDragging\n }: InteractionManagerProps): void {\n this.nodeEvents = nodeEvents;\n this.edgeEvents = edgeEvents;\n this.engine = engine;\n this.enableDragging = enableDragging;\n this.resumeLayoutAfterDragging = resumeLayoutAfterDragging;\n }\n\n getLastInteraction(): number {\n return this._lastInteraction;\n }\n\n // eslint-disable-next-line max-statements, complexity\n onClick(info, event): void {\n const {object} = info;\n\n if (!object) {\n return;\n }\n\n if (object.isNode) {\n const node = object as NodeInterface;\n const chainId = node.getPropertyValue('collapsedChainId');\n const collapsedNodeIds = node.getPropertyValue('collapsedNodeIds');\n const representativeId = node.getPropertyValue('collapsedChainRepresentativeId');\n const isCollapsed = Boolean(node.getPropertyValue('isCollapsedChain'));\n const hasChainMetadata =\n chainId !== null &&\n chainId !== undefined &&\n Array.isArray(collapsedNodeIds) &&\n collapsedNodeIds.length > 1 &&\n representativeId !== null &&\n representativeId !== undefined;\n const isRepresentative = hasChainMetadata && representativeId === node.getId();\n\n if (hasChainMetadata && isRepresentative) {\n const layout: any = this.engine?.props?.layout;\n if (layout && typeof layout.toggleCollapsedChain === 'function') {\n const interactionSource = resolveChainInteractionSource(info ?? null);\n\n // eslint-disable-next-line max-depth\n if (shouldToggleCollapsedChain(isCollapsed, interactionSource)) {\n const action = isCollapsed ? 'expand' : 'collapse';\n const chainIdStr = String(chainId);\n log.log(\n 0,\n `InteractionManager: ${action} chain ${chainIdStr} via ${interactionSource}`\n );\n // eslint-disable-next-line no-console\n console.log(\n `InteractionManager: ${action} chain ${chainIdStr} via ${interactionSource}`\n );\n layout.toggleCollapsedChain(chainIdStr);\n this._lastInteraction = Date.now();\n this.notifyCallback();\n // eslint-disable-next-line max-depth\n if (this.nodeEvents.onClick) {\n this.nodeEvents.onClick(info, event);\n }\n return;\n }\n }\n }\n\n if (node.isSelectable()) {\n if (this._lastSelectedNode) {\n setNodeState(this._lastSelectedNode, 'default');\n }\n setNodeState(node, 'selected');\n this._lastSelectedNode = node;\n this._lastInteraction = Date.now();\n this.notifyCallback();\n }\n\n if (this.nodeEvents.onClick) {\n this.nodeEvents.onClick(info, event);\n }\n }\n\n if ((object as EdgeInterface).isEdge && this.edgeEvents.onClick) {\n this.edgeEvents.onClick(info, event);\n }\n }\n\n _mouseLeaveNode(): void {\n const lastHoveredNode = this._lastHoveredNode;\n\n if (!(lastHoveredNode.isSelectable() && lastHoveredNode.getState() === 'selected')) {\n // reset the last hovered node's state\n const lastSelectedId = this._lastSelectedNode?.getId();\n const lastHoveredId = this._lastHoveredNode?.getId();\n const newState =\n lastSelectedId !== undefined && lastSelectedId === lastHoveredId ? 'selected' : 'default';\n setNodeState(lastHoveredNode, newState);\n }\n // trigger the callback if exists\n if (this.nodeEvents.onMouseLeave) {\n this.nodeEvents.onMouseLeave(lastHoveredNode);\n }\n }\n\n _mouseEnterNode(info): void {\n // set the node's state to hover\n setNodeState(info.object as NodeInterface, 'hover');\n // trigger the callback if exists\n if (this.nodeEvents.onMouseEnter) {\n this.nodeEvents.onMouseEnter(info);\n }\n if (this.nodeEvents.onHover) {\n this.nodeEvents.onHover(info);\n }\n }\n\n onHover(info, event) {\n if (!info.object) {\n if (this._lastHoveredNode) {\n this._mouseLeaveNode();\n this._lastInteraction = Date.now();\n this._lastHoveredNode = null;\n this.notifyCallback();\n }\n return;\n }\n\n // hover over on a node\n if (info.object.isNode) {\n const lastHoveredId = this._lastHoveredNode?.getId();\n const currentId = (info.object as NodeInterface).getId();\n const isSameNode = lastHoveredId !== undefined && lastHoveredId === currentId;\n // stay in the same node\n if (isSameNode) {\n return;\n }\n if (this._lastHoveredNode) {\n // reset the previous hovered node's state if not the same node\n this._mouseLeaveNode();\n }\n // enter new node\n this._mouseEnterNode(info);\n this._lastInteraction = Date.now();\n this._lastHoveredNode = info.object;\n this.notifyCallback();\n }\n if (info.object.isEdge && this.edgeEvents.onHover) {\n this.edgeEvents.onHover(info);\n }\n }\n\n onDragStart(info, event) {\n if (this.nodeEvents.onDragStart) {\n this.nodeEvents.onDragStart(info);\n }\n }\n\n onDrag(info, event) {\n if (!info.object.isNode || !this.enableDragging) {\n return;\n }\n event.stopImmediatePropagation();\n\n // info.viewport is undefined when the object is offscreen, so we use viewport from onDragStart\n const coordinates = info.layer.context.viewport.unproject([info.x, info.y]);\n\n // limit the node position to be within bounds of the viewport\n const bounds = info.layer.context.viewport.getBounds(); // [minX, minY, maxX, maxY]\n const x = Math.min(Math.max(coordinates[0], bounds[0]), bounds[2]);\n const y = Math.min(Math.max(coordinates[1], bounds[1]), bounds[3]);\n this.engine.lockNodePosition(info.object as NodeInterface, x, y);\n\n setNodeState(info.object as NodeInterface, 'dragging');\n this._lastInteraction = Date.now();\n this.notifyCallback();\n if (this.nodeEvents.onDrag) {\n this.nodeEvents.onDrag(info);\n }\n }\n\n onDragEnd(info, event) {\n if (!info.object.isNode || !this.enableDragging) {\n return;\n }\n if (this.resumeLayoutAfterDragging) {\n this.engine.resume();\n }\n setNodeState(info.object as NodeInterface, 'default');\n this.engine.unlockNodePosition(info.object as NodeInterface);\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Node} from '../graph/node';\n\nexport type RankAccessor = string | ((node: Node) => number | null | undefined);\nexport type LabelAccessor = string | ((node: Node) => string | number | null | undefined);\n\nexport type RankPosition = {\n rank: number;\n yPosition: number;\n label: string | number;\n};\n\nexport type MapRanksToYPositionsOptions = {\n rankAccessor?: RankAccessor;\n labelAccessor?: LabelAccessor;\n /** Optional target range for the computed y positions. */\n yRange?: {min?: number; max?: number};\n};\n\ntype RankAggregate = {sum: number; count: number; label: string | number | null};\n\ntype RankAggregateState = {\n aggregates: Map<number, RankAggregate>;\n range: {min: number; max: number};\n};\n\nfunction distributeEvenSpacing(positions: RankPosition[], start: number, end: number) {\n const count = positions.length;\n if (count === 0) {\n return;\n }\n\n if (count === 1) {\n positions[0].yPosition = start;\n return;\n }\n\n const step = (end - start) / (count - 1);\n for (let i = 0; i < count; i++) {\n positions[i].yPosition = start + step * i;\n }\n}\n\nfunction fallbackMonotonicSpacing(positions: RankPosition[]) {\n if (positions.length === 0) {\n return;\n }\n\n let previous = positions[0].yPosition;\n for (let i = 1; i < positions.length; i++) {\n const current = positions[i].yPosition;\n if (!(current > previous)) {\n previous += 1;\n positions[i].yPosition = previous;\n } else {\n previous = current;\n }\n }\n}\n\nfunction enforceMonotonicPositions(positions: RankPosition[], range: {min: number; max: number}) {\n if (positions.length === 0) {\n return;\n }\n\n const hasFiniteMin = Number.isFinite(range.min);\n const hasFiniteMax = Number.isFinite(range.max);\n\n if (positions.length === 1) {\n if (hasFiniteMin) {\n positions[0].yPosition = range.min;\n }\n return;\n }\n\n if (hasFiniteMin && hasFiniteMax && range.max > range.min) {\n distributeEvenSpacing(positions, range.min, range.max);\n return;\n }\n\n if (hasFiniteMin) {\n positions[0].yPosition = range.min;\n }\n\n fallbackMonotonicSpacing(positions);\n}\n\nfunction resolveTargetRange(\n range: {min: number; max: number},\n override?: {min?: number; max?: number}\n): {min: number; max: number} {\n const overrideMin =\n typeof override?.min === 'number' && Number.isFinite(override.min) ? override.min : undefined;\n const overrideMax =\n typeof override?.max === 'number' && Number.isFinite(override.max) ? override.max : undefined;\n\n const candidateMin = overrideMin ?? range.min;\n const candidateMax = overrideMax ?? range.max;\n\n const min = Number.isFinite(candidateMin) ? candidateMin : range.min;\n const max = Number.isFinite(candidateMax) ? candidateMax : range.max;\n\n return {min, max};\n}\n\nfunction accumulateRank(\n node: Node,\n getRank: (node: Node) => number | null,\n getLabel: (node: Node) => string | number | null,\n getPosition: (node: Node) => [number, number] | null | undefined,\n state: RankAggregateState\n) {\n const {aggregates, range} = state;\n const rank = getRank(node);\n if (typeof rank !== 'number' || !Number.isFinite(rank)) {\n return;\n }\n\n const position = getPosition(node);\n if (!position) {\n return;\n }\n\n const [, y] = position;\n if (typeof y !== 'number' || !Number.isFinite(y)) {\n return;\n }\n\n const entry = aggregates.get(rank) ?? {sum: 0, count: 0, label: null};\n entry.sum += y;\n entry.count += 1;\n\n if (entry.label === null) {\n const label = getLabel(node);\n if (label !== null) {\n entry.label = label;\n }\n }\n\n aggregates.set(rank, entry);\n range.min = Math.min(range.min, y);\n range.max = Math.max(range.max, y);\n}\n\nfunction normalizeRankAccessor(accessor: RankAccessor | undefined): (node: Node) => number | null {\n if (!accessor) {\n return (node: Node) => {\n const value = node.getPropertyValue('srank');\n if (typeof value === 'number' && Number.isFinite(value)) {\n return value;\n }\n if (typeof value === 'string') {\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : null;\n }\n return null;\n };\n }\n\n if (typeof accessor === 'function') {\n return (node: Node) => {\n const value = accessor(node);\n if (typeof value === 'number' && Number.isFinite(value)) {\n return value;\n }\n if (typeof value === 'string') {\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : null;\n }\n return null;\n };\n }\n\n return (node: Node) => {\n const value = node.getPropertyValue(accessor);\n if (typeof value === 'number' && Number.isFinite(value)) {\n return value;\n }\n if (typeof value === 'string') {\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : null;\n }\n return null;\n };\n}\n\nfunction normalizeLabelAccessor(\n accessor: LabelAccessor | undefined\n): (node: Node) => string | number | null {\n if (!accessor) {\n return (node: Node) => {\n const value = node.getPropertyValue('rankLabel');\n if (value === undefined || value === null || value === '') {\n return null;\n }\n if (typeof value === 'number' || typeof value === 'string') {\n return value;\n }\n return null;\n };\n }\n\n if (typeof accessor === 'function') {\n return (node: Node) => {\n const value = accessor(node);\n if (value === undefined || value === null || value === '') {\n return null;\n }\n if (typeof value === 'number' || typeof value === 'string') {\n return value;\n }\n return null;\n };\n }\n\n return (node: Node) => {\n const value = node.getPropertyValue(accessor);\n if (value === undefined || value === null || value === '') {\n return null;\n }\n if (typeof value === 'number' || typeof value === 'string') {\n return value;\n }\n return null;\n };\n}\n\n/**\n * Builds a mapping from rank identifiers to averaged y positions.\n */\nexport function mapRanksToYPositions(\n nodes: Iterable<Node>,\n getPosition: (node: Node) => [number, number] | null | undefined,\n options?: MapRanksToYPositionsOptions\n): RankPosition[] {\n const getRank = normalizeRankAccessor(options?.rankAccessor);\n const getLabel = normalizeLabelAccessor(options?.labelAccessor);\n\n const state: RankAggregateState = {\n aggregates: new Map<number, RankAggregate>(),\n range: {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY}\n };\n\n for (const node of nodes) {\n accumulateRank(node, getRank, getLabel, getPosition, state);\n }\n\n const {aggregates, range} = state;\n const positions: RankPosition[] = Array.from(aggregates.entries()).map(\n ([rank, {sum, count, label}]) => ({\n rank,\n yPosition: count ? sum / count : 0,\n label: label ?? rank\n })\n );\n\n positions.sort((a, b) => a.rank - b.rank);\n\n const needsRemap = positions.some(\n (entry, index) => index > 0 && entry.yPosition <= positions[index - 1].yPosition\n );\n if (needsRemap) {\n const targetRange = resolveTargetRange(range, options?.yRange);\n enforceMonotonicPositions(positions, targetRange);\n }\n\n return positions;\n}\n\nexport type SelectRankLinesOptions = {\n yMin: number;\n yMax: number;\n maxCount?: number;\n};\n\nfunction locateInsertionIndex(ranks: RankPosition[], target: number): number {\n let low = 0;\n let high = ranks.length - 1;\n\n while (low < high) {\n const mid = Math.floor((low + high) / 2);\n if (ranks[mid].yPosition < target) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n\n return low;\n}\n\nfunction pickNearestAvailableIndex(\n ranks: RankPosition[],\n target: number,\n startIndex: number,\n used: Set<number>\n): number {\n let bestIndex = -1;\n let bestDistance = Number.POSITIVE_INFINITY;\n\n const consider = (index: number) => {\n if (index < 0 || index >= ranks.length || used.has(index)) {\n return;\n }\n const distance = Math.abs(ranks[index].yPosition - target);\n const isCloser = distance < bestDistance;\n const isTie = distance === bestDistance && bestIndex !== -1;\n if (\n isCloser ||\n (isTie && (ranks[index].yPosition < ranks[bestIndex].yPosition || index < bestIndex))\n ) {\n bestDistance = distance;\n bestIndex = index;\n }\n };\n\n consider(startIndex);\n consider(startIndex - 1);\n\n for (\n let offset = 1;\n bestIndex === -1 && (startIndex - offset >= 0 || startIndex + offset < ranks.length);\n offset++\n ) {\n consider(startIndex - offset);\n consider(startIndex + offset);\n }\n\n return bestIndex;\n}\n\nfunction findFallbackIndex(ranks: RankPosition[], used: Set<number>): number {\n for (let i = 0; i < ranks.length; i++) {\n if (!used.has(i)) {\n return i;\n }\n }\n return -1;\n}\n\nfunction findClosestAvailableIndex(\n ranks: RankPosition[],\n target: number,\n used: Set<number>\n): number {\n if (ranks.length === 0) {\n return -1;\n }\n\n const insertionIndex = locateInsertionIndex(ranks, target);\n const nearest = pickNearestAvailableIndex(ranks, target, insertionIndex, used);\n if (nearest !== -1) {\n return nearest;\n }\n\n const fallback = findFallbackIndex(ranks, used);\n if (fallback !== -1) {\n return fallback;\n }\n\n return Math.min(Math.max(insertionIndex, 0), ranks.length - 1);\n}\n\nfunction computeTargetRatios(count: number): number[] {\n if (count <= 1) {\n return [0.5];\n }\n const step = 1 / (count - 1);\n return Array.from({length: count}, (_, index) => index * step);\n}\n\nfunction fillRemainingSelections(used: Set<number>, lastIndex: number, maxCount: number) {\n for (let i = 0; used.size < maxCount && i <= lastIndex; i++) {\n used.add(i);\n }\n}\n\nfunction chooseEvenlySpacedIndices(ranks: RankPosition[], maxCount: number): number[] {\n const lastIndex = ranks.length - 1;\n const start = ranks[0].yPosition;\n const end = ranks[lastIndex].yPosition;\n const span = end - start;\n const used = new Set<number>();\n\n for (const ratio of computeTargetRatios(maxCount)) {\n const target = span !== 0 ? start + ratio * span : start;\n const index = findClosestAvailableIndex(ranks, target, used);\n if (index !== -1) {\n used.add(index);\n }\n }\n\n fillRemainingSelections(used, lastIndex, maxCount);\n\n return Array.from(used)\n .sort((a, b) => a - b)\n .slice(0, maxCount);\n}\n\n/**\n * Selects a subset of rank positions that are evenly distributed within a range.\n */\nexport function selectRankLines(\n ranks: RankPosition[],\n {yMin, yMax, maxCount = 8}: SelectRankLinesOptions\n): RankPosition[] {\n if (!Number.isFinite(yMin) || !Number.isFinite(yMax) || maxCount <= 0) {\n return [];\n }\n\n const min = Math.min(yMin, yMax);\n const max = Math.max(yMin, yMax);\n\n const filtered = ranks\n .filter(\n (entry) =>\n Number.isFinite(entry.yPosition) && entry.yPosition >= min && entry.yPosition <= max\n )\n .sort((a, b) => a.yPosition - b.yPosition);\n\n if (filtered.length === 0) {\n return [];\n }\n\n if (filtered.length <= maxCount) {\n return filtered;\n }\n\n if (maxCount === 1) {\n const midpoint = (filtered[0].yPosition + filtered[filtered.length - 1].yPosition) / 2;\n const index = findClosestAvailableIndex(filtered, midpoint, new Set<number>());\n return index === -1 ? [filtered[0]] : [filtered[index]];\n }\n\n const selected = chooseEvenlySpacedIndices(filtered, maxCount);\n return selected.map((index) => filtered[index]);\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {NodeState, EdgeState} from '../core/constants';\nimport * as arrow from 'apache-arrow';\n\n/** Graph data types supported by this library */\nexport type GraphData = PlainGraphData | ArrowGraphData;\n\n/** Graph data stored in Apache Arrow binary columnar tables */\nexport type ArrowGraphData = {\n shape: 'arrow-graph-data';\n version: number;\n metadata?: Record<string, unknown>;\n nodes: arrow.Table;\n edges: arrow.Table;\n};\n\nexport type PlainGraphData = {\n shape: 'plain-graph-data';\n version?: number;\n metadata?: Record<string, unknown>;\n nodes?: GraphNodeData[] | null;\n edges?: GraphEdgeData[] | null;\n};\n\nexport type GraphNodeData = {\n id: string | number;\n label?: string;\n state?: NodeState;\n selectable?: boolean;\n highlightConnectedEdges?: boolean;\n weight?: number;\n attributes?: Record<string, unknown> | null | undefined;\n};\n\nexport type GraphEdgeData = {\n id: string | number;\n sourceId: string | number;\n targetId: string | number;\n label?: string;\n state?: EdgeState;\n directed?: boolean;\n weight?: number;\n attributes?: Record<string, unknown> | null | undefined;\n};\n\nexport function isArrowGraphData(value: unknown): value is ArrowGraphData {\n const candidate = value as ArrowGraphData;\n return typeof value === 'object' && candidate?.shape === 'arrow-graph-data';\n}\n\nexport function isPlainGraphData(value: unknown): value is PlainGraphData {\n const candidate = value as PlainGraphData;\n return typeof value === 'object' && candidate?.shape === 'plain-graph-data';\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Graph, GraphProps} from '../graph';\nimport {type GraphData, isArrowGraphData} from '../../graph-data/graph-data';\nimport {ArrowGraph} from '../arrow-graph';\nimport {ClassicGraph} from '../classic-graph';\n\nexport function createGraphFromData(data: GraphData, props: GraphProps = {}): Graph {\n if (isArrowGraphData(data)) {\n return new ArrowGraph({...props, data});\n }\n\n return new ClassicGraph({...props, data});\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\n\nimport type {PlainGraphData} from '../graph-data/graph-data';\n// import {PlainGraphDataBuilder} from '../graph-data/plain-graph-data-builder';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type JSONGraphLoaderOptions = LoaderOptions & {\n jsongraph?: {};\n};\n\nexport type JSONGraphParserOptions = NonNullable<JSONGraphLoaderOptions['jsongraph']>;\n\nexport const JSONGraphLoader = {\n dataType: null as unknown as PlainGraphData,\n batchType: null as never,\n\n name: 'DOT Graph',\n id: 'dot-graph',\n module: 'graph-layers',\n version: VERSION,\n worker: false,\n extensions: ['json'],\n mimeTypes: ['application/json'],\n text: true,\n options: {\n jsongraph: {}\n },\n\n parse: async (arrayBuffer: ArrayBuffer, options?: JSONGraphLoaderOptions) => {\n const text = new TextDecoder().decode(arrayBuffer);\n return Promise.resolve(JSONGraphLoader.parseTextSync(text, options));\n },\n\n parseTextSync: (text: string, options?: JSONGraphLoaderOptions) => {\n // const parseOptions = {...JSONGraphLoader.options.jsongraph, ...options?.jsongraph};\n throw new Error('JSONGraphLoader.parseTextSync not implemented');\n // return loadSimpleJSONGraph(text, parseOptions);\n }\n} as const satisfies LoaderWithParser<PlainGraphData, never, JSONGraphLoaderOptions>;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {ArrowGraphData} from '../graph-data/graph-data';\nimport {ArrowGraphDataBuilder} from '../graph-data/arrow-graph-data-builder';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\ntype DOTAttributeMap = Record<string, unknown>;\n\ntype ParsedNode = {\n id: string;\n attributes: DOTAttributeMap;\n subgraphs: Set<string>;\n};\n\ntype ParsedEdge = {\n id: string;\n sourceId: string;\n targetId: string;\n directed: boolean;\n attributes: DOTAttributeMap;\n subgraphs: string[];\n};\n\ntype ParsedSubgraph = {\n id: string;\n attributes: DOTAttributeMap;\n parentId?: string | null;\n};\n\ntype DOTParseResult = {\n id?: string;\n directed: boolean;\n strict: boolean;\n graphAttributes: DOTAttributeMap;\n nodes: Map<string, ParsedNode>;\n edges: ParsedEdge[];\n subgraphs: Map<string, ParsedSubgraph>;\n};\n\nexport type DOTGraphLoaderMetadata = {\n id?: string;\n directed: boolean;\n strict: boolean;\n attributes: DOTAttributeMap;\n subgraphs: ParsedSubgraph[];\n};\n\n// Loader definition\n\nexport type DOTGraphLoaderOptions = LoaderOptions & {\n dot?: {\n version?: number;\n };\n};\n\nexport type DOTGraphParserOptions = NonNullable<DOTGraphLoaderOptions['dot']>;\n\nexport const DOTGraphLoader = {\n dataType: null as unknown as ArrowGraphData,\n batchType: null as never,\n\n name: 'DOT Graph',\n id: 'dot-graph',\n module: 'graph-layers',\n version: VERSION,\n worker: false,\n extensions: ['dot'],\n mimeTypes: ['text/vnd.graphviz', 'text/x-graphviz', 'application/vnd.graphviz'],\n text: true,\n options: {\n dot: {\n version: 0\n }\n },\n parse: (arrayBuffer: ArrayBuffer, options?: DOTGraphLoaderOptions) => {\n const text = new TextDecoder().decode(arrayBuffer);\n return Promise.resolve(DOTGraphLoader.parseTextSync(text, options));\n },\n parseTextSync: (text: string, options?: DOTGraphLoaderOptions) => {\n const parseOptions = {...DOTGraphLoader.options.dot, ...options?.dot};\n return loadDOTGraph(text, parseOptions);\n }\n} as const satisfies LoaderWithParser<ArrowGraphData, never, DOTGraphLoaderOptions>;\n\nexport function loadDOTGraph(dot: string, options: DOTGraphParserOptions = {}): ArrowGraphData {\n const parsed = parseDOT(dot);\n return buildArrowGraphData(parsed, options);\n}\n\nexport function parseDOTToArrowGraphData(\n dot: string,\n options: DOTGraphParserOptions = {}\n): ArrowGraphData {\n const parsed = parseDOT(dot);\n return buildArrowGraphData(parsed, options);\n}\n\nfunction buildArrowGraphData(\n parsed: DOTParseResult,\n options: DOTGraphParserOptions\n): ArrowGraphData {\n const builder = new ArrowGraphDataBuilder({version: options.version});\n\n const subgraphDescriptors = new Map<string, ParsedSubgraph>();\n for (const [id, subgraph] of parsed.subgraphs.entries()) {\n subgraphDescriptors.set(id, {\n id,\n attributes: {...subgraph.attributes},\n parentId: subgraph.parentId\n });\n }\n\n for (const node of parsed.nodes.values()) {\n const attributes: DOTAttributeMap = {...node.attributes};\n if (node.subgraphs.size > 0) {\n attributes.subgraphs = Array.from(node.subgraphs, (id) =>\n describeSubgraph(id, subgraphDescriptors)\n );\n }\n builder.addNode({\n id: node.id,\n attributes\n });\n }\n\n parsed.edges.forEach((edge) => {\n const attributes: DOTAttributeMap = {...edge.attributes};\n if (edge.subgraphs.length > 0) {\n attributes.subgraphs = edge.subgraphs.map((id) => describeSubgraph(id, subgraphDescriptors));\n }\n builder.addEdge({\n id: edge.id,\n sourceId: edge.sourceId,\n targetId: edge.targetId,\n directed: edge.directed,\n attributes\n });\n });\n\n const metadata: DOTGraphLoaderMetadata = {\n id: parsed.id,\n directed: parsed.directed,\n strict: parsed.strict,\n attributes: {...parsed.graphAttributes},\n subgraphs: Array.from(parsed.subgraphs.values(), (subgraph) => ({\n id: subgraph.id,\n attributes: {...subgraph.attributes},\n parentId: subgraph.parentId\n }))\n };\n\n const data = builder.finish();\n data.metadata = metadata;\n return data;\n}\n\nfunction describeSubgraph(\n id: string,\n descriptors: Map<string, ParsedSubgraph>\n): {id: string; attributes: DOTAttributeMap; parentId?: string | null} {\n const subgraph = descriptors.get(id);\n if (!subgraph) {\n return {id, attributes: {}};\n }\n return {\n id,\n attributes: {...subgraph.attributes},\n parentId: subgraph.parentId\n };\n}\n\ntype TokenType =\n | 'identifier'\n | 'string'\n | 'html'\n | 'arrow'\n | 'lbrace'\n | 'rbrace'\n | 'lbrack'\n | 'rbrack'\n | 'equals'\n | 'comma'\n | 'semicolon';\n\ntype Token = {\n type: TokenType;\n value: string;\n};\n\ntype ScopeContext = {\n id?: string;\n nodeDefaults: DOTAttributeMap;\n edgeDefaults: DOTAttributeMap;\n graphAttributes: DOTAttributeMap;\n};\n\nclass DOTParser {\n private readonly tokens: Token[];\n private position = 0;\n private readonly result: DOTParseResult = {\n directed: false,\n strict: false,\n graphAttributes: {},\n nodes: new Map(),\n edges: [],\n subgraphs: new Map()\n };\n\n private readonly scopes: ScopeContext[] = [\n {nodeDefaults: {}, edgeDefaults: {}, graphAttributes: {}}\n ];\n\n private subgraphCounter = 0;\n private edgeCounter = 0;\n\n constructor(tokens: Token[]) {\n this.tokens = tokens;\n }\n\n parse(): DOTParseResult {\n this.parseGraph();\n return this.result;\n }\n\n private parseGraph(): void {\n const strictToken = this.peek();\n if (strictToken && isKeyword(strictToken, 'strict')) {\n this.consume();\n this.result.strict = true;\n }\n\n const typeToken = this.peek();\n if (!typeToken || !isGraphType(typeToken)) {\n throw new Error('DOT graph must start with graph or digraph keyword.');\n }\n this.consume();\n this.result.directed = isKeyword(typeToken, 'digraph');\n\n const idToken = this.peek();\n if (idToken && isIdentifierLike(idToken)) {\n if (!isStructuralToken(idToken)) {\n this.result.id = parseIdentifierValue(this.consume());\n }\n }\n\n this.expect('lbrace');\n while (!this.match('rbrace')) {\n if (!this.parseStatement()) {\n break;\n }\n }\n this.result.graphAttributes = {...this.scopes[0].graphAttributes};\n }\n\n private parseStatement(): boolean {\n if (this.consumeSemicolonIfPresent()) {\n return true;\n }\n\n const token = this.peek();\n if (!token) {\n return false;\n }\n\n if (this.tryParseSubgraphStatement(token)) {\n return true;\n }\n\n if (this.tryParseKeywordStatement(token)) {\n return true;\n }\n\n if (this.tryParseAssignmentStatement(token)) {\n return true;\n }\n\n if (isIdentifierLike(token)) {\n this.parseNodeOrEdgeStatement();\n this.consumeOptionalSemicolon();\n return true;\n }\n\n throw new Error(`Unexpected token: ${token.value}`);\n }\n\n private consumeSemicolonIfPresent(): boolean {\n const next = this.peek();\n if (next?.type === 'semicolon') {\n this.consume();\n return true;\n }\n return false;\n }\n\n private tryParseSubgraphStatement(token: Token): boolean {\n if (token.type !== 'lbrace' && !isKeyword(token, 'subgraph')) {\n return false;\n }\n this.parseSubgraph();\n return true;\n }\n\n private tryParseKeywordStatement(token: Token): boolean {\n if (!(isKeyword(token, 'graph') || isKeyword(token, 'node') || isKeyword(token, 'edge'))) {\n return false;\n }\n\n this.consume();\n const attrs = this.parseAttributeList();\n\n if (isKeyword(token, 'graph')) {\n Object.assign(this.currentScope().graphAttributes, attrs);\n } else if (isKeyword(token, 'node')) {\n Object.assign(this.currentScope().nodeDefaults, attrs);\n } else {\n Object.assign(this.currentScope().edgeDefaults, attrs);\n }\n\n this.consumeOptionalSemicolon();\n return true;\n }\n\n private tryParseAssignmentStatement(token: Token): boolean {\n if (!isIdentifierLike(token)) {\n return false;\n }\n const next = this.peek(1);\n if (next?.type !== 'equals') {\n return false;\n }\n\n const key = parseIdentifierValue(this.consume());\n this.consume();\n const valueToken = this.consume();\n const value = parseAttributeValue(valueToken);\n this.currentScope().graphAttributes[key] = value;\n this.consumeOptionalSemicolon();\n return true;\n }\n\n private parseNodeOrEdgeStatement(): void {\n const first = parseIdentifierValue(this.consume());\n const references: string[] = [first];\n const operators: string[] = [];\n\n let operatorToken = this.match('arrow');\n while (operatorToken) {\n operators.push(operatorToken.value);\n const referenceToken = this.consume();\n if (!isIdentifierLike(referenceToken)) {\n throw new Error('Expected node identifier in edge statement.');\n }\n references.push(parseIdentifierValue(referenceToken));\n operatorToken = this.match('arrow');\n }\n\n if (operators.length === 0) {\n const attrs = this.parseAttributeList();\n this.addNode(first, attrs);\n return;\n }\n\n const attrs = this.parseAttributeList();\n this.addEdgeChain(references, operators, attrs);\n }\n\n private addNode(id: string, attrs: DOTAttributeMap): void {\n const membership = this.getCurrentSubgraphChain();\n const node = this.ensureNode(id, membership);\n node.attributes = {...node.attributes, ...attrs};\n }\n\n private addEdgeChain(nodes: string[], operators: string[], attrs: DOTAttributeMap): void {\n const membership = this.getCurrentSubgraphChain();\n const defaults = this.currentScope().edgeDefaults;\n const attributes = {...defaults, ...attrs};\n\n for (let index = 0; index < nodes.length - 1; index++) {\n const sourceId = nodes[index];\n const targetId = nodes[index + 1];\n const operator = operators[index];\n const directed = operator === '->';\n\n const edgeId = deriveEdgeId(attributes, sourceId, targetId, ++this.edgeCounter);\n const edgeAttributes = {...attributes};\n this.ensureNode(sourceId, membership);\n this.ensureNode(targetId, membership);\n\n const directedOverride = deriveDirectedFlag(edgeAttributes, directed);\n this.result.edges.push({\n id: edgeId,\n sourceId,\n targetId,\n directed: directedOverride,\n attributes: edgeAttributes,\n subgraphs: membership\n });\n }\n }\n\n private parseSubgraph(): void {\n let idToken = this.peek();\n let subgraphId: string;\n\n if (idToken && isKeyword(idToken, 'subgraph')) {\n this.consume();\n idToken = this.peek();\n }\n\n if (idToken && isIdentifierLike(idToken) && idToken.type !== 'lbrace') {\n subgraphId = parseIdentifierValue(this.consume());\n } else {\n subgraphId = `subgraph_${++this.subgraphCounter}`;\n }\n\n this.expect('lbrace');\n const parentId = this.findCurrentSubgraphId();\n const context: ScopeContext = {\n id: subgraphId,\n nodeDefaults: {...this.currentScope().nodeDefaults},\n edgeDefaults: {...this.currentScope().edgeDefaults},\n graphAttributes: {}\n };\n this.scopes.push(context);\n this.result.subgraphs.set(subgraphId, {\n id: subgraphId,\n attributes: context.graphAttributes,\n parentId\n });\n\n let shouldContinue = true;\n while (shouldContinue) {\n if (this.match('rbrace')) {\n break;\n }\n shouldContinue = this.parseStatement();\n }\n\n this.scopes.pop();\n }\n\n private parseAttributeList(): DOTAttributeMap {\n const attributes: DOTAttributeMap = {};\n while (this.match('lbrack')) {\n while (!this.match('rbrack')) {\n const keyToken = this.consume();\n if (!isIdentifierLike(keyToken)) {\n throw new Error('Expected attribute name.');\n }\n const key = parseIdentifierValue(keyToken);\n let value: unknown = true;\n if (this.match('equals')) {\n const valueToken = this.consume();\n value = parseAttributeValue(valueToken);\n }\n attributes[key] = value;\n if (this.peek()?.type === 'comma' || this.peek()?.type === 'semicolon') {\n this.consume();\n }\n }\n }\n return attributes;\n }\n\n private ensureNode(id: string, membership: string[]): ParsedNode {\n let node = this.result.nodes.get(id);\n if (!node) {\n const defaults = this.currentScope().nodeDefaults;\n node = {id, attributes: {...defaults}, subgraphs: new Set()};\n this.result.nodes.set(id, node);\n }\n if (node) {\n membership.forEach((subgraphId) => node.subgraphs.add(subgraphId));\n }\n return node;\n }\n\n private getCurrentSubgraphChain(): string[] {\n const chain: string[] = [];\n for (const scope of this.scopes) {\n if (scope.id) {\n chain.push(scope.id);\n }\n }\n return chain;\n }\n\n private findCurrentSubgraphId(): string | undefined {\n for (let index = this.scopes.length - 1; index >= 0; index--) {\n const scope = this.scopes[index];\n if (scope.id) {\n return scope.id;\n }\n }\n return undefined;\n }\n\n private currentScope(): ScopeContext {\n return this.scopes[this.scopes.length - 1];\n }\n\n private consumeOptionalSemicolon(): void {\n const next = this.peek();\n if (next?.type === 'semicolon') {\n this.consume();\n }\n }\n\n private expect(type: TokenType): Token {\n const token = this.consume();\n if (!token || token.type !== type) {\n throw new Error(`Expected token ${type}.`);\n }\n return token;\n }\n\n private consume(): Token {\n const token = this.tokens[this.position];\n if (!token) {\n throw new Error('Unexpected end of DOT input.');\n }\n this.position++;\n return token;\n }\n\n private match(type: TokenType): Token | null {\n const token = this.peek();\n if (token && token.type === type) {\n this.position++;\n return token;\n }\n return null;\n }\n\n private peek(offset = 0): Token | null {\n return this.tokens[this.position + offset] ?? null;\n }\n}\n\nfunction parseDOT(input: string): DOTParseResult {\n const parser = new DOTParser(tokenize(input));\n return parser.parse();\n}\n\nconst IDENTIFIER_TERMINATORS = new Set(['{', '}', '[', ']', '=', ';', ',', '\"', '<', '#']);\n\nfunction tokenize(input: string): Token[] {\n const tokens: Token[] = [];\n let index = 0;\n\n while (index < input.length) {\n const {token, nextIndex} = readNextToken(input, index);\n if (nextIndex <= index) {\n throw new Error(`Tokenizer did not advance at position ${index}.`);\n }\n if (token) {\n tokens.push(token);\n }\n index = nextIndex;\n }\n\n return tokens;\n}\n\nfunction readNextToken(input: string, index: number): {token: Token | null; nextIndex: number} {\n if (index >= input.length) {\n return {token: null, nextIndex: input.length};\n }\n\n const char = input[index];\n\n if (isWhitespace(char)) {\n return {token: null, nextIndex: index + 1};\n }\n\n const commentEnd = skipComment(input, index);\n if (commentEnd !== null) {\n return {token: null, nextIndex: commentEnd};\n }\n\n const arrowToken = readArrowToken(input, index);\n if (arrowToken) {\n return arrowToken;\n }\n\n const punctuation = readPunctuationToken(char);\n if (punctuation) {\n return {token: punctuation, nextIndex: index + 1};\n }\n\n if (char === '\"') {\n const {value, nextIndex} = readQuotedString(input, index + 1);\n return {token: {type: 'string', value}, nextIndex};\n }\n\n if (char === '<') {\n const {value, nextIndex} = readHtmlString(input, index + 1);\n return {token: {type: 'html', value}, nextIndex};\n }\n\n const identifier = readIdentifier(input, index);\n if (identifier.value) {\n return {\n token: {type: 'identifier', value: identifier.value},\n nextIndex: identifier.nextIndex\n };\n }\n\n throw new Error(`Unexpected token at position ${index}.`);\n}\n\nfunction skipComment(input: string, index: number): number | null {\n const char = input[index];\n if (char === '/') {\n const next = input[index + 1];\n if (next === '/') {\n return skipLineComment(input, index + 2);\n }\n if (next === '*') {\n return skipBlockComment(input, index + 2);\n }\n return null;\n }\n\n if (char === '#') {\n return skipLineComment(input, index + 1);\n }\n\n return null;\n}\n\nfunction skipLineComment(input: string, startIndex: number): number {\n let cursor = startIndex;\n while (cursor < input.length && !isLineBreak(input[cursor])) {\n cursor++;\n }\n return cursor;\n}\n\nfunction skipBlockComment(input: string, startIndex: number): number {\n let cursor = startIndex;\n while (cursor < input.length) {\n if (input[cursor] === '*' && input[cursor + 1] === '/') {\n return cursor + 2;\n }\n cursor++;\n }\n throw new Error('Unterminated block comment in DOT source.');\n}\n\nfunction readArrowToken(input: string, index: number): {token: Token; nextIndex: number} | null {\n const next = input[index + 1];\n if (input[index] === '-' && next === '-') {\n return {token: {type: 'arrow', value: '--'}, nextIndex: index + 2};\n }\n if (input[index] === '-' && next === '>') {\n return {token: {type: 'arrow', value: '->'}, nextIndex: index + 2};\n }\n return null;\n}\n\nfunction readPunctuationToken(char: string): Token | null {\n switch (char) {\n case '{':\n return {type: 'lbrace', value: char};\n case '}':\n return {type: 'rbrace', value: char};\n case '[':\n return {type: 'lbrack', value: char};\n case ']':\n return {type: 'rbrack', value: char};\n case '=':\n return {type: 'equals', value: char};\n case ',':\n return {type: 'comma', value: char};\n case ';':\n return {type: 'semicolon', value: char};\n default:\n return null;\n }\n}\n\nfunction readQuotedString(input: string, startIndex: number): {value: string; nextIndex: number} {\n let value = '';\n let index = startIndex;\n while (index < input.length) {\n const char = input[index];\n if (char === '\"') {\n return {value, nextIndex: index + 1};\n }\n if (char === '\\\\') {\n const escape = readEscapedCharacter(input, index + 1);\n value += escape.value;\n index = escape.nextIndex;\n } else {\n value += char;\n index++;\n }\n }\n throw new Error('Unterminated string literal in DOT source.');\n}\n\nfunction readEscapedCharacter(\n input: string,\n startIndex: number\n): {value: string; nextIndex: number} {\n const next = input[startIndex];\n switch (next) {\n case 'n':\n case 'l':\n case 'L':\n return {value: '\\n', nextIndex: startIndex + 1};\n case 't':\n return {value: '\\t', nextIndex: startIndex + 1};\n case 'r':\n return {value: '\\r', nextIndex: startIndex + 1};\n case '\"':\n return {value: '\"', nextIndex: startIndex + 1};\n case '\\\\':\n return {value: '\\\\', nextIndex: startIndex + 1};\n default: {\n if (typeof next === 'undefined') {\n throw new Error('Unterminated escape sequence in DOT source.');\n }\n return {value: next, nextIndex: startIndex + 1};\n }\n }\n}\n\nfunction readHtmlString(input: string, startIndex: number): {value: string; nextIndex: number} {\n let value = '<';\n let depth = 1;\n let index = startIndex;\n while (index < input.length) {\n const char = input[index];\n value += char;\n if (char === '<') {\n depth++;\n } else if (char === '>') {\n depth--;\n if (depth === 0) {\n return {value, nextIndex: index + 1};\n }\n }\n index++;\n }\n throw new Error('Unterminated HTML-like string literal in DOT source.');\n}\n\nfunction readIdentifier(input: string, startIndex: number): {value: string; nextIndex: number} {\n let index = startIndex;\n let value = '';\n while (index < input.length && !isIdentifierTerminator(input, index)) {\n value += input[index];\n index++;\n }\n return {value, nextIndex: index};\n}\n\nfunction isIdentifierTerminator(input: string, index: number): boolean {\n const char = input[index];\n if (isWhitespace(char) || IDENTIFIER_TERMINATORS.has(char)) {\n return true;\n }\n if (isArrowOperatorStart(input, index)) {\n return true;\n }\n if (isCommentStart(input, index)) {\n return true;\n }\n return false;\n}\n\nfunction isArrowOperatorStart(input: string, index: number): boolean {\n if (input[index] !== '-') {\n return false;\n }\n const next = input[index + 1];\n return next === '-' || next === '>';\n}\n\nfunction isCommentStart(input: string, index: number): boolean {\n if (input[index] !== '/') {\n return false;\n }\n const next = input[index + 1];\n return next === '/' || next === '*';\n}\n\nfunction isWhitespace(char: string): boolean {\n return char === ' ' || char === '\\n' || char === '\\r' || char === '\\t' || char === '\\f';\n}\n\nfunction isLineBreak(char: string): boolean {\n return char === '\\n' || char === '\\r';\n}\n\nfunction isKeyword(token: Token, keyword: string): boolean {\n return token.type === 'identifier' && token.value.toLowerCase() === keyword.toLowerCase();\n}\n\nfunction isGraphType(token: Token): boolean {\n return isKeyword(token, 'graph') || isKeyword(token, 'digraph');\n}\n\nfunction isIdentifierLike(token: Token): boolean {\n return token.type === 'identifier' || token.type === 'string' || token.type === 'html';\n}\n\nfunction isStructuralToken(token: Token): boolean {\n return (\n token.type === 'lbrace' ||\n token.type === 'rbrace' ||\n token.type === 'lbrack' ||\n token.type === 'rbrack'\n );\n}\n\nfunction parseIdentifierValue(token: Token): string {\n return token.value;\n}\n\nfunction parseAttributeValue(token: Token): unknown {\n if (token.type === 'string' || token.type === 'html') {\n return token.value;\n }\n if (token.type === 'identifier') {\n const numeric = Number(token.value);\n if (!Number.isNaN(numeric)) {\n return numeric;\n }\n return token.value;\n }\n throw new Error('Invalid attribute value in DOT input.');\n}\n\nfunction deriveEdgeId(\n attributes: DOTAttributeMap,\n sourceId: string,\n targetId: string,\n counter: number\n): string {\n const candidate = attributes.id ?? attributes.Id ?? attributes.ID;\n if (typeof candidate === 'string' || typeof candidate === 'number') {\n return String(candidate);\n }\n return `${String(sourceId)}-${String(targetId)}-${counter}`;\n}\n\nfunction deriveDirectedFlag(attributes: DOTAttributeMap, defaultDirected: boolean): boolean {\n const candidate = attributes.directed;\n if (typeof candidate === 'boolean') {\n return candidate;\n }\n\n const dirAttr = attributes.dir;\n if (typeof dirAttr === 'string') {\n const normalized = dirAttr.toLowerCase();\n if (normalized === 'none') {\n return false;\n }\n return true;\n }\n\n return defaultDirected;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {\n EdgeDecoratorType,\n EdgeState,\n EdgeType,\n LayoutState,\n NodeState,\n NodeType\n} from '../core/constants';\nimport {Marker} from '../layers/common-layers/marker-layer/marker-list';\n\n/** Markers supported by graph-layers @deprecated v9.2: Use string literals */\nexport const MARKER_TYPE = {\n 'bell-filled': 'bell-filled',\n bell: 'bell',\n 'bookmark-filled': 'bookmark-filled',\n bookmark: 'bookmark',\n 'cd-filled': 'cd-filled',\n cd: 'cd',\n checkmark: 'checkmark',\n 'circle-check-filled': 'circle-check-filled',\n 'circle-check': 'circle-check',\n 'circle-filled': 'circle-filled',\n 'circle-i-filled': 'circle-i-filled',\n 'circle-i': 'circle-i',\n 'circle-minus-filled': 'circle-minus-filled',\n 'circle-minus': 'circle-minus',\n 'circle-plus-filled': 'circle-plus-filled',\n 'circle-plus': 'circle-plus',\n 'circle-questionmark-filled': 'circle-questionmark-filled',\n 'circle-questionmark': 'circle-questionmark',\n 'circle-slash-filled': 'circle-slash-filled',\n 'circle-slash': 'circle-slash',\n 'circle-x-filled': 'circle-x-filled',\n 'circle-x': 'circle-x',\n circle: 'circle',\n 'diamond-filled': 'diamond-filled',\n diamond: 'diamond',\n 'flag-filled': 'flag-filled',\n flag: 'flag',\n gear: 'gear',\n 'heart-filled': 'heart-filled',\n heart: 'heart',\n 'location-marker-filled': 'location-marker-filled',\n 'location-marker': 'location-marker',\n 'octagonal-star-filled': 'octagonal-star-filled',\n 'octagonal-star': 'octagonal-star',\n 'person-filled': 'person-filled',\n person: 'person',\n 'pin-filled': 'pin-filled',\n pin: 'pin',\n 'plus-small': 'plus-small',\n plus: 'plus',\n 'rectangle-filled': 'rectangle-filled',\n rectangle: 'rectangle',\n 'star-filled': 'star-filled',\n star: 'star',\n 'tag-filled': 'tag-filled',\n tag: 'tag',\n 'thumb-down-filled': 'thumb-down-filled',\n 'thumb-down': 'thumb-down',\n 'thumb-up': 'thumb-up',\n 'thumb_up-filled': 'thumb_up-filled',\n 'triangle-down-filled': 'triangle-down-filled',\n 'triangle-down': 'triangle-down',\n 'triangle-left-filled': 'triangle-left-filled',\n 'triangle-left': 'triangle-left',\n 'triangle-right-filled': 'triangle-right-filled',\n 'triangle-right': 'triangle-right',\n 'triangle-up-filled': 'triangle-up-filled',\n 'triangle-up': 'triangle-up',\n 'x-small': 'x-small',\n x: 'x'\n} as const satisfies Record<Marker, Marker>;\n/* eslint-enable */\n\n/** The interaction state of a node. @deprecated v9.2: Use string literals */\nexport const NODE_STATE = {\n DEFAULT: 'default',\n HOVER: 'hover',\n DRAGGING: 'dragging',\n SELECTED: 'selected'\n} as const satisfies Record<string, NodeState>;\n\n/** The interaction state of an edge. @deprecated v9.2: Use string literals */\nexport const EDGE_STATE = {\n DEFAULT: 'default',\n HOVER: 'hover',\n DRAGGING: 'dragging',\n SELECTED: 'selected'\n} as const satisfies Record<string, EdgeState>;\n\n/** The visual type of a node. @deprecated v9.2: Use string literals */\nexport const NODE_TYPE = {\n CIRCLE: 'circle',\n RECTANGLE: 'rectangle',\n ROUNDED_RECTANGLE: 'rounded-rectangle',\n PATH_ROUNDED_RECTANGLE: 'path-rounded-rectangle',\n ICON: 'icon',\n LABEL: 'label',\n MARKER: 'marker'\n} as const satisfies Record<string, NodeType>;\n\n/** The visual type of an edge. @deprecated v9.2: Use string literals */\nexport const EDGE_TYPE = {\n SPLINE_CURVE: 'spline',\n LINE: 'line',\n PATH: 'path'\n} as const satisfies Record<string, EdgeType>;\n\n/** Decorators on an edge. @deprecated v9.2: Use string literals */\nexport const EDGE_DECORATOR_TYPE = {\n LABEL: 'label',\n FLOW: 'flow',\n ARROW: 'arrow'\n} as const satisfies Record<string, EdgeDecoratorType>;\n\n/** the status of the layout. @deprecated v9.2: Use string literals */\nexport const LAYOUT_STATE = {\n INIT: 'init',\n START: 'start',\n CALCULATING: 'calculating',\n DONE: 'done',\n ERROR: 'error'\n} as const satisfies Record<string, LayoutState>;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACKA,YAAuB;;;ACCvB,IAAM,cAAsC,oBAAI,IAAI,CAAC,WAAW,SAAS,YAAY,UAAU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SAAS;EACT,OAAO;EACP,UAAU;EACV,UAAU;;AAIL,IAAM,aAAa;EACxB,SAAS;EACT,OAAO;EACP,UAAU;EACV,UAAU;;AAIL,IAAM,YAAY;EACvB,QAAQ;EACR,WAAW;EACX,mBAAmB;EACnB,wBAAwB;EACxB,MAAM;EACN,OAAO;EACP,QAAQ;;AAIH,IAAM,YAAY;EACvB,cAAc;EACd,MAAM;EACN,MAAM;;AAID,IAAM,sBAAsB;EACjC,OAAO;EACP,MAAM;EACN,OAAO;;AAIF,IAAM,eAAe;EAC1B,MAAM;EACN,OAAO;EACP,aAAa;EACb,MAAM;EACN,OAAO;;",
|
|
6
6
|
"names": ["defaultProps", "isEqual", "import_zod", "Color", "error", "attribute", "formatted", "error", "child", "error", "d3", "defaultProps", "error", "createDagGraph", "import_meta", "import_meta", "newD3Edge", "computeControlPoint", "import_core", "import_layers", "import_core", "import_layers", "import_core", "import_core", "import_layers", "getColor", "import_core", "import_layers", "import_core", "import_layers", "import_core", "import_core", "import_layers", "import_core", "import_core", "import_layers", "import_core", "import_layers", "import_core", "import_layers", "import_core", "import_layers", "getColor", "import_core", "import_core", "import_layers", "fs", "defaultProps", "fs", "import_core", "getColor", "getOffset", "nodes", "error", "import_core", "import_layers", "getColor", "getOffset", "offX", "offY", "polygon", "error", "getOffset", "VERSION", "attrs"]
|
|
7
7
|
}
|