@neo4j-ndl/react-graph 2.2.4 → 2.2.6
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/lib/cjs/_generated/style-rules/color-utils.js.map +1 -1
- package/lib/cjs/_generated/style-rules/date-utils.js +1 -1
- package/lib/cjs/_generated/style-rules/date-utils.js.map +1 -1
- package/lib/cjs/_generated/style-rules/index.js +1 -1
- package/lib/cjs/_generated/style-rules/index.js.map +1 -1
- package/lib/cjs/_generated/style-rules/literal-schemas.js +1 -1
- package/lib/cjs/_generated/style-rules/literal-schemas.js.map +1 -1
- package/lib/cjs/_generated/style-rules/numeric-utils.js.map +1 -1
- package/lib/cjs/_generated/style-rules/range-utils.js +1 -1
- package/lib/cjs/_generated/style-rules/range-utils.js.map +1 -1
- package/lib/cjs/graph-visualization-buttons.js +1 -1
- package/lib/cjs/graph-visualization-buttons.js.map +1 -1
- package/lib/cjs/graph-visualization-context.js +1 -1
- package/lib/cjs/graph-visualization-context.js.map +1 -1
- package/lib/cjs/graph-visualization-sidepanel.js +1 -1
- package/lib/cjs/graph-visualization-sidepanel.js.map +1 -1
- package/lib/cjs/graph-visualization.js +1 -1
- package/lib/cjs/graph-visualization.js.map +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/sidepanel-components/button-group.js +1 -1
- package/lib/cjs/sidepanel-components/button-group.js.map +1 -1
- package/lib/cjs/sidepanel-components/clickable-urls.js +1 -1
- package/lib/cjs/sidepanel-components/clickable-urls.js.map +1 -1
- package/lib/cjs/sidepanel-components/details-panel.js +1 -1
- package/lib/cjs/sidepanel-components/details-panel.js.map +1 -1
- package/lib/cjs/sidepanel-components/graph-label-wrapper.js +1 -1
- package/lib/cjs/sidepanel-components/graph-label-wrapper.js.map +1 -1
- package/lib/cjs/sidepanel-components/overview-panel.js +1 -1
- package/lib/cjs/sidepanel-components/overview-panel.js.map +1 -1
- package/lib/cjs/sidepanel-components/properties-table.js +1 -1
- package/lib/cjs/sidepanel-components/properties-table.js.map +1 -1
- package/lib/cjs/sidepanel-components/show-all.js +1 -1
- package/lib/cjs/sidepanel-components/show-all.js.map +1 -1
- package/lib/cjs/sidepanel-components/single-selection-sidepanel-contents.js +1 -1
- package/lib/cjs/sidepanel-components/single-selection-sidepanel-contents.js.map +1 -1
- package/lib/cjs/styling/compile-graph-styles.js +91 -55
- package/lib/cjs/styling/compile-graph-styles.js.map +1 -1
- package/lib/cjs/styling/create-vis-data-structures.js +16 -9
- package/lib/cjs/styling/create-vis-data-structures.js.map +1 -1
- package/lib/cjs/styling/parse-style-rules.js +1 -1
- package/lib/cjs/styling/parse-style-rules.js.map +1 -1
- package/lib/cjs/styling/style-types.js +1 -1
- package/lib/cjs/styling/style-types.js.map +1 -1
- package/lib/cjs/styling/use-graph-data.js +1 -1
- package/lib/cjs/styling/use-graph-data.js.map +1 -1
- package/lib/cjs/use-managed-node-state.js +1 -1
- package/lib/cjs/use-managed-node-state.js.map +1 -1
- package/lib/cjs/use-semi-controlled-state.js +1 -1
- package/lib/cjs/use-semi-controlled-state.js.map +1 -1
- package/lib/cjs/utils.js +1 -1
- package/lib/cjs/utils.js.map +1 -1
- package/lib/esm/_generated/style-rules/color-utils.js.map +1 -1
- package/lib/esm/_generated/style-rules/date-utils.js +1 -1
- package/lib/esm/_generated/style-rules/date-utils.js.map +1 -1
- package/lib/esm/_generated/style-rules/index.js +1 -1
- package/lib/esm/_generated/style-rules/index.js.map +1 -1
- package/lib/esm/_generated/style-rules/literal-schemas.js +1 -1
- package/lib/esm/_generated/style-rules/literal-schemas.js.map +1 -1
- package/lib/esm/_generated/style-rules/numeric-utils.js.map +1 -1
- package/lib/esm/_generated/style-rules/range-utils.js +1 -1
- package/lib/esm/_generated/style-rules/range-utils.js.map +1 -1
- package/lib/esm/graph-visualization-buttons.js +1 -1
- package/lib/esm/graph-visualization-buttons.js.map +1 -1
- package/lib/esm/graph-visualization-context.js +1 -1
- package/lib/esm/graph-visualization-context.js.map +1 -1
- package/lib/esm/graph-visualization-sidepanel.js +1 -1
- package/lib/esm/graph-visualization-sidepanel.js.map +1 -1
- package/lib/esm/graph-visualization.js +1 -1
- package/lib/esm/graph-visualization.js.map +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/sidepanel-components/button-group.js +1 -1
- package/lib/esm/sidepanel-components/button-group.js.map +1 -1
- package/lib/esm/sidepanel-components/clickable-urls.js +1 -1
- package/lib/esm/sidepanel-components/clickable-urls.js.map +1 -1
- package/lib/esm/sidepanel-components/details-panel.js +1 -1
- package/lib/esm/sidepanel-components/details-panel.js.map +1 -1
- package/lib/esm/sidepanel-components/graph-label-wrapper.js +1 -1
- package/lib/esm/sidepanel-components/graph-label-wrapper.js.map +1 -1
- package/lib/esm/sidepanel-components/overview-panel.js +1 -1
- package/lib/esm/sidepanel-components/overview-panel.js.map +1 -1
- package/lib/esm/sidepanel-components/properties-table.js +1 -1
- package/lib/esm/sidepanel-components/properties-table.js.map +1 -1
- package/lib/esm/sidepanel-components/show-all.js +1 -1
- package/lib/esm/sidepanel-components/show-all.js.map +1 -1
- package/lib/esm/sidepanel-components/single-selection-sidepanel-contents.js +1 -1
- package/lib/esm/sidepanel-components/single-selection-sidepanel-contents.js.map +1 -1
- package/lib/esm/styling/compile-graph-styles.js +89 -55
- package/lib/esm/styling/compile-graph-styles.js.map +1 -1
- package/lib/esm/styling/create-vis-data-structures.js +16 -9
- package/lib/esm/styling/create-vis-data-structures.js.map +1 -1
- package/lib/esm/styling/parse-style-rules.js +1 -1
- package/lib/esm/styling/parse-style-rules.js.map +1 -1
- package/lib/esm/styling/style-types.js +1 -1
- package/lib/esm/styling/style-types.js.map +1 -1
- package/lib/esm/styling/use-graph-data.js +1 -1
- package/lib/esm/styling/use-graph-data.js.map +1 -1
- package/lib/esm/use-managed-node-state.js +1 -1
- package/lib/esm/use-managed-node-state.js.map +1 -1
- package/lib/esm/use-semi-controlled-state.js +1 -1
- package/lib/esm/use-semi-controlled-state.js.map +1 -1
- package/lib/esm/utils.js +1 -1
- package/lib/esm/utils.js.map +1 -1
- package/lib/types/_generated/style-rules/color-utils.d.ts +1 -1
- package/lib/types/_generated/style-rules/index.d.ts +1 -1
- package/lib/types/_generated/style-rules/literal-schemas.d.ts +1 -1
- package/lib/types/_generated/style-rules/numeric-utils.d.ts +1 -1
- package/lib/types/graph-visualization-buttons.d.ts +1 -1
- package/lib/types/graph-visualization-context.d.ts +1 -1
- package/lib/types/graph-visualization-sidepanel.d.ts +1 -1
- package/lib/types/graph-visualization.d.ts +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/sidepanel-components/button-group.d.ts +1 -1
- package/lib/types/sidepanel-components/clickable-urls.d.ts +1 -1
- package/lib/types/sidepanel-components/details-panel.d.ts +1 -1
- package/lib/types/sidepanel-components/graph-label-wrapper.d.ts +1 -1
- package/lib/types/sidepanel-components/overview-panel.d.ts +1 -1
- package/lib/types/sidepanel-components/properties-table.d.ts +1 -1
- package/lib/types/sidepanel-components/show-all.d.ts +1 -1
- package/lib/types/sidepanel-components/single-selection-sidepanel-contents.d.ts +1 -1
- package/lib/types/styling/compile-graph-styles.d.ts +28 -1
- package/lib/types/styling/compile-graph-styles.d.ts.map +1 -1
- package/lib/types/styling/create-vis-data-structures.d.ts +2 -2
- package/lib/types/styling/create-vis-data-structures.d.ts.map +1 -1
- package/lib/types/styling/parse-style-rules.d.ts +1 -1
- package/lib/types/styling/style-types.d.ts +1 -1
- package/lib/types/styling/use-graph-data.d.ts +1 -1
- package/lib/types/use-managed-node-state.d.ts +1 -1
- package/lib/types/use-semi-controlled-state.d.ts +1 -1
- package/lib/types/utils.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"details-panel.js","sourceRoot":"","sources":["../../../src/sidepanel-components/details-panel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,O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AAK,SAAS,EAAC,kBAAkB,YAC9B,YAAY,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,CAClC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC5C,KAAC,iBAAiB,IAEhB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,EAC7C,QAAQ,EAAE,CAAC,IAJN,KAAK,CAKV,CACH,CAAC,CACH,CAAC,CAAC,CAAC,CACF,KAAC,iBAAiB,IAChB,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,EAC7B,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAE,cAAc,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAChE,QAAQ,EAAE,CAAC,GACX,CACH,GACG,EAEN,cAAK,SAAS,EAAC,qBAAqB,GAAG,EACvC,KAAC,eAAe,IACd,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,UAAU,EACxC,SAAS,EAAE,SAAS,GACpB,IACkC,IACrC,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"details-panel.js","sourceRoot":"","sources":["../../../src/sidepanel-components/details-panel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAGL,4BAA4B,GAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAUrD,MAAM,CAAC,MAAM,YA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V,CACH,CAAC,CACH,CAAC,CAAC,CAAC,CACF,KAAC,iBAAiB,IAChB,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,EAC7B,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAE,cAAc,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAChE,QAAQ,EAAE,CAAC,GACX,CACH,GACG,EAEN,cAAK,SAAS,EAAC,qBAAqB,GAAG,EACvC,KAAC,eAAe,IACd,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,UAAU,EACxC,SAAS,EAAE,SAAS,GACpB,IACkC,IACrC,CACJ,CAAC;AACJ,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 { ClipboardButton } from '@neo4j-ndl/react';\nimport { useMemo } from 'react';\n\nimport {\n type NodeData,\n type RelData,\n useGraphVisualizationContext,\n} from '../graph-visualization-context';\nimport { GraphVisualizationSidepanel } from '../graph-visualization-sidepanel';\nimport { GraphLabelWrapper } from './graph-label-wrapper';\nimport { PropertiesTable } from './properties-table';\n\ntype DetailPanelProps = {\n paneWidth?: number;\n};\n\ntype SelectedItem =\n | { dataType: 'node'; data: NodeData }\n | { dataType: 'relationship'; data: RelData };\n\nexport const DetailsPanel = ({ paneWidth = 400 }: DetailPanelProps) => {\n const { selected, nvlGraph, metadataLookup } = useGraphVisualizationContext();\n\n const nodeData = useMemo(() => {\n const [nodeId] = selected.nodeIds;\n if (nodeId !== undefined) {\n return nvlGraph.nodeData[nodeId];\n }\n\n return undefined;\n }, [selected, nvlGraph]);\n\n const relData = useMemo(() => {\n const [relId] = selected.relationshipIds;\n if (relId !== undefined) {\n return nvlGraph.relData[relId];\n }\n\n return undefined;\n }, [selected, nvlGraph]);\n\n const selectedItem = useMemo((): SelectedItem | undefined => {\n if (nodeData) {\n return { data: nodeData, dataType: 'node' };\n }\n\n if (relData) {\n return { data: relData, dataType: 'relationship' };\n }\n\n return undefined;\n }, [nodeData, relData]);\n\n if (selectedItem === undefined) {\n return null;\n }\n\n const properties = [\n {\n key: '<id>',\n type: 'String',\n value: `${selectedItem.data.id}`,\n },\n ...Object.keys(selectedItem.data.properties).map((key) => {\n return {\n key: key,\n type: selectedItem.data.properties[key].type,\n value: selectedItem.data.properties[key].stringified,\n };\n }),\n ];\n\n return (\n <>\n <GraphVisualizationSidepanel.Title>\n <h6 className=\"ndl-details-title\">\n {selectedItem.dataType === 'node'\n ? 'Node details'\n : 'Relationship details'}\n </h6>\n <ClipboardButton\n textToCopy={properties\n .map((prop) => `${prop.key}: ${prop.value}`)\n .join('\\n')}\n size=\"small\"\n />\n </GraphVisualizationSidepanel.Title>\n <GraphVisualizationSidepanel.Content>\n <div className=\"ndl-details-tags\">\n {selectedItem.dataType === 'node' ? (\n selectedItem.data.labelsSorted.map((label) => (\n <GraphLabelWrapper\n key={label}\n label={label}\n type=\"node\"\n metaData={metadataLookup.labelMetaData[label]}\n tabIndex={0}\n />\n ))\n ) : (\n <GraphLabelWrapper\n label={selectedItem.data.type}\n type=\"relationship\"\n metaData={metadataLookup.reltypeMetaData[selectedItem.data.type]}\n tabIndex={0}\n />\n )}\n </div>\n {/* Divider */}\n <div className=\"ndl-details-divider\" />\n <PropertiesTable\n properties={selectedItem.data.properties}\n paneWidth={paneWidth}\n />\n </GraphVisualizationSidepanel.Content>\n </>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-label-wrapper.js","sourceRoot":"","sources":["../../../src/sidepanel-components/graph-label-wrapper.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,UAAU,MAAM,YAAY,CAAC;AAcpC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAChC,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,QAAQ,GAAG,CAAC,CAAC,EACb,SAAS,GAAG,KAAK,GACM,EAAE,EAAE;;IAC3B,MAAM,OAAO,GAAG,UAAU,CAAC,gCAAgC,EAAE;QAC3D,2CAA2C,EAAE,IAAI,KAAK,cAAc;KACrE,CAAC,CAAC;IAEH,OAAO,CACL,MAAC,UAAU,IACT,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,iBAAiB,CAAC,CAAC,CAAC,0CAAE,KAAK,mCAAI,EAAE,EAClD,SAAS,EAAC,yBAAyB,EACnC,EAAE,EAAC,MAAM,EACT,cAAc,EAAE;YACd,QAAQ;SACT,aAEA,CAAC,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,iBAAiB,CAAC,MAAM,mCAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAChD,KAAC,eAAe,IAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAC,MAAM,GAAG,CACvD,EACA,KAAK,EACL,SAAS,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,KAAI,IAAI,IAAI,KAAK,QAAQ,CAAC,UAAU,GAAG,IAC9D,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"graph-label-wrapper.js","sourceRoot":"","sources":["../../../src/sidepanel-components/graph-label-wrapper.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,UAAU,MAAM,YAAY,CAAC;AAcpC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAChC,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,QAAQ,GAAG,CAAC,CAAC,EACb,SAAS,GAAG,KAAK,GACM,EAAE,EAAE;;IAC3B,MAAM,OAAO,GAAG,UAAU,CAAC,gCAAgC,EAAE;QAC3D,2CAA2C,EAAE,IAAI,KAAK,cAAc;KACrE,CAAC,CAAC;IAEH,OAAO,CACL,MAAC,UAAU,IACT,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,iBAAiB,CAAC,CAAC,CAAC,0CAAE,KAAK,mCAAI,EAAE,EAClD,SAAS,EAAC,yBAAyB,EACnC,EAAE,EAAC,MAAM,EACT,cAAc,EAAE;YACd,QAAQ;SACT,aAEA,CAAC,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,iBAAiB,CAAC,MAAM,mCAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAChD,KAAC,eAAe,IAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAC,MAAM,GAAG,CACvD,EACA,KAAK,EACL,SAAS,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,KAAI,IAAI,IAAI,KAAK,QAAQ,CAAC,UAAU,GAAG,IAC9D,CACd,CAAC;AACJ,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 { GraphLabel, StatusIndicator } from '@neo4j-ndl/react';\nimport classNames from 'classnames';\n\nimport { type GraphItemMetaData } from '../graph-visualization-context';\n\ntype GraphLabelWrapperProps = {\n label: string;\n type: 'node' | 'relationship';\n metaData: GraphItemMetaData | undefined;\n tabIndex?: number;\n // TODO v5: fix boolean naming convention\n // eslint-disable-next-line @typescript-eslint/naming-convention\n showCount?: boolean;\n};\n\nexport const GraphLabelWrapper = ({\n label,\n type,\n metaData,\n tabIndex = -1,\n showCount = false,\n}: GraphLabelWrapperProps) => {\n const classes = classNames('ndl-graph-label-rule-indicator', {\n 'ndl-graph-label-rule-indicator-shift-left': type === 'relationship',\n });\n\n return (\n <GraphLabel\n type={type}\n color={metaData?.colorDistribution[0]?.color ?? ''}\n className=\"ndl-graph-label-wrapper\"\n as=\"span\"\n htmlAttributes={{\n tabIndex,\n }}\n >\n {(metaData?.colorDistribution.length ?? 0) > 1 && (\n <StatusIndicator className={classes} variant=\"info\" />\n )}\n {label}\n {showCount && metaData?.totalCount != null && ` (${metaData.totalCount})`}\n </GraphLabel>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overview-panel.js","sourceRoot":"","sources":["../../../src/sidepanel-components/overview-panel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,OAAO,EA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,CAAC,IAAI,EAAE,EAAE,CAAC,CACrC,KAAC,iBAAiB,IAEhB,KAAK,EAAE,IAAI,EACX,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAE,cAAc,CAAC,eAAe,CAAC,IAAI,CAAC,EAC9C,SAAS,UAJJ,IAAI,CAKT,CACH,CAAC,GACM,GACN,IACF,CACP,EAEA,cAAc,CAAC,iBAAiB,IAAI,CACnC,eAAK,SAAS,EAAC,mBAAmB,aAChC,KAAC,eAAe,IAAC,OAAO,EAAC,MAAM,GAAG,EAClC,KAAC,UAAU,IAAC,OAAO,EAAC,YAAY,8CAEnB,IACT,CACP,IACG,GAC8B,IACrC,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"overview-panel.js","sourceRoot":"","sources":["../../../src/sidepanel-components/overview-panel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,4BAA4B,EAAE,CAAC;IAEpE,OAAO,CACL,8BACE,KAAC,2BAA2B,CAAC,KAAK,cAChC,KAAC,UAAU,IAAC,OAAO,EAAC,SAAS,iCAA8B,GACzB,EACpC,KAAC,2BAA2B,CAAC,OAAO,cAClC,eAAK,SAAS,EAAC,wCAAwC,aACpD,cAAc,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAA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IACrC,CACJ,CAAC;AACJ,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 { StatusIndicator, Typography } from '@neo4j-ndl/react';\n\nimport { useGraphVisualizationContext } from '../graph-visualization-context';\nimport { GraphVisualizationSidepanel } from '../graph-visualization-sidepanel';\nimport { GraphLabelWrapper } from './graph-label-wrapper';\nimport { ShowAll } from './show-all';\n\nconst OVERVIEW_STEP_SIZE = 25;\n\nexport const OverviewPanel = () => {\n const { nvlGraph, metadataLookup } = useGraphVisualizationContext();\n\n return (\n <>\n <GraphVisualizationSidepanel.Title>\n <Typography variant=\"title-4\">Results overview</Typography>\n </GraphVisualizationSidepanel.Title>\n <GraphVisualizationSidepanel.Content>\n <div className=\"ndl-graph-visualization-overview-panel\">\n {metadataLookup.labels.length > 0 && (\n <div className=\"ndl-overview-section\">\n <div className=\"ndl-overview-header\">\n <span>\n Nodes{` (${nvlGraph.nodes.length.toLocaleString()})`}\n </span>\n </div>\n <div className=\"ndl-overview-items\">\n <ShowAll initiallyShown={OVERVIEW_STEP_SIZE} isButtonGroup>\n {metadataLookup.labels.map((label) => (\n <GraphLabelWrapper\n key={label}\n label={label}\n type=\"node\"\n metaData={metadataLookup.labelMetaData[label]}\n showCount\n />\n ))}\n </ShowAll>\n </div>\n </div>\n )}\n\n {metadataLookup.reltypes.length > 0 && (\n <div className=\"ndl-overview-relationships-section\">\n <span className=\"ndl-overview-relationships-title\">\n Relationships{` (${nvlGraph.rels.length.toLocaleString()})`}\n </span>\n <div className=\"ndl-overview-items\">\n <ShowAll initiallyShown={OVERVIEW_STEP_SIZE} isButtonGroup>\n {metadataLookup.reltypes.map((type) => (\n <GraphLabelWrapper\n key={type}\n label={type}\n type=\"relationship\"\n metaData={metadataLookup.reltypeMetaData[type]}\n showCount\n />\n ))}\n </ShowAll>\n </div>\n </div>\n )}\n\n {metadataLookup.hasMultipleColors && (\n <div className=\"ndl-overview-hint\">\n <StatusIndicator variant=\"info\" />\n <Typography variant=\"body-small\">\n indicates color may not match\n </Typography>\n </div>\n )}\n </div>\n </GraphVisualizationSidepanel.Content>\n </>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties-table.js","sourceRoot":"","sources":["../../../src/sidepanel-components/properties-table.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AACrC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AAMnC,MAAM,eAAe,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAwB,EAAE,EAAE;IACvE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,MAAM,SAAS,GACb,KAAK,GAAG,mBAAmB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAEpE,MAAM,iBAAiB,G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,GAAG,GACO,EACb,cAAK,SAAS,EAAC,sBAAsB,YACnC,KAAC,eAAe,IACd,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,IAAI,GACV,GACE,EACN,cAAK,SAAS,EAAC,iCAAiC,YAC9C,KAAC,eAAe,IACd,UAAU,EAAE,GAAG,GAAG,KAAK,WAAW,EAAE,EACpC,IAAI,EAAC,OAAO,EACZ,YAAY,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GACnD,GACE,KAjBE,GAAG,CAkBP,CACP,CAAC;YACJ,CAAC,CAAC,IACE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"properties-table.js","sourceRoot":"","sources":["../../../src/sidepanel-components/properties-table.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AACrC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AAMnC,MAAM,eAAe,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAwB,EAAE,EAAE;IACvE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,MAAM,SAAS,GACb,KAAK,GAAG,mBAAmB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAEpE,MAAM,iBAAiB,GAAG,GAAG,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,EACb,cAAK,SAAS,EAAC,sBAAsB,YACnC,KAAC,eAAe,IACd,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,IAAI,GACV,GACE,EACN,cAAK,SAAS,EAAC,iCAAiC,YAC9C,KAAC,eAAe,IACd,UAAU,EAAE,GAAG,GAAG,KAAK,WAAW,EAAE,EACpC,IAAI,EAAC,OAAO,EACZ,YAAY,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GACnD,GACE,KAjBE,GAAG,CAkBP,CACP,CAAC;YACJ,CAAC,CAAC,IACE,CACP,CAAC;AACJ,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 { ClipboardButton, Typography } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nimport { type PortableProperty } from '../graph-visualization-context';\nimport { ClickableUrls } from './clickable-urls';\n\nexport const ELLIPSIS = '\\u2026';\nexport const WIDE_VIEW_THRESHOLD = 900;\nexport const MAX_LENGTH_NARROW = 150;\nexport const MAX_LENGTH_WIDE = 300;\ntype ExpandableValueProps = {\n value: string;\n width: number;\n type: string;\n};\nconst ExpandableValue = ({ value, width, type }: ExpandableValueProps) => {\n const [isExpanded, setIsExpanded] = useState(false);\n\n const maxLength =\n width > WIDE_VIEW_THRESHOLD ? MAX_LENGTH_WIDE : MAX_LENGTH_NARROW;\n\n const handleExpandClick = () => {\n setIsExpanded(true);\n };\n\n let valueShown = isExpanded ? value : value.slice(0, maxLength);\n const isValueTrimmed = valueShown.length !== value.length;\n valueShown += isValueTrimmed ? ELLIPSIS : '';\n\n return (\n <>\n {type.startsWith('Array') && '['}\n <ClickableUrls text={valueShown} />\n {isValueTrimmed && (\n <button\n type=\"button\"\n onClick={handleExpandClick}\n className=\"ndl-properties-show-all-button\"\n >\n {' Show all'}\n </button>\n )}\n {type.startsWith('Array') && ']'}\n </>\n );\n};\n\ntype PropertiesTableProps = {\n properties: Record<string, PortableProperty>;\n paneWidth: number;\n};\n\nexport const PropertiesTable = ({\n properties,\n paneWidth,\n}: PropertiesTableProps) => {\n return (\n <div className=\"ndl-graph-visualization-properties-table\">\n <div className=\"ndl-properties-header\">\n <Typography variant=\"body-small\" className=\"ndl-properties-header-key\">\n Key\n </Typography>\n <Typography variant=\"body-small\">Value</Typography>\n </div>\n {Object.entries(properties).map(([key, { stringified, type }]) => {\n return (\n <div key={key} className=\"ndl-properties-row\">\n <Typography variant=\"body-small\" className=\"ndl-properties-key\">\n {key}\n </Typography>\n <div className=\"ndl-properties-value\">\n <ExpandableValue\n value={stringified}\n width={paneWidth}\n type={type}\n />\n </div>\n <div className=\"ndl-properties-clipboard-button\">\n <ClipboardButton\n textToCopy={`${key}: ${stringified}`}\n size=\"small\"\n tooltipProps={{ placement: 'left', type: 'simple' }}\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"show-all.js","sourceRoot":"","sources":["../../../src/sidepanel-components/show-all.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAkB,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAS7C,MAAM,gBAAgB,GAAG,CACvB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C,CAAC,CAAC,CACxB,KAAC,WAAW,cAAE,eAAe,GAAe,CAC7C,CAAC,CAAC,CAAC,CACF,cAAK,KAAK,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,YAAG,eAAe,GAAO,CACxD,EACA,kBAAkB,IAAI,CACrB,KAAC,UAAU,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,cAAc,YAC7C,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,UAAU,QAAQ,GAChD,CACd,IACA,CACJ,CAAC;AACJ,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 { TextButton } from '@neo4j-ndl/react';\nimport { type ReactNode, useState } from 'react';\n\nimport { ButtonGroup } from './button-group';\n\ntype ShowAllProps = {\n initiallyShown: number;\n /* pass thunk to enable rendering only shown components */\n children: ((() => ReactNode) | ReactNode)[];\n isButtonGroup?: boolean;\n ariaLabel?: string;\n};\nconst isThunkComponent = (\n childOrThunk: (() => ReactNode) | ReactNode,\n): childOrThunk is () => ReactNode => typeof childOrThunk === 'function';\n\nexport function ShowAll({\n initiallyShown,\n children,\n isButtonGroup,\n}: ShowAllProps) {\n const [isExpanded, setIsExpanded] = useState(false);\n const toggleExpanded = () => setIsExpanded((expanded) => !expanded);\n\n const itemCount = children.length;\n\n const shouldHaveControls = itemCount > initiallyShown;\n const shown = isExpanded ? itemCount : initiallyShown;\n const leftToShow = itemCount - shown;\n\n if (itemCount === 0) {\n return null;\n }\n\n const currentChildren = children\n .slice(0, shown)\n .map((child) => (isThunkComponent(child) ? child() : child));\n return (\n <>\n {isButtonGroup === true ? (\n <ButtonGroup>{currentChildren}</ButtonGroup>\n ) : (\n <div style={{ all: 'inherit' }}>{currentChildren}</div>\n )}\n {shouldHaveControls && (\n <TextButton size=\"small\" onClick={toggleExpanded}>\n {isExpanded ? 'Show less' : `Show all (${leftToShow} more)`}\n </TextButton>\n )}\n </>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single-selection-sidepanel-contents.js","sourceRoot":"","sources":["../../../src/sidepanel-components/single-selection-sidepanel-contents.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,gCAAgC,GAAG,GAAG,EAAE;IACnD,MAAM,EAAE,QAAQ,EAAE,GAAG,4BAA4B,EAAE,CAAC;IAEpD,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EACxE,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,YAAY,CAAC,CAAC,CAAC,KAAC,YAAY,KAAG,CAAC,CAAC,CAAC,KAAC,aAAa,KAAG,CAAC;AAC7D,CAAC,CAAC","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"single-selection-sidepanel-contents.js","sourceRoot":"","sources":["../../../src/sidepanel-components/single-selection-sidepanel-contents.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,gCAAgC,GAAG,GAAG,EAAE;IACnD,MAAM,EAAE,QAAQ,EAAE,GAAG,4BAA4B,EAAE,CAAC;IAEpD,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EACxE,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,YAAY,CAAC,CAAC,CAAC,KAAC,YAAY,KAAG,CAAC,CAAC,CAAC,KAAC,aAAa,KAAG,CAAC;AAC7D,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 { useMemo } from 'react';\n\nimport { useGraphVisualizationContext } from '../graph-visualization-context';\nimport { DetailsPanel } from './details-panel';\nimport { OverviewPanel } from './overview-panel';\n\nexport const SingleSelectionSidepanelContents = () => {\n const { selected } = useGraphVisualizationContext();\n\n const hasSelection = useMemo(\n () => selected.nodeIds.length > 0 || selected.relationshipIds.length > 0,\n [selected],\n );\n\n return hasSelection ? <DetailsPanel /> : <OverviewPanel />;\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
2
|
*
|
|
3
3
|
* Copyright (c) "Neo4j"
|
|
4
4
|
* Neo4j Sweden AB [http://neo4j.com]
|
|
@@ -482,6 +482,26 @@ function resolveUniqueColor(uniqueColors, properties, uniqueColorsCache) {
|
|
|
482
482
|
function shouldUseProperty(prop) {
|
|
483
483
|
return prop !== undefined && prop.isDisabled !== true;
|
|
484
484
|
}
|
|
485
|
+
/**
|
|
486
|
+
* Merges one matching rule's `apply` into the cascade, called in ascending priority order.
|
|
487
|
+
*
|
|
488
|
+
* A disabled property contributes nothing, so a lower-priority rule's value survives it.
|
|
489
|
+
* `captions` is compound, so its fields merge individually — a rule setting only the caption size
|
|
490
|
+
* keeps caption text from a lower-priority rule. Never mutates `apply`: rule objects are shared
|
|
491
|
+
* between items, and the merged result is cached per label set.
|
|
492
|
+
*/
|
|
493
|
+
function mergeApply(target, apply) {
|
|
494
|
+
for (const [key, incoming] of Object.entries(apply)) {
|
|
495
|
+
if (!shouldUseProperty(incoming)) {
|
|
496
|
+
continue;
|
|
497
|
+
}
|
|
498
|
+
if (key === 'captions') {
|
|
499
|
+
target.captions = Object.assign(Object.assign({}, target.captions), incoming);
|
|
500
|
+
continue;
|
|
501
|
+
}
|
|
502
|
+
target[key] = incoming;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
485
505
|
function evaluateStaticStyle(_a) {
|
|
486
506
|
var { overlayIcon } = _a, scalarStyle = __rest(_a, ["overlayIcon"]);
|
|
487
507
|
const result = {};
|
|
@@ -496,6 +516,21 @@ function evaluateStaticStyle(_a) {
|
|
|
496
516
|
}
|
|
497
517
|
return result;
|
|
498
518
|
}
|
|
519
|
+
/**
|
|
520
|
+
* Caption layout is independent of caption text: a rule setting only `captions.size` resizes the
|
|
521
|
+
* text a lower-priority rule supplied, rather than being dropped along with the absent text.
|
|
522
|
+
*/
|
|
523
|
+
function applyCaptionLayout(result, captions) {
|
|
524
|
+
if (!shouldUseProperty(captions)) {
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
if ((captions === null || captions === void 0 ? void 0 : captions.align) !== undefined) {
|
|
528
|
+
result.captionAlign = captions.align;
|
|
529
|
+
}
|
|
530
|
+
if ((captions === null || captions === void 0 ? void 0 : captions.size) !== undefined) {
|
|
531
|
+
result.captionSize = captions.size;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
499
534
|
function evaluateRelStyle(style, rel, uniqueColorsCache) {
|
|
500
535
|
const { captions, colorRange, widthRange, uniqueColors } = style, staticStyle = __rest(style, ["captions", "colorRange", "widthRange", "uniqueColors"]);
|
|
501
536
|
const result = evaluateStaticStyle(staticStyle);
|
|
@@ -520,13 +555,8 @@ function evaluateRelStyle(style, rel, uniqueColorsCache) {
|
|
|
520
555
|
}
|
|
521
556
|
return { styles, value: rel.id };
|
|
522
557
|
});
|
|
523
|
-
if ((captions === null || captions === void 0 ? void 0 : captions.align) !== undefined) {
|
|
524
|
-
result.captionAlign = captions.align;
|
|
525
|
-
}
|
|
526
|
-
if ((captions === null || captions === void 0 ? void 0 : captions.size) !== undefined) {
|
|
527
|
-
result.captionSize = captions.size;
|
|
528
|
-
}
|
|
529
558
|
}
|
|
559
|
+
applyCaptionLayout(result, captions);
|
|
530
560
|
if (shouldUseProperty(colorRange)) {
|
|
531
561
|
const interpolated = getInterpolatedColor(colorRange, rel);
|
|
532
562
|
if (interpolated !== null) {
|
|
@@ -652,13 +682,9 @@ function getDefaultNodeCaption(node) {
|
|
|
652
682
|
}
|
|
653
683
|
return { value: node.id };
|
|
654
684
|
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
const captionSource = shouldUseProperty(captions) && captions.text
|
|
659
|
-
? captions.text
|
|
660
|
-
: [getDefaultNodeCaption(node)];
|
|
661
|
-
result.captions = captionSource.map((caption) => {
|
|
685
|
+
/** Resolves caption descriptors against a node's own labels and property values. */
|
|
686
|
+
function resolveNodeCaptions(text, node) {
|
|
687
|
+
return text.map((caption) => {
|
|
662
688
|
const { value, styles } = caption;
|
|
663
689
|
if (typeof value === 'string' || value === undefined) {
|
|
664
690
|
return { styles, value };
|
|
@@ -678,14 +704,42 @@ function evaluateNodeStyle(style, node, uniqueColorsCache) {
|
|
|
678
704
|
}
|
|
679
705
|
return { styles, value: node.labelsSorted[0] };
|
|
680
706
|
});
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* The caption to fall back to when no rule sets caption text: the node's highest-priority property
|
|
710
|
+
* by {@link captionPriorityOrder}, else its first label, else its id.
|
|
711
|
+
*
|
|
712
|
+
*/
|
|
713
|
+
export function getDefaultNodeCaptions(node) {
|
|
714
|
+
return resolveNodeCaptions([getDefaultNodeCaption(node)], node);
|
|
715
|
+
}
|
|
716
|
+
// Memoized by label: hashing a label to a color is pure, and graphs repeat a small set of labels
|
|
717
|
+
// across many nodes.
|
|
718
|
+
const defaultNodeColorCache = new Map();
|
|
719
|
+
/**
|
|
720
|
+
* The color to fall back to when no rule sets one: derived from the node's highest-precedence
|
|
721
|
+
* label, or a neutral color when it has no labels.
|
|
722
|
+
*/
|
|
723
|
+
export function getDefaultNodeColor(node) {
|
|
724
|
+
const label = node.labelsSorted[0];
|
|
725
|
+
if (label === undefined) {
|
|
726
|
+
return NO_LABEL_FALLBACK_COLOR;
|
|
727
|
+
}
|
|
728
|
+
let cached = defaultNodeColorCache.get(label);
|
|
729
|
+
if (cached === undefined) {
|
|
730
|
+
cached = calculateDefaultNodeColors(label).backgroundColor;
|
|
731
|
+
defaultNodeColorCache.set(label, cached);
|
|
732
|
+
}
|
|
733
|
+
return cached;
|
|
734
|
+
}
|
|
735
|
+
function evaluateNodeStyle(style, node, uniqueColorsCache) {
|
|
736
|
+
const { captions, colorRange, sizeRange, uniqueColors } = style, staticStyle = __rest(style, ["captions", "colorRange", "sizeRange", "uniqueColors"]);
|
|
737
|
+
const result = evaluateStaticStyle(staticStyle);
|
|
738
|
+
// Only set `captions` when a rule actually asks for caption text
|
|
739
|
+
if (shouldUseProperty(captions) && captions.text) {
|
|
740
|
+
result.captions = resolveNodeCaptions(captions.text, node);
|
|
688
741
|
}
|
|
742
|
+
applyCaptionLayout(result, captions);
|
|
689
743
|
if (shouldUseProperty(colorRange)) {
|
|
690
744
|
const interpolated = getInterpolatedColor(colorRange, node);
|
|
691
745
|
if (interpolated !== null) {
|
|
@@ -713,18 +767,16 @@ function createRelStyleFunction(rules, uniqueColorsCache) {
|
|
|
713
767
|
for (const rule of rules) {
|
|
714
768
|
if (doesGraphStyleRuleMatch(rel, rule)) {
|
|
715
769
|
// Merge the style properties (later rules override earlier ones)
|
|
716
|
-
|
|
770
|
+
mergeApply(style, rule.apply);
|
|
717
771
|
}
|
|
718
772
|
}
|
|
719
773
|
return evaluateRelStyle(style, rel, uniqueColorsCache);
|
|
720
774
|
};
|
|
721
775
|
}
|
|
722
776
|
function createByLabelSetFunction(styleMatchers, uniqueColorsCache) {
|
|
723
|
-
const defaultColorCache = new Map();
|
|
724
777
|
const sortedRulesCache = new Map();
|
|
725
778
|
const mergedStyleCache = new Map();
|
|
726
779
|
return (node) => {
|
|
727
|
-
var _a;
|
|
728
780
|
const labelSetKey = node.labelsSorted.join('\0');
|
|
729
781
|
// Fast path: if all rules for this label set are where-free and none use
|
|
730
782
|
// uniqueColors, the merged style is identical for every node with the same labels.
|
|
@@ -732,21 +784,6 @@ function createByLabelSetFunction(styleMatchers, uniqueColorsCache) {
|
|
|
732
784
|
if (cachedStyle !== undefined) {
|
|
733
785
|
return evaluateNodeStyle(cachedStyle, node, uniqueColorsCache);
|
|
734
786
|
}
|
|
735
|
-
// Memoize default color by first label
|
|
736
|
-
const labelForDefaultColor = (_a = node.labelsSorted[0]) !== null && _a !== void 0 ? _a : null;
|
|
737
|
-
let defaultColor;
|
|
738
|
-
if (labelForDefaultColor === null) {
|
|
739
|
-
defaultColor = NO_LABEL_FALLBACK_COLOR;
|
|
740
|
-
}
|
|
741
|
-
else {
|
|
742
|
-
let cached = defaultColorCache.get(labelForDefaultColor);
|
|
743
|
-
if (cached === undefined) {
|
|
744
|
-
cached =
|
|
745
|
-
calculateDefaultNodeColors(labelForDefaultColor).backgroundColor;
|
|
746
|
-
defaultColorCache.set(labelForDefaultColor, cached);
|
|
747
|
-
}
|
|
748
|
-
defaultColor = cached;
|
|
749
|
-
}
|
|
750
787
|
// Cache sorted rules by label set (avoids repeated allocation + sort)
|
|
751
788
|
let sortedRules = sortedRulesCache.get(labelSetKey);
|
|
752
789
|
if (sortedRules === undefined) {
|
|
@@ -763,14 +800,14 @@ function createByLabelSetFunction(styleMatchers, uniqueColorsCache) {
|
|
|
763
800
|
sortedRulesCache.set(labelSetKey, sortedRules);
|
|
764
801
|
}
|
|
765
802
|
// Evaluate rules, tracking whether all are where-free and uniqueColors-free.
|
|
766
|
-
const collectStyles = {
|
|
803
|
+
const collectStyles = {};
|
|
767
804
|
let isCacheable = true;
|
|
768
805
|
for (const rule of sortedRules) {
|
|
769
806
|
if (rule.where !== undefined || rule.apply.uniqueColors !== undefined) {
|
|
770
807
|
isCacheable = false;
|
|
771
808
|
}
|
|
772
809
|
if (doesGraphStyleRuleMatch(node, rule)) {
|
|
773
|
-
|
|
810
|
+
mergeApply(collectStyles, rule.apply);
|
|
774
811
|
}
|
|
775
812
|
}
|
|
776
813
|
// When all rules are where-free and uniqueColors-free, the merged style
|
|
@@ -782,13 +819,15 @@ function createByLabelSetFunction(styleMatchers, uniqueColorsCache) {
|
|
|
782
819
|
return evaluateNodeStyle(collectStyles, node, uniqueColorsCache);
|
|
783
820
|
};
|
|
784
821
|
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
822
|
+
/**
|
|
823
|
+
* Compiles style rules into the functions used to evaluate a graph item's style.
|
|
824
|
+
*
|
|
825
|
+
* Rules cascade by ascending `priority`, so a higher-priority rule wins. A disabled rule — or a
|
|
826
|
+
* disabled property within one — contributes nothing, leaving the next rule down to apply.
|
|
827
|
+
*
|
|
828
|
+
* An evaluated style contains only the properties a matching rule set; nothing is defaulted. Supply
|
|
829
|
+
* defaults as lowest-priority rules, or apply your own when reading the result.
|
|
830
|
+
*/
|
|
792
831
|
export function compileGraphStyleRules(styleRules) {
|
|
793
832
|
const styleMatchers = collectStyleMatchers(styleRules);
|
|
794
833
|
// Shared across nodes and every relationship type so each rule keeps a single
|
|
@@ -802,13 +841,8 @@ export function compileGraphStyleRules(styleRules) {
|
|
|
802
841
|
let fn = cache.get(type);
|
|
803
842
|
if (fn === undefined) {
|
|
804
843
|
const rules = (_a = styleMatchers.rulesByType.get(type)) !== null && _a !== void 0 ? _a : [];
|
|
805
|
-
// Sort global and type-specific rules together by priority, mirroring
|
|
806
|
-
|
|
807
|
-
// applies first.
|
|
808
|
-
fn = createRelStyleFunction([
|
|
809
|
-
DEFAULT_REL_STYLE,
|
|
810
|
-
...[...styleMatchers.globalReltypeRules, ...rules].toSorted(compareByPriorityAscending),
|
|
811
|
-
], uniqueColorsCache);
|
|
844
|
+
// Sort global and type-specific rules together by priority, mirroring the node path.
|
|
845
|
+
fn = createRelStyleFunction([...styleMatchers.globalReltypeRules, ...rules].toSorted(compareByPriorityAscending), uniqueColorsCache);
|
|
812
846
|
cache.set(type, fn);
|
|
813
847
|
}
|
|
814
848
|
return fn;
|