@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.
Files changed (99) hide show
  1. package/lib/cjs/graph-visualization-buttons.js +85 -20
  2. package/lib/cjs/graph-visualization-buttons.js.map +1 -1
  3. package/lib/esm/graph-visualization-buttons.js +85 -20
  4. package/lib/esm/graph-visualization-buttons.js.map +1 -1
  5. package/lib/types/graph-visualization-buttons.d.ts +13 -5
  6. package/lib/types/graph-visualization-buttons.d.ts.map +1 -1
  7. package/lib/types/graph-visualization.d.ts +58 -3
  8. package/lib/types/graph-visualization.d.ts.map +1 -1
  9. package/package.json +1 -1
  10. package/lib/cjs/stories/graph-visualization-barebones.story.js +0 -93
  11. package/lib/cjs/stories/graph-visualization-barebones.story.js.map +0 -1
  12. package/lib/cjs/stories/graph-visualization-custom.story.js +0 -77
  13. package/lib/cjs/stories/graph-visualization-custom.story.js.map +0 -1
  14. package/lib/cjs/stories/graph-visualization-default.story.js +0 -93
  15. package/lib/cjs/stories/graph-visualization-default.story.js.map +0 -1
  16. package/lib/cjs/stories/graph-visualization-highlighting.story.js +0 -30
  17. package/lib/cjs/stories/graph-visualization-highlighting.story.js.map +0 -1
  18. package/lib/cjs/stories/graph-visualization-maximalist.story.js +0 -107
  19. package/lib/cjs/stories/graph-visualization-maximalist.story.js.map +0 -1
  20. package/lib/cjs/stories/graph-visualization-range-styling.story.js +0 -100
  21. package/lib/cjs/stories/graph-visualization-range-styling.story.js.map +0 -1
  22. package/lib/cjs/stories/graph-visualization-rule-based-styling-advanced.story.js +0 -270
  23. package/lib/cjs/stories/graph-visualization-rule-based-styling-advanced.story.js.map +0 -1
  24. package/lib/cjs/stories/graph-visualization-rule-based-styling-datetime.story.js +0 -181
  25. package/lib/cjs/stories/graph-visualization-rule-based-styling-datetime.story.js.map +0 -1
  26. package/lib/cjs/stories/graph-visualization-rule-based-styling.story.js +0 -81
  27. package/lib/cjs/stories/graph-visualization-rule-based-styling.story.js.map +0 -1
  28. package/lib/cjs/stories/graph-visualization-search.story.js +0 -36
  29. package/lib/cjs/stories/graph-visualization-search.story.js.map +0 -1
  30. package/lib/cjs/stories/graph-visualization-simple-styling.story.js +0 -59
  31. package/lib/cjs/stories/graph-visualization-simple-styling.story.js.map +0 -1
  32. package/lib/cjs/stories/graph-visualization-unique-colors-styling.story.js +0 -71
  33. package/lib/cjs/stories/graph-visualization-unique-colors-styling.story.js.map +0 -1
  34. package/lib/cjs/stories/index.js +0 -80
  35. package/lib/cjs/stories/index.js.map +0 -1
  36. package/lib/cjs/stories/preview-graph-visualization.story.js +0 -68
  37. package/lib/cjs/stories/preview-graph-visualization.story.js.map +0 -1
  38. package/lib/cjs/stories/story-data.js +0 -992
  39. package/lib/cjs/stories/story-data.js.map +0 -1
  40. package/lib/esm/stories/graph-visualization-barebones.story.js +0 -90
  41. package/lib/esm/stories/graph-visualization-barebones.story.js.map +0 -1
  42. package/lib/esm/stories/graph-visualization-custom.story.js +0 -74
  43. package/lib/esm/stories/graph-visualization-custom.story.js.map +0 -1
  44. package/lib/esm/stories/graph-visualization-default.story.js +0 -90
  45. package/lib/esm/stories/graph-visualization-default.story.js.map +0 -1
  46. package/lib/esm/stories/graph-visualization-highlighting.story.js +0 -28
  47. package/lib/esm/stories/graph-visualization-highlighting.story.js.map +0 -1
  48. package/lib/esm/stories/graph-visualization-maximalist.story.js +0 -104
  49. package/lib/esm/stories/graph-visualization-maximalist.story.js.map +0 -1
  50. package/lib/esm/stories/graph-visualization-range-styling.story.js +0 -97
  51. package/lib/esm/stories/graph-visualization-range-styling.story.js.map +0 -1
  52. package/lib/esm/stories/graph-visualization-rule-based-styling-advanced.story.js +0 -267
  53. package/lib/esm/stories/graph-visualization-rule-based-styling-advanced.story.js.map +0 -1
  54. package/lib/esm/stories/graph-visualization-rule-based-styling-datetime.story.js +0 -178
  55. package/lib/esm/stories/graph-visualization-rule-based-styling-datetime.story.js.map +0 -1
  56. package/lib/esm/stories/graph-visualization-rule-based-styling.story.js +0 -78
  57. package/lib/esm/stories/graph-visualization-rule-based-styling.story.js.map +0 -1
  58. package/lib/esm/stories/graph-visualization-search.story.js +0 -34
  59. package/lib/esm/stories/graph-visualization-search.story.js.map +0 -1
  60. package/lib/esm/stories/graph-visualization-simple-styling.story.js +0 -56
  61. package/lib/esm/stories/graph-visualization-simple-styling.story.js.map +0 -1
  62. package/lib/esm/stories/graph-visualization-unique-colors-styling.story.js +0 -69
  63. package/lib/esm/stories/graph-visualization-unique-colors-styling.story.js.map +0 -1
  64. package/lib/esm/stories/index.js +0 -61
  65. package/lib/esm/stories/index.js.map +0 -1
  66. package/lib/esm/stories/preview-graph-visualization.story.js +0 -66
  67. package/lib/esm/stories/preview-graph-visualization.story.js.map +0 -1
  68. package/lib/esm/stories/story-data.js +0 -989
  69. package/lib/esm/stories/story-data.js.map +0 -1
  70. package/lib/types/stories/graph-visualization-barebones.story.d.ts +0 -24
  71. package/lib/types/stories/graph-visualization-barebones.story.d.ts.map +0 -1
  72. package/lib/types/stories/graph-visualization-custom.story.d.ts +0 -24
  73. package/lib/types/stories/graph-visualization-custom.story.d.ts.map +0 -1
  74. package/lib/types/stories/graph-visualization-default.story.d.ts +0 -24
  75. package/lib/types/stories/graph-visualization-default.story.d.ts.map +0 -1
  76. package/lib/types/stories/graph-visualization-highlighting.story.d.ts +0 -23
  77. package/lib/types/stories/graph-visualization-highlighting.story.d.ts.map +0 -1
  78. package/lib/types/stories/graph-visualization-maximalist.story.d.ts +0 -24
  79. package/lib/types/stories/graph-visualization-maximalist.story.d.ts.map +0 -1
  80. package/lib/types/stories/graph-visualization-range-styling.story.d.ts +0 -25
  81. package/lib/types/stories/graph-visualization-range-styling.story.d.ts.map +0 -1
  82. package/lib/types/stories/graph-visualization-rule-based-styling-advanced.story.d.ts +0 -33
  83. package/lib/types/stories/graph-visualization-rule-based-styling-advanced.story.d.ts.map +0 -1
  84. package/lib/types/stories/graph-visualization-rule-based-styling-datetime.story.d.ts +0 -25
  85. package/lib/types/stories/graph-visualization-rule-based-styling-datetime.story.d.ts.map +0 -1
  86. package/lib/types/stories/graph-visualization-rule-based-styling.story.d.ts +0 -25
  87. package/lib/types/stories/graph-visualization-rule-based-styling.story.d.ts.map +0 -1
  88. package/lib/types/stories/graph-visualization-search.story.d.ts +0 -23
  89. package/lib/types/stories/graph-visualization-search.story.d.ts.map +0 -1
  90. package/lib/types/stories/graph-visualization-simple-styling.story.d.ts +0 -25
  91. package/lib/types/stories/graph-visualization-simple-styling.story.d.ts.map +0 -1
  92. package/lib/types/stories/graph-visualization-unique-colors-styling.story.d.ts +0 -23
  93. package/lib/types/stories/graph-visualization-unique-colors-styling.story.d.ts.map +0 -1
  94. package/lib/types/stories/index.d.ts +0 -47
  95. package/lib/types/stories/index.d.ts.map +0 -1
  96. package/lib/types/stories/preview-graph-visualization.story.d.ts +0 -23
  97. package/lib/types/stories/preview-graph-visualization.story.d.ts.map +0 -1
  98. package/lib/types/stories/story-data.d.ts +0 -31
  99. package/lib/types/stories/story-data.d.ts.map +0 -1
