@neo4j-ndl/react-graph 1.2.44 → 1.3.0
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/graph-visualization-buttons.js +1 -3
- package/lib/cjs/graph-visualization-buttons.js.map +1 -1
- package/lib/cjs/graph-visualization-context.js.map +1 -1
- package/lib/cjs/graph-visualization.js +7 -5
- package/lib/cjs/graph-visualization.js.map +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/sidepanel-components/details-panel.js +5 -11
- package/lib/cjs/sidepanel-components/details-panel.js.map +1 -1
- package/lib/cjs/sidepanel-components/graph-label-wrapper.js +40 -0
- package/lib/cjs/sidepanel-components/graph-label-wrapper.js.map +1 -0
- package/lib/cjs/sidepanel-components/overview-panel.js +3 -12
- package/lib/cjs/sidepanel-components/overview-panel.js.map +1 -1
- package/lib/cjs/stories/graph-visualization-rule-based-styling-advanced.story.js +247 -0
- package/lib/cjs/stories/graph-visualization-rule-based-styling-advanced.story.js.map +1 -0
- package/lib/cjs/stories/graph-visualization-rule-based-styling.story.js +79 -0
- package/lib/cjs/stories/graph-visualization-rule-based-styling.story.js.map +1 -0
- package/lib/cjs/stories/graph-visualization-simple-styling.story.js +57 -0
- package/lib/cjs/stories/graph-visualization-simple-styling.story.js.map +1 -0
- package/lib/cjs/stories/index.js +23 -10
- package/lib/cjs/stories/index.js.map +1 -1
- package/lib/cjs/stories/story-data.js +906 -3
- package/lib/cjs/stories/story-data.js.map +1 -1
- package/lib/cjs/styling/compile-graph-styles.js +22 -21
- package/lib/cjs/styling/compile-graph-styles.js.map +1 -1
- package/lib/cjs/styling/create-vis-data-structures.js +126 -0
- package/lib/cjs/styling/create-vis-data-structures.js.map +1 -0
- package/lib/cjs/styling/use-graph-data.js +35 -0
- package/lib/cjs/styling/use-graph-data.js.map +1 -0
- package/lib/cjs/utils.js +23 -9
- package/lib/cjs/utils.js.map +1 -1
- package/lib/esm/graph-visualization-buttons.js +1 -3
- package/lib/esm/graph-visualization-buttons.js.map +1 -1
- package/lib/esm/graph-visualization-context.js.map +1 -1
- package/lib/esm/graph-visualization.js +7 -5
- package/lib/esm/graph-visualization.js.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/sidepanel-components/details-panel.js +6 -12
- package/lib/esm/sidepanel-components/details-panel.js.map +1 -1
- package/lib/esm/sidepanel-components/graph-label-wrapper.js +33 -0
- package/lib/esm/sidepanel-components/graph-label-wrapper.js.map +1 -0
- package/lib/esm/sidepanel-components/overview-panel.js +4 -13
- package/lib/esm/sidepanel-components/overview-panel.js.map +1 -1
- package/lib/esm/stories/graph-visualization-rule-based-styling-advanced.story.js +244 -0
- package/lib/esm/stories/graph-visualization-rule-based-styling-advanced.story.js.map +1 -0
- package/lib/esm/stories/graph-visualization-rule-based-styling.story.js +76 -0
- package/lib/esm/stories/graph-visualization-rule-based-styling.story.js.map +1 -0
- package/lib/esm/stories/graph-visualization-simple-styling.story.js +54 -0
- package/lib/esm/stories/graph-visualization-simple-styling.story.js.map +1 -0
- package/lib/esm/stories/index.js +18 -8
- package/lib/esm/stories/index.js.map +1 -1
- package/lib/esm/stories/story-data.js +905 -2
- package/lib/esm/stories/story-data.js.map +1 -1
- package/lib/esm/styling/compile-graph-styles.js +22 -21
- package/lib/esm/styling/compile-graph-styles.js.map +1 -1
- package/lib/esm/styling/create-vis-data-structures.js +122 -0
- package/lib/esm/styling/create-vis-data-structures.js.map +1 -0
- package/lib/esm/styling/use-graph-data.js +32 -0
- package/lib/esm/styling/use-graph-data.js.map +1 -0
- package/lib/esm/utils.js +20 -8
- package/lib/esm/utils.js.map +1 -1
- package/lib/types/graph-visualization-buttons.d.ts.map +1 -1
- package/lib/types/graph-visualization-context.d.ts +15 -9
- package/lib/types/graph-visualization-context.d.ts.map +1 -1
- package/lib/types/graph-visualization.d.ts +8 -1
- package/lib/types/graph-visualization.d.ts.map +1 -1
- package/lib/types/index.d.ts +2 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/sidepanel-components/details-panel.d.ts.map +1 -1
- package/lib/types/{map-to-nvl-graph.d.ts → sidepanel-components/graph-label-wrapper.d.ts} +10 -17
- package/lib/types/sidepanel-components/graph-label-wrapper.d.ts.map +1 -0
- package/lib/types/sidepanel-components/overview-panel.d.ts.map +1 -1
- package/lib/types/stories/graph-visualization-rule-based-styling-advanced.story.d.ts +33 -0
- package/lib/types/stories/graph-visualization-rule-based-styling-advanced.story.d.ts.map +1 -0
- package/lib/types/stories/graph-visualization-rule-based-styling.story.d.ts +25 -0
- package/lib/types/stories/graph-visualization-rule-based-styling.story.d.ts.map +1 -0
- package/lib/types/stories/graph-visualization-simple-styling.story.d.ts +25 -0
- package/lib/types/stories/graph-visualization-simple-styling.story.d.ts.map +1 -0
- package/lib/types/stories/index.d.ts +7 -1
- package/lib/types/stories/index.d.ts.map +1 -1
- package/lib/types/stories/story-data.d.ts +4 -0
- package/lib/types/stories/story-data.d.ts.map +1 -1
- package/lib/types/styling/compile-graph-styles.d.ts +2 -5
- package/lib/types/styling/compile-graph-styles.d.ts.map +1 -1
- package/lib/types/styling/create-vis-data-structures.d.ts +28 -0
- package/lib/types/styling/create-vis-data-structures.d.ts.map +1 -0
- package/lib/types/styling/style-types.d.ts +2 -2
- package/lib/types/styling/use-graph-data.d.ts +28 -0
- package/lib/types/styling/use-graph-data.d.ts.map +1 -0
- package/lib/types/utils.d.ts +5 -3
- package/lib/types/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/lib/cjs/map-to-nvl-graph.js +0 -167
- package/lib/cjs/map-to-nvl-graph.js.map +0 -1
- package/lib/esm/map-to-nvl-graph.js +0 -162
- package/lib/esm/map-to-nvl-graph.js.map +0 -1
- package/lib/types/map-to-nvl-graph.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"story-data.js","sourceRoot":"","sources":["../../../src/stories/story-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG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U,EAAE,EAAE;YACd,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,UAAU;SACjB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAC3B,oEAAoE,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 NeoNode, type NeoRel } from '../graph-visualization-context';\n\nexport const StoryGraph: { nodes: NeoNode[]; rels: NeoRel[] } = {\n nodes: [\n {\n id: 'node1',\n labels: ['Pokemon', 'Legendary'],\n properties: {\n durationToWinBattle: {\n stringified: 'P0M0DT0.000000001S',\n type: 'duration',\n },\n favoriteColors: {\n stringified: '[\"red\", \"blue\", \"green\"]',\n type: 'list',\n },\n getsBeatBy: {\n stringified: 'null',\n type: 'null',\n },\n isAwesome: {\n stringified: 'true',\n type: 'boolean',\n },\n location: {\n stringified: 'point({srid:1, x:100, y:200, z:300})',\n type: 'point',\n },\n name: {\n stringified: '\"Rayquaza\"',\n type: 'string',\n },\n weight: {\n stringified: '392.0',\n type: 'float',\n },\n },\n },\n {\n id: 'node2',\n labels: ['Type'],\n properties: { name: { stringified: 'Dragon', type: 'String' } },\n },\n {\n id: 'node3',\n labels: ['Type'],\n properties: { name: { stringified: 'Flying', type: 'String' } },\n },\n ],\n rels: [\n {\n from: 'node1',\n id: 'rel1',\n properties: {},\n to: 'node2',\n type: 'HAS_TYPE',\n },\n {\n from: 'node1',\n id: 'rel2',\n properties: {},\n to: 'node3',\n type: 'HAS_TYPE',\n },\n ],\n};\n\nexport const containerClasses =\n 'n-w-full n-border-neutral-border-weak n-mx-2 n-rounded-lg n-border';\n"]}
|
|
1
|
+
{"version":3,"file":"story-data.js","sourceRoot":"","sources":["../../../src/stories/story-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,MAAM,CAAC,MAAM,UAAU,GAAyC;IAC9D,KAAK,EAAE;QACL;YACE,EAAE,EAAE,OAAO;YACX,MAAM,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;YAChC,UAAU,EAAE;gBACV,mBAAmB,EAAE;oBACnB,WAAW,EAAE,oBAAoB;oBACjC,IAAI,EAAE,UAAU;iBACjB;gBACD,cAAc,EAAE;oBACd,WAAW,EAAE,0BAA0B;oBACvC,IAAI,EAAE,MAAM;iBACb;gBACD,UAAU,EAAE;oBACV,WAAW,EAAE,MAAM;oBACnB,IAAI,EAAE,MAAM;iBACb;gBACD,SAAS,EAAE;oBACT,WAAW,EAAE,MAAM;oBACnB,IAAI,EAAE,SAAS;iBAChB;gBACD,QAAQ,EAAE;oBACR,WAAW,EAAE,sCAAsC;oBACnD,IAAI,EAAE,OAAO;iBACd;gBACD,IAAI,EAAE;oBACJ,WAAW,EAAE,YAAY;oBACzB,IAAI,EAAE,QAAQ;iBACf;gBACD,MAAM,EAAE;oBACN,WAAW,EAAE,OAAO;oBACpB,IAAI,EAAE,OAAO;iBACd;aACF;SACF;QACD;YACE,EAAE,EAAE,OAAO;YACX,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;SAClE;QACD;YACE,EAAE,EAAE,OAAO;YACX,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;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EAAE,SAAS,EAAE;gBAC5C,MAAM,EAAE,EAAE,WAAW,EAAE,sBAAsB,EAAE,IAAI,EAAE,QAAQ,EAAE;aAChE;SACF;QACD;YACE,EAAE,EAAE,QAAQ;YACZ,IAAI,EAAE,WAAW;YACjB,EAAE,EAAE,WAAW;YACf,IAAI,EAAE,YAAY;YAClB,UAAU,EAAE;gBACV,KAAK,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE;gBAC5C,MAAM,EAAE,EAAE,WAAW,EAAE,yBAAyB,EAAE,IAAI,EAAE,QAAQ,EAAE;aACnE;SACF;QACD;YACE,EAAE,EAAE,SAAS;YACb,IAAI,EAAE,WAAW;YACjB,EAAE,EAAE,WAAW;YACf,IAAI,EAAE,YAAY;YAClB,UAAU,EAAE;gBACV,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;gBAC7C,MAAM,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE;aACnD;SACF;QACD;YACE,EAAE,EAAE,SAAS;YACb,IAAI,EAAE,WAAW;YACjB,EAAE,EAAE,WAAW;YACf,IAAI,EAAE,YAAY;YAClB,UAAU,EAAE;gBACV,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;gBAC7C,MAAM,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE;aACnD;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAC3B,oEAAoE,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 NeoNode, type NeoRel } from '../graph-visualization-context';\n\nexport const StoryGraph: { nodes: NeoNode[]; rels: NeoRel[] } = {\n nodes: [\n {\n id: 'node1',\n labels: ['Pokemon', 'Legendary'],\n properties: {\n durationToWinBattle: {\n stringified: 'P0M0DT0.000000001S',\n type: 'duration',\n },\n favoriteColors: {\n stringified: '[\"red\", \"blue\", \"green\"]',\n type: 'list',\n },\n getsBeatBy: {\n stringified: 'null',\n type: 'null',\n },\n isAwesome: {\n stringified: 'true',\n type: 'boolean',\n },\n location: {\n stringified: 'point({srid:1, x:100, y:200, z:300})',\n type: 'point',\n },\n name: {\n stringified: '\"Rayquaza\"',\n type: 'string',\n },\n weight: {\n stringified: '392.0',\n type: 'float',\n },\n },\n },\n {\n id: 'node2',\n labels: ['Type'],\n properties: { name: { stringified: '\"Dragon\"', type: 'string' } },\n },\n {\n id: 'node3',\n labels: ['Type'],\n properties: { name: { stringified: '\"Flying\"', type: 'string' } },\n },\n {\n id: 'node4',\n labels: ['Pokemon'],\n properties: { name: { stringified: '\"Pidgey\"', type: 'string' } },\n },\n ],\n rels: [\n {\n from: 'node1',\n id: 'rel1',\n properties: {},\n to: 'node2',\n type: 'HAS_TYPE',\n },\n {\n from: 'node1',\n id: 'rel2',\n properties: {},\n to: 'node3',\n type: 'HAS_TYPE',\n },\n {\n from: 'node4',\n id: 'rel3',\n properties: {},\n to: 'node3',\n type: 'HAS_TYPE',\n },\n ],\n};\n\nexport const advancedStoryGraph: { nodes: NeoNode[]; rels: NeoRel[] } = {\n nodes: [\n // Trainers\n {\n id: 'trainer1',\n labels: ['Trainer'],\n properties: {\n name: { stringified: '\"Ash\"', type: 'string' },\n level: { stringified: '85', type: 'integer' },\n badges: { stringified: '8', type: 'integer' },\n reputation: { stringified: '\"Champion\"', type: 'string' },\n },\n },\n {\n id: 'trainer2',\n labels: ['Trainer'],\n properties: {\n name: { stringified: '\"Misty\"', type: 'string' },\n level: { stringified: '72', type: 'integer' },\n badges: { stringified: '8', type: 'integer' },\n reputation: { stringified: '\"Gym Leader\"', type: 'string' },\n },\n },\n {\n id: 'trainer3',\n labels: ['Trainer'],\n properties: {\n name: { stringified: '\"Gary\"', type: 'string' },\n level: { stringified: '80', type: 'integer' },\n badges: { stringified: '8', type: 'integer' },\n reputation: { stringified: '\"Rival\"', type: 'string' },\n },\n },\n {\n id: 'trainer4',\n labels: ['Trainer'],\n properties: {\n name: { stringified: '\"Brock\"', type: 'string' },\n level: { stringified: '68', type: 'integer' },\n badges: { stringified: '2', type: 'integer' },\n reputation: { stringified: '\"Breeder\"', type: 'string' },\n },\n },\n // Gyms\n {\n id: 'gym1',\n labels: ['Gym'],\n properties: {\n name: { stringified: '\"Cerulean Gym\"', type: 'string' },\n city: { stringified: '\"Cerulean City\"', type: 'string' },\n type: { stringified: '\"Water\"', type: 'string' },\n badge: { stringified: '\"Cascade Badge\"', type: 'string' },\n },\n },\n // Ash's Pokemon\n {\n id: 'pokemon1',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Pikachu\"', type: 'string' },\n level: { stringified: '88', type: 'integer' },\n is_starter: { stringified: 'true', type: 'boolean' },\n catch_rate: { stringified: '190.0', type: 'float' },\n },\n },\n {\n id: 'pokemon2',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Charizard\"', type: 'string' },\n level: { stringified: '82', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '45.0', type: 'float' },\n },\n },\n {\n id: 'pokemon3',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Greninja\"', type: 'string' },\n level: { stringified: '80', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '45.0', type: 'float' },\n },\n },\n // Misty's Pokemon\n {\n id: 'pokemon4',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Starmie\"', type: 'string' },\n level: { stringified: '75', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '60.0', type: 'float' },\n },\n },\n {\n id: 'pokemon5',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Psyduck\"', type: 'string' },\n level: { stringified: '65', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '190.0', type: 'float' },\n },\n },\n {\n id: 'pokemon6',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Gyarados\"', type: 'string' },\n level: { stringified: '78', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '45.0', type: 'float' },\n },\n },\n // Gary's Pokemon\n {\n id: 'pokemon7',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Blastoise\"', type: 'string' },\n level: { stringified: '83', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '45.0', type: 'float' },\n },\n },\n {\n id: 'pokemon8',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Umbreon\"', type: 'string' },\n level: { stringified: '79', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '45.0', type: 'float' },\n },\n },\n {\n id: 'pokemon9',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Electivire\"', type: 'string' },\n level: { stringified: '81', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '30.0', type: 'float' },\n },\n },\n // Brock's Pokemon\n {\n id: 'pokemon10',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Onix\"', type: 'string' },\n level: { stringified: '70', type: 'integer' },\n is_starter: { stringified: 'true', type: 'boolean' },\n catch_rate: { stringified: '45.0', type: 'float' },\n },\n },\n // Evolution Pokemon (pre-evolutions and uncaught)\n {\n id: 'pokemon11',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Pichu\"', type: 'string' },\n level: { stringified: '1', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '190.0', type: 'float' },\n },\n },\n {\n id: 'pokemon12',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Raichu\"', type: 'string' },\n level: { stringified: '1', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '75.0', type: 'float' },\n },\n },\n {\n id: 'pokemon13',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Charmander\"', type: 'string' },\n level: { stringified: '1', type: 'integer' },\n is_starter: { stringified: 'true', type: 'boolean' },\n catch_rate: { stringified: '45.0', type: 'float' },\n },\n },\n {\n id: 'pokemon14',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Charmeleon\"', type: 'string' },\n level: { stringified: '1', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '45.0', type: 'float' },\n },\n },\n {\n id: 'pokemon15',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Staryu\"', type: 'string' },\n level: { stringified: '1', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '225.0', type: 'float' },\n },\n },\n {\n id: 'pokemon16',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Golduck\"', type: 'string' },\n level: { stringified: '1', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '75.0', type: 'float' },\n },\n },\n {\n id: 'pokemon17',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Magikarp\"', type: 'string' },\n level: { stringified: '1', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '255.0', type: 'float' },\n },\n },\n {\n id: 'pokemon18',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Eevee\"', type: 'string' },\n level: { stringified: '1', type: 'integer' },\n is_starter: { stringified: 'true', type: 'boolean' },\n catch_rate: { stringified: '45.0', type: 'float' },\n },\n },\n {\n id: 'pokemon19',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Steelix\"', type: 'string' },\n level: { stringified: '1', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '25.0', type: 'float' },\n },\n },\n // Uncaught evolution line: Bulbasaur line\n {\n id: 'pokemon20',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Bulbasaur\"', type: 'string' },\n level: { stringified: '1', type: 'integer' },\n is_starter: { stringified: 'true', type: 'boolean' },\n catch_rate: { stringified: '45.0', type: 'float' },\n },\n },\n {\n id: 'pokemon21',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Ivysaur\"', type: 'string' },\n level: { stringified: '1', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '45.0', type: 'float' },\n },\n },\n {\n id: 'pokemon22',\n labels: ['Pokemon'],\n properties: {\n name: { stringified: '\"Venusaur\"', type: 'string' },\n level: { stringified: '1', type: 'integer' },\n is_starter: { stringified: 'false', type: 'boolean' },\n catch_rate: { stringified: '45.0', type: 'float' },\n },\n },\n // Types\n {\n id: 'type1',\n labels: ['Type'],\n properties: {\n name: { stringified: '\"Electric\"', type: 'string' },\n },\n },\n {\n id: 'type2',\n labels: ['Type'],\n properties: {\n name: { stringified: '\"Fire\"', type: 'string' },\n },\n },\n {\n id: 'type3',\n labels: ['Type'],\n properties: {\n name: { stringified: '\"Flying\"', type: 'string' },\n },\n },\n {\n id: 'type4',\n labels: ['Type'],\n properties: {\n name: { stringified: '\"Water\"', type: 'string' },\n },\n },\n {\n id: 'type5',\n labels: ['Type'],\n properties: {\n name: { stringified: '\"Dark\"', type: 'string' },\n },\n },\n {\n id: 'type6',\n labels: ['Type'],\n properties: {\n name: { stringified: '\"Psychic\"', type: 'string' },\n },\n },\n {\n id: 'type7',\n labels: ['Type'],\n properties: {\n name: { stringified: '\"Rock\"', type: 'string' },\n },\n },\n {\n id: 'type8',\n labels: ['Type'],\n properties: {\n name: { stringified: '\"Ground\"', type: 'string' },\n },\n },\n {\n id: 'type9',\n labels: ['Type'],\n properties: {\n name: { stringified: '\"Grass\"', type: 'string' },\n },\n },\n {\n id: 'type10',\n labels: ['Type'],\n properties: {\n name: { stringified: '\"Poison\"', type: 'string' },\n },\n },\n {\n id: 'type11',\n labels: ['Type'],\n properties: {\n name: { stringified: '\"Steel\"', type: 'string' },\n },\n },\n {\n id: 'type12',\n labels: ['Type'],\n properties: {\n name: { stringified: '\"Normal\"', type: 'string' },\n },\n },\n ],\n rels: [\n // Trainer -> Pokemon relationships (CAUGHT)\n // Ash's Pokemon\n {\n id: 'rel_p1',\n from: 'trainer1',\n to: 'pokemon1',\n type: 'CAUGHT',\n properties: {\n at: { stringified: '\"1997-04-01\"', type: 'string' },\n level: { stringified: '5', type: 'integer' },\n },\n },\n {\n id: 'rel_p2',\n from: 'trainer1',\n to: 'pokemon2',\n type: 'CAUGHT',\n properties: {\n at: { stringified: '\"1997-06-15\"', type: 'string' },\n level: { stringified: '7', type: 'integer' },\n },\n },\n {\n id: 'rel_p3',\n from: 'trainer1',\n to: 'pokemon3',\n type: 'CAUGHT',\n properties: {\n at: { stringified: '\"2015-10-22\"', type: 'string' },\n level: { stringified: '5', type: 'integer' },\n },\n },\n // Misty's Pokemon\n {\n id: 'rel_p4',\n from: 'trainer2',\n to: 'pokemon4',\n type: 'CAUGHT',\n properties: {\n at: { stringified: '\"1996-08-10\"', type: 'string' },\n level: { stringified: '20', type: 'integer' },\n },\n },\n {\n id: 'rel_p5',\n from: 'trainer2',\n to: 'pokemon5',\n type: 'CAUGHT',\n properties: {\n at: { stringified: '\"1997-09-12\"', type: 'string' },\n level: { stringified: '15', type: 'integer' },\n },\n },\n {\n id: 'rel_p6',\n from: 'trainer2',\n to: 'pokemon6',\n type: 'CAUGHT',\n properties: {\n at: { stringified: '\"1998-02-18\"', type: 'string' },\n level: { stringified: '10', type: 'integer' },\n },\n },\n // Gary's Pokemon\n {\n id: 'rel_p7',\n from: 'trainer3',\n to: 'pokemon7',\n type: 'CAUGHT',\n properties: {\n at: { stringified: '\"1997-04-01\"', type: 'string' },\n level: { stringified: '5', type: 'integer' },\n },\n },\n {\n id: 'rel_p8',\n from: 'trainer3',\n to: 'pokemon8',\n type: 'CAUGHT',\n properties: {\n at: { stringified: '\"1999-12-14\"', type: 'string' },\n level: { stringified: '12', type: 'integer' },\n },\n },\n {\n id: 'rel_p9',\n from: 'trainer3',\n to: 'pokemon9',\n type: 'CAUGHT',\n properties: {\n at: { stringified: '\"2008-05-29\"', type: 'string' },\n level: { stringified: '30', type: 'integer' },\n },\n },\n // Brock's Pokemon\n {\n id: 'rel_p10',\n from: 'trainer4',\n to: 'pokemon10',\n type: 'CAUGHT',\n properties: {\n at: { stringified: '\"1995-03-20\"', type: 'string' },\n level: { stringified: '8', type: 'integer' },\n },\n },\n // Gym leadership\n {\n id: 'rel1',\n from: 'trainer2',\n to: 'gym1',\n type: 'LEADS',\n properties: {\n since: { stringified: '\"1998-03-15\"', type: 'string' },\n },\n },\n // Gym -> Type specialization\n {\n id: 'rel_gym_type',\n from: 'gym1',\n to: 'type4',\n type: 'SPECIALIZES_IN',\n properties: {},\n },\n // Ash's gym battle\n {\n id: 'rel2',\n from: 'trainer1',\n to: 'gym1',\n type: 'BATTLED',\n properties: {\n date: { stringified: '\"2024-05-10\"', type: 'string' },\n won: { stringified: 'true', type: 'boolean' },\n attempt: { stringified: '1', type: 'integer' },\n },\n },\n // Gary's first gym battle (lost)\n {\n id: 'rel3',\n from: 'trainer3',\n to: 'gym1',\n type: 'BATTLED',\n properties: {\n date: { stringified: '\"2024-04-15\"', type: 'string' },\n won: { stringified: 'false', type: 'boolean' },\n attempt: { stringified: '1', type: 'integer' },\n },\n },\n // Gary's second gym battle (won)\n {\n id: 'rel4',\n from: 'trainer3',\n to: 'gym1',\n type: 'BATTLED',\n properties: {\n date: { stringified: '\"2024-06-20\"', type: 'string' },\n won: { stringified: 'true', type: 'boolean' },\n attempt: { stringified: '2', type: 'integer' },\n },\n },\n // Rival battles between Ash and Gary\n {\n id: 'rel5',\n from: 'trainer1',\n to: 'trainer3',\n type: 'BATTLED',\n properties: {\n date: { stringified: '\"2024-03-10\"', type: 'string' },\n won: { stringified: 'false', type: 'boolean' },\n location: { stringified: '\"Pallet Town\"', type: 'string' },\n },\n },\n {\n id: 'rel6',\n from: 'trainer1',\n to: 'trainer3',\n type: 'BATTLED',\n properties: {\n date: { stringified: '\"2024-05-22\"', type: 'string' },\n won: { stringified: 'true', type: 'boolean' },\n location: { stringified: '\"Viridian City\"', type: 'string' },\n },\n },\n {\n id: 'rel7',\n from: 'trainer1',\n to: 'trainer3',\n type: 'BATTLED',\n properties: {\n date: { stringified: '\"2024-07-15\"', type: 'string' },\n won: { stringified: 'true', type: 'boolean' },\n location: { stringified: '\"Indigo Plateau\"', type: 'string' },\n },\n },\n // Pokemon -> Type relationships (OF_TYPE)\n {\n id: 'rel_t1',\n from: 'pokemon1',\n to: 'type1',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t2',\n from: 'pokemon2',\n to: 'type2',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t3',\n from: 'pokemon2',\n to: 'type3',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t4',\n from: 'pokemon3',\n to: 'type4',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t5',\n from: 'pokemon3',\n to: 'type5',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t6',\n from: 'pokemon4',\n to: 'type4',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t7',\n from: 'pokemon4',\n to: 'type6',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t8',\n from: 'pokemon5',\n to: 'type4',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t9',\n from: 'pokemon6',\n to: 'type4',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t10',\n from: 'pokemon6',\n to: 'type3',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t11',\n from: 'pokemon7',\n to: 'type4',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t12',\n from: 'pokemon8',\n to: 'type5',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t13',\n from: 'pokemon9',\n to: 'type1',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t14',\n from: 'pokemon10',\n to: 'type7',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t15',\n from: 'pokemon10',\n to: 'type8',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t16',\n from: 'pokemon11',\n to: 'type1',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t17',\n from: 'pokemon12',\n to: 'type1',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t18',\n from: 'pokemon13',\n to: 'type2',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t19',\n from: 'pokemon14',\n to: 'type2',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t20',\n from: 'pokemon15',\n to: 'type4',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t21',\n from: 'pokemon16',\n to: 'type4',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t22',\n from: 'pokemon17',\n to: 'type4',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t23',\n from: 'pokemon18',\n to: 'type12',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t24',\n from: 'pokemon19',\n to: 'type11',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t25',\n from: 'pokemon19',\n to: 'type8',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t26',\n from: 'pokemon20',\n to: 'type9',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t27',\n from: 'pokemon20',\n to: 'type10',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t28',\n from: 'pokemon21',\n to: 'type9',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t29',\n from: 'pokemon21',\n to: 'type10',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t30',\n from: 'pokemon22',\n to: 'type9',\n type: 'OF_TYPE',\n properties: {},\n },\n {\n id: 'rel_t31',\n from: 'pokemon22',\n to: 'type10',\n type: 'OF_TYPE',\n properties: {},\n },\n // Evolution relationships (EVOLVES_TO)\n {\n id: 'rel_e1',\n from: 'pokemon11',\n to: 'pokemon1',\n type: 'EVOLVES_TO',\n properties: {\n level: { stringified: '0', type: 'integer' },\n method: { stringified: '\"Friendship\"', type: 'string' },\n },\n },\n {\n id: 'rel_e2',\n from: 'pokemon1',\n to: 'pokemon12',\n type: 'EVOLVES_TO',\n properties: {\n level: { stringified: '0', type: 'integer' },\n method: { stringified: '\"Thunder Stone\"', type: 'string' },\n },\n },\n {\n id: 'rel_e3',\n from: 'pokemon13',\n to: 'pokemon14',\n type: 'EVOLVES_TO',\n properties: {\n level: { stringified: '16', type: 'integer' },\n method: { stringified: '\"Level\"', type: 'string' },\n },\n },\n {\n id: 'rel_e4',\n from: 'pokemon14',\n to: 'pokemon2',\n type: 'EVOLVES_TO',\n properties: {\n level: { stringified: '36', type: 'integer' },\n method: { stringified: '\"Level\"', type: 'string' },\n },\n },\n {\n id: 'rel_e5',\n from: 'pokemon15',\n to: 'pokemon4',\n type: 'EVOLVES_TO',\n properties: {\n level: { stringified: '0', type: 'integer' },\n method: { stringified: '\"Water Stone\"', type: 'string' },\n },\n },\n {\n id: 'rel_e6',\n from: 'pokemon5',\n to: 'pokemon16',\n type: 'EVOLVES_TO',\n properties: {\n level: { stringified: '33', type: 'integer' },\n method: { stringified: '\"Level\"', type: 'string' },\n },\n },\n {\n id: 'rel_e7',\n from: 'pokemon17',\n to: 'pokemon6',\n type: 'EVOLVES_TO',\n properties: {\n level: { stringified: '20', type: 'integer' },\n method: { stringified: '\"Level\"', type: 'string' },\n },\n },\n {\n id: 'rel_e8',\n from: 'pokemon18',\n to: 'pokemon8',\n type: 'EVOLVES_TO',\n properties: {\n level: { stringified: '0', type: 'integer' },\n method: { stringified: '\"Friendship (Night)\"', type: 'string' },\n },\n },\n {\n id: 'rel_e9',\n from: 'pokemon10',\n to: 'pokemon19',\n type: 'EVOLVES_TO',\n properties: {\n level: { stringified: '0', type: 'integer' },\n method: { stringified: '\"Trade with Metal Coat\"', type: 'string' },\n },\n },\n {\n id: 'rel_e10',\n from: 'pokemon20',\n to: 'pokemon21',\n type: 'EVOLVES_TO',\n properties: {\n level: { stringified: '16', type: 'integer' },\n method: { stringified: '\"Level\"', type: 'string' },\n },\n },\n {\n id: 'rel_e11',\n from: 'pokemon21',\n to: 'pokemon22',\n type: 'EVOLVES_TO',\n properties: {\n level: { stringified: '32', type: 'integer' },\n method: { stringified: '\"Level\"', type: 'string' },\n },\n },\n ],\n};\n\nexport const containerClasses =\n 'n-w-full n-border-neutral-border-weak n-mx-2 n-rounded-lg n-border';\n"]}
|
|
@@ -50,7 +50,7 @@ function collectStyleMatchers(styles) {
|
|
|
50
50
|
}
|
|
51
51
|
const totalRules = styles.length;
|
|
52
52
|
styles.forEach((style, index) => {
|
|
53
|
-
var _a, _b;
|
|
53
|
+
var _a, _b, _c;
|
|
54
54
|
if ((_a = style.disabled) !== null && _a !== void 0 ? _a : false) {
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
@@ -62,8 +62,8 @@ function collectStyleMatchers(styles) {
|
|
|
62
62
|
const ruleWithPriority = Object.assign(Object.assign({}, rest), { priority: priority !== null && priority !== void 0 ? priority : index - totalRules });
|
|
63
63
|
// style for nodes
|
|
64
64
|
if ('label' in style.match) {
|
|
65
|
-
// if the label is null
|
|
66
|
-
if (style.match.label
|
|
65
|
+
// if the label is null, it's a global rule (matches any node)
|
|
66
|
+
if (style.match.label === null) {
|
|
67
67
|
globalLabelRules.push(ruleWithPriority);
|
|
68
68
|
}
|
|
69
69
|
else {
|
|
@@ -80,7 +80,7 @@ function collectStyleMatchers(styles) {
|
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
82
82
|
// Specific reltype rule
|
|
83
|
-
const existing = rulesByType.get(style.match.reltype)
|
|
83
|
+
const existing = (_c = rulesByType.get(style.match.reltype)) !== null && _c !== void 0 ? _c : [];
|
|
84
84
|
rulesByType.set(style.match.reltype, [...existing, ruleWithPriority]);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -340,7 +340,7 @@ function getDefaultNodeCaption(node) {
|
|
|
340
340
|
if (node.labelsSorted[0] !== undefined) {
|
|
341
341
|
return { value: { useType: true } };
|
|
342
342
|
}
|
|
343
|
-
return { value:
|
|
343
|
+
return { value: node.id };
|
|
344
344
|
}
|
|
345
345
|
function evaluateNodeStyle(apply, node) {
|
|
346
346
|
var _a;
|
|
@@ -386,11 +386,8 @@ function createRelStyleFunction(rules) {
|
|
|
386
386
|
export const DEFAULT_REL_COLOR = tokens.palette.neutral['40'];
|
|
387
387
|
const NO_LABEL_FALLBACK_COLOR = tokens.palette.neutral['40'];
|
|
388
388
|
function createByLabelSetFunction(styleMatchers) {
|
|
389
|
-
// Memoize default color by label string (idea 2: avoid recalculating per node)
|
|
390
389
|
const defaultColorCache = new Map();
|
|
391
|
-
// Cache sorted rules by label set key (idea 1: avoid allocation + sort per node)
|
|
392
390
|
const sortedRulesCache = new Map();
|
|
393
|
-
// Cache merged Style for where-free rule sets (idea 3: skip rule iteration entirely)
|
|
394
391
|
const mergedStyleCache = new Map();
|
|
395
392
|
return (node) => {
|
|
396
393
|
var _a;
|
|
@@ -458,20 +455,24 @@ const DEFAULT_REL_STYLE = {
|
|
|
458
455
|
captions: [{ value: { useType: true } }],
|
|
459
456
|
},
|
|
460
457
|
};
|
|
461
|
-
export function compileStyleRules(
|
|
462
|
-
var _a;
|
|
458
|
+
export function compileStyleRules(styleRules) {
|
|
463
459
|
const styleMatchers = collectStyleMatchers(styleRules);
|
|
464
|
-
//
|
|
465
|
-
const
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
460
|
+
// Lazily build and cache a style function per relationship type
|
|
461
|
+
const cache = new Map();
|
|
462
|
+
const byType = (type) => {
|
|
463
|
+
var _a;
|
|
464
|
+
let fn = cache.get(type);
|
|
465
|
+
if (fn === undefined) {
|
|
466
|
+
const rules = (_a = styleMatchers.rulesByType.get(type)) !== null && _a !== void 0 ? _a : [];
|
|
467
|
+
fn = createRelStyleFunction([
|
|
468
|
+
DEFAULT_REL_STYLE,
|
|
469
|
+
...styleMatchers.globalReltypeRules,
|
|
470
|
+
...rules,
|
|
471
|
+
]);
|
|
472
|
+
cache.set(type, fn);
|
|
473
|
+
}
|
|
474
|
+
return fn;
|
|
475
|
+
};
|
|
475
476
|
const byLabelSet = createByLabelSetFunction(styleMatchers);
|
|
476
477
|
return { byLabelSet, byType, styleMatchers };
|
|
477
478
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-graph-styles.js","sourceRoot":"","sources":["../../../src/styling/compile-graph-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAyBzC,SAAS,0BAA0B,CAAC,CAAY,EAAE,CAAY;IAC5D,OAAO,CAAC,CAAC,QAAS,GAAG,CAAC,CAAC,QAAS,CAAC;AACnC,CAAC;AAED,SAAS,oBAAoB,CAC3B,MAAsC;IAEtC,MAAM,YAAY,GAAG,IAAI,GA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AG,CACR,OAAO,EACP,sBAAsB,CAAC;YACrB,iBAAiB;YACjB,GAAG,aAAa,CAAC,kBAAkB;YACnC,GAAG,KAAK;SACT,CAAC,CACH,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAG,wBAAwB,CAAC,aAAa,CAAC,CAAC;IAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;AAC/C,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 { calculateDefaultNodeColors } from '@neo4j-devtools/word-color';\nimport { tokens } from '@neo4j-ndl/base';\n\nimport {\n type NodeData,\n type PortableProperty,\n type RelData,\n} from '../graph-visualization-context';\nimport {\n type Caption,\n type CypherValue,\n type EvaluatedNvlNodeStyle,\n type EvaluatedNvlRelationshipStyle,\n type Style,\n type StyleRule,\n type Value,\n type Where,\n} from './style-types';\n\ntype StyleMatchers = {\n globalLabelRules: StyleRule[];\n globalReltypeRules: StyleRule[];\n rulesByLabel: Map<string, StyleRule[]>;\n rulesByType: Map<string, StyleRule[]>;\n};\n\nfunction compareByPriorityAscending(a: StyleRule, b: StyleRule): number {\n return a.priority! - b.priority!;\n}\n\nfunction collectStyleMatchers(\n styles: StyleRule[] | null | undefined,\n): StyleMatchers {\n const rulesByLabel = new Map<string, StyleRule[]>();\n const rulesByType = new Map<string, StyleRule[]>();\n const globalLabelRules: StyleRule[] = [];\n const globalReltypeRules: StyleRule[] = [];\n\n // Handle null/undefined styles gracefully\n if (!styles || styles.length === 0) {\n return {\n globalLabelRules,\n globalReltypeRules,\n rulesByLabel,\n rulesByType,\n };\n }\n\n const totalRules = styles.length;\n\n styles.forEach((style, index) => {\n if (style.disabled ?? false) {\n return;\n }\n\n if (style.priority !== undefined && style.priority < 0) {\n throw new Error(\n `StyleRule priority must be >= 0, got ${style.priority}. Negative values are reserved for internal use.`,\n );\n }\n\n // Fill in priority if not set (negative values preserve original order)\n const { priority, ...rest } = style;\n const ruleWithPriority: StyleRule = {\n ...rest,\n priority: priority ?? index - totalRules,\n };\n\n // style for nodes\n if ('label' in style.match) {\n // if the label is null/undefined, it's a global rule (matches any node)\n if (style.match.label == null) {\n globalLabelRules.push(ruleWithPriority);\n } else {\n // Specific label rule\n const existing = rulesByLabel.get(style.match.label) ?? [];\n rulesByLabel.set(style.match.label, [...existing, ruleWithPriority]);\n }\n }\n\n // style for relationships\n if ('reltype' in style.match) {\n if (style.match.reltype === null) {\n // Global reltype rule (matches any relationship)\n globalReltypeRules.push(ruleWithPriority);\n } else {\n // Specific reltype rule\n const existing = rulesByType.get(style.match.reltype) || [];\n rulesByType.set(style.match.reltype, [...existing, ruleWithPriority]);\n }\n }\n });\n\n return {\n globalLabelRules,\n globalReltypeRules,\n rulesByLabel,\n rulesByType,\n };\n}\n\nfunction extractPropertyValue(\n prop: PortableProperty,\n): string | number | boolean | null {\n switch (prop.type) {\n case 'string':\n return JSON.parse(prop.stringified);\n case 'number':\n case 'integer':\n case 'float':\n return Number(prop.stringified);\n case 'boolean':\n case 'Boolean':\n return prop.stringified === 'true';\n case 'null':\n return null;\n default:\n return prop.stringified;\n }\n}\n\n/**\n * Three-valued logic type matching Cypher/SQL semantics.\n * - `true`: condition is satisfied\n * - `false`: condition is not satisfied\n * - `null`: condition is unknown (e.g., comparing with null/missing property)\n *\n * @see https://neo4j.com/docs/cypher-manual/current/values-and-types/working-with-null/\n */\ntype Ternary = boolean | null;\n\n/**\n * Evaluates a WHERE clause using three-valued logic matching Cypher semantics.\n *\n * From Neo4j Cypher Manual:\n * - Comparing any value to `null` results in `null`, not `true` or `false`\n * - Accessing a non-existent property returns `null`\n * - In WHERE clauses, only `true` passes; both `false` and `null` exclude the row\n *\n * Three-valued logic rules:\n * - NOT null → null\n * - true AND null → null, false AND null → false\n * - true OR null → true, false OR null → null\n *\n * @see https://neo4j.com/docs/cypher-manual/current/values-and-types/working-with-null/\n */\nfunction evaluateWhere(node: NodeData | RelData, where?: Where): Ternary {\n if (!where) {\n return true;\n }\n\n if ('equal' in where) {\n const [left, right] = where.equal;\n const leftVal = evaluateValue(left, node);\n const rightVal = evaluateValue(right, node);\n // In Cypher, null = null → null (not true)\n if (leftVal === null || rightVal === null) {\n return null;\n }\n return leftVal === rightVal;\n }\n\n if ('not' in where) {\n // Cypher: NOT null → null\n const isMatch = evaluateWhere(node, where.not);\n return isMatch === null ? null : !isMatch;\n }\n\n if ('lessThan' in where) {\n const [left, right] = where.lessThan;\n return safeCompare(left, right, node, (a, b) => a < b);\n }\n\n if ('lessThanOrEqual' in where) {\n const [left, right] = where.lessThanOrEqual;\n return safeCompare(left, right, node, (a, b) => a <= b);\n }\n\n if ('greaterThan' in where) {\n const [left, right] = where.greaterThan;\n return safeCompare(left, right, node, (a, b) => a > b);\n }\n\n if ('greaterThanOrEqual' in where) {\n const [left, right] = where.greaterThanOrEqual;\n return safeCompare(left, right, node, (a, b) => a >= b);\n }\n\n if ('contains' in where) {\n const [left, right] = where.contains;\n return safeStringCompare(left, right, node, (a, b) => a.includes(b));\n }\n\n if ('startsWith' in where) {\n const [left, right] = where.startsWith;\n return safeStringCompare(left, right, node, (a, b) => a.startsWith(b));\n }\n\n if ('endsWith' in where) {\n const [left, right] = where.endsWith;\n return safeStringCompare(left, right, node, (a, b) => a.endsWith(b));\n }\n\n if ('isNull' in where) {\n // IS NULL returns true/false (never null)\n const value = evaluateValue(where.isNull, node);\n return value === null;\n }\n\n if ('and' in where) {\n // Cypher three-valued AND:\n // - If any is false → false\n // - Else if any is null → null\n // - Else → true\n let hasNull = false;\n for (const r of where.and) {\n const isMatch = evaluateWhere(node, r);\n if (isMatch === false) {\n return false;\n }\n if (isMatch === null) {\n hasNull = true;\n }\n }\n return hasNull ? null : true;\n }\n\n if ('or' in where) {\n // Cypher three-valued OR:\n // - If any is true → true\n // - Else if any is null → null\n // - Else → false\n let hasNull = false;\n for (const r of where.or) {\n const isMatch = evaluateWhere(node, r);\n if (isMatch === true) {\n return true;\n }\n if (isMatch === null) {\n hasNull = true;\n }\n }\n return hasNull ? null : false;\n }\n\n if ('label' in where) {\n if ('labelsSorted' in node) {\n return where.label === null || node.labelsSorted.includes(where.label);\n }\n return false;\n }\n\n if ('reltype' in where) {\n if ('type' in node) {\n return where.reltype === null || (node as RelData).type === where.reltype;\n }\n return false;\n }\n\n if ('property' in where) {\n return where.property === null || where.property in node.properties;\n }\n\n return false;\n}\n\nfunction evaluateRelStyle(\n apply: Style,\n rel: RelData,\n): EvaluatedNvlRelationshipStyle {\n return {\n ...apply,\n captions: apply.captions?.map((caption) => {\n const { value, styles } = caption;\n\n if (typeof value === 'string' || value === undefined) {\n return { styles, value };\n }\n\n if ('useType' in value) {\n return { styles, value: rel.type };\n }\n\n if ('property' in value) {\n const prop = rel.properties[value.property];\n if (prop === undefined) {\n return { styles, value: '' };\n }\n\n const resolvedValue =\n prop.type === 'string'\n ? prop.stringified.slice(1, -1)\n : prop.stringified;\n\n return { styles, value: resolvedValue };\n }\n\n return { styles, value: rel.id };\n }),\n };\n}\n\n/**\n * Safely compare two values using Cypher's three-valued logic.\n * Returns `null` if either operand is null (matching Cypher semantics).\n *\n * From Neo4j Cypher Manual:\n * \"Comparing any value to `null` using `=` or `<>` results in `null`\"\n *\n * @see https://neo4j.com/docs/cypher-manual/current/values-and-types/working-with-null/\n */\nfunction safeCompare(\n left: Value,\n right: Value,\n graphItem: NodeData | RelData,\n compareFn: (\n a: NonNullable<CypherValue>,\n b: NonNullable<CypherValue>,\n ) => boolean,\n): Ternary {\n const leftVal = evaluateValue(left, graphItem);\n const rightVal = evaluateValue(right, graphItem);\n if (leftVal === null || rightVal === null) {\n return null;\n }\n return compareFn(leftVal, rightVal);\n}\n\n/**\n * String comparison using Cypher semantics.\n * Returns `null` if either operand is null OR not a string.\n *\n * From Neo4j Cypher Manual:\n * \"When these operators are applied to non-string values, they return `null`\n * instead of attempting type coercion.\"\n *\n * @see https://neo4j.com/docs/cypher-manual/current/expressions/predicates/string-operators/\n */\nfunction safeStringCompare(\n left: Value,\n right: Value,\n graphItem: NodeData | RelData,\n compareFn: (a: string, b: string) => boolean,\n): Ternary {\n const leftVal = evaluateValue(left, graphItem);\n const rightVal = evaluateValue(right, graphItem);\n // Return null if either is null or not a string (no type coercion)\n if (\n leftVal === null ||\n rightVal === null ||\n typeof leftVal !== 'string' ||\n typeof rightVal !== 'string'\n ) {\n return null;\n }\n return compareFn(leftVal, rightVal);\n}\n\nfunction evaluateValue(\n value: Value,\n graphItem: NodeData | RelData,\n): CypherValue {\n if (typeof value === 'object' && value !== null) {\n if ('property' in value) {\n if (value.property === null) {\n return null;\n }\n const prop = graphItem.properties[value.property];\n if (prop === undefined) {\n return null;\n }\n return extractPropertyValue(prop);\n }\n if ('label' in value) {\n if ('labelsSorted' in graphItem) {\n return (\n value.label === null || graphItem.labelsSorted.includes(value.label)\n );\n }\n return false;\n }\n if ('reltype' in value) {\n if ('type' in graphItem) {\n return (\n value.reltype === null ||\n (graphItem as RelData).type === value.reltype\n );\n }\n return false;\n }\n }\n\n return value;\n}\n\n// Default caption selection logic\nconst captionPriorityOrder = [\n /^name$/i,\n /^title$/i,\n /^label$/i,\n /name$/i,\n /description$/i,\n /^.+/,\n];\n\nfunction getDefaultNodeCaption(node: NodeData): Caption {\n const propertyKeys = Object.keys(node.properties);\n\n for (const regex of captionPriorityOrder) {\n const matchingKey = propertyKeys.find((key) => regex.test(key));\n if (matchingKey !== undefined) {\n const prop = node.properties[matchingKey];\n if (prop !== undefined) {\n return { value: { property: matchingKey } };\n }\n }\n }\n\n if (node.labelsSorted[0] !== undefined) {\n return { value: { useType: true } };\n }\n\n return { value: { property: node.id } };\n}\n\nfunction evaluateNodeStyle(\n apply: Style,\n node: NodeData,\n): EvaluatedNvlNodeStyle {\n return {\n ...apply,\n captions: (apply.captions ?? [getDefaultNodeCaption(node)]).map(\n (caption) => {\n const { value, styles } = caption;\n\n if (typeof value === 'string' || value === undefined) {\n return { styles, value };\n }\n\n if ('useType' in value) {\n return { styles, value: node.labelsSorted[0] };\n }\n\n if ('property' in value) {\n const prop = node.properties[value.property];\n if (prop === undefined) {\n return { styles, value: '' };\n }\n\n const resolvedValue =\n prop.type === 'string'\n ? prop.stringified.slice(1, -1)\n : prop.stringified;\n\n return { styles, value: resolvedValue };\n }\n\n return { styles, value: node.labelsSorted[0] };\n },\n ),\n };\n}\n\nfunction createRelStyleFunction(\n rules: StyleRule[],\n): (rel: RelData) => EvaluatedNvlRelationshipStyle {\n return (rel: RelData) => {\n const style: Style = {};\n\n // evaluateWhere uses Cypher-style three-valued logic (true/false/null).\n // Only `true` passes; both `false` and `null` (unknown) skip the rule.\n for (const rule of rules) {\n // Check if the rule applies to this relationship\n if ('reltype' in rule.match) {\n const isReltypeMatch =\n rule.match.reltype === null || rel.type === rule.match.reltype;\n\n if (isReltypeMatch && evaluateWhere(rel, rule.where) === true) {\n // Merge the style properties (later rules override earlier ones)\n Object.assign(style, rule.apply);\n }\n }\n }\n\n return evaluateRelStyle(style, rel);\n };\n}\n\nexport type CompiledStyleRules = {\n byType: Map<string, (rel: RelData) => EvaluatedNvlRelationshipStyle>;\n styleMatchers: StyleMatchers;\n byLabelSet: (node: NodeData) => EvaluatedNvlNodeStyle;\n};\n\nexport const DEFAULT_REL_COLOR = tokens.palette.neutral['40'];\nconst NO_LABEL_FALLBACK_COLOR = tokens.palette.neutral['40'];\n\nfunction createByLabelSetFunction(\n styleMatchers: StyleMatchers,\n): (node: NodeData) => EvaluatedNvlNodeStyle {\n // Memoize default color by label string (idea 2: avoid recalculating per node)\n const defaultColorCache = new Map<string, string>();\n // Cache sorted rules by label set key (idea 1: avoid allocation + sort per node)\n const sortedRulesCache = new Map<string, StyleRule[]>();\n // Cache merged Style for where-free rule sets (idea 3: skip rule iteration entirely)\n const mergedStyleCache = new Map<string, Style>();\n\n return (node: NodeData) => {\n const labelSetKey = node.labelsSorted.join('\\0');\n\n // Fast path: if all rules for this label set are where-free,\n // the merged style is identical for every node with the same labels.\n const cachedStyle = mergedStyleCache.get(labelSetKey);\n if (cachedStyle !== undefined) {\n return evaluateNodeStyle(cachedStyle, node);\n }\n\n // Memoize default color by first label\n const labelForDefaultColor = node.labelsSorted[0] ?? null;\n let defaultColor: string;\n if (labelForDefaultColor === null) {\n defaultColor = NO_LABEL_FALLBACK_COLOR;\n } else {\n let cached = defaultColorCache.get(labelForDefaultColor);\n if (cached === undefined) {\n cached =\n calculateDefaultNodeColors(labelForDefaultColor).backgroundColor;\n defaultColorCache.set(labelForDefaultColor, cached);\n }\n defaultColor = cached;\n }\n\n // Cache sorted rules by label set (avoids repeated allocation + sort)\n let sortedRules = sortedRulesCache.get(labelSetKey);\n if (sortedRules === undefined) {\n const matchingRules: StyleRule[] = [...styleMatchers.globalLabelRules];\n for (const label of node.labelsSorted) {\n const labelRules = styleMatchers.rulesByLabel.get(label);\n if (labelRules) {\n matchingRules.push(...labelRules);\n }\n }\n sortedRules = matchingRules.toSorted(compareByPriorityAscending);\n sortedRulesCache.set(labelSetKey, sortedRules);\n }\n\n // Evaluate rules, tracking whether all are where-free\n const collectStyles: Style = { color: defaultColor };\n let isAllWhereFree = true;\n for (const rule of sortedRules) {\n if (rule.where !== undefined) {\n isAllWhereFree = false;\n if (evaluateWhere(node, rule.where) === true) {\n Object.assign(collectStyles, rule.apply);\n }\n } else {\n Object.assign(collectStyles, rule.apply);\n }\n }\n\n // When all rules are where-free, the merged style depends only on labels.\n // Cache it so subsequent nodes with the same label set skip rule iteration.\n if (isAllWhereFree) {\n mergedStyleCache.set(labelSetKey, collectStyles);\n }\n\n return evaluateNodeStyle(collectStyles, node);\n };\n}\n\nconst DEFAULT_REL_STYLE: StyleRule = {\n match: { reltype: null },\n apply: {\n color: DEFAULT_REL_COLOR,\n captions: [{ value: { useType: true } }],\n },\n};\n\nexport function compileStyleRules({\n reltypes,\n styleRules,\n}: {\n reltypes: string[];\n styleRules: StyleRule[] | null | undefined;\n}): CompiledStyleRules {\n const styleMatchers = collectStyleMatchers(styleRules);\n // as relationships can only have one type, we can use a map to store the style function for each type\n const byType = new Map<\n string,\n (rel: RelData) => EvaluatedNvlRelationshipStyle\n >();\n\n // Compile relationship type-based rules\n for (const reltype of reltypes) {\n const rules = styleMatchers.rulesByType.get(reltype) ?? [];\n byType.set(\n reltype,\n createRelStyleFunction([\n DEFAULT_REL_STYLE,\n ...styleMatchers.globalReltypeRules,\n ...rules,\n ]),\n );\n }\n\n const byLabelSet = createByLabelSetFunction(styleMatchers);\n\n return { byLabelSet, byType, styleMatchers };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compile-graph-styles.js","sourceRoot":"","sources":["../../../src/styling/compile-graph-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAyBzC,SAAS,0BAA0B,CAAC,CAAY,EAAE,CAAY;IAC5D,OAAO,CAAC,CAAC,QAAS,GAAG,CAAC,CAAC,QAAS,CAAC;AACnC,CAAC;AAED,SAAS,oBAAoB,CAC3B,MAAsC;IAEtC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAuB,CAAC;IACpD,MAAM,WAAW,GAAG,IAAI,GAAG,EAAuB,CAAC;IACnD,MAAM,gBAAgB,GAAgB,EAAE,CAAC;IACzC,MAAM,kBAAkB,GAAgB,EAAE,CAAC;IAE3C,0CAA0C;IAC1C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;QACtB,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,wBAAwB,CAAC,aAAa,CAAC,CAAC;IAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;AAC/C,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 { calculateDefaultNodeColors } from '@neo4j-devtools/word-color';\nimport { tokens } from '@neo4j-ndl/base';\n\nimport {\n type NodeData,\n type PortableProperty,\n type RelData,\n} from '../graph-visualization-context';\nimport {\n type Caption,\n type CypherValue,\n type EvaluatedNvlNodeStyle,\n type EvaluatedNvlRelationshipStyle,\n type Style,\n type StyleRule,\n type Value,\n type Where,\n} from './style-types';\n\ntype StyleMatchers = {\n globalLabelRules: StyleRule[];\n globalReltypeRules: StyleRule[];\n rulesByLabel: Map<string, StyleRule[]>;\n rulesByType: Map<string, StyleRule[]>;\n};\n\nfunction compareByPriorityAscending(a: StyleRule, b: StyleRule): number {\n return a.priority! - b.priority!;\n}\n\nfunction collectStyleMatchers(\n styles: StyleRule[] | null | undefined,\n): StyleMatchers {\n const rulesByLabel = new Map<string, StyleRule[]>();\n const rulesByType = new Map<string, StyleRule[]>();\n const globalLabelRules: StyleRule[] = [];\n const globalReltypeRules: StyleRule[] = [];\n\n // Handle null/undefined styles gracefully\n if (!styles || styles.length === 0) {\n return {\n globalLabelRules,\n globalReltypeRules,\n rulesByLabel,\n rulesByType,\n };\n }\n\n const totalRules = styles.length;\n\n styles.forEach((style, index) => {\n if (style.disabled ?? false) {\n return;\n }\n\n if (style.priority !== undefined && style.priority < 0) {\n throw new Error(\n `StyleRule priority must be >= 0, got ${style.priority}. Negative values are reserved for internal use.`,\n );\n }\n\n // Fill in priority if not set (negative values preserve original order)\n const { priority, ...rest } = style;\n const ruleWithPriority: StyleRule = {\n ...rest,\n priority: priority ?? index - totalRules,\n };\n\n // style for nodes\n if ('label' in style.match) {\n // if the label is null, it's a global rule (matches any node)\n if (style.match.label === null) {\n globalLabelRules.push(ruleWithPriority);\n } else {\n // Specific label rule\n const existing = rulesByLabel.get(style.match.label) ?? [];\n rulesByLabel.set(style.match.label, [...existing, ruleWithPriority]);\n }\n }\n\n // style for relationships\n if ('reltype' in style.match) {\n if (style.match.reltype === null) {\n // Global reltype rule (matches any relationship)\n globalReltypeRules.push(ruleWithPriority);\n } else {\n // Specific reltype rule\n const existing = rulesByType.get(style.match.reltype) ?? [];\n rulesByType.set(style.match.reltype, [...existing, ruleWithPriority]);\n }\n }\n });\n\n return {\n globalLabelRules,\n globalReltypeRules,\n rulesByLabel,\n rulesByType,\n };\n}\n\nfunction extractPropertyValue(\n prop: PortableProperty,\n): string | number | boolean | null {\n switch (prop.type) {\n case 'string':\n return JSON.parse(prop.stringified);\n case 'number':\n case 'integer':\n case 'float':\n return Number(prop.stringified);\n case 'boolean':\n case 'Boolean':\n return prop.stringified === 'true';\n case 'null':\n return null;\n default:\n return prop.stringified;\n }\n}\n\n/**\n * Three-valued logic type matching Cypher/SQL semantics.\n * - `true`: condition is satisfied\n * - `false`: condition is not satisfied\n * - `null`: condition is unknown (e.g., comparing with null/missing property)\n *\n * @see https://neo4j.com/docs/cypher-manual/current/values-and-types/working-with-null/\n */\ntype Ternary = boolean | null;\n\n/**\n * Evaluates a WHERE clause using three-valued logic matching Cypher semantics.\n *\n * From Neo4j Cypher Manual:\n * - Comparing any value to `null` results in `null`, not `true` or `false`\n * - Accessing a non-existent property returns `null`\n * - In WHERE clauses, only `true` passes; both `false` and `null` exclude the row\n *\n * Three-valued logic rules:\n * - NOT null → null\n * - true AND null → null, false AND null → false\n * - true OR null → true, false OR null → null\n *\n * @see https://neo4j.com/docs/cypher-manual/current/values-and-types/working-with-null/\n */\nfunction evaluateWhere(node: NodeData | RelData, where?: Where): Ternary {\n if (!where) {\n return true;\n }\n\n if ('equal' in where) {\n const [left, right] = where.equal;\n const leftVal = evaluateValue(left, node);\n const rightVal = evaluateValue(right, node);\n // In Cypher, null = null → null (not true)\n if (leftVal === null || rightVal === null) {\n return null;\n }\n return leftVal === rightVal;\n }\n\n if ('not' in where) {\n // Cypher: NOT null → null\n const isMatch = evaluateWhere(node, where.not);\n return isMatch === null ? null : !isMatch;\n }\n\n if ('lessThan' in where) {\n const [left, right] = where.lessThan;\n return safeCompare(left, right, node, (a, b) => a < b);\n }\n\n if ('lessThanOrEqual' in where) {\n const [left, right] = where.lessThanOrEqual;\n return safeCompare(left, right, node, (a, b) => a <= b);\n }\n\n if ('greaterThan' in where) {\n const [left, right] = where.greaterThan;\n return safeCompare(left, right, node, (a, b) => a > b);\n }\n\n if ('greaterThanOrEqual' in where) {\n const [left, right] = where.greaterThanOrEqual;\n return safeCompare(left, right, node, (a, b) => a >= b);\n }\n\n if ('contains' in where) {\n const [left, right] = where.contains;\n return safeStringCompare(left, right, node, (a, b) => a.includes(b));\n }\n\n if ('startsWith' in where) {\n const [left, right] = where.startsWith;\n return safeStringCompare(left, right, node, (a, b) => a.startsWith(b));\n }\n\n if ('endsWith' in where) {\n const [left, right] = where.endsWith;\n return safeStringCompare(left, right, node, (a, b) => a.endsWith(b));\n }\n\n if ('isNull' in where) {\n // IS NULL returns true/false (never null)\n const value = evaluateValue(where.isNull, node);\n return value === null;\n }\n\n if ('and' in where) {\n // Cypher three-valued AND:\n // - If any is false → false\n // - Else if any is null → null\n // - Else → true\n let hasNull = false;\n for (const r of where.and) {\n const isMatch = evaluateWhere(node, r);\n if (isMatch === false) {\n return false;\n }\n if (isMatch === null) {\n hasNull = true;\n }\n }\n return hasNull ? null : true;\n }\n\n if ('or' in where) {\n // Cypher three-valued OR:\n // - If any is true → true\n // - Else if any is null → null\n // - Else → false\n let hasNull = false;\n for (const r of where.or) {\n const isMatch = evaluateWhere(node, r);\n if (isMatch === true) {\n return true;\n }\n if (isMatch === null) {\n hasNull = true;\n }\n }\n return hasNull ? null : false;\n }\n\n if ('label' in where) {\n if ('labelsSorted' in node) {\n return where.label === null || node.labelsSorted.includes(where.label);\n }\n return false;\n }\n\n if ('reltype' in where) {\n if ('type' in node) {\n return where.reltype === null || (node as RelData).type === where.reltype;\n }\n return false;\n }\n\n if ('property' in where) {\n return where.property === null || where.property in node.properties;\n }\n\n return false;\n}\n\nfunction evaluateRelStyle(\n apply: Style,\n rel: RelData,\n): EvaluatedNvlRelationshipStyle {\n return {\n ...apply,\n captions: apply.captions?.map((caption) => {\n const { value, styles } = caption;\n\n if (typeof value === 'string' || value === undefined) {\n return { styles, value };\n }\n\n if ('useType' in value) {\n return { styles, value: rel.type };\n }\n\n if ('property' in value) {\n const prop = rel.properties[value.property];\n if (prop === undefined) {\n return { styles, value: '' };\n }\n\n const resolvedValue =\n prop.type === 'string'\n ? prop.stringified.slice(1, -1)\n : prop.stringified;\n\n return { styles, value: resolvedValue };\n }\n\n return { styles, value: rel.id };\n }),\n };\n}\n\n/**\n * Safely compare two values using Cypher's three-valued logic.\n * Returns `null` if either operand is null (matching Cypher semantics).\n *\n * From Neo4j Cypher Manual:\n * \"Comparing any value to `null` using `=` or `<>` results in `null`\"\n *\n * @see https://neo4j.com/docs/cypher-manual/current/values-and-types/working-with-null/\n */\nfunction safeCompare(\n left: Value,\n right: Value,\n graphItem: NodeData | RelData,\n compareFn: (\n a: NonNullable<CypherValue>,\n b: NonNullable<CypherValue>,\n ) => boolean,\n): Ternary {\n const leftVal = evaluateValue(left, graphItem);\n const rightVal = evaluateValue(right, graphItem);\n if (leftVal === null || rightVal === null) {\n return null;\n }\n return compareFn(leftVal, rightVal);\n}\n\n/**\n * String comparison using Cypher semantics.\n * Returns `null` if either operand is null OR not a string.\n *\n * From Neo4j Cypher Manual:\n * \"When these operators are applied to non-string values, they return `null`\n * instead of attempting type coercion.\"\n *\n * @see https://neo4j.com/docs/cypher-manual/current/expressions/predicates/string-operators/\n */\nfunction safeStringCompare(\n left: Value,\n right: Value,\n graphItem: NodeData | RelData,\n compareFn: (a: string, b: string) => boolean,\n): Ternary {\n const leftVal = evaluateValue(left, graphItem);\n const rightVal = evaluateValue(right, graphItem);\n // Return null if either is null or not a string (no type coercion)\n if (\n leftVal === null ||\n rightVal === null ||\n typeof leftVal !== 'string' ||\n typeof rightVal !== 'string'\n ) {\n return null;\n }\n return compareFn(leftVal, rightVal);\n}\n\nfunction evaluateValue(\n value: Value,\n graphItem: NodeData | RelData,\n): CypherValue {\n if (typeof value === 'object' && value !== null) {\n if ('property' in value) {\n if (value.property === null) {\n return null;\n }\n const prop = graphItem.properties[value.property];\n if (prop === undefined) {\n return null;\n }\n return extractPropertyValue(prop);\n }\n if ('label' in value) {\n if ('labelsSorted' in graphItem) {\n return (\n value.label === null || graphItem.labelsSorted.includes(value.label)\n );\n }\n return false;\n }\n if ('reltype' in value) {\n if ('type' in graphItem) {\n return (\n value.reltype === null ||\n (graphItem as RelData).type === value.reltype\n );\n }\n return false;\n }\n }\n\n return value;\n}\n\n// Default caption selection logic\nconst captionPriorityOrder = [\n /^name$/i,\n /^title$/i,\n /^label$/i,\n /name$/i,\n /description$/i,\n /^.+/,\n];\n\nfunction getDefaultNodeCaption(node: NodeData): Caption {\n const propertyKeys = Object.keys(node.properties);\n\n for (const regex of captionPriorityOrder) {\n const matchingKey = propertyKeys.find((key) => regex.test(key));\n if (matchingKey !== undefined) {\n const prop = node.properties[matchingKey];\n if (prop !== undefined) {\n return { value: { property: matchingKey } };\n }\n }\n }\n\n if (node.labelsSorted[0] !== undefined) {\n return { value: { useType: true } };\n }\n\n return { value: node.id };\n}\n\nfunction evaluateNodeStyle(\n apply: Style,\n node: NodeData,\n): EvaluatedNvlNodeStyle {\n return {\n ...apply,\n captions: (apply.captions ?? [getDefaultNodeCaption(node)]).map(\n (caption) => {\n const { value, styles } = caption;\n\n if (typeof value === 'string' || value === undefined) {\n return { styles, value };\n }\n\n if ('useType' in value) {\n return { styles, value: node.labelsSorted[0] };\n }\n\n if ('property' in value) {\n const prop = node.properties[value.property];\n if (prop === undefined) {\n return { styles, value: '' };\n }\n\n const resolvedValue =\n prop.type === 'string'\n ? prop.stringified.slice(1, -1)\n : prop.stringified;\n\n return { styles, value: resolvedValue };\n }\n\n return { styles, value: node.labelsSorted[0] };\n },\n ),\n };\n}\n\nfunction createRelStyleFunction(\n rules: StyleRule[],\n): (rel: RelData) => EvaluatedNvlRelationshipStyle {\n return (rel: RelData) => {\n const style: Style = {};\n\n // evaluateWhere uses Cypher-style three-valued logic (true/false/null).\n // Only `true` passes; both `false` and `null` (unknown) skip the rule.\n for (const rule of rules) {\n // Check if the rule applies to this relationship\n if ('reltype' in rule.match) {\n const isReltypeMatch =\n rule.match.reltype === null || rel.type === rule.match.reltype;\n\n if (isReltypeMatch && evaluateWhere(rel, rule.where) === true) {\n // Merge the style properties (later rules override earlier ones)\n Object.assign(style, rule.apply);\n }\n }\n }\n\n return evaluateRelStyle(style, rel);\n };\n}\n\nexport type CompiledStyleRules = {\n byType: (type: string) => (rel: RelData) => EvaluatedNvlRelationshipStyle;\n styleMatchers: StyleMatchers;\n byLabelSet: (node: NodeData) => EvaluatedNvlNodeStyle;\n};\n\nexport const DEFAULT_REL_COLOR = tokens.palette.neutral['40'];\nconst NO_LABEL_FALLBACK_COLOR = tokens.palette.neutral['40'];\n\nfunction createByLabelSetFunction(\n styleMatchers: StyleMatchers,\n): (node: NodeData) => EvaluatedNvlNodeStyle {\n const defaultColorCache = new Map<string, string>();\n const sortedRulesCache = new Map<string, StyleRule[]>();\n const mergedStyleCache = new Map<string, Style>();\n\n return (node: NodeData) => {\n const labelSetKey = node.labelsSorted.join('\\0');\n\n // Fast path: if all rules for this label set are where-free,\n // the merged style is identical for every node with the same labels.\n const cachedStyle = mergedStyleCache.get(labelSetKey);\n if (cachedStyle !== undefined) {\n return evaluateNodeStyle(cachedStyle, node);\n }\n\n // Memoize default color by first label\n const labelForDefaultColor = node.labelsSorted[0] ?? null;\n let defaultColor: string;\n if (labelForDefaultColor === null) {\n defaultColor = NO_LABEL_FALLBACK_COLOR;\n } else {\n let cached = defaultColorCache.get(labelForDefaultColor);\n if (cached === undefined) {\n cached =\n calculateDefaultNodeColors(labelForDefaultColor).backgroundColor;\n defaultColorCache.set(labelForDefaultColor, cached);\n }\n defaultColor = cached;\n }\n\n // Cache sorted rules by label set (avoids repeated allocation + sort)\n let sortedRules = sortedRulesCache.get(labelSetKey);\n if (sortedRules === undefined) {\n const matchingRules: StyleRule[] = [...styleMatchers.globalLabelRules];\n for (const label of node.labelsSorted) {\n const labelRules = styleMatchers.rulesByLabel.get(label);\n if (labelRules) {\n matchingRules.push(...labelRules);\n }\n }\n sortedRules = matchingRules.toSorted(compareByPriorityAscending);\n sortedRulesCache.set(labelSetKey, sortedRules);\n }\n\n // Evaluate rules, tracking whether all are where-free\n const collectStyles: Style = { color: defaultColor };\n let isAllWhereFree = true;\n for (const rule of sortedRules) {\n if (rule.where !== undefined) {\n isAllWhereFree = false;\n if (evaluateWhere(node, rule.where) === true) {\n Object.assign(collectStyles, rule.apply);\n }\n } else {\n Object.assign(collectStyles, rule.apply);\n }\n }\n\n // When all rules are where-free, the merged style depends only on labels.\n // Cache it so subsequent nodes with the same label set skip rule iteration.\n if (isAllWhereFree) {\n mergedStyleCache.set(labelSetKey, collectStyles);\n }\n\n return evaluateNodeStyle(collectStyles, node);\n };\n}\n\nconst DEFAULT_REL_STYLE: StyleRule = {\n match: { reltype: null },\n apply: {\n color: DEFAULT_REL_COLOR,\n captions: [{ value: { useType: true } }],\n },\n};\n\nexport function compileStyleRules(\n styleRules: StyleRule[] | null | undefined,\n): CompiledStyleRules {\n const styleMatchers = collectStyleMatchers(styleRules);\n\n // Lazily build and cache a style function per relationship type\n const cache = new Map<\n string,\n (rel: RelData) => EvaluatedNvlRelationshipStyle\n >();\n const byType = (type: string) => {\n let fn = cache.get(type);\n if (fn === undefined) {\n const rules = styleMatchers.rulesByType.get(type) ?? [];\n fn = createRelStyleFunction([\n DEFAULT_REL_STYLE,\n ...styleMatchers.globalReltypeRules,\n ...rules,\n ]);\n cache.set(type, fn);\n }\n return fn;\n };\n\n const byLabelSet = createByLabelSetFunction(styleMatchers);\n\n return { byLabelSet, byType, styleMatchers };\n}\n"]}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import { sortAlphabetically } from '../utils';
|
|
22
|
+
export const NO_LABEL = '(no label)';
|
|
23
|
+
function buildColorDistribution(colorCounts) {
|
|
24
|
+
return Object.entries(colorCounts)
|
|
25
|
+
.map(([color, count]) => ({ color, count }))
|
|
26
|
+
.sort((a, b) => b.count - a.count);
|
|
27
|
+
}
|
|
28
|
+
export function createVisualizationDataStructures(rawNodes, rawRels, compiledStyleRules) {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
const nodeData = {};
|
|
31
|
+
const labelColorCounts = {};
|
|
32
|
+
const labelTotalCounts = {};
|
|
33
|
+
// Single pass: extract data, apply styles, count colors
|
|
34
|
+
const styledNodes = rawNodes.map((rawNode) => {
|
|
35
|
+
var _a, _b, _c;
|
|
36
|
+
const data = {
|
|
37
|
+
id: rawNode.id,
|
|
38
|
+
labelsSorted: [...rawNode.labels].sort(sortAlphabetically),
|
|
39
|
+
properties: rawNode.properties,
|
|
40
|
+
};
|
|
41
|
+
nodeData[rawNode.id] = data;
|
|
42
|
+
const appliedStyle = compiledStyleRules.byLabelSet(data);
|
|
43
|
+
const styledNode = Object.assign(Object.assign(Object.assign(Object.assign({}, rawNode), { labels: undefined, properties: undefined }), appliedStyle), (rawNode.color !== undefined ? { color: rawNode.color } : {}));
|
|
44
|
+
// Accumulate color distribution
|
|
45
|
+
const labels = data.labelsSorted.length > 0 ? data.labelsSorted : [NO_LABEL];
|
|
46
|
+
const color = styledNode.color;
|
|
47
|
+
for (const label of labels) {
|
|
48
|
+
labelTotalCounts[label] = ((_a = labelTotalCounts[label]) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
49
|
+
if (color !== undefined) {
|
|
50
|
+
const counts = (_b = labelColorCounts[label]) !== null && _b !== void 0 ? _b : {};
|
|
51
|
+
counts[color] = ((_c = counts[color]) !== null && _c !== void 0 ? _c : 0) + 1;
|
|
52
|
+
labelColorCounts[label] = counts;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return styledNode;
|
|
56
|
+
});
|
|
57
|
+
const labels = Object.keys(labelTotalCounts).sort(sortAlphabetically);
|
|
58
|
+
const labelMetaData = {};
|
|
59
|
+
let hasMultipleColors = false;
|
|
60
|
+
for (const label of labels) {
|
|
61
|
+
const colorDistribution = buildColorDistribution((_a = labelColorCounts[label]) !== null && _a !== void 0 ? _a : {});
|
|
62
|
+
if (colorDistribution.length > 1) {
|
|
63
|
+
hasMultipleColors = true;
|
|
64
|
+
}
|
|
65
|
+
labelMetaData[label] = {
|
|
66
|
+
totalCount: labelTotalCounts[label],
|
|
67
|
+
colorDistribution,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const relData = {};
|
|
71
|
+
const relTypeCounts = {};
|
|
72
|
+
const relColorCounts = {};
|
|
73
|
+
// Single pass: extract data, apply styles, count colors
|
|
74
|
+
const styledRels = rawRels.map((rawRel) => {
|
|
75
|
+
var _a, _b, _c;
|
|
76
|
+
const data = {
|
|
77
|
+
id: rawRel.id,
|
|
78
|
+
properties: rawRel.properties,
|
|
79
|
+
type: rawRel.type,
|
|
80
|
+
};
|
|
81
|
+
relData[rawRel.id] = data;
|
|
82
|
+
const appliedStyle = compiledStyleRules.byType(data.type)(data);
|
|
83
|
+
const styledRel = Object.assign(Object.assign(Object.assign(Object.assign({}, rawRel), { properties: undefined, type: undefined }), appliedStyle), (rawRel.color !== undefined ? { color: rawRel.color } : {}));
|
|
84
|
+
// Accumulate color distribution and type counts
|
|
85
|
+
relTypeCounts[data.type] = ((_a = relTypeCounts[data.type]) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
86
|
+
const color = styledRel.color;
|
|
87
|
+
if (color !== undefined) {
|
|
88
|
+
const counts = (_b = relColorCounts[data.type]) !== null && _b !== void 0 ? _b : {};
|
|
89
|
+
counts[color] = ((_c = counts[color]) !== null && _c !== void 0 ? _c : 0) + 1;
|
|
90
|
+
relColorCounts[data.type] = counts;
|
|
91
|
+
}
|
|
92
|
+
return styledRel;
|
|
93
|
+
});
|
|
94
|
+
const reltypes = Object.keys(relTypeCounts).sort(sortAlphabetically);
|
|
95
|
+
const reltypeMetaData = {};
|
|
96
|
+
for (const type of reltypes) {
|
|
97
|
+
const colorDistribution = buildColorDistribution((_b = relColorCounts[type]) !== null && _b !== void 0 ? _b : {});
|
|
98
|
+
if (colorDistribution.length > 1) {
|
|
99
|
+
hasMultipleColors = true;
|
|
100
|
+
}
|
|
101
|
+
reltypeMetaData[type] = {
|
|
102
|
+
totalCount: relTypeCounts[type],
|
|
103
|
+
colorDistribution,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
metadataLookup: {
|
|
108
|
+
hasMultipleColors,
|
|
109
|
+
labelMetaData,
|
|
110
|
+
labels,
|
|
111
|
+
reltypeMetaData,
|
|
112
|
+
reltypes,
|
|
113
|
+
},
|
|
114
|
+
styledGraph: {
|
|
115
|
+
nodeData,
|
|
116
|
+
nodes: styledNodes,
|
|
117
|
+
relData,
|
|
118
|
+
rels: styledRels,
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=create-vis-data-structures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-vis-data-structures.js","sourceRoot":"","sources":["../../../src/styling/create-vis-data-structures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAYH,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC;AAErC,SAAS,sBAAsB,CAC7B,WAAmC;IAEnC,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC;SAC/B,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;SAC3C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,QAAmB,EACnB,OAAiB,EACjB,kBAAsC;;IAKtC,MAAM,QAAQ,GAA6B,EAAE,CAAC;IAC9C,MAAM,gBAAgB,GAA2C,EAAE,CAAC;IAC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EAAE,aAAa,CAAC,IAAI,CAAE;YAChC,iBAAiB;SAClB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,cAAc,EAAE;YACd,iBAAiB;YACjB,aAAa;YACb,MAAM;YACN,eAAe;YACf,QAAQ;SACT;QACD,WAAW,EAAE;YACX,QAAQ;YACR,KAAK,EAAE,WAAW;YAClB,OAAO;YACP,IAAI,EAAE,UAAU;SACjB;KACF,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 type {\n ColorCount,\n GraphItemMetaData,\n MetadataLookupTable,\n NeoNode,\n NeoRel,\n NodeData,\n NvlGraph,\n RelData,\n} from '../graph-visualization-context';\nimport { sortAlphabetically } from '../utils';\nimport type { CompiledStyleRules } from './compile-graph-styles';\n\nexport const NO_LABEL = '(no label)';\n\nfunction buildColorDistribution(\n colorCounts: Record<string, number>,\n): ColorCount[] {\n return Object.entries(colorCounts)\n .map(([color, count]) => ({ color, count }))\n .sort((a, b) => b.count - a.count);\n}\n\nexport function createVisualizationDataStructures(\n rawNodes: NeoNode[],\n rawRels: NeoRel[],\n compiledStyleRules: CompiledStyleRules,\n): {\n styledGraph: NvlGraph;\n metadataLookup: MetadataLookupTable;\n} {\n const nodeData: Record<string, NodeData> = {};\n const labelColorCounts: Record<string, Record<string, number>> = {};\n const labelTotalCounts: Record<string, number> = {};\n\n // Single pass: extract data, apply styles, count colors\n const styledNodes = rawNodes.map((rawNode) => {\n const data: NodeData = {\n id: rawNode.id,\n labelsSorted: [...rawNode.labels].sort(sortAlphabetically),\n properties: rawNode.properties,\n };\n nodeData[rawNode.id] = data;\n\n const appliedStyle = compiledStyleRules.byLabelSet(data);\n\n const styledNode = {\n ...rawNode,\n labels: undefined,\n properties: undefined,\n ...appliedStyle,\n // Consumer-set color on NeoNode takes precedence over style rules\n ...(rawNode.color !== undefined ? { color: rawNode.color } : {}),\n };\n\n // Accumulate color distribution\n const labels =\n data.labelsSorted.length > 0 ? data.labelsSorted : [NO_LABEL];\n const color = styledNode.color;\n\n for (const label of labels) {\n labelTotalCounts[label] = (labelTotalCounts[label] ?? 0) + 1;\n\n if (color !== undefined) {\n const counts = labelColorCounts[label] ?? {};\n counts[color] = (counts[color] ?? 0) + 1;\n labelColorCounts[label] = counts;\n }\n }\n\n return styledNode;\n });\n\n const labels = Object.keys(labelTotalCounts).sort(sortAlphabetically);\n const labelMetaData: Record<string, GraphItemMetaData> = {};\n let hasMultipleColors = false;\n for (const label of labels) {\n const colorDistribution = buildColorDistribution(\n labelColorCounts[label] ?? {},\n );\n if (colorDistribution.length > 1) {\n hasMultipleColors = true;\n }\n labelMetaData[label] = {\n totalCount: labelTotalCounts[label]!,\n colorDistribution,\n };\n }\n\n const relData: Record<string, RelData> = {};\n const relTypeCounts: Record<string, number> = {};\n const relColorCounts: Record<string, Record<string, number>> = {};\n\n // Single pass: extract data, apply styles, count colors\n const styledRels = rawRels.map((rawRel) => {\n const data: RelData = {\n id: rawRel.id,\n properties: rawRel.properties,\n type: rawRel.type,\n };\n relData[rawRel.id] = data;\n\n const appliedStyle = compiledStyleRules.byType(data.type)(data);\n\n const styledRel = {\n ...rawRel,\n properties: undefined,\n type: undefined,\n ...appliedStyle,\n // Consumer-set color on NeoRel takes precedence over style rules\n ...(rawRel.color !== undefined ? { color: rawRel.color } : {}),\n };\n\n // Accumulate color distribution and type counts\n relTypeCounts[data.type] = (relTypeCounts[data.type] ?? 0) + 1;\n const color = styledRel.color;\n if (color !== undefined) {\n const counts = relColorCounts[data.type] ?? {};\n counts[color] = (counts[color] ?? 0) + 1;\n relColorCounts[data.type] = counts;\n }\n\n return styledRel;\n });\n\n const reltypes = Object.keys(relTypeCounts).sort(sortAlphabetically);\n const reltypeMetaData: Record<string, GraphItemMetaData> = {};\n for (const type of reltypes) {\n const colorDistribution = buildColorDistribution(\n relColorCounts[type] ?? {},\n );\n if (colorDistribution.length > 1) {\n hasMultipleColors = true;\n }\n reltypeMetaData[type] = {\n totalCount: relTypeCounts[type]!,\n colorDistribution,\n };\n }\n\n return {\n metadataLookup: {\n hasMultipleColors,\n labelMetaData,\n labels,\n reltypeMetaData,\n reltypes,\n },\n styledGraph: {\n nodeData,\n nodes: styledNodes,\n relData,\n rels: styledRels,\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import { useMemo } from 'react';
|
|
22
|
+
import { compileStyleRules } from './compile-graph-styles';
|
|
23
|
+
import { createVisualizationDataStructures } from './create-vis-data-structures';
|
|
24
|
+
export function useGraphData(rawNodes, rawRels, styleRules) {
|
|
25
|
+
// Compile style rules — only re-runs when styleRules changes.
|
|
26
|
+
// Per-type relationship functions are built lazily on first access.
|
|
27
|
+
const compiledStyleRules = useMemo(() => compileStyleRules(styleRules), [styleRules]);
|
|
28
|
+
// Apply styles and build metadata — runs on every data change.
|
|
29
|
+
const { styledGraph, metadataLookup } = useMemo(() => createVisualizationDataStructures(rawNodes, rawRels, compiledStyleRules), [rawNodes, rawRels, compiledStyleRules]);
|
|
30
|
+
return { styledGraph, metadataLookup, compiledStyleRules };
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=use-graph-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-graph-data.js","sourceRoot":"","sources":["../../../src/styling/use-graph-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AAGjF,MAAM,UAAU,YAAY,CAC1B,QAAmB,EACnB,OAAiB,EACjB,UAAwB;IAExB,8DAA8D;IAC9D,oEAAoE;IACpE,MAAM,kBAAkB,GAAG,OAAO,CAChC,GAAG,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,EACnC,CAAC,UAAU,CAAC,CACb,CAAC;IAEF,+DAA+D;IAC/D,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,OAAO,CAC7C,GAAG,EAAE,CACH,iCAAiC,CAAC,QAAQ,EAAE,OAAO,EAAE,kBAAkB,CAAC,EAC1E,CAAC,QAAQ,EAAE,OAAO,EAAE,kBAAkB,CAAC,CACxC,CAAC;IAEF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC;AAC7D,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 type { NeoNode, NeoRel } from '../graph-visualization-context';\nimport { compileStyleRules } from './compile-graph-styles';\nimport { createVisualizationDataStructures } from './create-vis-data-structures';\nimport type { StyleRule } from './style-types';\n\nexport function useGraphData(\n rawNodes: NeoNode[],\n rawRels: NeoRel[],\n styleRules?: StyleRule[],\n) {\n // Compile style rules — only re-runs when styleRules changes.\n // Per-type relationship functions are built lazily on first access.\n const compiledStyleRules = useMemo(\n () => compileStyleRules(styleRules),\n [styleRules],\n );\n\n // Apply styles and build metadata — runs on every data change.\n const { styledGraph, metadataLookup } = useMemo(\n () =>\n createVisualizationDataStructures(rawNodes, rawRels, compiledStyleRules),\n [rawNodes, rawRels, compiledStyleRules],\n );\n\n return { styledGraph, metadataLookup, compiledStyleRules };\n}\n"]}
|