@neo4j-ndl/react-graph 1.3.28 → 1.3.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"graph-visualization-context.js","sourceRoot":"","sources":["../../src/graph-visualization-context.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAIH,iCAAkD;AAoFrC,QAAA,yBAAyB,GAAG,IAAA,qBAAa,EAEpD,SAAS,CAAC,CAAC;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACI,MAAM,4BAA4B,GAAG,GAAG,EAAE;IAC/C,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,iCAAyB,CAAC,CAAC;IACtD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AARW,QAAA,4BAA4B,gCAQvC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport type NVL from '@neo4j-nvl/base';\nimport { type Layout, type Node, type Relationship } from '@neo4j-nvl/base';\nimport { createContext, useContext } from 'react';\n\nimport { type CompiledStyleRules } from './styling/compile-graph-styles';\n\nexport type GraphSelection = { nodeIds: string[]; relationshipIds: string[] };\nexport type Sidepanel = {\n children: React.ReactNode;\n isSidePanelOpen: boolean;\n setIsSidePanelOpen?: (isSidePanelOpen: boolean) => void;\n sidePanelWidth?: number;\n onSidePanelResize: (width: number) => void;\n minWidth?: number;\n};\n\nexport type NvlGraph = {\n nodes: Node[];\n nodeData: Record<string, NodeData>;\n rels: Relationship[];\n relData: Record<string, RelData>;\n};\n\nexport type ColorCount = { color: string; count: number };\n\nexport type GraphItemMetaData = {\n totalCount: number;\n /** Distribution of colors across all elements with this label/type, sorted descending by count. */\n colorDistribution: ColorCount[];\n};\n\nexport type MetadataLookupTable = {\n labels: string[];\n labelMetaData: Record<string, GraphItemMetaData>;\n reltypes: string[];\n reltypeMetaData: Record<string, GraphItemMetaData>;\n hasMultipleColors: boolean;\n};\n\n// We use this type to avoid coupling the graph visualization component to the neo4j driver types\n// The tradeoff is that it's limited to displaying values and not manipulating them\n// and that it's harder to pass to the graph visualization component from the raw driver result\nexport type PortableProperty = { stringified: string; type: string };\n\nexport type NodeData = {\n labelsSorted: string[];\n properties: Record<string, PortableProperty>;\n id: string;\n};\nexport type RelData = {\n type: string;\n properties: Record<string, PortableProperty>;\n id: string;\n};\n\nexport type NeoNode = Node & {\n properties: Record<string, PortableProperty>;\n labels: string[];\n};\n\nexport type NeoRel = Relationship & {\n properties: Record<string, PortableProperty>;\n type: string;\n};\n\n/**\n * Data that is shared across the graph visualization component.\n *\n * @see {@link useGraphVisualizationContext}\n * @alpha\n */\nexport type GraphVisualizationContextData = {\n nvlInstance: React.MutableRefObject<NVL | null>;\n sidepanel: Sidepanel | null;\n gesture: Gesture;\n setGesture?: (gesture: Gesture) => void;\n interactionMode: InteractionMode;\n nvlGraph: NvlGraph;\n selected: GraphSelection;\n metadataLookup: MetadataLookupTable;\n compiledStyleRules: CompiledStyleRules;\n layout: Layout;\n setLayout?: (layout: Layout) => void;\n portalTarget?: HTMLElement | null;\n};\n\nexport const GraphVisualizationContext = createContext<\n GraphVisualizationContextData | undefined\n>(undefined);\n\n/**\n * Hook to access the graph visualization context.\n *\n * This hook is used to implement custom UI components like buttons, panels, and controls\n * that need access to data and functionality from the graph visualization component.\n * @see {@link GraphVisualizationContextData}\n *\n * @returns The graph visualization context containing NVL instance, sidepanel, gestures, and graph data\n * @throws Error if used outside of a GraphVisualizationContext provider\n *\n * @example\n * ```tsx\n * const NodeLoggerButton = () => {\n * const { selected } = useGraphVisualizationContext();\n *\n * const handleClick = () => {\n * console.log('Selected nodes:', selected.nodeIds);\n * };\n *\n * return (\n * <button onClick={handleClick}>\n * Log Selected Nodes ({selected.nodeIds.length})\n * </button>\n * );\n * };\n * ```\n * @alpha\n */\nexport const useGraphVisualizationContext = () => {\n const context = useContext(GraphVisualizationContext);\n if (!context) {\n throw new Error(\n 'useGraphVisualizationContext must be used within a GraphVisualizationContext',\n );\n }\n return context;\n};\n\nexport type Gesture = 'single' | 'box' | 'lasso';\n\nexport type InteractionMode =\n | 'select'\n | 'draw'\n | 'edit-text'\n | 'pan'\n | 'drag'\n | 'none';\n"]}
1
+ {"version":3,"file":"graph-visualization-context.js","sourceRoot":"","sources":["../../src/graph-visualization-context.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAIH,iCAAkD;AAqFrC,QAAA,yBAAyB,GAAG,IAAA,qBAAa,EAEpD,SAAS,CAAC,CAAC;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACI,MAAM,4BAA4B,GAAG,GAAG,EAAE;IAC/C,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,iCAAyB,CAAC,CAAC;IACtD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AARW,QAAA,4BAA4B,gCAQvC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport type NVL from '@neo4j-nvl/base';\nimport { type Layout, type Node, type Relationship } from '@neo4j-nvl/base';\nimport { createContext, useContext } from 'react';\n\nimport { type CompiledStyleRules } from './styling/compile-graph-styles';\n\nexport type GraphSelection = { nodeIds: string[]; relationshipIds: string[] };\nexport type Sidepanel = {\n children: React.ReactNode;\n isSidePanelOpen: boolean;\n setIsSidePanelOpen?: (isSidePanelOpen: boolean) => void;\n sidePanelWidth?: number;\n onSidePanelResize: (width: number) => void;\n minWidth?: number | string;\n maxWidth?: number | string;\n};\n\nexport type NvlGraph = {\n nodes: Node[];\n nodeData: Record<string, NodeData>;\n rels: Relationship[];\n relData: Record<string, RelData>;\n};\n\nexport type ColorCount = { color: string; count: number };\n\nexport type GraphItemMetaData = {\n totalCount: number;\n /** Distribution of colors across all elements with this label/type, sorted descending by count. */\n colorDistribution: ColorCount[];\n};\n\nexport type MetadataLookupTable = {\n labels: string[];\n labelMetaData: Record<string, GraphItemMetaData>;\n reltypes: string[];\n reltypeMetaData: Record<string, GraphItemMetaData>;\n hasMultipleColors: boolean;\n};\n\n// We use this type to avoid coupling the graph visualization component to the neo4j driver types\n// The tradeoff is that it's limited to displaying values and not manipulating them\n// and that it's harder to pass to the graph visualization component from the raw driver result\nexport type PortableProperty = { stringified: string; type: string };\n\nexport type NodeData = {\n labelsSorted: string[];\n properties: Record<string, PortableProperty>;\n id: string;\n};\nexport type RelData = {\n type: string;\n properties: Record<string, PortableProperty>;\n id: string;\n};\n\nexport type NeoNode = Node & {\n properties: Record<string, PortableProperty>;\n labels: string[];\n};\n\nexport type NeoRel = Relationship & {\n properties: Record<string, PortableProperty>;\n type: string;\n};\n\n/**\n * Data that is shared across the graph visualization component.\n *\n * @see {@link useGraphVisualizationContext}\n * @alpha\n */\nexport type GraphVisualizationContextData = {\n nvlInstance: React.MutableRefObject<NVL | null>;\n sidepanel: Sidepanel | null;\n gesture: Gesture;\n setGesture?: (gesture: Gesture) => void;\n interactionMode: InteractionMode;\n nvlGraph: NvlGraph;\n selected: GraphSelection;\n metadataLookup: MetadataLookupTable;\n compiledStyleRules: CompiledStyleRules;\n layout: Layout;\n setLayout?: (layout: Layout) => void;\n portalTarget?: HTMLElement | null;\n};\n\nexport const GraphVisualizationContext = createContext<\n GraphVisualizationContextData | undefined\n>(undefined);\n\n/**\n * Hook to access the graph visualization context.\n *\n * This hook is used to implement custom UI components like buttons, panels, and controls\n * that need access to data and functionality from the graph visualization component.\n * @see {@link GraphVisualizationContextData}\n *\n * @returns The graph visualization context containing NVL instance, sidepanel, gestures, and graph data\n * @throws Error if used outside of a GraphVisualizationContext provider\n *\n * @example\n * ```tsx\n * const NodeLoggerButton = () => {\n * const { selected } = useGraphVisualizationContext();\n *\n * const handleClick = () => {\n * console.log('Selected nodes:', selected.nodeIds);\n * };\n *\n * return (\n * <button onClick={handleClick}>\n * Log Selected Nodes ({selected.nodeIds.length})\n * </button>\n * );\n * };\n * ```\n * @alpha\n */\nexport const useGraphVisualizationContext = () => {\n const context = useContext(GraphVisualizationContext);\n if (!context) {\n throw new Error(\n 'useGraphVisualizationContext must be used within a GraphVisualizationContext',\n );\n }\n return context;\n};\n\nexport type Gesture = 'single' | 'box' | 'lasso';\n\nexport type InteractionMode =\n | 'select'\n | 'draw'\n | 'edit-text'\n | 'pan'\n | 'drag'\n | 'none';\n"]}
@@ -24,7 +24,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
24
24
  */