@@ -1,97 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- *
4
- * Copyright (c) "Neo4j"
5
- * Neo4j Sweden AB [http://neo4j.com]
6
- *
7
- * This file is part of Neo4j.
8
- *
9
- * Neo4j is free software: you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation, either version 3 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
- */
22
- import { GraphVisualization } from '../graph-visualization';
23
- import { advancedStoryGraph, containerClasses } from './story-data';
24
- const pokemonRules = [
25
- {
26
- apply: {
27
- captions: {
28
- text: [
29
- { styles: ['bold'], value: { property: 'name' } },
30
- { styles: [], value: ' Lv' },
31
- { styles: [], value: { property: 'level' } },
32
- ],
33
- },
34
- colorRange: {
35
- maxColor: '#e74c3c',
36
- maxValue: 88,
37
- midColor: '#f1c40f',
38
- midValue: 45,
39
- minColor: '#3498db',
40
- minValue: 1,
41
- onProperty: 'level',
42
- },
43
- sizeRange: {
44
- maxSize: 50,
45
- maxValue: 88,
46
- minSize: 20,
47
- minValue: 1,
48
- onProperty: 'level',
49
- },
50
- },
51
- match: { label: 'Pokemon' },
52
- },
53
- ];
54
- const caughtRelRules = [
55
- {
56
- apply: {
57
- captions: {
58
- size: 1.5,
59
- text: [
60
- { styles: [], value: 'Caught @ Lv' },
61
- { styles: ['bold'], value: { property: 'level' } },
62
- ],
63
- },
64
- colorRange: {
65
- maxColor: '#ff2d78',
66
- maxValue: 40,
67
- minColor: '#00d2ff',
68
- minValue: 1,
69
- onProperty: 'level',
70
- },
71
- width: { value: 4 },
72
- widthRange: {
73
- maxValue: 40,
74
- maxWidth: 8,
75
- minValue: 1,
76
- minWidth: 1,
77
- onProperty: 'level',
78
- },
79
- },
80
- match: { reltype: 'CAUGHT' },
81
- },
82
- ];
83
- const otherNodeRules = [
84
- { apply: { color: { value: '#95a5a6' } }, match: { label: 'Trainer' } },
85
- { apply: { color: { value: '#bdc3c7' } }, match: { label: 'Type' } },
86
- { apply: { color: { value: '#bdc3c7' } }, match: { label: 'Gym' } },
87
- ];
88
- export const colorRangeStyleRules = [
89
- ...pokemonRules,
90
- ...caughtRelRules,
91
- ...otherNodeRules,
92
- ];
93
- const Component = () => {
94
- return (_jsx("div", { style: { height: '600px' }, children: _jsx(GraphVisualization, { nodes: advancedStoryGraph.nodes, rels: advancedStoryGraph.rels, className: containerClasses, styleRules: colorRangeStyleRules }) }));
95
- };
96
- export default Component;
97
- //# 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;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEpE,MAAM,YAAY,GAAqB;IACrC;QACE,KAAK,EAAE;YACL,QAAQ,EAAE;gBACR,IAAI,EAAE;oBACJ,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE;oBACjD,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;oBAC5B,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;iBAC7C;aACF;YACD,UAAU,EAAE;gBACV,QAAQ,EAAE,SAAS;gBACnB,QAAQ,EAAE,EAAE;gBACZ,QAAQ,EAAE,SAAS;gBACnB,QAAQ,EAAE,EAAE;gBACZ,QAAQ,EAAE,SAAS;gBACnB,QAAQ,EAAE,CAAC;gBACX,UAAU,EAAE,OAAO;aACpB;YACD,SAAS,EAAE;gBACT,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,EAAE;gBACZ,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,CAAC;gBACX,UAAU,EAAE,OAAO;aACpB;SACF;QACD,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;KAC5B;CACF,CAAC;AAEF,MAAM,cAAc,GAAqB;IACvC;QACE,KAAK,EAAE;YACL,QAAQ,EAAE;gBACR,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE;oBACJ,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE;oBACpC,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE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EAC3B,UAAU,EAAE,oBAAoB,GAChC,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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 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,267 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- *
4
- * Copyright (c) "Neo4j"
5
- * Neo4j Sweden AB [http://neo4j.com]
6
- *
7
- * This file is part of Neo4j.
8
- *
9
- * Neo4j is free software: you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation, either version 3 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
- */
22
- import { GraphVisualization } from '../graph-visualization';
23
- import { advancedStoryGraph, containerClasses } from './story-data';
24
- export const defaultNodeRules = [
25
- {
26
- match: { label: null },
27
- apply: { size: { value: 10 } },
28
- },
29
- ];
30
- export const trainerRules = [
31
- {
32
- match: { label: 'Trainer' },
33
- where: { equal: [{ property: 'reputation' }, 'Gym Leader'] },
34
- priority: 20, // Gym Leaders are special - should override level-based styling
35
- apply: {
36
- color: { value: '#9b59b6' },
37
- captions: {
38
- text: [
39
- { value: { property: 'name' }, styles: ['bold'] },
40
- { value: ' 🏆', styles: [] },
41
- { value: ' Gym Leader', styles: ['italic'] },
42
- ],
43
- align: 'bottom',
44
- },
45
- size: { value: 45 },
46
- },
47
- },
48
- {
49
- match: { label: 'Trainer' },
50
- where: { greaterThanOrEqual: [{ property: 'level' }, 85] },
51
- priority: 10, // Base high-level styling
52
- apply: {
53
- size: { value: 30 },
54
- captions: {
55
- text: [
56
- { value: { property: 'name' }, styles: ['bold'] },
57
- { value: ' (Lv ', styles: [] },
58
- { value: { property: 'level' }, styles: [] },
59
- { value: ')', styles: [] },
60
- ],
61
- size: 2,
62
- },
63
- },
64
- },
65
- ];
66
- export const pokemonRules = [
67
- // Make the 'saur family green is our highest priority
68
- {
69
- match: { label: 'Pokemon' },
70
- where: { endsWith: [{ property: 'name' }, 'saur'] },
71
- priority: 50,
72
- apply: {
73
- color: { value: '#2ecc71' },
74
- captions: {
75
- text: [
76
- { value: '🌿 ', styles: [] },
77
- { value: { property: 'name' }, styles: ['bold', 'italic'] },
78
- ],
79
- },
80
- },
81
- },
82
- {
83
- match: { label: 'Pokemon' },
84
- where: { equal: [{ property: 'is_starter' }, true] },
85
- apply: {
86
- color: { value: '#f39c12' },
87
- captions: {
88
- text: [
89
- { value: { property: 'name' }, styles: ['bold'] },
90
- { value: ' ⭐', styles: [] },
91
- ],
92
- },
93
- size: { value: 40 },
94
- },
95
- },
96
- {
97
- match: { label: 'Pokemon' },
98
- where: { greaterThanOrEqual: [{ property: 'level' }, 85] },
99
- priority: 30, // High-level Pokemon override starter styling
100
- apply: {
101
- color: { value: '#c0392b' },
102
- captions: {
103
- text: [
104
- { value: '💪 ', styles: [] },
105
- { value: { property: 'name' }, styles: ['bold'] },
106
- { value: ' Lv', styles: [] },
107
- { value: { property: 'level' }, styles: [] },
108
- ],
109
- },
110
- size: { value: 42 },
111
- },
112
- },
113
- {
114
- match: { label: 'Pokemon' },
115
- where: { lessThan: [{ property: 'catch_rate' }, 50] },
116
- priority: 40, // Rare caption is our second highest priority
117
- apply: {
118
- captions: {
119
- text: [
120
- { value: { property: 'name' }, styles: ['bold'] },
121
- { value: ' (Rare)', styles: ['italic'] },
122
- ],
123
- },
124
- },
125
- },
126
- {
127
- match: { label: 'Pokemon' },
128
- where: {
129
- and: [
130
- { lessThan: [{ property: 'level' }, 10] },
131
- { not: { equal: [{ property: 'is_starter' }, true] } },
132
- ],
133
- },
134
- priority: 15, // Baby Pokemon get special styling
135
- apply: {
136
- size: { value: 25 },
137
- color: { value: '#95a5a6' },
138
- captions: {
139
- text: [
140
- { value: { property: 'name' }, styles: ['italic'] },
141
- { value: ' (Smol)', styles: [] },
142
- ],
143
- },
144
- },
145
- },
146
- ];
147
- export const typeRules = [
148
- {
149
- match: { label: 'Type' },
150
- where: {
151
- or: [
152
- { equal: [{ property: 'name' }, 'Grass'] },
153
- { equal: [{ property: 'name' }, 'Poison'] },
154
- ],
155
- },
156
- apply: {
157
- color: { value: '#27ae60' },
158
- },
159
- },
160
- ];
161
- export const gymRules = [
162
- {
163
- match: { label: 'Gym' },
164
- apply: {
165
- color: { value: '#8e44ad' },
166
- size: { value: 48 },
167
- captions: {
168
- text: [
169
- { value: '🏛️ ', styles: [] },
170
- { value: { property: 'name' }, styles: ['bold', 'underline'] },
171
- ],
172
- align: 'top',
173
- },
174
- },
175
- },
176
- ];
177
- export const battledRelRules = [
178
- {
179
- match: { reltype: 'BATTLED' },
180
- where: { equal: [{ property: 'won' }, true] },
181
- apply: {
182
- color: { value: '#27ae60' },
183
- width: { value: 4 },
184
- captions: { text: [{ value: 'WON BATTLE', styles: ['bold'] }], size: 2 },
185
- },
186
- },
187
- {
188
- match: { reltype: 'BATTLED' },
189
- where: { equal: [{ property: 'won' }, false] },
190
- apply: {
191
- color: { value: '#e74c3c' },
192
- width: { value: 2 },
193
- captions: {
194
- text: [{ value: 'LOST BATTLE', styles: ['italic'] }],
195
- size: 2,
196
- },
197
- },
198
- },
199
- ];
200
- export const caughtRelRules = [
201
- {
202
- match: { reltype: 'CAUGHT' },
203
- apply: {
204
- color: { value: '#e91e63' },
205
- width: { value: 3 },
206
- captions: {
207
- text: [
208
- { value: 'Caught @ Lv', styles: [] },
209
- { value: { property: 'level' }, styles: ['bold'] },
210
- ],
211
- size: 1.5,
212
- },
213
- },
214
- },
215
- ];
216
- export const evolvesToRelRules = [
217
- {
218
- match: { reltype: 'EVOLVES_TO' },
219
- apply: {
220
- color: { value: '#16a085' },
221
- width: { value: 2 },
222
- captions: { text: [{ value: '→', styles: ['bold'] }] },
223
- },
224
- },
225
- {
226
- match: { reltype: 'EVOLVES_TO' },
227
- where: { equal: [{ property: 'method' }, 'Level'] },
228
- priority: 1,
229
- apply: {
230
- captions: {
231
- text: [
232
- { value: '→ Lv', styles: [] },
233
- { value: { property: 'level' }, styles: ['bold'] },
234
- ],
235
- },
236
- },
237
- },
238
- {
239
- match: { reltype: 'EVOLVES_TO' },
240
- where: { not: { equal: [{ property: 'method' }, 'Level'] } },
241
- priority: 1,
242
- apply: {
243
- color: { value: '#8e44ad' },
244
- captions: {
245
- text: [
246
- { value: '→ ', styles: [] },
247
- { value: { property: 'method' }, styles: ['italic'] },
248
- ],
249
- },
250
- },
251
- },
252
- ];
253
- export const advancedStyleRules = [
254
- ...defaultNodeRules,
255
- ...trainerRules,
256
- ...pokemonRules,
257
- ...typeRules,
258
- ...gymRules,
259
- ...battledRelRules,
260
- ...caughtRelRules,
261
- ...evolvesToRelRules,
262
- ];
263
- const Component = () => {
264
- return (_jsx("div", { style: { height: '600px' }, children: _jsx(GraphVisualization, { nodes: advancedStoryGraph.nodes, rels: advancedStoryGraph.rels, className: containerClasses, styleRules: advancedStyleRules }) }));
265
- };
266
- export default Component;
267
- //# sourceMappingURL=graph-visualization-rule-based-styling-advanced.story.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph-visualization-rule-based-styling-advanced.story.js","sourceRoot":"","sources":["../../../src/stories/graph-visualization-rule-based-styling-advanced.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;G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E,CAAC,MAAM,CAAC,EAAE;iBACnD;aACF;SACF;KACF;IACD;QACE,KAAK,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE;QAChC,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE;QAC5D,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE;YACL,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;YAC3B,QAAQ,EAAE;gBACR,IAAI,EAAE;oBACJ,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;oBAC3B,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE;iBACtD;aACF;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAqB;IAClD,GAAG,gBAAgB;IACnB,GAAG,YAAY;IACf,GAAG,YAAY;IACf,GAAG,SAAS;IACZ,GAAG,QAAQ;IACX,GAAG,eAAe;IAClB,GAAG,cAAc;IACjB,GAAG,iBAAiB;CACrB,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,cAAK,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAC7B,KAAC,kBAAkB,IACjB,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAC/B,IAAI,EAAE,kBAAkB,CAAC,IAAI,EAC7B,SAAS,EAAE,gBAAgB,EAC3B,UAAU,EAAE,kBAAkB,GAC9B,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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 GraphStyleRule } from '../styling/style-types';\nimport { advancedStoryGraph, containerClasses } from './story-data';\n\nexport const defaultNodeRules: GraphStyleRule[] = [\n {\n match: { label: null },\n apply: { size: { value: 10 } },\n },\n];\n\nexport const trainerRules: GraphStyleRule[] = [\n {\n match: { label: 'Trainer' },\n where: { equal: [{ property: 'reputation' }, 'Gym Leader'] },\n priority: 20, // Gym Leaders are special - should override level-based styling\n apply: {\n color: { value: '#9b59b6' },\n captions: {\n text: [\n { value: { property: 'name' }, styles: ['bold'] },\n { value: ' 🏆', styles: [] },\n { value: ' Gym Leader', styles: ['italic'] },\n ],\n align: 'bottom',\n },\n size: { value: 45 },\n },\n },\n {\n match: { label: 'Trainer' },\n where: { greaterThanOrEqual: [{ property: 'level' }, 85] },\n priority: 10, // Base high-level styling\n apply: {\n size: { value: 30 },\n captions: {\n text: [\n { value: { property: 'name' }, styles: ['bold'] },\n { value: ' (Lv ', styles: [] },\n { value: { property: 'level' }, styles: [] },\n { value: ')', styles: [] },\n ],\n size: 2,\n },\n },\n },\n];\n\nexport const pokemonRules: GraphStyleRule[] = [\n // Make the 'saur family green is our highest priority\n {\n match: { label: 'Pokemon' },\n where: { endsWith: [{ property: 'name' }, 'saur'] },\n priority: 50,\n apply: {\n color: { value: '#2ecc71' },\n captions: {\n text: [\n { value: '🌿 ', styles: [] },\n { value: { property: 'name' }, styles: ['bold', 'italic'] },\n ],\n },\n },\n },\n {\n match: { label: 'Pokemon' },\n where: { equal: [{ property: 'is_starter' }, true] },\n apply: {\n color: { value: '#f39c12' },\n captions: {\n text: [\n { value: { property: 'name' }, styles: ['bold'] },\n { value: ' ⭐', styles: [] },\n ],\n },\n size: { value: 40 },\n },\n },\n {\n match: { label: 'Pokemon' },\n where: { greaterThanOrEqual: [{ property: 'level' }, 85] },\n priority: 30, // High-level Pokemon override starter styling\n apply: {\n color: { value: '#c0392b' },\n captions: {\n text: [\n { value: '💪 ', styles: [] },\n { value: { property: 'name' }, styles: ['bold'] },\n { value: ' Lv', styles: [] },\n { value: { property: 'level' }, styles: [] },\n ],\n },\n size: { value: 42 },\n },\n },\n {\n match: { label: 'Pokemon' },\n where: { lessThan: [{ property: 'catch_rate' }, 50] },\n priority: 40, // Rare caption is our second highest priority\n apply: {\n captions: {\n text: [\n { value: { property: 'name' }, styles: ['bold'] },\n { value: ' (Rare)', styles: ['italic'] },\n ],\n },\n },\n },\n {\n match: { label: 'Pokemon' },\n where: {\n and: [\n { lessThan: [{ property: 'level' }, 10] },\n { not: { equal: [{ property: 'is_starter' }, true] } },\n ],\n },\n priority: 15, // Baby Pokemon get special styling\n apply: {\n size: { value: 25 },\n color: { value: '#95a5a6' },\n captions: {\n text: [\n { value: { property: 'name' }, styles: ['italic'] },\n { value: ' (Smol)', styles: [] },\n ],\n },\n },\n },\n];\n\nexport const typeRules: GraphStyleRule[] = [\n {\n match: { label: 'Type' },\n where: {\n or: [\n { equal: [{ property: 'name' }, 'Grass'] },\n { equal: [{ property: 'name' }, 'Poison'] },\n ],\n },\n apply: {\n color: { value: '#27ae60' },\n },\n },\n];\n\nexport const gymRules: GraphStyleRule[] = [\n {\n match: { label: 'Gym' },\n apply: {\n color: { value: '#8e44ad' },\n size: { value: 48 },\n captions: {\n text: [\n { value: '🏛️ ', styles: [] },\n { value: { property: 'name' }, styles: ['bold', 'underline'] },\n ],\n align: 'top',\n },\n },\n },\n];\n\nexport const battledRelRules: GraphStyleRule[] = [\n {\n match: { reltype: 'BATTLED' },\n where: { equal: [{ property: 'won' }, true] },\n apply: {\n color: { value: '#27ae60' },\n width: { value: 4 },\n captions: { text: [{ value: 'WON BATTLE', styles: ['bold'] }], size: 2 },\n },\n },\n {\n match: { reltype: 'BATTLED' },\n where: { equal: [{ property: 'won' }, false] },\n apply: {\n color: { value: '#e74c3c' },\n width: { value: 2 },\n captions: {\n text: [{ value: 'LOST BATTLE', styles: ['italic'] }],\n size: 2,\n },\n },\n },\n];\n\nexport const caughtRelRules: GraphStyleRule[] = [\n {\n match: { reltype: 'CAUGHT' },\n apply: {\n color: { value: '#e91e63' },\n width: { value: 3 },\n captions: {\n text: [\n { value: 'Caught @ Lv', styles: [] },\n { value: { property: 'level' }, styles: ['bold'] },\n ],\n size: 1.5,\n },\n },\n },\n];\n\nexport const evolvesToRelRules: GraphStyleRule[] = [\n {\n match: { reltype: 'EVOLVES_TO' },\n apply: {\n color: { value: '#16a085' },\n width: { value: 2 },\n captions: { text: [{ value: '→', styles: ['bold'] }] },\n },\n },\n {\n match: { reltype: 'EVOLVES_TO' },\n where: { equal: [{ property: 'method' }, 'Level'] },\n priority: 1,\n apply: {\n captions: {\n text: [\n { value: '→ Lv', styles: [] },\n { value: { property: 'level' }, styles: ['bold'] },\n ],\n },\n },\n },\n {\n match: { reltype: 'EVOLVES_TO' },\n where: { not: { equal: [{ property: 'method' }, 'Level'] } },\n priority: 1,\n apply: {\n color: { value: '#8e44ad' },\n captions: {\n text: [\n { value: '→ ', styles: [] },\n { value: { property: 'method' }, styles: ['italic'] },\n ],\n },\n },\n },\n];\n\nexport const advancedStyleRules: GraphStyleRule[] = [\n ...defaultNodeRules,\n ...trainerRules,\n ...pokemonRules,\n ...typeRules,\n ...gymRules,\n ...battledRelRules,\n ...caughtRelRules,\n ...evolvesToRelRules,\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={advancedStyleRules}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -1,178 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- *
4
- * Copyright (c) "Neo4j"
5
- * Neo4j Sweden AB [http://neo4j.com]
6
- *
7
- * This file is part of Neo4j.
8
- *
9
- * Neo4j is free software: you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation, either version 3 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
- */
22
- import { GraphVisualization } from '../graph-visualization';
23
- import { containerClasses } from './story-data';
24
- /** Neo4j driver-style portable DateTime property (ISO string in `stringified`). */
25
- function dateTimeProp(iso) {
26
- return { stringified: JSON.stringify(iso), type: 'DateTime' };
27
- }
28
- /** Neo4j driver-style portable LocalTime property. */
29
- function localTimeProp(time) {
30
- return { stringified: JSON.stringify(time), type: 'LocalTime' };
31
- }
32
- /**
33
- * Pokemon nodes with `firstSeen` (DateTime) and optional `peakActivity` (LocalTime).
34
- * Values use UTC offsets and RFC 9557 IANA brackets where noted.
35
- * Pikachu uses IANA-only form (`…[Europe/Stockholm]`) — no explicit offset required.
36
- */
37
- const dateTimeStoryGraph = {
38
- nodes: [
39
- {
40
- id: 'mewtwo',
41
- labels: ['Pokemon'],
42
- properties: {
43
- era: { stringified: '"1996 — Kanto"', type: 'string' },
44
- firstSeen: dateTimeProp('1996-02-27T00:00:00Z'),
45
- name: { stringified: '"Mewtwo"', type: 'string' },
46
- },
47
- },
48
- {
49
- id: 'eevee',
50
- labels: ['Pokemon'],
51
- properties: {
52
- era: { stringified: '"2024 — Paldea"', type: 'string' },
53
- firstSeen: dateTimeProp('2024-01-15T10:00:00+01:00'),
54
- name: { stringified: '"Eevee"', type: 'string' },
55
- },
56
- },
57
- {
58
- id: 'pikachu',
59
- labels: ['Pokemon'],
60
- properties: {
61
- era: { stringified: '"2024 — Stockholm CEST"', type: 'string' },
62
- // RFC 9557: local time in Europe/Stockholm — offset inferred (CEST in June)
63
- firstSeen: dateTimeProp('2024-06-15T14:00:00[Europe/Stockholm]'),
64
- name: { stringified: '"Pikachu"', type: 'string' },
65
- peakActivity: localTimeProp('14:30:00'),
66
- },
67
- },
68
- {
69
- id: 'charizard',
70
- labels: ['Pokemon'],
71
- properties: {
72
- era: { stringified: '"2024 — New York EDT"', type: 'string' },
73
- firstSeen: dateTimeProp('2024-07-04T12:00:00-04:00[America/New_York]'),
74
- name: { stringified: '"Charizard"', type: 'string' },
75
- peakActivity: localTimeProp('09:00:00'),
76
- },
77
- },
78
- {
79
- id: 'dragon-type',
80
- labels: ['Type'],
81
- properties: { name: { stringified: '"Dragon"', type: 'string' } },
82
- },
83
- ],
84
- rels: [
85
- {
86
- from: 'mewtwo',
87
- id: 'rel1',
88
- properties: {},
89
- to: 'dragon-type',
90
- type: 'HAS_TYPE',
91
- },
92
- {
93
- from: 'pikachu',
94
- id: 'rel2',
95
- properties: {},
96
- to: 'dragon-type',
97
- type: 'HAS_TYPE',
98
- },
99
- {
100
- from: 'charizard',
101
- id: 'rel3',
102
- properties: {},
103
- to: 'dragon-type',
104
- type: 'HAS_TYPE',
105
- },
106
- ],
107
- };
108
- export const dateTimeStyleRules = [
109
- {
110
- // Default slate for all Pokemon
111
- match: { label: 'Pokemon' },
112
- apply: {
113
- color: { value: '#94a3b8' },
114
- captions: {
115
- text: [
116
- { value: { property: 'name' }, styles: ['bold'] },
117
- { value: '\n', styles: [] },
118
- { value: { property: 'era' }, styles: ['italic'] },
119
- ],
120
- },
121
- size: { value: 28 },
122
- },
123
- },
124
- {
125
- // firstSeen in 2024 or later (UTC midnight boundary)
126
- match: { label: 'Pokemon' },
127
- where: {
128
- greaterThanOrEqual: [
129
- { property: 'firstSeen' },
130
- { datetime: '2024-01-01T00:00:00Z' },
131
- ],
132
- },
133
- priority: 10,
134
- apply: { color: { value: '#22c55e' } },
135
- },
136
- {
137
- // firstSeen from mid-2024 onward
138
- match: { label: 'Pokemon' },
139
- where: {
140
- greaterThanOrEqual: [
141
- { property: 'firstSeen' },
142
- { datetime: '2024-06-01T00:00:00Z' },
143
- ],
144
- },
145
- priority: 20,
146
- apply: { color: { value: '#f97316' }, size: { value: 36 } },
147
- },
148
- {
149
- // Very recent sightings (June 2024+) — Charizard qualifies
150
- match: { label: 'Pokemon' },
151
- where: {
152
- greaterThanOrEqual: [
153
- { property: 'firstSeen' },
154
- { datetime: '2024-06-15T14:00:00Z' },
155
- ],
156
- },
157
- priority: 30,
158
- apply: { color: { value: '#eab308' }, size: { value: 44 } },
159
- },
160
- {
161
- // Afternoon-active Pokemon: peakActivity after noon UTC
162
- match: { label: 'Pokemon' },
163
- where: {
164
- greaterThanOrEqual: [{ property: 'peakActivity' }, { time: '12:00:00Z' }],
165
- },
166
- priority: 40,
167
- apply: { size: { value: 50 } },
168
- },
169
- {
170
- match: { label: 'Type' },
171
- apply: { color: { value: '#6366f1' }, size: { value: 22 } },
172
- },
173
- ];
174
- const Component = () => {
175
- return (_jsx("div", { style: { height: '600px' }, children: _jsx(GraphVisualization, { nodes: dateTimeStoryGraph.nodes, rels: dateTimeStoryGraph.rels, className: containerClasses, styleRules: dateTimeStyleRules }) }));
176
- };
177
- export default Component;
178
- //# sourceMappingURL=graph-visualization-rule-based-styling-datetime.story.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph-visualization-rule-based-styling-datetime.story.js","sourceRoot":"","sources":["../../../src/stories/graph-visualization-rule-based-styling-datetime.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAO5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,mFAAmF;AACnF,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO,EAAE,WAAW,E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,wDAAwD;QACxD,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;QAC3B,KAAK,EAAE;YACL,kBAAkB,EAAE,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;SAC1E;QACD,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;KAC/B;IACD;QACE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;QACxB,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;KAC5D;CACF,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,cAAK,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAC7B,KAAC,kBAAkB,IACjB,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAC/B,IAAI,EAAE,kBAAkB,CAAC,IAAI,EAC7B,SAAS,EAAE,gBAAgB,EAC3B,UAAU,EAAE,kBAAkB,GAC9B,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,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 {\n type NeoNode,\n type NeoRel,\n type PortableProperty,\n} from '../graph-visualization-context';\nimport { type GraphStyleRule } from '../styling/style-types';\nimport { containerClasses } from './story-data';\n\n/** Neo4j driver-style portable DateTime property (ISO string in `stringified`). */\nfunction dateTimeProp(iso: string): PortableProperty {\n return { stringified: JSON.stringify(iso), type: 'DateTime' };\n}\n\n/** Neo4j driver-style portable LocalTime property. */\nfunction localTimeProp(time: string): PortableProperty {\n return { stringified: JSON.stringify(time), type: 'LocalTime' };\n}\n\n/**\n * Pokemon nodes with `firstSeen` (DateTime) and optional `peakActivity` (LocalTime).\n * Values use UTC offsets and RFC 9557 IANA brackets where noted.\n * Pikachu uses IANA-only form (`…[Europe/Stockholm]`) — no explicit offset required.\n */\nconst dateTimeStoryGraph: { nodes: NeoNode[]; rels: NeoRel[] } = {\n nodes: [\n {\n id: 'mewtwo',\n labels: ['Pokemon'],\n properties: {\n era: { stringified: '\"1996 — Kanto\"', type: 'string' },\n firstSeen: dateTimeProp('1996-02-27T00:00:00Z'),\n name: { stringified: '\"Mewtwo\"', type: 'string' },\n },\n },\n {\n id: 'eevee',\n labels: ['Pokemon'],\n properties: {\n era: { stringified: '\"2024 — Paldea\"', type: 'string' },\n firstSeen: dateTimeProp('2024-01-15T10:00:00+01:00'),\n name: { stringified: '\"Eevee\"', type: 'string' },\n },\n },\n {\n id: 'pikachu',\n labels: ['Pokemon'],\n properties: {\n era: { stringified: '\"2024 — Stockholm CEST\"', type: 'string' },\n // RFC 9557: local time in Europe/Stockholm — offset inferred (CEST in June)\n firstSeen: dateTimeProp('2024-06-15T14:00:00[Europe/Stockholm]'),\n name: { stringified: '\"Pikachu\"', type: 'string' },\n peakActivity: localTimeProp('14:30:00'),\n },\n },\n {\n id: 'charizard',\n labels: ['Pokemon'],\n properties: {\n era: { stringified: '\"2024 — New York EDT\"', type: 'string' },\n firstSeen: dateTimeProp('2024-07-04T12:00:00-04:00[America/New_York]'),\n name: { stringified: '\"Charizard\"', type: 'string' },\n peakActivity: localTimeProp('09:00:00'),\n },\n },\n {\n id: 'dragon-type',\n labels: ['Type'],\n properties: { name: { stringified: '\"Dragon\"', type: 'string' } },\n },\n ],\n rels: [\n {\n from: 'mewtwo',\n id: 'rel1',\n properties: {},\n to: 'dragon-type',\n type: 'HAS_TYPE',\n },\n {\n from: 'pikachu',\n id: 'rel2',\n properties: {},\n to: 'dragon-type',\n type: 'HAS_TYPE',\n },\n {\n from: 'charizard',\n id: 'rel3',\n properties: {},\n to: 'dragon-type',\n type: 'HAS_TYPE',\n },\n ],\n};\n\nexport const dateTimeStyleRules: GraphStyleRule[] = [\n {\n // Default slate for all Pokemon\n match: { label: 'Pokemon' },\n apply: {\n color: { value: '#94a3b8' },\n captions: {\n text: [\n { value: { property: 'name' }, styles: ['bold'] },\n { value: '\\n', styles: [] },\n { value: { property: 'era' }, styles: ['italic'] },\n ],\n },\n size: { value: 28 },\n },\n },\n {\n // firstSeen in 2024 or later (UTC midnight boundary)\n match: { label: 'Pokemon' },\n where: {\n greaterThanOrEqual: [\n { property: 'firstSeen' },\n { datetime: '2024-01-01T00:00:00Z' },\n ],\n },\n priority: 10,\n apply: { color: { value: '#22c55e' } },\n },\n {\n // firstSeen from mid-2024 onward\n match: { label: 'Pokemon' },\n where: {\n greaterThanOrEqual: [\n { property: 'firstSeen' },\n { datetime: '2024-06-01T00:00:00Z' },\n ],\n },\n priority: 20,\n apply: { color: { value: '#f97316' }, size: { value: 36 } },\n },\n {\n // Very recent sightings (June 2024+) — Charizard qualifies\n match: { label: 'Pokemon' },\n where: {\n greaterThanOrEqual: [\n { property: 'firstSeen' },\n { datetime: '2024-06-15T14:00:00Z' },\n ],\n },\n priority: 30,\n apply: { color: { value: '#eab308' }, size: { value: 44 } },\n },\n {\n // Afternoon-active Pokemon: peakActivity after noon UTC\n match: { label: 'Pokemon' },\n where: {\n greaterThanOrEqual: [{ property: 'peakActivity' }, { time: '12:00:00Z' }],\n },\n priority: 40,\n apply: { size: { value: 50 } },\n },\n {\n match: { label: 'Type' },\n apply: { color: { value: '#6366f1' }, size: { value: 22 } },\n },\n];\n\nconst Component = () => {\n return (\n <div style={{ height: '600px' }}>\n <GraphVisualization\n nodes={dateTimeStoryGraph.nodes}\n rels={dateTimeStoryGraph.rels}\n className={containerClasses}\n styleRules={dateTimeStyleRules}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}