@neo4j-ndl/react-graph 2.1.1 → 2.1.2
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 +85 -20
- package/lib/cjs/graph-visualization-buttons.js.map +1 -1
- package/lib/esm/graph-visualization-buttons.js +85 -20
- package/lib/esm/graph-visualization-buttons.js.map +1 -1
- package/lib/types/graph-visualization-buttons.d.ts +13 -5
- package/lib/types/graph-visualization-buttons.d.ts.map +1 -1
- package/lib/types/graph-visualization.d.ts +58 -3
- package/lib/types/graph-visualization.d.ts.map +1 -1
- package/package.json +1 -1
- package/lib/cjs/stories/graph-visualization-barebones.story.js +0 -93
- package/lib/cjs/stories/graph-visualization-barebones.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-custom.story.js +0 -77
- package/lib/cjs/stories/graph-visualization-custom.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-default.story.js +0 -93
- package/lib/cjs/stories/graph-visualization-default.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-highlighting.story.js +0 -30
- package/lib/cjs/stories/graph-visualization-highlighting.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-maximalist.story.js +0 -107
- package/lib/cjs/stories/graph-visualization-maximalist.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-range-styling.story.js +0 -100
- package/lib/cjs/stories/graph-visualization-range-styling.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-rule-based-styling-advanced.story.js +0 -270
- package/lib/cjs/stories/graph-visualization-rule-based-styling-advanced.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-rule-based-styling-datetime.story.js +0 -181
- package/lib/cjs/stories/graph-visualization-rule-based-styling-datetime.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-rule-based-styling.story.js +0 -81
- package/lib/cjs/stories/graph-visualization-rule-based-styling.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-search.story.js +0 -36
- package/lib/cjs/stories/graph-visualization-search.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-simple-styling.story.js +0 -59
- package/lib/cjs/stories/graph-visualization-simple-styling.story.js.map +0 -1
- package/lib/cjs/stories/graph-visualization-unique-colors-styling.story.js +0 -71
- package/lib/cjs/stories/graph-visualization-unique-colors-styling.story.js.map +0 -1
- package/lib/cjs/stories/index.js +0 -80
- package/lib/cjs/stories/index.js.map +0 -1
- package/lib/cjs/stories/preview-graph-visualization.story.js +0 -68
- package/lib/cjs/stories/preview-graph-visualization.story.js.map +0 -1
- package/lib/cjs/stories/story-data.js +0 -992
- package/lib/cjs/stories/story-data.js.map +0 -1
- package/lib/esm/stories/graph-visualization-barebones.story.js +0 -90
- package/lib/esm/stories/graph-visualization-barebones.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-custom.story.js +0 -74
- package/lib/esm/stories/graph-visualization-custom.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-default.story.js +0 -90
- package/lib/esm/stories/graph-visualization-default.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-highlighting.story.js +0 -28
- package/lib/esm/stories/graph-visualization-highlighting.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-maximalist.story.js +0 -104
- package/lib/esm/stories/graph-visualization-maximalist.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-range-styling.story.js +0 -97
- package/lib/esm/stories/graph-visualization-range-styling.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-rule-based-styling-advanced.story.js +0 -267
- package/lib/esm/stories/graph-visualization-rule-based-styling-advanced.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-rule-based-styling-datetime.story.js +0 -178
- package/lib/esm/stories/graph-visualization-rule-based-styling-datetime.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-rule-based-styling.story.js +0 -78
- package/lib/esm/stories/graph-visualization-rule-based-styling.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-search.story.js +0 -34
- package/lib/esm/stories/graph-visualization-search.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-simple-styling.story.js +0 -56
- package/lib/esm/stories/graph-visualization-simple-styling.story.js.map +0 -1
- package/lib/esm/stories/graph-visualization-unique-colors-styling.story.js +0 -69
- package/lib/esm/stories/graph-visualization-unique-colors-styling.story.js.map +0 -1
- package/lib/esm/stories/index.js +0 -61
- package/lib/esm/stories/index.js.map +0 -1
- package/lib/esm/stories/preview-graph-visualization.story.js +0 -66
- package/lib/esm/stories/preview-graph-visualization.story.js.map +0 -1
- package/lib/esm/stories/story-data.js +0 -989
- package/lib/esm/stories/story-data.js.map +0 -1
- package/lib/types/stories/graph-visualization-barebones.story.d.ts +0 -24
- package/lib/types/stories/graph-visualization-barebones.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-custom.story.d.ts +0 -24
- package/lib/types/stories/graph-visualization-custom.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-default.story.d.ts +0 -24
- package/lib/types/stories/graph-visualization-default.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-highlighting.story.d.ts +0 -23
- package/lib/types/stories/graph-visualization-highlighting.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-maximalist.story.d.ts +0 -24
- package/lib/types/stories/graph-visualization-maximalist.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-range-styling.story.d.ts +0 -25
- package/lib/types/stories/graph-visualization-range-styling.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-rule-based-styling-advanced.story.d.ts +0 -33
- package/lib/types/stories/graph-visualization-rule-based-styling-advanced.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-rule-based-styling-datetime.story.d.ts +0 -25
- package/lib/types/stories/graph-visualization-rule-based-styling-datetime.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-rule-based-styling.story.d.ts +0 -25
- package/lib/types/stories/graph-visualization-rule-based-styling.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-search.story.d.ts +0 -23
- package/lib/types/stories/graph-visualization-search.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-simple-styling.story.d.ts +0 -25
- package/lib/types/stories/graph-visualization-simple-styling.story.d.ts.map +0 -1
- package/lib/types/stories/graph-visualization-unique-colors-styling.story.d.ts +0 -23
- package/lib/types/stories/graph-visualization-unique-colors-styling.story.d.ts.map +0 -1
- package/lib/types/stories/index.d.ts +0 -47
- package/lib/types/stories/index.d.ts.map +0 -1
- package/lib/types/stories/preview-graph-visualization.story.d.ts +0 -23
- package/lib/types/stories/preview-graph-visualization.story.d.ts.map +0 -1
- package/lib/types/stories/story-data.d.ts +0 -31
- package/lib/types/stories/story-data.d.ts.map +0 -1
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.containerClasses = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) "Neo4j"
|
|
8
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
9
|
-
*
|
|
10
|
-
* This file is part of Neo4j.
|
|
11
|
-
*
|
|
12
|
-
* Neo4j is free software: you can redistribute it and/or modify
|
|
13
|
-
* it under the terms of the GNU General Public License as published by
|
|
14
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
15
|
-
* (at your option) any later version.
|
|
16
|
-
*
|
|
17
|
-
* This program is distributed in the hope that it will be useful,
|
|
18
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20
|
-
* GNU General Public License for more details.
|
|
21
|
-
*
|
|
22
|
-
* You should have received a copy of the GNU General Public License
|
|
23
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
24
|
-
*/
|
|
25
|
-
const graph_visualization_1 = require("../graph-visualization");
|
|
26
|
-
const nodes = [
|
|
27
|
-
{
|
|
28
|
-
id: 'node1',
|
|
29
|
-
labels: ['Pokemon', 'Legendary'],
|
|
30
|
-
properties: {
|
|
31
|
-
durationToWinBattle: {
|
|
32
|
-
stringified: 'P0M0DT0.000000001S',
|
|
33
|
-
type: 'duration',
|
|
34
|
-
},
|
|
35
|
-
favoriteColors: {
|
|
36
|
-
stringified: '["red", "blue", "green"]',
|
|
37
|
-
type: 'list',
|
|
38
|
-
},
|
|
39
|
-
getsBeatBy: {
|
|
40
|
-
stringified: 'null',
|
|
41
|
-
type: 'null',
|
|
42
|
-
},
|
|
43
|
-
isAwesome: {
|
|
44
|
-
stringified: 'true',
|
|
45
|
-
type: 'boolean',
|
|
46
|
-
},
|
|
47
|
-
location: {
|
|
48
|
-
stringified: 'point({srid:1, x:100, y:200, z:300})',
|
|
49
|
-
type: 'point',
|
|
50
|
-
},
|
|
51
|
-
name: {
|
|
52
|
-
stringified: '"Rayquaza"',
|
|
53
|
-
type: 'string',
|
|
54
|
-
},
|
|
55
|
-
weight: {
|
|
56
|
-
stringified: '392.0',
|
|
57
|
-
type: 'float',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
id: 'node2',
|
|
63
|
-
labels: ['Type'],
|
|
64
|
-
properties: { name: { stringified: 'Dragon', type: 'String' } },
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
id: 'node3',
|
|
68
|
-
labels: ['Type'],
|
|
69
|
-
properties: { name: { stringified: 'Flying', type: 'String' } },
|
|
70
|
-
},
|
|
71
|
-
];
|
|
72
|
-
const rels = [
|
|
73
|
-
{
|
|
74
|
-
from: 'node1',
|
|
75
|
-
id: 'rel1',
|
|
76
|
-
properties: {},
|
|
77
|
-
to: 'node2',
|
|
78
|
-
type: 'HAS_TYPE',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
from: 'node1',
|
|
82
|
-
id: 'rel2',
|
|
83
|
-
properties: {},
|
|
84
|
-
to: 'node3',
|
|
85
|
-
type: 'HAS_TYPE',
|
|
86
|
-
},
|
|
87
|
-
];
|
|
88
|
-
exports.containerClasses = 'n-w-full n-border-neutral-border-weak n-mx-2 n-rounded-lg n-border';
|
|
89
|
-
const Component = () => {
|
|
90
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: { height: '600px' }, children: (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization, { nodes: nodes, rels: rels, className: exports.containerClasses }) }));
|
|
91
|
-
};
|
|
92
|
-
exports.default = Component;
|
|
93
|
-
//# sourceMappingURL=graph-visualization-default.story.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph-visualization-default.story.js","sourceRoot":"","sources":["../../../src/stories/graph-visualization-default.story.tsx"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,gEAA4D;AAG5D,MAAM,KAAK,GAAc;IACvB;QACE,EAAE,EAAE,OAAO;QACX,MAAM,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;QAChC,UAAU,EAAE;YACV,mBAAmB,EAAE;gBACnB,WAAW,EAAE,oBAAoB;gBACjC,IAAI,EAAE,UAAU;aACjB;YACD,cAAc,EAAE;gBACd,WAAW,EAAE,0BAA0B;gBACvC,IAAI,EAAE,MAAM;aACb;YACD,UAAU,EAAE;gBACV,WAAW,EAAE,MAAM;gBACnB,IAAI,EAAE,MAAM;aACb;YACD,SAAS,EAAE;gBACT,WAAW,EAAE,MAAM;gBACnB,IAAI,EAAE,SAAS;aAChB;YACD,QAAQ,EAAE;gBACR,WAAW,EAAE,sCAAsC;gBACnD,IAAI,EAAE,OAAO;aACd;YACD,IAAI,EAAE;gBACJ,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,QAAQ;aACf;YACD,MAAM,EAAE;gBACN,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;aACd;SACF;KACF;IACD;QACE,EAAE,EAAE,OAAO;QACX,MAAM,EAAE,CAAC,MAAM,CAAC;QAChB,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;KAChE;IACD;QACE,EAAE,EAAE,OAAO;QACX,MAAM,EAAE,CAAC,MAAM,CAAC;QAChB,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;KAChE;CACF,CAAC;AAEF,MAAM,IAAI,GAAG;IACX;QACE,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,MAAM;QACV,UAAU,EAAE,EAAE;QACd,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,UAAU;KACjB;IACD;QACE,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,MAAM;QACV,UAAU,EAAE,EAAE;QACd,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,UAAU;KACjB;CACF,CAAC;AACW,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAEvE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,gCAAK,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAC7B,uBAAC,wCAAkB,IACjB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,wBAAgB,GAC3B,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,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 { GraphVisualization } from '../graph-visualization';\nimport { type NeoNode } from '../graph-visualization-context';\n\nconst nodes: NeoNode[] = [\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\nconst 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];\nexport const containerClasses =\n 'n-w-full n-border-neutral-border-weak n-mx-2 n-rounded-lg n-border';\n\nconst Component = () => {\n return (\n <div style={{ height: '600px' }}>\n <GraphVisualization\n nodes={nodes}\n rels={rels}\n className={containerClasses}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) "Neo4j"
|
|
7
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
-
*
|
|
9
|
-
* This file is part of Neo4j.
|
|
10
|
-
*
|
|
11
|
-
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
-
* it under the terms of the GNU General Public License as published by
|
|
13
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
-
* (at your option) any later version.
|
|
15
|
-
*
|
|
16
|
-
* This program is distributed in the hope that it will be useful,
|
|
17
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
-
* GNU General Public License for more details.
|
|
20
|
-
*
|
|
21
|
-
* You should have received a copy of the GNU General Public License
|
|
22
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
-
*/
|
|
24
|
-
const graph_visualization_1 = require("../graph-visualization");
|
|
25
|
-
const story_data_1 = require("./story-data");
|
|
26
|
-
const Component = () => {
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: { height: '600px' }, children: (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization, { nodes: story_data_1.StoryGraph.nodes, rels: story_data_1.StoryGraph.rels, className: story_data_1.containerClasses, highlightedNodeIds: ['node1'], highlightedRelationshipIds: [] }) }));
|
|
28
|
-
};
|
|
29
|
-
exports.default = Component;
|
|
30
|
-
//# sourceMappingURL=graph-visualization-highlighting.story.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph-visualization-highlighting.story.js","sourceRoot":"","sources":["../../../src/stories/graph-visualization-highlighting.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,gEAA4D;AAC5D,6CAA4D;AAE5D,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,gCAAK,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAC7B,uBAAC,wCAAkB,IACjB,KAAK,EAAE,uBAAU,CAAC,KAAK,EACvB,IAAI,EAAE,uBAAU,CAAC,IAAI,EACrB,SAAS,EAAE,6BAAgB,EAC3B,kBAAkB,EAAE,CAAC,OAAO,CAAC,EAC7B,0BAA0B,EAAE,EAAE,GAC9B,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,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 { GraphVisualization } from '../graph-visualization';\nimport { containerClasses, StoryGraph } from './story-data';\n\nconst Component = () => {\n return (\n <div style={{ height: '600px' }}>\n <GraphVisualization\n nodes={StoryGraph.nodes}\n rels={StoryGraph.rels}\n className={containerClasses}\n highlightedNodeIds={['node1']} // Highlight only Rayquaza\n highlightedRelationshipIds={[]}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.containerClasses = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) "Neo4j"
|
|
8
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
9
|
-
*
|
|
10
|
-
* This file is part of Neo4j.
|
|
11
|
-
*
|
|
12
|
-
* Neo4j is free software: you can redistribute it and/or modify
|
|
13
|
-
* it under the terms of the GNU General Public License as published by
|
|
14
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
15
|
-
* (at your option) any later version.
|
|
16
|
-
*
|
|
17
|
-
* This program is distributed in the hope that it will be useful,
|
|
18
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20
|
-
* GNU General Public License for more details.
|
|
21
|
-
*
|
|
22
|
-
* You should have received a copy of the GNU General Public License
|
|
23
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
24
|
-
*/
|
|
25
|
-
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
-
const react_2 = require("react");
|
|
27
|
-
const graph_visualization_1 = require("../graph-visualization");
|
|
28
|
-
const nodes = [
|
|
29
|
-
{
|
|
30
|
-
id: 'node1',
|
|
31
|
-
labels: ['Pokemon', 'Legendary'],
|
|
32
|
-
properties: {
|
|
33
|
-
durationToWinBattle: {
|
|
34
|
-
stringified: 'P0M0DT0.000000001S',
|
|
35
|
-
type: 'duration',
|
|
36
|
-
},
|
|
37
|
-
favoriteColors: {
|
|
38
|
-
stringified: '["red", "blue", "green"]',
|
|
39
|
-
type: 'list',
|
|
40
|
-
},
|
|
41
|
-
getsBeatBy: {
|
|
42
|
-
stringified: 'null',
|
|
43
|
-
type: 'null',
|
|
44
|
-
},
|
|
45
|
-
isAwesome: {
|
|
46
|
-
stringified: 'true',
|
|
47
|
-
type: 'boolean',
|
|
48
|
-
},
|
|
49
|
-
location: {
|
|
50
|
-
stringified: 'point({srid:1, x:100, y:200, z:300})',
|
|
51
|
-
type: 'point',
|
|
52
|
-
},
|
|
53
|
-
name: {
|
|
54
|
-
stringified: '"Rayquaza"',
|
|
55
|
-
type: 'string',
|
|
56
|
-
},
|
|
57
|
-
weight: {
|
|
58
|
-
stringified: '392.0',
|
|
59
|
-
type: 'float',
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: 'node2',
|
|
65
|
-
labels: ['Type'],
|
|
66
|
-
properties: { name: { stringified: 'Dragon', type: 'String' } },
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
id: 'node3',
|
|
70
|
-
labels: ['Type'],
|
|
71
|
-
properties: { name: { stringified: 'Flying', type: 'String' } },
|
|
72
|
-
},
|
|
73
|
-
];
|
|
74
|
-
const rels = [
|
|
75
|
-
{
|
|
76
|
-
from: 'node1',
|
|
77
|
-
id: 'rel1',
|
|
78
|
-
properties: {},
|
|
79
|
-
to: 'node2',
|
|
80
|
-
type: 'HAS_TYPE',
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
from: 'node1',
|
|
84
|
-
id: 'rel2',
|
|
85
|
-
properties: {},
|
|
86
|
-
to: 'node3',
|
|
87
|
-
type: 'HAS_TYPE',
|
|
88
|
-
},
|
|
89
|
-
];
|
|
90
|
-
exports.containerClasses = 'n-w-full n-border-neutral-border-weak n-mx-2 n-rounded-lg n-border';
|
|
91
|
-
const Component = () => {
|
|
92
|
-
const [isOpen, setIsOpen] = (0, react_2.useState)(true);
|
|
93
|
-
const [gesture, setGesture] = (0, react_2.useState)('box');
|
|
94
|
-
// Hierarchical layout not working properly with storybook
|
|
95
|
-
const [layout, setLayout] = (0, react_2.useState)('hierarchical');
|
|
96
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: { height: '600px' }, children: (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization, { gesture: gesture, setGesture: setGesture, layout: layout, setLayout: setLayout, bottomRightIsland: (0, jsx_runtime_1.jsxs)(react_1.IconButtonArray, { size: "medium", children: [(0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization.GestureSelectButton, { menuPlacement: "top-end-bottom-end" }), (0, jsx_runtime_1.jsx)(react_1.Divider, { orientation: "vertical" }), (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization.ZoomInButton, { tooltipPlacement: "top" }), (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization.ZoomOutButton, { tooltipPlacement: "top" }), (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization.ZoomToFitButton, { tooltipPlacement: "top" }), (0, jsx_runtime_1.jsx)(react_1.Divider, { orientation: "vertical" }), (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization.LayoutSelectButton, { menuPlacement: "top-end-bottom-end" })] }), nodes: nodes, rels: rels, sidepanel: {
|
|
97
|
-
children: (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization.SingleSelectionSidePanelContents, {}),
|
|
98
|
-
isSidePanelOpen: isOpen,
|
|
99
|
-
onSidePanelResize: () => {
|
|
100
|
-
/* no op */
|
|
101
|
-
},
|
|
102
|
-
setIsSidePanelOpen: setIsOpen,
|
|
103
|
-
sidePanelWidth: 300,
|
|
104
|
-
}, topLeftIsland: (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization.DownloadButton, {}), topRightIsland: (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization.ToggleSidePanelButton, {}), className: exports.containerClasses }) }));
|
|
105
|
-
};
|
|
106
|
-
exports.default = Component;
|
|
107
|
-
//# sourceMappingURL=graph-visualization-maximalist.story.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph-visualization-maximalist.story.js","sourceRoot":"","sources":["../../../src/stories/graph-visualization-maximalist.story.tsx"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4CAA4D;AAE5D,iCAAiC;AAEjC,gEAA4D;AAG5D,MAAM,KAAK,GAAc;IACvB;QACE,EAAE,EAAE,OAAO;QACX,MAAM,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;QAChC,UAAU,EAAE;YACV,mBAAmB,EAAE;gBACnB,WAAW,EAAE,oBAAoB;gBACjC,IAAI,EAAE,UAAU;aACjB;YACD,cAAc,EAAE;gBACd,WAAW,EAAE,0BAA0B;gBACvC,IAAI,EAAE,MAAM;aACb;YACD,UAAU,EAAE;gBACV,WAAW,EAAE,MAAM;gBACnB,IAAI,EAAE,MAAM;aACb;YACD,SAAS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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 { Divider, IconButtonArray } from '@neo4j-ndl/react';\nimport { type Layout } from '@neo4j-nvl/base';\nimport { useState } from 'react';\n\nimport { GraphVisualization } from '../graph-visualization';\nimport { type Gesture, type NeoNode } from '../graph-visualization-context';\n\nconst nodes: NeoNode[] = [\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\nconst 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\nexport const containerClasses =\n 'n-w-full n-border-neutral-border-weak n-mx-2 n-rounded-lg n-border';\n\nconst Component = () => {\n const [isOpen, setIsOpen] = useState(true);\n const [gesture, setGesture] = useState<Gesture>('box');\n // Hierarchical layout not working properly with storybook\n const [layout, setLayout] = useState<Layout>('hierarchical');\n\n return (\n <div style={{ height: '600px' }}>\n <GraphVisualization\n gesture={gesture}\n setGesture={setGesture}\n layout={layout}\n setLayout={setLayout}\n bottomRightIsland={\n <IconButtonArray size=\"medium\">\n <GraphVisualization.GestureSelectButton menuPlacement=\"top-end-bottom-end\" />\n <Divider orientation=\"vertical\" />\n <GraphVisualization.ZoomInButton tooltipPlacement=\"top\" />\n <GraphVisualization.ZoomOutButton tooltipPlacement=\"top\" />\n <GraphVisualization.ZoomToFitButton tooltipPlacement=\"top\" />\n <Divider orientation=\"vertical\" />\n <GraphVisualization.LayoutSelectButton menuPlacement=\"top-end-bottom-end\" />\n </IconButtonArray>\n }\n nodes={nodes}\n rels={rels}\n sidepanel={{\n children: <GraphVisualization.SingleSelectionSidePanelContents />,\n isSidePanelOpen: isOpen,\n onSidePanelResize: () => {\n /* no op */\n },\n setIsSidePanelOpen: setIsOpen,\n sidePanelWidth: 300,\n }}\n topLeftIsland={<GraphVisualization.DownloadButton />}\n topRightIsland={<GraphVisualization.ToggleSidePanelButton />}\n className={containerClasses}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.colorRangeStyleRules = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) "Neo4j"
|
|
8
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
9
|
-
*
|
|
10
|
-
* This file is part of Neo4j.
|
|
11
|
-
*
|
|
12
|
-
* Neo4j is free software: you can redistribute it and/or modify
|
|
13
|
-
* it under the terms of the GNU General Public License as published by
|
|
14
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
15
|
-
* (at your option) any later version.
|
|
16
|
-
*
|
|
17
|
-
* This program is distributed in the hope that it will be useful,
|
|
18
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20
|
-
* GNU General Public License for more details.
|
|
21
|
-
*
|
|
22
|
-
* You should have received a copy of the GNU General Public License
|
|
23
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
24
|
-
*/
|
|
25
|
-
const graph_visualization_1 = require("../graph-visualization");
|
|
26
|
-
const story_data_1 = require("./story-data");
|
|
27
|
-
const pokemonRules = [
|
|
28
|
-
{
|
|
29
|
-
apply: {
|
|
30
|
-
captions: {
|
|
31
|
-
text: [
|
|
32
|
-
{ styles: ['bold'], value: { property: 'name' } },
|
|
33
|
-
{ styles: [], value: ' Lv' },
|
|
34
|
-
{ styles: [], value: { property: 'level' } },
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
colorRange: {
|
|
38
|
-
maxColor: '#e74c3c',
|
|
39
|
-
maxValue: 88,
|
|
40
|
-
midColor: '#f1c40f',
|
|
41
|
-
midValue: 45,
|
|
42
|
-
minColor: '#3498db',
|
|
43
|
-
minValue: 1,
|
|
44
|
-
onProperty: 'level',
|
|
45
|
-
},
|
|
46
|
-
sizeRange: {
|
|
47
|
-
maxSize: 50,
|
|
48
|
-
maxValue: 88,
|
|
49
|
-
minSize: 20,
|
|
50
|
-
minValue: 1,
|
|
51
|
-
onProperty: 'level',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
match: { label: 'Pokemon' },
|
|
55
|
-
},
|
|
56
|
-
];
|
|
57
|
-
const caughtRelRules = [
|
|
58
|
-
{
|
|
59
|
-
apply: {
|
|
60
|
-
captions: {
|
|
61
|
-
size: 1.5,
|
|
62
|
-
text: [
|
|
63
|
-
{ styles: [], value: 'Caught @ Lv' },
|
|
64
|
-
{ styles: ['bold'], value: { property: 'level' } },
|
|
65
|
-
],
|
|
66
|
-
},
|
|
67
|
-
colorRange: {
|
|
68
|
-
maxColor: '#ff2d78',
|
|
69
|
-
maxValue: 40,
|
|
70
|
-
minColor: '#00d2ff',
|
|
71
|
-
minValue: 1,
|
|
72
|
-
onProperty: 'level',
|
|
73
|
-
},
|
|
74
|
-
width: { value: 4 },
|
|
75
|
-
widthRange: {
|
|
76
|
-
maxValue: 40,
|
|
77
|
-
maxWidth: 8,
|
|
78
|
-
minValue: 1,
|
|
79
|
-
minWidth: 1,
|
|
80
|
-
onProperty: 'level',
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
match: { reltype: 'CAUGHT' },
|
|
84
|
-
},
|
|
85
|
-
];
|
|
86
|
-
const otherNodeRules = [
|
|
87
|
-
{ apply: { color: { value: '#95a5a6' } }, match: { label: 'Trainer' } },
|
|
88
|
-
{ apply: { color: { value: '#bdc3c7' } }, match: { label: 'Type' } },
|
|
89
|
-
{ apply: { color: { value: '#bdc3c7' } }, match: { label: 'Gym' } },
|
|
90
|
-
];
|
|
91
|
-
exports.colorRangeStyleRules = [
|
|
92
|
-
...pokemonRules,
|
|
93
|
-
...caughtRelRules,
|
|
94
|
-
...otherNodeRules,
|
|
95
|
-
];
|
|
96
|
-
const Component = () => {
|
|
97
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: { height: '600px' }, children: (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization, { nodes: story_data_1.advancedStoryGraph.nodes, rels: story_data_1.advancedStoryGraph.rels, className: story_data_1.containerClasses, styleRules: exports.colorRangeStyleRules }) }));
|
|
98
|
-
};
|
|
99
|
-
exports.default = Component;
|
|
100
|
-
//# sourceMappingURL=graph-visualization-range-styling.story.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph-visualization-range-styling.story.js","sourceRoot":"","sources":["../../../src/stories/graph-visualization-range-styling.story.tsx"],"names":[],"mappings":";;;;AAAA;;;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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 { GraphVisualization } from '../graph-visualization';\nimport { type GraphStyleRule } from '../styling/style-types';\nimport { advancedStoryGraph, containerClasses } from './story-data';\n\nconst pokemonRules: GraphStyleRule[] = [\n {\n apply: {\n captions: {\n text: [\n { styles: ['bold'], value: { property: 'name' } },\n { styles: [], value: ' Lv' },\n { styles: [], value: { property: 'level' } },\n ],\n },\n colorRange: {\n maxColor: '#e74c3c',\n maxValue: 88,\n midColor: '#f1c40f',\n midValue: 45,\n minColor: '#3498db',\n minValue: 1,\n onProperty: 'level',\n },\n sizeRange: {\n maxSize: 50,\n maxValue: 88,\n minSize: 20,\n minValue: 1,\n onProperty: 'level',\n },\n },\n match: { label: 'Pokemon' },\n },\n];\n\nconst caughtRelRules: GraphStyleRule[] = [\n {\n apply: {\n captions: {\n size: 1.5,\n text: [\n { styles: [], value: 'Caught @ Lv' },\n { styles: ['bold'], value: { property: 'level' } },\n ],\n },\n colorRange: {\n maxColor: '#ff2d78',\n maxValue: 40,\n minColor: '#00d2ff',\n minValue: 1,\n onProperty: 'level',\n },\n width: { value: 4 },\n widthRange: {\n maxValue: 40,\n maxWidth: 8,\n minValue: 1,\n minWidth: 1,\n onProperty: 'level',\n },\n },\n match: { reltype: 'CAUGHT' },\n },\n];\n\nconst otherNodeRules: GraphStyleRule[] = [\n { apply: { color: { value: '#95a5a6' } }, match: { label: 'Trainer' } },\n { apply: { color: { value: '#bdc3c7' } }, match: { label: 'Type' } },\n { apply: { color: { value: '#bdc3c7' } }, match: { label: 'Gym' } },\n];\n\nexport const colorRangeStyleRules: GraphStyleRule[] = [\n ...pokemonRules,\n ...caughtRelRules,\n ...otherNodeRules,\n];\n\nconst Component = () => {\n return (\n <div style={{ height: '600px' }}>\n <GraphVisualization\n nodes={advancedStoryGraph.nodes}\n rels={advancedStoryGraph.rels}\n className={containerClasses}\n styleRules={colorRangeStyleRules}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.advancedStyleRules = exports.evolvesToRelRules = exports.caughtRelRules = exports.battledRelRules = exports.gymRules = exports.typeRules = exports.pokemonRules = exports.trainerRules = exports.defaultNodeRules = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) "Neo4j"
|
|
8
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
9
|
-
*
|
|
10
|
-
* This file is part of Neo4j.
|
|
11
|
-
*
|
|
12
|
-
* Neo4j is free software: you can redistribute it and/or modify
|
|
13
|
-
* it under the terms of the GNU General Public License as published by
|
|
14
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
15
|
-
* (at your option) any later version.
|
|
16
|
-
*
|
|
17
|
-
* This program is distributed in the hope that it will be useful,
|
|
18
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20
|
-
* GNU General Public License for more details.
|
|
21
|
-
*
|
|
22
|
-
* You should have received a copy of the GNU General Public License
|
|
23
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
24
|
-
*/
|
|
25
|
-
const graph_visualization_1 = require("../graph-visualization");
|
|
26
|
-
const story_data_1 = require("./story-data");
|
|
27
|
-
exports.defaultNodeRules = [
|
|
28
|
-
{
|
|
29
|
-
match: { label: null },
|
|
30
|
-
apply: { size: { value: 10 } },
|
|
31
|
-
},
|
|
32
|
-
];
|
|
33
|
-
exports.trainerRules = [
|
|
34
|
-
{
|
|
35
|
-
match: { label: 'Trainer' },
|
|
36
|
-
where: { equal: [{ property: 'reputation' }, 'Gym Leader'] },
|
|
37
|
-
priority: 20, // Gym Leaders are special - should override level-based styling
|
|
38
|
-
apply: {
|
|
39
|
-
color: { value: '#9b59b6' },
|
|
40
|
-
captions: {
|
|
41
|
-
text: [
|
|
42
|
-
{ value: { property: 'name' }, styles: ['bold'] },
|
|
43
|
-
{ value: ' 🏆', styles: [] },
|
|
44
|
-
{ value: ' Gym Leader', styles: ['italic'] },
|
|
45
|
-
],
|
|
46
|
-
align: 'bottom',
|
|
47
|
-
},
|
|
48
|
-
size: { value: 45 },
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
match: { label: 'Trainer' },
|
|
53
|
-
where: { greaterThanOrEqual: [{ property: 'level' }, 85] },
|
|
54
|
-
priority: 10, // Base high-level styling
|
|
55
|
-
apply: {
|
|
56
|
-
size: { value: 30 },
|
|
57
|
-
captions: {
|
|
58
|
-
text: [
|
|
59
|
-
{ value: { property: 'name' }, styles: ['bold'] },
|
|
60
|
-
{ value: ' (Lv ', styles: [] },
|
|
61
|
-
{ value: { property: 'level' }, styles: [] },
|
|
62
|
-
{ value: ')', styles: [] },
|
|
63
|
-
],
|
|
64
|
-
size: 2,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
];
|
|
69
|
-
exports.pokemonRules = [
|
|
70
|
-
// Make the 'saur family green is our highest priority
|
|
71
|
-
{
|
|
72
|
-
match: { label: 'Pokemon' },
|
|
73
|
-
where: { endsWith: [{ property: 'name' }, 'saur'] },
|
|
74
|
-
priority: 50,
|
|
75
|
-
apply: {
|
|
76
|
-
color: { value: '#2ecc71' },
|
|
77
|
-
captions: {
|
|
78
|
-
text: [
|
|
79
|
-
{ value: '🌿 ', styles: [] },
|
|
80
|
-
{ value: { property: 'name' }, styles: ['bold', 'italic'] },
|
|
81
|
-
],
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
match: { label: 'Pokemon' },
|
|
87
|
-
where: { equal: [{ property: 'is_starter' }, true] },
|
|
88
|
-
apply: {
|
|
89
|
-
color: { value: '#f39c12' },
|
|
90
|
-
captions: {
|
|
91
|
-
text: [
|
|
92
|
-
{ value: { property: 'name' }, styles: ['bold'] },
|
|
93
|
-
{ value: ' ⭐', styles: [] },
|
|
94
|
-
],
|
|
95
|
-
},
|
|
96
|
-
size: { value: 40 },
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
match: { label: 'Pokemon' },
|
|
101
|
-
where: { greaterThanOrEqual: [{ property: 'level' }, 85] },
|
|
102
|
-
priority: 30, // High-level Pokemon override starter styling
|
|
103
|
-
apply: {
|
|
104
|
-
color: { value: '#c0392b' },
|
|
105
|
-
captions: {
|
|
106
|
-
text: [
|
|
107
|
-
{ value: '💪 ', styles: [] },
|
|
108
|
-
{ value: { property: 'name' }, styles: ['bold'] },
|
|
109
|
-
{ value: ' Lv', styles: [] },
|
|
110
|
-
{ value: { property: 'level' }, styles: [] },
|
|
111
|
-
],
|
|
112
|
-
},
|
|
113
|
-
size: { value: 42 },
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
match: { label: 'Pokemon' },
|
|
118
|
-
where: { lessThan: [{ property: 'catch_rate' }, 50] },
|
|
119
|
-
priority: 40, // Rare caption is our second highest priority
|
|
120
|
-
apply: {
|
|
121
|
-
captions: {
|
|
122
|
-
text: [
|
|
123
|
-
{ value: { property: 'name' }, styles: ['bold'] },
|
|
124
|
-
{ value: ' (Rare)', styles: ['italic'] },
|
|
125
|
-
],
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
match: { label: 'Pokemon' },
|
|
131
|
-
where: {
|
|
132
|
-
and: [
|
|
133
|
-
{ lessThan: [{ property: 'level' }, 10] },
|
|
134
|
-
{ not: { equal: [{ property: 'is_starter' }, true] } },
|
|
135
|
-
],
|
|
136
|
-
},
|
|
137
|
-
priority: 15, // Baby Pokemon get special styling
|
|
138
|
-
apply: {
|
|
139
|
-
size: { value: 25 },
|
|
140
|
-
color: { value: '#95a5a6' },
|
|
141
|
-
captions: {
|
|
142
|
-
text: [
|
|
143
|
-
{ value: { property: 'name' }, styles: ['italic'] },
|
|
144
|
-
{ value: ' (Smol)', styles: [] },
|
|
145
|
-
],
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
];
|
|
150
|
-
exports.typeRules = [
|
|
151
|
-
{
|
|
152
|
-
match: { label: 'Type' },
|
|
153
|
-
where: {
|
|
154
|
-
or: [
|
|
155
|
-
{ equal: [{ property: 'name' }, 'Grass'] },
|
|
156
|
-
{ equal: [{ property: 'name' }, 'Poison'] },
|
|
157
|
-
],
|
|
158
|
-
},
|
|
159
|
-
apply: {
|
|
160
|
-
color: { value: '#27ae60' },
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
];
|
|
164
|
-
exports.gymRules = [
|
|
165
|
-
{
|
|
166
|
-
match: { label: 'Gym' },
|
|
167
|
-
apply: {
|
|
168
|
-
color: { value: '#8e44ad' },
|
|
169
|
-
size: { value: 48 },
|
|
170
|
-
captions: {
|
|
171
|
-
text: [
|
|
172
|
-
{ value: '🏛️ ', styles: [] },
|
|
173
|
-
{ value: { property: 'name' }, styles: ['bold', 'underline'] },
|
|
174
|
-
],
|
|
175
|
-
align: 'top',
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
];
|
|
180
|
-
exports.battledRelRules = [
|
|
181
|
-
{
|
|
182
|
-
match: { reltype: 'BATTLED' },
|
|
183
|
-
where: { equal: [{ property: 'won' }, true] },
|
|
184
|
-
apply: {
|
|
185
|
-
color: { value: '#27ae60' },
|
|
186
|
-
width: { value: 4 },
|
|
187
|
-
captions: { text: [{ value: 'WON BATTLE', styles: ['bold'] }], size: 2 },
|
|
188
|
-
},
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
match: { reltype: 'BATTLED' },
|
|
192
|
-
where: { equal: [{ property: 'won' }, false] },
|
|
193
|
-
apply: {
|
|
194
|
-
color: { value: '#e74c3c' },
|
|
195
|
-
width: { value: 2 },
|
|
196
|
-
captions: {
|
|
197
|
-
text: [{ value: 'LOST BATTLE', styles: ['italic'] }],
|
|
198
|
-
size: 2,
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
];
|
|
203
|
-
exports.caughtRelRules = [
|
|
204
|
-
{
|
|
205
|
-
match: { reltype: 'CAUGHT' },
|
|
206
|
-
apply: {
|
|
207
|
-
color: { value: '#e91e63' },
|
|
208
|
-
width: { value: 3 },
|
|
209
|
-
captions: {
|
|
210
|
-
text: [
|
|
211
|
-
{ value: 'Caught @ Lv', styles: [] },
|
|
212
|
-
{ value: { property: 'level' }, styles: ['bold'] },
|
|
213
|
-
],
|
|
214
|
-
size: 1.5,
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
];
|
|
219
|
-
exports.evolvesToRelRules = [
|
|
220
|
-
{
|
|
221
|
-
match: { reltype: 'EVOLVES_TO' },
|
|
222
|
-
apply: {
|
|
223
|
-
color: { value: '#16a085' },
|
|
224
|
-
width: { value: 2 },
|
|
225
|
-
captions: { text: [{ value: '→', styles: ['bold'] }] },
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
match: { reltype: 'EVOLVES_TO' },
|
|
230
|
-
where: { equal: [{ property: 'method' }, 'Level'] },
|
|
231
|
-
priority: 1,
|
|
232
|
-
apply: {
|
|
233
|
-
captions: {
|
|
234
|
-
text: [
|
|
235
|
-
{ value: '→ Lv', styles: [] },
|
|
236
|
-
{ value: { property: 'level' }, styles: ['bold'] },
|
|
237
|
-
],
|
|
238
|
-
},
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
match: { reltype: 'EVOLVES_TO' },
|
|
243
|
-
where: { not: { equal: [{ property: 'method' }, 'Level'] } },
|
|
244
|
-
priority: 1,
|
|
245
|
-
apply: {
|
|
246
|
-
color: { value: '#8e44ad' },
|
|
247
|
-
captions: {
|
|
248
|
-
text: [
|
|
249
|
-
{ value: '→ ', styles: [] },
|
|
250
|
-
{ value: { property: 'method' }, styles: ['italic'] },
|
|
251
|
-
],
|
|
252
|
-
},
|
|
253
|
-
},
|
|
254
|
-
},
|
|
255
|
-
];
|
|
256
|
-
exports.advancedStyleRules = [
|
|
257
|
-
...exports.defaultNodeRules,
|
|
258
|
-
...exports.trainerRules,
|
|
259
|
-
...exports.pokemonRules,
|
|
260
|
-
...exports.typeRules,
|
|
261
|
-
...exports.gymRules,
|
|
262
|
-
...exports.battledRelRules,
|
|
263
|
-
...exports.caughtRelRules,
|
|
264
|
-
...exports.evolvesToRelRules,
|
|
265
|
-
];
|
|
266
|
-
const Component = () => {
|
|
267
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: { height: '600px' }, children: (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization, { nodes: story_data_1.advancedStoryGraph.nodes, rels: story_data_1.advancedStoryGraph.rels, className: story_data_1.containerClasses, styleRules: exports.advancedStyleRules }) }));
|
|
268
|
-
};
|
|
269
|
-
exports.default = Component;
|
|
270
|
-
//# sourceMappingURL=graph-visualization-rule-based-styling-advanced.story.js.map
|