25
25
  const react_1 = require("@neo4j-ndl/react");
26
26
  const GraphVisualizationSidepanel = ({ sidepanel, }) => {
27
- const { children, isSidePanelOpen, setIsSidePanelOpen, sidePanelWidth, onSidePanelResize, minWidth = 230, } = sidepanel;
27
+ const { children, isSidePanelOpen, setIsSidePanelOpen, sidePanelWidth, onSidePanelResize, maxWidth = '66%', minWidth = 230, } = sidepanel;
28
28
  if (!isSidePanelOpen) {
29
29
  return null;
30
30
  }
@@ -36,7 +36,7 @@ const GraphVisualizationSidepanel = ({ sidepanel, }) => {
36
36
  height: '100%',
37
37
  width: sidePanelWidth !== null && sidePanelWidth !== void 0 ? sidePanelWidth : 400,
38
38
  },
39
- maxWidth: 600,
39
+ maxWidth,
40
40
  minWidth,
41
41
  onResizeStop: (_e, _dir, ref) => {
42
42
  onSidePanelResize(ref.getBoundingClientRect().width);
@@ -1 +1 @@
1
- {"version":3,"file":"graph-visualization-sidepanel.js","sourceRoot":"","sources":["../../src/graph-visualization-sidepanel.tsx"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4CAA0C;AAInC,MAAM,2BAA2B,GAAG,CAAC,EAC1C,SAAS,GAGV,EAAE,EAAE;IACH,MAAM,EACJ,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,QAAQ,GAAG,GAAG,GACf,GAAG,SAAS,CAAC;IAEd,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,uBAAC,cAAM,IACL,SAAS,EAAC,gCAAgC,EAC1C,UAAU,EAAE,eAAe,EAC3B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,EAAE;YAC7B,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAG,QAAQ,CAAC,CAAC;QACjC,CAAC,EACD,QAAQ,EAAC,OAAO,EAChB,IAAI,EAAC,MAAM,EACX,YAAY,QACZ,WAAW,EAAE,KAAK,EAClB,eAAe,EAAE;YACf,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE;gBACX,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,GAAG;aAC7B;YACD,QAAQ,EAAE,GAAG;YACb,QAAQ;YACR,YAAY,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;gBAC9B,iBAAiB,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC,CAAC;YACvD,CAAC;SACF,YAED,gCAAK,SAAS,EAAC,2CAA2C,YACvD,QAAQ,GACL,GACC,CACV,CAAC;AACJ,CAAC,CAAC;AA/CW,QAAA,2BAA2B,+BA+CtC;AAEF,MAAM,KAAK,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE;IAC5D,OAAO,CACL,uBAAC,cAAM,CAAC,MAAM,IAAC,SAAS,EAAC,yCAAyC,YAC/D,QAAQ,GACK,CACjB,CAAC;AACJ,CAAC,CAAC;AACF,mCAA2B,CAAC,KAAK,GAAG,KAAK,CAAC;AAE1C,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE;IAC9D,OAAO,CACL,uBAAC,cAAM,CAAC,IAAI,IAAC,SAAS,EAAC,2CAA2C,YAC/D,QAAQ,GACG,CACf,CAAC;AACJ,CAAC,CAAC;AACF,mCAA2B,CAAC,OAAO,GAAG,OAAO,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { Drawer } from '@neo4j-ndl/react';\n\nimport { type Sidepanel } from './graph-visualization-context';\n\nexport const GraphVisualizationSidepanel = ({\n sidepanel,\n}: {\n sidepanel: Sidepanel;\n}) => {\n const {\n children,\n isSidePanelOpen,\n setIsSidePanelOpen,\n sidePanelWidth,\n onSidePanelResize,\n minWidth = 230,\n } = sidepanel;\n\n if (!isSidePanelOpen) {\n return null;\n }\n\n return (\n <Drawer\n className=\"ndl-graph-visualization-drawer\"\n isExpanded={isSidePanelOpen}\n onExpandedChange={(expanded) => {\n setIsSidePanelOpen?.(expanded);\n }}\n position=\"right\"\n type=\"push\"\n isResizeable\n isCloseable={false}\n resizeableProps={{\n bounds: 'window',\n defaultSize: {\n height: '100%',\n width: sidePanelWidth ?? 400,\n },\n maxWidth: 600,\n minWidth,\n onResizeStop: (_e, _dir, ref) => {\n onSidePanelResize(ref.getBoundingClientRect().width);\n },\n }}\n >\n <div className=\"ndl-graph-visualization-sidepanel-wrapper\">\n {children}\n </div>\n </Drawer>\n );\n};\n\nconst Title = ({ children }: { children: React.ReactNode }) => {\n return (\n <Drawer.Header className=\"ndl-graph-visualization-sidepanel-title\">\n {children}\n </Drawer.Header>\n );\n};\nGraphVisualizationSidepanel.Title = Title;\n\nconst Content = ({ children }: { children: React.ReactNode }) => {\n return (\n <Drawer.Body className=\"ndl-graph-visualization-sidepanel-content\">\n {children}\n </Drawer.Body>\n );\n};\nGraphVisualizationSidepanel.Content = Content;\n"]}
1
+ {"version":3,"file":"graph-visualization-sidepanel.js","sourceRoot":"","sources":["../../src/graph-visualization-sidepanel.tsx"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4CAA0C;AAInC,MAAM,2BAA2B,GAAG,CAAC,EAC1C,SAAS,GAGV,EAAE,EAAE;IACH,MAAM,EACJ,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,GAAG,GACf,GAAG,SAAS,CAAC;IAEd,IAA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O,GAAG,OAAO,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { Drawer } from '@neo4j-ndl/react';\n\nimport { type Sidepanel } from './graph-visualization-context';\n\nexport const GraphVisualizationSidepanel = ({\n sidepanel,\n}: {\n sidepanel: Sidepanel;\n}) => {\n const {\n children,\n isSidePanelOpen,\n setIsSidePanelOpen,\n sidePanelWidth,\n onSidePanelResize,\n maxWidth = '66%',\n minWidth = 230,\n } = sidepanel;\n\n if (!isSidePanelOpen) {\n return null;\n }\n\n return (\n <Drawer\n className=\"ndl-graph-visualization-drawer\"\n isExpanded={isSidePanelOpen}\n onExpandedChange={(expanded) => {\n setIsSidePanelOpen?.(expanded);\n }}\n position=\"right\"\n type=\"push\"\n isResizeable\n isCloseable={false}\n resizeableProps={{\n bounds: 'window',\n defaultSize: {\n height: '100%',\n width: sidePanelWidth ?? 400,\n },\n maxWidth,\n minWidth,\n onResizeStop: (_e, _dir, ref) => {\n onSidePanelResize(ref.getBoundingClientRect().width);\n },\n }}\n >\n <div className=\"ndl-graph-visualization-sidepanel-wrapper\">\n {children}\n </div>\n </Drawer>\n );\n};\n\nconst Title = ({ children }: { children: React.ReactNode }) => {\n return (\n <Drawer.Header className=\"ndl-graph-visualization-sidepanel-title\">\n {children}\n </Drawer.Header>\n );\n};\nGraphVisualizationSidepanel.Title = Title;\n\nconst Content = ({ children }: { children: React.ReactNode }) => {\n return (\n <Drawer.Body className=\"ndl-graph-visualization-sidepanel-content\">\n {children}\n </Drawer.Body>\n );\n};\nGraphVisualizationSidepanel.Content = Content;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"graph-visualization-context.js","sourceRoot":"","sources":["../../src/graph-visualization-context.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAoFlD,MAAM,CAAC,MAAM,yBAAyB,GAAG,aAAa,CAEpD,SAAS,CAAC,CAAC;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,EAAE;IAC/C,MAAM,OAAO,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC;IACtD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport type NVL from '@neo4j-nvl/base';\nimport { type Layout, type Node, type Relationship } from '@neo4j-nvl/base';\nimport { createContext, useContext } from 'react';\n\nimport { type CompiledStyleRules } from './styling/compile-graph-styles';\n\nexport type GraphSelection = { nodeIds: string[]; relationshipIds: string[] };\nexport type Sidepanel = {\n children: React.ReactNode;\n isSidePanelOpen: boolean;\n setIsSidePanelOpen?: (isSidePanelOpen: boolean) => void;\n sidePanelWidth?: number;\n onSidePanelResize: (width: number) => void;\n minWidth?: number;\n};\n\nexport type NvlGraph = {\n nodes: Node[];\n nodeData: Record<string, NodeData>;\n rels: Relationship[];\n relData: Record<string, RelData>;\n};\n\nexport type ColorCount = { color: string; count: number };\n\nexport type GraphItemMetaData = {\n totalCount: number;\n /** Distribution of colors across all elements with this label/type, sorted descending by count. */\n colorDistribution: ColorCount[];\n};\n\nexport type MetadataLookupTable = {\n labels: string[];\n labelMetaData: Record<string, GraphItemMetaData>;\n reltypes: string[];\n reltypeMetaData: Record<string, GraphItemMetaData>;\n hasMultipleColors: boolean;\n};\n\n// We use this type to avoid coupling the graph visualization component to the neo4j driver types\n// The tradeoff is that it's limited to displaying values and not manipulating them\n// and that it's harder to pass to the graph visualization component from the raw driver result\nexport type PortableProperty = { stringified: string; type: string };\n\nexport type NodeData = {\n labelsSorted: string[];\n properties: Record<string, PortableProperty>;\n id: string;\n};\nexport type RelData = {\n type: string;\n properties: Record<string, PortableProperty>;\n id: string;\n};\n\nexport type NeoNode = Node & {\n properties: Record<string, PortableProperty>;\n labels: string[];\n};\n\nexport type NeoRel = Relationship & {\n properties: Record<string, PortableProperty>;\n type: string;\n};\n\n/**\n * Data that is shared across the graph visualization component.\n *\n * @see {@link useGraphVisualizationContext}\n * @alpha\n */\nexport type GraphVisualizationContextData = {\n nvlInstance: React.MutableRefObject<NVL | null>;\n sidepanel: Sidepanel | null;\n gesture: Gesture;\n setGesture?: (gesture: Gesture) => void;\n interactionMode: InteractionMode;\n nvlGraph: NvlGraph;\n selected: GraphSelection;\n metadataLookup: MetadataLookupTable;\n compiledStyleRules: CompiledStyleRules;\n layout: Layout;\n setLayout?: (layout: Layout) => void;\n portalTarget?: HTMLElement | null;\n};\n\nexport const GraphVisualizationContext = createContext<\n GraphVisualizationContextData | undefined\n>(undefined);\n\n/**\n * Hook to access the graph visualization context.\n *\n * This hook is used to implement custom UI components like buttons, panels, and controls\n * that need access to data and functionality from the graph visualization component.\n * @see {@link GraphVisualizationContextData}\n *\n * @returns The graph visualization context containing NVL instance, sidepanel, gestures, and graph data\n * @throws Error if used outside of a GraphVisualizationContext provider\n *\n * @example\n * ```tsx\n * const NodeLoggerButton = () => {\n * const { selected } = useGraphVisualizationContext();\n *\n * const handleClick = () => {\n * console.log('Selected nodes:', selected.nodeIds);\n * };\n *\n * return (\n * <button onClick={handleClick}>\n * Log Selected Nodes ({selected.nodeIds.length})\n * </button>\n * );\n * };\n * ```\n * @alpha\n */\nexport const useGraphVisualizationContext = () => {\n const context = useContext(GraphVisualizationContext);\n if (!context) {\n throw new Error(\n 'useGraphVisualizationContext must be used within a GraphVisualizationContext',\n );\n }\n return context;\n};\n\nexport type Gesture = 'single' | 'box' | 'lasso';\n\nexport type InteractionMode =\n | 'select'\n | 'draw'\n | 'edit-text'\n | 'pan'\n | 'drag'\n | 'none';\n"]}
1
+ {"version":3,"file":"graph-visualization-context.js","sourceRoot":"","sources":["../../src/graph-visualization-context.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAqFlD,MAAM,CAAC,MAAM,yBAAyB,GAAG,aAAa,CAEpD,SAAS,CAAC,CAAC;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,EAAE;IAC/C,MAAM,OAAO,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC;IACtD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport type NVL from '@neo4j-nvl/base';\nimport { type Layout, type Node, type Relationship } from '@neo4j-nvl/base';\nimport { createContext, useContext } from 'react';\n\nimport { type CompiledStyleRules } from './styling/compile-graph-styles';\n\nexport type GraphSelection = { nodeIds: string[]; relationshipIds: string[] };\nexport type Sidepanel = {\n children: React.ReactNode;\n isSidePanelOpen: boolean;\n setIsSidePanelOpen?: (isSidePanelOpen: boolean) => void;\n sidePanelWidth?: number;\n onSidePanelResize: (width: number) => void;\n minWidth?: number | string;\n maxWidth?: number | string;\n};\n\nexport type NvlGraph = {\n nodes: Node[];\n nodeData: Record<string, NodeData>;\n rels: Relationship[];\n relData: Record<string, RelData>;\n};\n\nexport type ColorCount = { color: string; count: number };\n\nexport type GraphItemMetaData = {\n totalCount: number;\n /** Distribution of colors across all elements with this label/type, sorted descending by count. */\n colorDistribution: ColorCount[];\n};\n\nexport type MetadataLookupTable = {\n labels: string[];\n labelMetaData: Record<string, GraphItemMetaData>;\n reltypes: string[];\n reltypeMetaData: Record<string, GraphItemMetaData>;\n hasMultipleColors: boolean;\n};\n\n// We use this type to avoid coupling the graph visualization component to the neo4j driver types\n// The tradeoff is that it's limited to displaying values and not manipulating them\n// and that it's harder to pass to the graph visualization component from the raw driver result\nexport type PortableProperty = { stringified: string; type: string };\n\nexport type NodeData = {\n labelsSorted: string[];\n properties: Record<string, PortableProperty>;\n id: string;\n};\nexport type RelData = {\n type: string;\n properties: Record<string, PortableProperty>;\n id: string;\n};\n\nexport type NeoNode = Node & {\n properties: Record<string, PortableProperty>;\n labels: string[];\n};\n\nexport type NeoRel = Relationship & {\n properties: Record<string, PortableProperty>;\n type: string;\n};\n\n/**\n * Data that is shared across the graph visualization component.\n *\n * @see {@link useGraphVisualizationContext}\n * @alpha\n */\nexport type GraphVisualizationContextData = {\n nvlInstance: React.MutableRefObject<NVL | null>;\n sidepanel: Sidepanel | null;\n gesture: Gesture;\n setGesture?: (gesture: Gesture) => void;\n interactionMode: InteractionMode;\n nvlGraph: NvlGraph;\n selected: GraphSelection;\n metadataLookup: MetadataLookupTable;\n compiledStyleRules: CompiledStyleRules;\n layout: Layout;\n setLayout?: (layout: Layout) => void;\n portalTarget?: HTMLElement | null;\n};\n\nexport const GraphVisualizationContext = createContext<\n GraphVisualizationContextData | undefined\n>(undefined);\n\n/**\n * Hook to access the graph visualization context.\n *\n * This hook is used to implement custom UI components like buttons, panels, and controls\n * that need access to data and functionality from the graph visualization component.\n * @see {@link GraphVisualizationContextData}\n *\n * @returns The graph visualization context containing NVL instance, sidepanel, gestures, and graph data\n * @throws Error if used outside of a GraphVisualizationContext provider\n *\n * @example\n * ```tsx\n * const NodeLoggerButton = () => {\n * const { selected } = useGraphVisualizationContext();\n *\n * const handleClick = () => {\n * console.log('Selected nodes:', selected.nodeIds);\n * };\n *\n * return (\n * <button onClick={handleClick}>\n * Log Selected Nodes ({selected.nodeIds.length})\n * </button>\n * );\n * };\n * ```\n * @alpha\n */\nexport const useGraphVisualizationContext = () => {\n const context = useContext(GraphVisualizationContext);\n if (!context) {\n throw new Error(\n 'useGraphVisualizationContext must be used within a GraphVisualizationContext',\n );\n }\n return context;\n};\n\nexport type Gesture = 'single' | 'box' | 'lasso';\n\nexport type InteractionMode =\n | 'select'\n | 'draw'\n | 'edit-text'\n | 'pan'\n | 'drag'\n | 'none';\n"]}
@@ -21,7 +21,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
21
21
  */
22
22
  import { Drawer } from '@neo4j-ndl/react';
23
23
  export const GraphVisualizationSidepanel = ({ sidepanel, }) => {
24
- const { children, isSidePanelOpen, setIsSidePanelOpen, sidePanelWidth, onSidePanelResize, minWidth = 230, } = sidepanel;
24
+ const { children, isSidePanelOpen, setIsSidePanelOpen, sidePanelWidth, onSidePanelResize, maxWidth = '66%', minWidth = 230, } = sidepanel;
25
25
  if (!isSidePanelOpen) {
26
26
  return null;
27
27
  }
@@ -33,7 +33,7 @@ export const GraphVisualizationSidepanel = ({ sidepanel, }) => {
33
33
  height: '100%',
34
34
  width: sidePanelWidth !== null && sidePanelWidth !== void 0 ? sidePanelWidth : 400,
35
35
  },
36
- maxWidth: 600,
36
+ maxWidth,
37
37
  minWidth,
38
38
  onResizeStop: (_e, _dir, ref) => {
39
39
  onSidePanelResize(ref.getBoundingClientRect().width);
@@ -1 +1 @@
1
- {"version":3,"file":"graph-visualization-sidepanel.js","sourceRoot":"","sources":["../../src/graph-visualization-sidepanel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAI1C,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,EAC1C,SAAS,GAGV,EAAE,EAAE;IACH,MAAM,EACJ,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,QAAQ,GAAG,GAAG,GACf,GAAG,SAAS,CAAC;IAEd,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,KAAC,MAAM,IACL,SAAS,EAAC,gCAAgC,EAC1C,UAAU,EAAE,eAAe,EAC3B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,EAAE;YAC7B,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAG,QAAQ,CAAC,CAAC;QACjC,CAAC,EACD,QAAQ,EAAC,OAAO,EAChB,IAAI,EAAC,MAAM,EACX,YAAY,QACZ,WAAW,EAAE,KAAK,EAClB,eAAe,EAAE;YACf,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE;gBACX,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,GAAG;aAC7B;YACD,QAAQ,EAAE,GAAG;YACb,QAAQ;YACR,YAAY,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;gBAC9B,iBAAiB,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC,CAAC;YACvD,CAAC;SACF,YAED,cAAK,SAAS,EAAC,2CAA2C,YACvD,QAAQ,GACL,GACC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE;IAC5D,OAAO,CACL,KAAC,MAAM,CAAC,MAAM,IAAC,SAAS,EAAC,yCAAyC,YAC/D,QAAQ,GACK,CACjB,CAAC;AACJ,CAAC,CAAC;AACF,2BAA2B,CAAC,KAAK,GAAG,KAAK,CAAC;AAE1C,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE;IAC9D,OAAO,CACL,KAAC,MAAM,CAAC,IAAI,IAAC,SAAS,EAAC,2CAA2C,YAC/D,QAAQ,GACG,CACf,CAAC;AACJ,CAAC,CAAC;AACF,2BAA2B,CAAC,OAAO,GAAG,OAAO,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { Drawer } from '@neo4j-ndl/react';\n\nimport { type Sidepanel } from './graph-visualization-context';\n\nexport const GraphVisualizationSidepanel = ({\n sidepanel,\n}: {\n sidepanel: Sidepanel;\n}) => {\n const {\n children,\n isSidePanelOpen,\n setIsSidePanelOpen,\n sidePanelWidth,\n onSidePanelResize,\n minWidth = 230,\n } = sidepanel;\n\n if (!isSidePanelOpen) {\n return null;\n }\n\n return (\n <Drawer\n className=\"ndl-graph-visualization-drawer\"\n isExpanded={isSidePanelOpen}\n onExpandedChange={(expanded) => {\n setIsSidePanelOpen?.(expanded);\n }}\n position=\"right\"\n type=\"push\"\n isResizeable\n isCloseable={false}\n resizeableProps={{\n bounds: 'window',\n defaultSize: {\n height: '100%',\n width: sidePanelWidth ?? 400,\n },\n maxWidth: 600,\n minWidth,\n onResizeStop: (_e, _dir, ref) => {\n onSidePanelResize(ref.getBoundingClientRect().width);\n },\n }}\n >\n <div className=\"ndl-graph-visualization-sidepanel-wrapper\">\n {children}\n </div>\n </Drawer>\n );\n};\n\nconst Title = ({ children }: { children: React.ReactNode }) => {\n return (\n <Drawer.Header className=\"ndl-graph-visualization-sidepanel-title\">\n {children}\n </Drawer.Header>\n );\n};\nGraphVisualizationSidepanel.Title = Title;\n\nconst Content = ({ children }: { children: React.ReactNode }) => {\n return (\n <Drawer.Body className=\"ndl-graph-visualization-sidepanel-content\">\n {children}\n </Drawer.Body>\n );\n};\nGraphVisualizationSidepanel.Content = Content;\n"]}
1
+ {"version":3,"file":"graph-visualization-sidepanel.js","sourceRoot":"","sources":["../../src/graph-visualization-sidepanel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAI1C,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,EAC1C,SAAS,GAGV,EAAE,EAAE;IACH,MAAM,EACJ,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB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;AACJ,CAAC,CAAC;AACF,2BAA2B,CAAC,OAAO,GAAG,OAAO,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { Drawer } from '@neo4j-ndl/react';\n\nimport { type Sidepanel } from './graph-visualization-context';\n\nexport const GraphVisualizationSidepanel = ({\n sidepanel,\n}: {\n sidepanel: Sidepanel;\n}) => {\n const {\n children,\n isSidePanelOpen,\n setIsSidePanelOpen,\n sidePanelWidth,\n onSidePanelResize,\n maxWidth = '66%',\n minWidth = 230,\n } = sidepanel;\n\n if (!isSidePanelOpen) {\n return null;\n }\n\n return (\n <Drawer\n className=\"ndl-graph-visualization-drawer\"\n isExpanded={isSidePanelOpen}\n onExpandedChange={(expanded) => {\n setIsSidePanelOpen?.(expanded);\n }}\n position=\"right\"\n type=\"push\"\n isResizeable\n isCloseable={false}\n resizeableProps={{\n bounds: 'window',\n defaultSize: {\n height: '100%',\n width: sidePanelWidth ?? 400,\n },\n maxWidth,\n minWidth,\n onResizeStop: (_e, _dir, ref) => {\n onSidePanelResize(ref.getBoundingClientRect().width);\n },\n }}\n >\n <div className=\"ndl-graph-visualization-sidepanel-wrapper\">\n {children}\n </div>\n </Drawer>\n );\n};\n\nconst Title = ({ children }: { children: React.ReactNode }) => {\n return (\n <Drawer.Header className=\"ndl-graph-visualization-sidepanel-title\">\n {children}\n </Drawer.Header>\n );\n};\nGraphVisualizationSidepanel.Title = Title;\n\nconst Content = ({ children }: { children: React.ReactNode }) => {\n return (\n <Drawer.Body className=\"ndl-graph-visualization-sidepanel-content\">\n {children}\n </Drawer.Body>\n );\n};\nGraphVisualizationSidepanel.Content = Content;\n"]}
@@ -31,7 +31,8 @@ export type Sidepanel = {
31
31
  setIsSidePanelOpen?: (isSidePanelOpen: boolean) => void;
32
32
  sidePanelWidth?: number;
33
33
  onSidePanelResize: (width: number) => void;
34
- minWidth?: number;
34
+ minWidth?: number | string;
35
+ maxWidth?: number | string;
35
36
  };
36
37
  export type NvlGraph = {
37
38
  nodes: Node[];
@@ -1 +1 @@
1
- {"version":3,"file":"graph-visualization-context.d.ts","sourceRoot":"","sources":["../../src/graph-visualization-context.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,IAAI,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG5E,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,MAAM,MAAM,cAAc,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,eAAe,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAC9E,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,Q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c,EAAE,mBAAmB,CAAC;IACpC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,yBAAyB,oEAE1B,CAAC;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,4BAA4B,qCAQxC,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAC;AAEjD,MAAM,MAAM,eAAe,GACvB,QAAQ,GACR,MAAM,GACN,WAAW,GACX,KAAK,GACL,MAAM,GACN,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"graph-visualization-sidepanel.d.ts","sourceRoot":"","sources":["../../src/graph-visualization-sidepanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,eAAO,MAAM,2BAA2B;qBAErC;QACD,SAAS,EAAE,SAAS,CAAC;KACtB;0BA6C4B;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE;4BAS3B;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE;CAX3D,CAAC"}
1
+ {"version":3,"file":"graph-visualization-sidepanel.d.ts","sourceRoot":"","sources":["../../src/graph-visualization-sidepanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,eAAO,MAAM,2BAA2B;qBAErC;QACD,SAAS,EAAE,SAAS,CAAC;KACtB;0BA8C4B;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE;4BAS3B;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE;CAX3D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo4j-ndl/react-graph",
3
- "version": "1.3.28",
3
+ "version": "1.3.29",
4
4
  "sideEffects": false,
5
5
  "description": "React implementation of the graph visualization from Neo4j Design System",
6
6
  "keywords": [
@@ -57,7 +57,7 @@
57
57
  "@neo4j-nvl/interaction-handlers": "^1.0.0",
58
58
  "@neo4j-nvl/react": "^1.0.0",
59
59
  "@neo4j-ndl/base": "^4.11.2",
60
- "@neo4j-ndl/react": "^4.11.4"
60
+ "@neo4j-ndl/react": "^4.11.5"
61
61
  },
62
62
  "dependencies": {
63
63
  "classnames": "2.5.1",