@neo4j-ndl/react-graph 2.0.3 → 2.0.5
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/{styling/color-interpolation.js → _generated/style-rules/color-utils.js} +19 -4
- package/lib/cjs/_generated/style-rules/color-utils.js.map +1 -0
- package/lib/cjs/_generated/style-rules/date-utils.js +145 -0
- package/lib/cjs/_generated/style-rules/date-utils.js.map +1 -0
- package/lib/cjs/_generated/style-rules/index.js +38 -0
- package/lib/cjs/_generated/style-rules/index.js.map +1 -0
- package/lib/cjs/_generated/style-rules/literal-schemas.js +64 -0
- package/lib/cjs/_generated/style-rules/literal-schemas.js.map +1 -0
- package/lib/cjs/stories/graph-visualization-rule-based-styling-datetime.story.js +181 -0
- package/lib/cjs/stories/graph-visualization-rule-based-styling-datetime.story.js.map +1 -0
- package/lib/cjs/stories/index.js +5 -1
- package/lib/cjs/stories/index.js.map +1 -1
- package/lib/cjs/styling/compile-graph-styles.js +34 -8
- package/lib/cjs/styling/compile-graph-styles.js.map +1 -1
- package/lib/cjs/styling/style-types.js +4 -1
- package/lib/cjs/styling/style-types.js.map +1 -1
- package/lib/esm/{styling/color-interpolation.js → _generated/style-rules/color-utils.js} +18 -3
- package/lib/esm/_generated/style-rules/color-utils.js.map +1 -0
- package/lib/esm/_generated/style-rules/date-utils.js +141 -0
- package/lib/esm/_generated/style-rules/date-utils.js.map +1 -0
- package/lib/esm/_generated/style-rules/index.js +29 -0
- package/lib/esm/_generated/style-rules/index.js.map +1 -0
- package/lib/esm/_generated/style-rules/literal-schemas.js +61 -0
- package/lib/esm/_generated/style-rules/literal-schemas.js.map +1 -0
- package/lib/esm/stories/graph-visualization-rule-based-styling-datetime.story.js +178 -0
- package/lib/esm/stories/graph-visualization-rule-based-styling-datetime.story.js.map +1 -0
- package/lib/esm/stories/index.js +3 -0
- package/lib/esm/stories/index.js.map +1 -1
- package/lib/esm/styling/compile-graph-styles.js +27 -1
- package/lib/esm/styling/compile-graph-styles.js.map +1 -1
- package/lib/esm/styling/style-types.js +4 -1
- package/lib/esm/styling/style-types.js.map +1 -1
- package/lib/types/_generated/style-rules/color-utils.d.ts +33 -0
- package/lib/types/_generated/style-rules/color-utils.d.ts.map +1 -0
- package/lib/types/_generated/style-rules/date-utils.d.ts +54 -0
- package/lib/types/_generated/style-rules/date-utils.d.ts.map +1 -0
- package/lib/types/_generated/style-rules/index.d.ts +25 -0
- package/lib/types/_generated/style-rules/index.d.ts.map +1 -0
- package/lib/types/_generated/style-rules/literal-schemas.d.ts +53 -0
- package/lib/types/_generated/style-rules/literal-schemas.d.ts.map +1 -0
- package/lib/types/{styling/color-interpolation.d.ts → stories/graph-visualization-rule-based-styling-datetime.story.d.ts} +5 -4
- package/lib/types/stories/graph-visualization-rule-based-styling-datetime.story.d.ts.map +1 -0
- package/lib/types/stories/index.d.ts +2 -0
- package/lib/types/stories/index.d.ts.map +1 -1
- package/lib/types/styling/compile-graph-styles.d.ts.map +1 -1
- package/lib/types/styling/style-types.d.ts +12 -3
- package/lib/types/styling/style-types.d.ts.map +1 -1
- package/package.json +6 -4
- package/lib/cjs/styling/color-interpolation.js.map +0 -1
- package/lib/esm/styling/color-interpolation.js.map +0 -1
- package/lib/types/styling/color-interpolation.d.ts.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
*
|
|
4
3
|
* Copyright (c) "Neo4j"
|
|
@@ -19,17 +18,33 @@
|
|
|
19
18
|
* You should have received a copy of the GNU General Public License
|
|
20
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
20
|
*/
|
|
21
|
+
|
|
22
|
+
"use strict";
|
|
23
|
+
/*
|
|
24
|
+
* AUTO-GENERATED FILE — DO NOT EDIT.
|
|
25
|
+
* Source of truth: packages/style-rules/src/
|
|
26
|
+
* Regenerate with `pnpm generate:shared` (runs automatically at build/dev/install).
|
|
27
|
+
*/
|
|
22
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
29
|
exports.getWeight = getWeight;
|
|
24
30
|
exports.lerpColor = lerpColor;
|
|
31
|
+
/**
|
|
32
|
+
* Computes a linear interpolation weight in [0, 1] for `value` between
|
|
33
|
+
* `startValue` and `endValue`. Values outside the range produce weights
|
|
34
|
+
* outside [0, 1] — callers are responsible for clamping if needed.
|
|
35
|
+
*/
|
|
25
36
|
function getWeight(startValue, endValue, value) {
|
|
26
37
|
return (value - startValue) / (endValue - startValue);
|
|
27
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Linearly interpolates between two RGB colors by `weight` (0 = start, 1 = end).
|
|
41
|
+
* Each channel is rounded to the nearest integer.
|
|
42
|
+
*/
|
|
28
43
|
function lerpColor(startColor, endColor, weight) {
|
|
29
44
|
return {
|
|
30
|
-
r: Math.round(startColor.r * (1 - weight) + endColor.r * weight),
|
|
31
|
-
g: Math.round(startColor.g * (1 - weight) + endColor.g * weight),
|
|
32
45
|
b: Math.round(startColor.b * (1 - weight) + endColor.b * weight),
|
|
46
|
+
g: Math.round(startColor.g * (1 - weight) + endColor.g * weight),
|
|
47
|
+
r: Math.round(startColor.r * (1 - weight) + endColor.r * weight),
|
|
33
48
|
};
|
|
34
49
|
}
|
|
35
|
-
//# sourceMappingURL=color-
|
|
50
|
+
//# sourceMappingURL=color-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-utils.js","sourceRoot":"","sources":["../../../../src/_generated/style-rules/color-utils.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AA8BH,8BAMC;AAMD,8BAUC;AA3BD;;;;GAIG;AACH,SAAgB,SAAS,CACvB,UAAkB,EAClB,QAAgB,EAChB,KAAa;IAEb,OAAO,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,GAAG,UAAU,CAAC,CAAC;AACxD,CAAC;AAED;;;GAGG;AACH,SAAgB,SAAS,CACvB,UAAoB,EACpB,QAAkB,EAClB,MAAc;IAEd,OAAO;QACL,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC;QAChE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC;QAChE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC;KACjE,CAAC;AACJ,CAAC","sourcesContent":["/*\n * AUTO-GENERATED FILE — DO NOT EDIT.\n * Source of truth: packages/style-rules/src/\n * Regenerate with `pnpm generate:shared` (runs automatically at build/dev/install).\n */\n\n/**\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 { RgbColor } from '@uiw/react-color';\n\n/**\n * Computes a linear interpolation weight in [0, 1] for `value` between\n * `startValue` and `endValue`. Values outside the range produce weights\n * outside [0, 1] — callers are responsible for clamping if needed.\n */\nexport function getWeight(\n startValue: number,\n endValue: number,\n value: number,\n): number {\n return (value - startValue) / (endValue - startValue);\n}\n\n/**\n * Linearly interpolates between two RGB colors by `weight` (0 = start, 1 = end).\n * Each channel is rounded to the nearest integer.\n */\nexport function lerpColor(\n startColor: RgbColor,\n endColor: RgbColor,\n weight: number,\n): RgbColor {\n return {\n b: Math.round(startColor.b * (1 - weight) + endColor.b * weight),\n g: Math.round(startColor.g * (1 - weight) + endColor.g * weight),\n r: Math.round(startColor.r * (1 - weight) + endColor.r * weight),\n };\n}\n"]}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* AUTO-GENERATED FILE — DO NOT EDIT.
|
|
4
|
+
* Source of truth: packages/style-rules/src/
|
|
5
|
+
* Regenerate with `pnpm generate:shared` (runs automatically at build/dev/install).
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.parseTimeString = parseTimeString;
|
|
9
|
+
exports.parseDateString = parseDateString;
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* Copyright (c) "Neo4j"
|
|
13
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
14
|
+
*
|
|
15
|
+
* This file is part of Neo4j.
|
|
16
|
+
*
|
|
17
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
18
|
+
* it under the terms of the GNU General Public License as published by
|
|
19
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
20
|
+
* (at your option) any later version.
|
|
21
|
+
*
|
|
22
|
+
* This program is distributed in the hope that it will be useful,
|
|
23
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
24
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
25
|
+
* GNU General Public License for more details.
|
|
26
|
+
*
|
|
27
|
+
* You should have received a copy of the GNU General Public License
|
|
28
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
29
|
+
*/
|
|
30
|
+
const temporal_polyfill_1 = require("temporal-polyfill");
|
|
31
|
+
const MS_PER_DAY = 86400000;
|
|
32
|
+
function plainTimeToMs(pt) {
|
|
33
|
+
return (pt.hour * 3600000 +
|
|
34
|
+
pt.minute * 60000 +
|
|
35
|
+
pt.second * 1000 +
|
|
36
|
+
pt.millisecond);
|
|
37
|
+
}
|
|
38
|
+
function parseOffsetMs(offsetStr) {
|
|
39
|
+
const match = offsetStr.match(/^([+-])(\d{2}):(\d{2})$/);
|
|
40
|
+
if (!match) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
const sign = match[1] === '+' ? 1 : -1;
|
|
44
|
+
return (sign *
|
|
45
|
+
(parseInt(match[2], 10) * 3600000 + parseInt(match[3], 10) * 60000));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Parses an ISO 8601 time string to UTC milliseconds since midnight
|
|
49
|
+
* (0–86,399,999). Returns `null` if the string cannot be parsed.
|
|
50
|
+
*
|
|
51
|
+
* Three formats are accepted:
|
|
52
|
+
* 1. Local time (no offset): `"14:30:00"`, `"14:30:00.500"` — treated as UTC
|
|
53
|
+
* 2. UTC time with Z suffix: `"14:30:00Z"` — treated identically to the local form
|
|
54
|
+
* 3. Offset time: `"14:30:00+02:00"` — the offset is applied so the result
|
|
55
|
+
* is the equivalent UTC time of day. `"12:00:00+01:00"` resolves to
|
|
56
|
+
* 39,600,000 (11:00 UTC), which is less than `"12:00:00+00:00"` (43,200,000).
|
|
57
|
+
*
|
|
58
|
+
* Values wrap around midnight: `"00:00:00+01:00"` → 82,800,000 (23:00 UTC).
|
|
59
|
+
*/
|
|
60
|
+
function parseTimeString(s) {
|
|
61
|
+
// Reject datetime strings and anything with an IANA timezone bracket.
|
|
62
|
+
// Temporal.PlainTime.from silently extracts the time portion from strings
|
|
63
|
+
// containing a 'T' separator. IANA brackets are meaningless for time-only
|
|
64
|
+
// values (there is no date to anchor DST to), so they are also rejected.
|
|
65
|
+
if (s.includes('T') || s.includes('[')) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
// Offset time: detect "+HH:MM" or "-HH:MM" suffix first. Temporal.PlainTime.from
|
|
69
|
+
// silently strips offsets and returns the clock-face time, so we must handle
|
|
70
|
+
// offset strings explicitly before falling through to the plain parse.
|
|
71
|
+
const offsetMatch = s.match(/([+-]\d{2}:\d{2})(\[.*\])?$/);
|
|
72
|
+
if (offsetMatch) {
|
|
73
|
+
const offsetStr = offsetMatch[1];
|
|
74
|
+
const timeStr = s.slice(0, s.indexOf(offsetStr));
|
|
75
|
+
const offsetMs = parseOffsetMs(offsetStr);
|
|
76
|
+
if (offsetMs !== null) {
|
|
77
|
+
try {
|
|
78
|
+
const localMs = plainTimeToMs(temporal_polyfill_1.Temporal.PlainTime.from(timeStr));
|
|
79
|
+
// Subtract the UTC offset to normalise to UTC time-of-day; wrap around midnight
|
|
80
|
+
return (((localMs - offsetMs) % MS_PER_DAY) + MS_PER_DAY) % MS_PER_DAY;
|
|
81
|
+
}
|
|
82
|
+
catch (_a) {
|
|
83
|
+
/* empty */
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
// UTC time with Z suffix (e.g. "14:30:00Z") — strip Z and treat as local (UTC) time.
|
|
89
|
+
// Only apply when there is no 'T' in the string; a datetime string like
|
|
90
|
+
// "2024-06-15T14:30:00Z" must not be accepted here.
|
|
91
|
+
const normalized = s.endsWith('Z') && !s.includes('T') ? s.slice(0, -1) : s;
|
|
92
|
+
// Local time (no offset) — treated as UTC
|
|
93
|
+
try {
|
|
94
|
+
return plainTimeToMs(temporal_polyfill_1.Temporal.PlainTime.from(normalized));
|
|
95
|
+
}
|
|
96
|
+
catch (_b) {
|
|
97
|
+
/* empty */
|
|
98
|
+
}
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Parses an ISO 8601 or RFC 9557 date/datetime string to a Unix millisecond
|
|
103
|
+
* timestamp. Returns `null` if the string cannot be parsed.
|
|
104
|
+
*
|
|
105
|
+
* Three formats are tried in order:
|
|
106
|
+
* 1. RFC 9557 ZonedDateTime with IANA bracket notation
|
|
107
|
+
* e.g. `"2024-06-15T14:00:00[Europe/Stockholm]"` (offset inferred from the
|
|
108
|
+
* named timezone, including DST) or `"2024-06-15T14:00:00+02:00[Europe/Stockholm]"`
|
|
109
|
+
* (offset explicit; bracket must agree with the IANA zone)
|
|
110
|
+
* 2. UTC or fixed-offset Instant
|
|
111
|
+
* e.g. `"2024-01-01T00:00:00Z"`, `"2024-01-01T00:00:00+02:00"`
|
|
112
|
+
* 3. Plain date or datetime (no offset, `Z`, or IANA bracket), interpreted as UTC
|
|
113
|
+
* e.g. `"2024-01-01"`, `"2024-01-01T14:30:00"`, `"2024-01-01T14:30:00.500"`
|
|
114
|
+
*
|
|
115
|
+
* Strings with a time component that lack `Z`, an offset, or an IANA bracket are
|
|
116
|
+
* parsed as UTC wall-clock time (same semantics as Neo4j `LocalDateTime`).
|
|
117
|
+
*/
|
|
118
|
+
function parseDateString(s) {
|
|
119
|
+
// RFC 9557 / ZonedDateTime with IANA bracket notation
|
|
120
|
+
try {
|
|
121
|
+
return temporal_polyfill_1.Temporal.ZonedDateTime.from(s).epochMilliseconds;
|
|
122
|
+
}
|
|
123
|
+
catch (_a) {
|
|
124
|
+
/* empty */
|
|
125
|
+
}
|
|
126
|
+
// UTC or fixed-offset datetime (no IANA name)
|
|
127
|
+
try {
|
|
128
|
+
return temporal_polyfill_1.Temporal.Instant.from(s).epochMilliseconds;
|
|
129
|
+
}
|
|
130
|
+
catch (_b) {
|
|
131
|
+
/* empty */
|
|
132
|
+
}
|
|
133
|
+
// Plain datetime — interpret as UTC.
|
|
134
|
+
// Also covers date-only strings like "2024-01-01" (PlainDateTime.from parses
|
|
135
|
+
// them as midnight), so a separate PlainDate path is not needed.
|
|
136
|
+
try {
|
|
137
|
+
return temporal_polyfill_1.Temporal.PlainDateTime.from(s).toZonedDateTime('UTC')
|
|
138
|
+
.epochMilliseconds;
|
|
139
|
+
}
|
|
140
|
+
catch (_c) {
|
|
141
|
+
/* empty */
|
|
142
|
+
}
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=date-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-utils.js","sourceRoot":"","sources":["../../../../src/_generated/style-rules/date-utils.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AA6DH,0CAyCC;AAmBD,0CA0BC;AAjJD;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,yDAA6C;AAE7C,MAAM,UAAU,GAAG,QAAU,CAAC;AAE9B,SAAS,aAAa,CAAC,EAAsB;IAC3C,OAAO,CACL,EAAE,CAAC,IAAI,GAAG,OAAS;QACnB,EAAE,CAAC,MAAM,GAAG,KAAM;QAClB,EAAE,CAAC,MAAM,GAAG,IAAK;QACjB,EAAE,CAAC,WAAW,CACf,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,SAAiB;IACtC,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACzD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,OAAO,CACL,IAAI;QACJ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,OAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,KAAM,CAAC,CACvE,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,eAAe,CAAC,CAAS;IACvC,sEAAsE;IACtE,0EAA0E;IAC1E,0EAA0E;IAC1E,yEAAyE;IACzE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAA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;GAgBG;AACH,SAAgB,eAAe,CAAC,CAAS;IACvC,sDAAsD;IACtD,IAAI,CAAC;QACH,OAAO,4BAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAC1D,CAAC;IAAC,WAAM,CAAC;QACP,WAAW;IACb,CAAC;IAED,8CAA8C;IAC9C,IAAI,CAAC;QACH,OAAO,4BAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC;IACpD,CAAC;IAAC,WAAM,CAAC;QACP,WAAW;IACb,CAAC;IAED,qCAAqC;IACrC,6EAA6E;IAC7E,iEAAiE;IACjE,IAAI,CAAC;QACH,OAAO,4BAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC;aACzD,iBAAiB,CAAC;IACvB,CAAC;IAAC,WAAM,CAAC;QACP,WAAW;IACb,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/*\n * AUTO-GENERATED FILE — DO NOT EDIT.\n * Source of truth: packages/style-rules/src/\n * Regenerate with `pnpm generate:shared` (runs automatically at build/dev/install).\n */\n\n/**\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 { Temporal } from 'temporal-polyfill';\n\nconst MS_PER_DAY = 86_400_000;\n\nfunction plainTimeToMs(pt: Temporal.PlainTime): number {\n return (\n pt.hour * 3_600_000 +\n pt.minute * 60_000 +\n pt.second * 1_000 +\n pt.millisecond\n );\n}\n\nfunction parseOffsetMs(offsetStr: string): number | null {\n const match = offsetStr.match(/^([+-])(\\d{2}):(\\d{2})$/);\n if (!match) {\n return null;\n }\n const sign = match[1] === '+' ? 1 : -1;\n return (\n sign *\n (parseInt(match[2], 10) * 3_600_000 + parseInt(match[3], 10) * 60_000)\n );\n}\n\n/**\n * Parses an ISO 8601 time string to UTC milliseconds since midnight\n * (0–86,399,999). Returns `null` if the string cannot be parsed.\n *\n * Three formats are accepted:\n * 1. Local time (no offset): `\"14:30:00\"`, `\"14:30:00.500\"` — treated as UTC\n * 2. UTC time with Z suffix: `\"14:30:00Z\"` — treated identically to the local form\n * 3. Offset time: `\"14:30:00+02:00\"` — the offset is applied so the result\n * is the equivalent UTC time of day. `\"12:00:00+01:00\"` resolves to\n * 39,600,000 (11:00 UTC), which is less than `\"12:00:00+00:00\"` (43,200,000).\n *\n * Values wrap around midnight: `\"00:00:00+01:00\"` → 82,800,000 (23:00 UTC).\n */\nexport function parseTimeString(s: string): number | null {\n // Reject datetime strings and anything with an IANA timezone bracket.\n // Temporal.PlainTime.from silently extracts the time portion from strings\n // containing a 'T' separator. IANA brackets are meaningless for time-only\n // values (there is no date to anchor DST to), so they are also rejected.\n if (s.includes('T') || s.includes('[')) {\n return null;\n }\n // Offset time: detect \"+HH:MM\" or \"-HH:MM\" suffix first. Temporal.PlainTime.from\n // silently strips offsets and returns the clock-face time, so we must handle\n // offset strings explicitly before falling through to the plain parse.\n const offsetMatch = s.match(/([+-]\\d{2}:\\d{2})(\\[.*\\])?$/);\n if (offsetMatch) {\n const offsetStr = offsetMatch[1];\n const timeStr = s.slice(0, s.indexOf(offsetStr));\n const offsetMs = parseOffsetMs(offsetStr);\n if (offsetMs !== null) {\n try {\n const localMs = plainTimeToMs(Temporal.PlainTime.from(timeStr));\n // Subtract the UTC offset to normalise to UTC time-of-day; wrap around midnight\n return (((localMs - offsetMs) % MS_PER_DAY) + MS_PER_DAY) % MS_PER_DAY;\n } catch {\n /* empty */\n }\n }\n return null;\n }\n\n // UTC time with Z suffix (e.g. \"14:30:00Z\") — strip Z and treat as local (UTC) time.\n // Only apply when there is no 'T' in the string; a datetime string like\n // \"2024-06-15T14:30:00Z\" must not be accepted here.\n const normalized = s.endsWith('Z') && !s.includes('T') ? s.slice(0, -1) : s;\n\n // Local time (no offset) — treated as UTC\n try {\n return plainTimeToMs(Temporal.PlainTime.from(normalized));\n } catch {\n /* empty */\n }\n\n return null;\n}\n\n/**\n * Parses an ISO 8601 or RFC 9557 date/datetime string to a Unix millisecond\n * timestamp. Returns `null` if the string cannot be parsed.\n *\n * Three formats are tried in order:\n * 1. RFC 9557 ZonedDateTime with IANA bracket notation\n * e.g. `\"2024-06-15T14:00:00[Europe/Stockholm]\"` (offset inferred from the\n * named timezone, including DST) or `\"2024-06-15T14:00:00+02:00[Europe/Stockholm]\"`\n * (offset explicit; bracket must agree with the IANA zone)\n * 2. UTC or fixed-offset Instant\n * e.g. `\"2024-01-01T00:00:00Z\"`, `\"2024-01-01T00:00:00+02:00\"`\n * 3. Plain date or datetime (no offset, `Z`, or IANA bracket), interpreted as UTC\n * e.g. `\"2024-01-01\"`, `\"2024-01-01T14:30:00\"`, `\"2024-01-01T14:30:00.500\"`\n *\n * Strings with a time component that lack `Z`, an offset, or an IANA bracket are\n * parsed as UTC wall-clock time (same semantics as Neo4j `LocalDateTime`).\n */\nexport function parseDateString(s: string): number | null {\n // RFC 9557 / ZonedDateTime with IANA bracket notation\n try {\n return Temporal.ZonedDateTime.from(s).epochMilliseconds;\n } catch {\n /* empty */\n }\n\n // UTC or fixed-offset datetime (no IANA name)\n try {\n return Temporal.Instant.from(s).epochMilliseconds;\n } catch {\n /* empty */\n }\n\n // Plain datetime — interpret as UTC.\n // Also covers date-only strings like \"2024-01-01\" (PlainDateTime.from parses\n // them as midnight), so a separate PlainDate path is not needed.\n try {\n return Temporal.PlainDateTime.from(s).toZonedDateTime('UTC')\n .epochMilliseconds;\n } catch {\n /* empty */\n }\n\n return null;\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* AUTO-GENERATED FILE — DO NOT EDIT.
|
|
4
|
+
* Source of truth: packages/style-rules/src/
|
|
5
|
+
* Regenerate with `pnpm generate:shared` (runs automatically at build/dev/install).
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.TimeLiteralSchema = exports.DatetimeLiteralSchema = exports.parseTimeString = exports.parseDateString = exports.lerpColor = exports.getWeight = void 0;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) "Neo4j"
|
|
12
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
13
|
+
*
|
|
14
|
+
* This file is part of Neo4j.
|
|
15
|
+
*
|
|
16
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
17
|
+
* it under the terms of the GNU General Public License as published by
|
|
18
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
19
|
+
* (at your option) any later version.
|
|
20
|
+
*
|
|
21
|
+
* This program is distributed in the hope that it will be useful,
|
|
22
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
23
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
24
|
+
* GNU General Public License for more details.
|
|
25
|
+
*
|
|
26
|
+
* You should have received a copy of the GNU General Public License
|
|
27
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
28
|
+
*/
|
|
29
|
+
var color_utils_1 = require("./color-utils");
|
|
30
|
+
Object.defineProperty(exports, "getWeight", { enumerable: true, get: function () { return color_utils_1.getWeight; } });
|
|
31
|
+
Object.defineProperty(exports, "lerpColor", { enumerable: true, get: function () { return color_utils_1.lerpColor; } });
|
|
32
|
+
var date_utils_1 = require("./date-utils");
|
|
33
|
+
Object.defineProperty(exports, "parseDateString", { enumerable: true, get: function () { return date_utils_1.parseDateString; } });
|
|
34
|
+
Object.defineProperty(exports, "parseTimeString", { enumerable: true, get: function () { return date_utils_1.parseTimeString; } });
|
|
35
|
+
var literal_schemas_1 = require("./literal-schemas");
|
|
36
|
+
Object.defineProperty(exports, "DatetimeLiteralSchema", { enumerable: true, get: function () { return literal_schemas_1.DatetimeLiteralSchema; } });
|
|
37
|
+
Object.defineProperty(exports, "TimeLiteralSchema", { enumerable: true, get: function () { return literal_schemas_1.TimeLiteralSchema; } });
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/_generated/style-rules/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,6CAAqD;AAA5C,wGAAA,SAAS,OAAA;AAAE,wGAAA,SAAS,OAAA;AAC7B,2CAAgE;AAAvD,6GAAA,eAAe,OAAA;AAAE,6GAAA,eAAe,OAAA;AACzC,qDAA6E;AAApE,wHAAA,qBAAqB,OAAA;AAAE,oHAAA,iBAAiB,OAAA","sourcesContent":["/*\n * AUTO-GENERATED FILE — DO NOT EDIT.\n * Source of truth: packages/style-rules/src/\n * Regenerate with `pnpm generate:shared` (runs automatically at build/dev/install).\n */\n\n/**\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\nexport { getWeight, lerpColor } from './color-utils';\nexport { parseDateString, parseTimeString } from './date-utils';\nexport { DatetimeLiteralSchema, TimeLiteralSchema } from './literal-schemas';\nexport type { DatetimeLiteral, TimeLiteral } from './literal-schemas';\n"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* AUTO-GENERATED FILE — DO NOT EDIT.
|
|
4
|
+
* Source of truth: packages/style-rules/src/
|
|
5
|
+
* Regenerate with `pnpm generate:shared` (runs automatically at build/dev/install).
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.TimeLiteralSchema = exports.DatetimeLiteralSchema = void 0;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) "Neo4j"
|
|
12
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
13
|
+
*
|
|
14
|
+
* This file is part of Neo4j.
|
|
15
|
+
*
|
|
16
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
17
|
+
* it under the terms of the GNU General Public License as published by
|
|
18
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
19
|
+
* (at your option) any later version.
|
|
20
|
+
*
|
|
21
|
+
* This program is distributed in the hope that it will be useful,
|
|
22
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
23
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
24
|
+
* GNU General Public License for more details.
|
|
25
|
+
*
|
|
26
|
+
* You should have received a copy of the GNU General Public License
|
|
27
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
28
|
+
*/
|
|
29
|
+
const zod_1 = require("zod");
|
|
30
|
+
const date_utils_1 = require("./date-utils");
|
|
31
|
+
/**
|
|
32
|
+
* An ISO 8601 or RFC 9557 datetime literal that resolves to a Unix millisecond
|
|
33
|
+
* timestamp at evaluation time. Supported formats:
|
|
34
|
+
* - RFC 9557 with IANA timezone: `"2024-06-15T14:00:00[Europe/Stockholm]"` (offset
|
|
35
|
+
* inferred from the named zone, DST-aware) or `"2024-06-15T14:00:00+02:00[Europe/Stockholm]"`
|
|
36
|
+
* (offset explicit)
|
|
37
|
+
* - UTC or offset datetime: `"2024-01-01T00:00:00Z"`, `"2024-01-01T00:00:00+02:00"`
|
|
38
|
+
* - Plain datetime (treated as UTC): `"2024-01-01T14:30:00"`, `"2024-01-01T14:30:00.500"`
|
|
39
|
+
* - Date-only (treated as UTC midnight): `"2024-01-01"`
|
|
40
|
+
*/
|
|
41
|
+
exports.DatetimeLiteralSchema = zod_1.z.object({
|
|
42
|
+
datetime: zod_1.z.string().refine((s) => (0, date_utils_1.parseDateString)(s) !== null, {
|
|
43
|
+
message: 'datetime must be a valid ISO 8601 / RFC 9557 date or datetime string',
|
|
44
|
+
}),
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* An ISO 8601 time literal that resolves to milliseconds since UTC midnight
|
|
48
|
+
* at evaluation time. Supported formats:
|
|
49
|
+
* - Local time (treated as UTC): `"14:30:00"`, `"14:30:00.500"`
|
|
50
|
+
* - UTC time: `"14:30:00Z"` — identical to local form
|
|
51
|
+
* - Offset time (UTC-normalised): `"14:30:00+02:00"` → 45,000,000 ms (12:30 UTC)
|
|
52
|
+
*
|
|
53
|
+
* IANA timezone brackets (e.g. `[Europe/Stockholm]`) are **not** accepted — a
|
|
54
|
+
* time-of-day value has no calendar date so DST cannot be resolved. Use
|
|
55
|
+
* `{ datetime }` literals for timezone-aware instants.
|
|
56
|
+
*
|
|
57
|
+
* Full datetime strings (containing `T`) are rejected.
|
|
58
|
+
*/
|
|
59
|
+
exports.TimeLiteralSchema = zod_1.z.object({
|
|
60
|
+
time: zod_1.z.string().refine((s) => (0, date_utils_1.parseTimeString)(s) !== null, {
|
|
61
|
+
message: 'time must be a valid ISO 8601 time string (e.g. "14:30:00" or "14:30:00+02:00")',
|
|
62
|
+
}),
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=literal-schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literal-schemas.js","sourceRoot":"","sources":["../../../../src/_generated/style-rules/literal-schemas.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,6BAAwB;AAExB,6CAAgE;AAEhE;;;;;;;;;GASG;AACU,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,4BAAe,EAAC,CAAC,CAAC,KAAK,IAAI,EAAE;QAC9D,OAAO,EACL,sEAAsE;KACzE,CAAC;CACH,CAAC,CAAC;AAGH;;;;;;;;;;;;GAYG;AACU,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,4BAAe,EAAC,CAAC,CAAC,KAAK,IAAI,EAAE;QAC1D,OAAO,EACL,iFAAiF;KACpF,CAAC;CACH,CAAC,CAAC","sourcesContent":["/*\n * AUTO-GENERATED FILE — DO NOT EDIT.\n * Source of truth: packages/style-rules/src/\n * Regenerate with `pnpm generate:shared` (runs automatically at build/dev/install).\n */\n\n/**\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 { z } from 'zod';\n\nimport { parseDateString, parseTimeString } from './date-utils';\n\n/**\n * An ISO 8601 or RFC 9557 datetime literal that resolves to a Unix millisecond\n * timestamp at evaluation time. Supported formats:\n * - RFC 9557 with IANA timezone: `\"2024-06-15T14:00:00[Europe/Stockholm]\"` (offset\n * inferred from the named zone, DST-aware) or `\"2024-06-15T14:00:00+02:00[Europe/Stockholm]\"`\n * (offset explicit)\n * - UTC or offset datetime: `\"2024-01-01T00:00:00Z\"`, `\"2024-01-01T00:00:00+02:00\"`\n * - Plain datetime (treated as UTC): `\"2024-01-01T14:30:00\"`, `\"2024-01-01T14:30:00.500\"`\n * - Date-only (treated as UTC midnight): `\"2024-01-01\"`\n */\nexport const DatetimeLiteralSchema = z.object({\n datetime: z.string().refine((s) => parseDateString(s) !== null, {\n message:\n 'datetime must be a valid ISO 8601 / RFC 9557 date or datetime string',\n }),\n});\nexport type DatetimeLiteral = z.infer<typeof DatetimeLiteralSchema>;\n\n/**\n * An ISO 8601 time literal that resolves to milliseconds since UTC midnight\n * at evaluation time. Supported formats:\n * - Local time (treated as UTC): `\"14:30:00\"`, `\"14:30:00.500\"`\n * - UTC time: `\"14:30:00Z\"` — identical to local form\n * - Offset time (UTC-normalised): `\"14:30:00+02:00\"` → 45,000,000 ms (12:30 UTC)\n *\n * IANA timezone brackets (e.g. `[Europe/Stockholm]`) are **not** accepted — a\n * time-of-day value has no calendar date so DST cannot be resolved. Use\n * `{ datetime }` literals for timezone-aware instants.\n *\n * Full datetime strings (containing `T`) are rejected.\n */\nexport const TimeLiteralSchema = z.object({\n time: z.string().refine((s) => parseTimeString(s) !== null, {\n message:\n 'time must be a valid ISO 8601 time string (e.g. \"14:30:00\" or \"14:30:00+02:00\")',\n }),\n});\nexport type TimeLiteral = z.infer<typeof TimeLiteralSchema>;\n"]}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dateTimeStyleRules = 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
|
+
/** Neo4j driver-style portable DateTime property (ISO string in `stringified`). */
|
|
28
|
+
function dateTimeProp(iso) {
|
|
29
|
+
return { stringified: JSON.stringify(iso), type: 'DateTime' };
|
|
30
|
+
}
|
|
31
|
+
/** Neo4j driver-style portable LocalTime property. */
|
|
32
|
+
function localTimeProp(time) {
|
|
33
|
+
return { stringified: JSON.stringify(time), type: 'LocalTime' };
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Pokemon nodes with `firstSeen` (DateTime) and optional `peakActivity` (LocalTime).
|
|
37
|
+
* Values use UTC offsets and RFC 9557 IANA brackets where noted.
|
|
38
|
+
* Pikachu uses IANA-only form (`…[Europe/Stockholm]`) — no explicit offset required.
|
|
39
|
+
*/
|
|
40
|
+
const dateTimeStoryGraph = {
|
|
41
|
+
nodes: [
|
|
42
|
+
{
|
|
43
|
+
id: 'mewtwo',
|
|
44
|
+
labels: ['Pokemon'],
|
|
45
|
+
properties: {
|
|
46
|
+
era: { stringified: '"1996 — Kanto"', type: 'string' },
|
|
47
|
+
firstSeen: dateTimeProp('1996-02-27T00:00:00Z'),
|
|
48
|
+
name: { stringified: '"Mewtwo"', type: 'string' },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: 'eevee',
|
|
53
|
+
labels: ['Pokemon'],
|
|
54
|
+
properties: {
|
|
55
|
+
era: { stringified: '"2024 — Paldea"', type: 'string' },
|
|
56
|
+
firstSeen: dateTimeProp('2024-01-15T10:00:00+01:00'),
|
|
57
|
+
name: { stringified: '"Eevee"', type: 'string' },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 'pikachu',
|
|
62
|
+
labels: ['Pokemon'],
|
|
63
|
+
properties: {
|
|
64
|
+
era: { stringified: '"2024 — Stockholm CEST"', type: 'string' },
|
|
65
|
+
// RFC 9557: local time in Europe/Stockholm — offset inferred (CEST in June)
|
|
66
|
+
firstSeen: dateTimeProp('2024-06-15T14:00:00[Europe/Stockholm]'),
|
|
67
|
+
name: { stringified: '"Pikachu"', type: 'string' },
|
|
68
|
+
peakActivity: localTimeProp('14:30:00'),
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 'charizard',
|
|
73
|
+
labels: ['Pokemon'],
|
|
74
|
+
properties: {
|
|
75
|
+
era: { stringified: '"2024 — New York EDT"', type: 'string' },
|
|
76
|
+
firstSeen: dateTimeProp('2024-07-04T12:00:00-04:00[America/New_York]'),
|
|
77
|
+
name: { stringified: '"Charizard"', type: 'string' },
|
|
78
|
+
peakActivity: localTimeProp('09:00:00'),
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: 'dragon-type',
|
|
83
|
+
labels: ['Type'],
|
|
84
|
+
properties: { name: { stringified: '"Dragon"', type: 'string' } },
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
rels: [
|
|
88
|
+
{
|
|
89
|
+
from: 'mewtwo',
|
|
90
|
+
id: 'rel1',
|
|
91
|
+
properties: {},
|
|
92
|
+
to: 'dragon-type',
|
|
93
|
+
type: 'HAS_TYPE',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
from: 'pikachu',
|
|
97
|
+
id: 'rel2',
|
|
98
|
+
properties: {},
|
|
99
|
+
to: 'dragon-type',
|
|
100
|
+
type: 'HAS_TYPE',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
from: 'charizard',
|
|
104
|
+
id: 'rel3',
|
|
105
|
+
properties: {},
|
|
106
|
+
to: 'dragon-type',
|
|
107
|
+
type: 'HAS_TYPE',
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
exports.dateTimeStyleRules = [
|
|
112
|
+
{
|
|
113
|
+
// Default slate for all Pokemon
|
|
114
|
+
match: { label: 'Pokemon' },
|
|
115
|
+
apply: {
|
|
116
|
+
color: { value: '#94a3b8' },
|
|
117
|
+
captions: {
|
|
118
|
+
text: [
|
|
119
|
+
{ value: { property: 'name' }, styles: ['bold'] },
|
|
120
|
+
{ value: '\n', styles: [] },
|
|
121
|
+
{ value: { property: 'era' }, styles: ['italic'] },
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
size: { value: 28 },
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
// firstSeen in 2024 or later (UTC midnight boundary)
|
|
129
|
+
match: { label: 'Pokemon' },
|
|
130
|
+
where: {
|
|
131
|
+
greaterThanOrEqual: [
|
|
132
|
+
{ property: 'firstSeen' },
|
|
133
|
+
{ datetime: '2024-01-01T00:00:00Z' },
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
priority: 10,
|
|
137
|
+
apply: { color: { value: '#22c55e' } },
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
// firstSeen from mid-2024 onward
|
|
141
|
+
match: { label: 'Pokemon' },
|
|
142
|
+
where: {
|
|
143
|
+
greaterThanOrEqual: [
|
|
144
|
+
{ property: 'firstSeen' },
|
|
145
|
+
{ datetime: '2024-06-01T00:00:00Z' },
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
priority: 20,
|
|
149
|
+
apply: { color: { value: '#f97316' }, size: { value: 36 } },
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
// Very recent sightings (June 2024+) — Charizard qualifies
|
|
153
|
+
match: { label: 'Pokemon' },
|
|
154
|
+
where: {
|
|
155
|
+
greaterThanOrEqual: [
|
|
156
|
+
{ property: 'firstSeen' },
|
|
157
|
+
{ datetime: '2024-06-15T14:00:00Z' },
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
priority: 30,
|
|
161
|
+
apply: { color: { value: '#eab308' }, size: { value: 44 } },
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
// Afternoon-active Pokemon: peakActivity after noon UTC
|
|
165
|
+
match: { label: 'Pokemon' },
|
|
166
|
+
where: {
|
|
167
|
+
greaterThanOrEqual: [{ property: 'peakActivity' }, { time: '12:00:00Z' }],
|
|
168
|
+
},
|
|
169
|
+
priority: 40,
|
|
170
|
+
apply: { size: { value: 50 } },
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
match: { label: 'Type' },
|
|
174
|
+
apply: { color: { value: '#6366f1' }, size: { value: 22 } },
|
|
175
|
+
},
|
|
176
|
+
];
|
|
177
|
+
const Component = () => {
|
|
178
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { height: '600px' }, children: (0, jsx_runtime_1.jsx)(graph_visualization_1.GraphVisualization, { nodes: dateTimeStoryGraph.nodes, rels: dateTimeStoryGraph.rels, className: story_data_1.containerClasses, styleRules: exports.dateTimeStyleRules }) }));
|
|
179
|
+
};
|
|
180
|
+
exports.default = Component;
|
|
181
|
+
//# sourceMappingURL=graph-visualization-rule-based-styling-datetime.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,gEAA4D;AAO5D,6CAAgD;AAEhD,mFAAmF;AACnF,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;AAChE,CAAC;AAED,sDAAsD;AACtD,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;AAClE,CAAC;AAED;;;;GAIG;AACH,MAAM,kBAAkB,GAAyC;IAC/D,KAAK,EAAE;QACL;YACE,EAAE,EAAE,QAAQ;YACZ,MAAM,EAAE,CAAC,SAAS,CAAC;YACnB,UAAU,EAAE;gBACV,GAAG,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACtD,SAAS,EAAE,YAAY,CAAC,sBAAsB,CAAC;gBAC/C,IAAI,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;aAClD;SACF;QACD;YACE,EAAE,EAAE,OAAO;YACX,MAAM,EAAE,CAAC,SAAS,CAAC;YACnB,UAAU,EAAE;gBACV,GAAG,EAAE,EAAE,WAAW,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACvD,SAAS,EAAE,YAAY,CAAC,2BAA2B,CAAC;gBACpD,IAAI,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE;aACjD;SACF;QACD;YACE,EAAE,EAAE,SAAS;YACb,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,SAAS,EAAE;QAC3B,KAAK,EAAE;YACL,kBAAkB,EAAE;gBAClB,EAAE,QAAQ,EAAE,WAAW,EAAE;gBACzB,EAAE,QAAQ,EAAE,sBAAsB,EAAE;aACrC;SACF;QACD,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;KAC5D;IACD;QACE,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,gCAAK,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAC7B,uBAAC,wCAAkB,IACjB,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAC/B,IAAI,EAAE,kBAAkB,CAAC,IAAI,EAC7B,SAAS,EAAE,6BAAgB,EAC3B,UAAU,EAAE,0BAAkB,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 {\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"]}
|
package/lib/cjs/stories/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.PreviewGraphVisualizationSrc = exports.GraphVisualizationUniqueColorsStylingRawSrc = exports.GraphVisualizationRangeStylingSrc = exports.GraphVisualizationRuleBasedStylingAdvancedSrc = exports.GraphVisualizationSearchSrc = exports.GraphVisualizationRuleBasedStylingSrc = exports.GraphVisualizationSimpleStylingSrc = exports.GraphVisualizationHighlightingSrc = exports.GraphVisualizationCustomSrc = exports.GraphVisualizationMaximalistSrc = exports.GraphVisualizationBarebonesSrc = exports.GraphVisualizationDefaultSrc = exports.PreviewGraphVisualization = exports.GraphVisualizationUniqueColorsStyling = exports.GraphVisualizationSimpleStyling = exports.GraphVisualizationSearch = exports.GraphVisualizationRuleBasedStyling = exports.GraphVisualizationRuleBasedStylingAdvanced = exports.GraphVisualizationRangeStyling = exports.GraphVisualizationMaximalist = exports.GraphVisualizationHighlighting = exports.GraphVisualizationDefault = exports.GraphVisualizationCustom = exports.GraphVisualizationBarebones = void 0;
|
|
26
|
+
exports.PreviewGraphVisualizationSrc = exports.GraphVisualizationUniqueColorsStylingRawSrc = exports.GraphVisualizationRangeStylingSrc = exports.GraphVisualizationRuleBasedStylingDateTimeSrc = exports.GraphVisualizationRuleBasedStylingAdvancedSrc = exports.GraphVisualizationSearchSrc = exports.GraphVisualizationRuleBasedStylingSrc = exports.GraphVisualizationSimpleStylingSrc = exports.GraphVisualizationHighlightingSrc = exports.GraphVisualizationCustomSrc = exports.GraphVisualizationMaximalistSrc = exports.GraphVisualizationBarebonesSrc = exports.GraphVisualizationDefaultSrc = exports.PreviewGraphVisualization = exports.GraphVisualizationUniqueColorsStyling = exports.GraphVisualizationSimpleStyling = exports.GraphVisualizationSearch = exports.GraphVisualizationRuleBasedStyling = exports.GraphVisualizationRuleBasedStylingDateTime = exports.GraphVisualizationRuleBasedStylingAdvanced = exports.GraphVisualizationRangeStyling = exports.GraphVisualizationMaximalist = exports.GraphVisualizationHighlighting = exports.GraphVisualizationDefault = exports.GraphVisualizationCustom = exports.GraphVisualizationBarebones = void 0;
|
|
27
27
|
var graph_visualization_barebones_story_1 = require("./graph-visualization-barebones.story");
|
|
28
28
|
Object.defineProperty(exports, "GraphVisualizationBarebones", { enumerable: true, get: function () { return __importDefault(graph_visualization_barebones_story_1).default; } });
|
|
29
29
|
var graph_visualization_custom_story_1 = require("./graph-visualization-custom.story");
|
|
@@ -38,6 +38,8 @@ var graph_visualization_range_styling_story_1 = require("./graph-visualization-r
|
|
|
38
38
|
Object.defineProperty(exports, "GraphVisualizationRangeStyling", { enumerable: true, get: function () { return __importDefault(graph_visualization_range_styling_story_1).default; } });
|
|
39
39
|
var graph_visualization_rule_based_styling_advanced_story_1 = require("./graph-visualization-rule-based-styling-advanced.story");
|
|
40
40
|
Object.defineProperty(exports, "GraphVisualizationRuleBasedStylingAdvanced", { enumerable: true, get: function () { return __importDefault(graph_visualization_rule_based_styling_advanced_story_1).default; } });
|
|
41
|
+
var graph_visualization_rule_based_styling_datetime_story_1 = require("./graph-visualization-rule-based-styling-datetime.story");
|
|
42
|
+
Object.defineProperty(exports, "GraphVisualizationRuleBasedStylingDateTime", { enumerable: true, get: function () { return __importDefault(graph_visualization_rule_based_styling_datetime_story_1).default; } });
|
|
41
43
|
var graph_visualization_rule_based_styling_story_1 = require("./graph-visualization-rule-based-styling.story");
|
|
42
44
|
Object.defineProperty(exports, "GraphVisualizationRuleBasedStyling", { enumerable: true, get: function () { return __importDefault(graph_visualization_rule_based_styling_story_1).default; } });
|
|
43
45
|
var graph_visualization_search_story_1 = require("./graph-visualization-search.story");
|
|
@@ -57,6 +59,7 @@ const graph_visualization_maximalist_story_raw_1 = __importDefault(require("./gr
|
|
|
57
59
|
const graph_visualization_range_styling_story_raw_1 = __importDefault(require("./graph-visualization-range-styling.story?raw"));
|
|
58
60
|
const graph_visualization_rule_based_styling_story_raw_1 = __importDefault(require("./graph-visualization-rule-based-styling.story?raw"));
|
|
59
61
|
const graph_visualization_rule_based_styling_advanced_story_raw_1 = __importDefault(require("./graph-visualization-rule-based-styling-advanced.story?raw"));
|
|
62
|
+
const graph_visualization_rule_based_styling_datetime_story_raw_1 = __importDefault(require("./graph-visualization-rule-based-styling-datetime.story?raw"));
|
|
60
63
|
const graph_visualization_search_story_raw_1 = __importDefault(require("./graph-visualization-search.story?raw"));
|
|
61
64
|
const graph_visualization_simple_styling_story_raw_1 = __importDefault(require("./graph-visualization-simple-styling.story?raw"));
|
|
62
65
|
const graph_visualization_unique_colors_styling_story_raw_1 = __importDefault(require("./graph-visualization-unique-colors-styling.story?raw"));
|
|
@@ -70,6 +73,7 @@ exports.GraphVisualizationSimpleStylingSrc = (0, utils_1.removeLicenseHeader)(gr
|
|
|
70
73
|
exports.GraphVisualizationRuleBasedStylingSrc = (0, utils_1.removeLicenseHeader)(graph_visualization_rule_based_styling_story_raw_1.default);
|
|
71
74
|
exports.GraphVisualizationSearchSrc = (0, utils_1.removeLicenseHeader)(graph_visualization_search_story_raw_1.default);
|
|
72
75
|
exports.GraphVisualizationRuleBasedStylingAdvancedSrc = (0, utils_1.removeLicenseHeader)(graph_visualization_rule_based_styling_advanced_story_raw_1.default);
|
|
76
|
+
exports.GraphVisualizationRuleBasedStylingDateTimeSrc = (0, utils_1.removeLicenseHeader)(graph_visualization_rule_based_styling_datetime_story_raw_1.default);
|
|
73
77
|
exports.GraphVisualizationRangeStylingSrc = (0, utils_1.removeLicenseHeader)(graph_visualization_range_styling_story_raw_1.default);
|
|
74
78
|
exports.GraphVisualizationUniqueColorsStylingRawSrc = (0, utils_1.removeLicenseHeader)(graph_visualization_unique_colors_styling_story_raw_1.default);
|
|
75
79
|
exports.PreviewGraphVisualizationSrc = (0, utils_1.removeLicenseHeader)(preview_graph_visualization_story_raw_1.default);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/stories/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,6FAA+F;AAAtF,mKAAA,OAAO,OAA+B;AAC/C,uFAAyF;AAAhF,6JAAA,OAAO,OAA4B;AAC5C,yFAA2F;AAAlF,+JAAA,OAAO,OAA6B;AAC7C,mGAAqG;AAA5F,yKAAA,OAAO,OAAkC;AAClD,+FAAiG;AAAxF,qKAAA,OAAO,OAAgC;AAChD,qGAAsG;AAA7F,0KAAA,OAAO,OAAkC;AAClD,iIAAgI;AAAvH,oMAAA,OAAO,OAA8C;AAC9D,+GAA+G;AAAtG,mLAAA,OAAO,OAAsC;AACtD,uFAAyF;AAAhF,6JAAA,OAAO,OAA4B;AAC5C,uGAAwG;AAA/F,4KAAA,OAAO,OAAmC;AACnD,qHAAqH;AAA5G,yLAAA,OAAO,OAAyC;AACzD,yFAA2F;AAAlF,+JAAA,OAAO,OAA6B;AAE7C,oCAA+C;AAC/C,wHAA0F;AAC1F,kHAAoF;AACpF,oHAAsF;AACtF,8HAAgG;AAChG,0HAA4F;AAC5F,gIAA8F;AAC9F,0IAA0G;AAC1G,4JAA2H;AAC3H,kHAAoF;AACpF,kIAAmG;AACnG,gJAA6G;AAC7G,oHAAsF;AAEzE,QAAA,4BAA4B,GAAG,IAAA,2BAAmB,EAC7D,+CAA+B,CAChC,CAAC;AAEW,QAAA,8BAA8B,GAAG,IAAA,2BAAmB,EAC/D,iDAAiC,CAClC,CAAC;AAEW,QAAA,+BAA+B,GAAG,IAAA,2BAAmB,EAChE,kDAAkC,CACnC,CAAC;AAEW,QAAA,2BAA2B,GAAG,IAAA,2BAAmB,EAC5D,8CAA8B,CAC/B,CAAC;AAEW,QAAA,iCAAiC,GAAG,IAAA,2BAAmB,EAClE,oDAAoC,CACrC,CAAC;AAEW,QAAA,kCAAkC,GAAG,IAAA,2BAAmB,EACnE,sDAAqC,CACtC,CAAC;AAEW,QAAA,qCAAqC,GAAG,IAAA,2BAAmB,EACtE,0DAAwC,CACzC,CAAC;AAEW,QAAA,2BAA2B,GAAG,IAAA,2BAAmB,EAC5D,8CAA8B,CAC/B,CAAC;AAEW,QAAA,6CAA6C,GACxD,IAAA,2BAAmB,EAAC,mEAAgD,CAAC,CAAC;AAE3D,QAAA,iCAAiC,GAAG,IAAA,2BAAmB,EAClE,qDAAiC,CAClC,CAAC;AAEW,QAAA,2CAA2C,GAAG,IAAA,2BAAmB,EAC5E,6DAAwC,CACzC,CAAC;AAEW,QAAA,4BAA4B,GAAG,IAAA,2BAAmB,EAC7D,+CAA+B,CAChC,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\nexport { default as GraphVisualizationBarebones } from './graph-visualization-barebones.story';\nexport { default as GraphVisualizationCustom } from './graph-visualization-custom.story';\nexport { default as GraphVisualizationDefault } from './graph-visualization-default.story';\nexport { default as GraphVisualizationHighlighting } from './graph-visualization-highlighting.story';\nexport { default as GraphVisualizationMaximalist } from './graph-visualization-maximalist.story';\nexport { default as GraphVisualizationRangeStyling } from './graph-visualization-range-styling.story';\nexport { default as GraphVisualizationRuleBasedStylingAdvanced } from './graph-visualization-rule-based-styling-advanced.story';\nexport { default as GraphVisualizationRuleBasedStyling } from './graph-visualization-rule-based-styling.story';\nexport { default as GraphVisualizationSearch } from './graph-visualization-search.story';\nexport { default as GraphVisualizationSimpleStyling } from './graph-visualization-simple-styling.story';\nexport { default as GraphVisualizationUniqueColorsStyling } from './graph-visualization-unique-colors-styling.story';\nexport { default as PreviewGraphVisualization } from './preview-graph-visualization.story';\n\nimport { removeLicenseHeader } from '../utils';\nimport GraphVisualizationBarebonesSrcRaw from './graph-visualization-barebones.story?raw';\nimport GraphVisualizationCustomSrcRaw from './graph-visualization-custom.story?raw';\nimport GraphVisualizationDefaultSrcRaw from './graph-visualization-default.story?raw';\nimport GraphVisualizationHighlightingSrcRaw from './graph-visualization-highlighting.story?raw';\nimport GraphVisualizationMaximalistSrcRaw from './graph-visualization-maximalist.story?raw';\nimport GraphVisualizationRangeStylingRaw from './graph-visualization-range-styling.story?raw';\nimport GraphVisualizationRuleBasedStylingSrcRaw from './graph-visualization-rule-based-styling.story?raw';\nimport GraphVisualizationRuleBasedStylingAdvancedSrcRaw from './graph-visualization-rule-based-styling-advanced.story?raw';\nimport GraphVisualizationSearchSrcRaw from './graph-visualization-search.story?raw';\nimport GraphVisualizationSimpleStylingSrcRaw from './graph-visualization-simple-styling.story?raw';\nimport GraphVisualizationUniqueColorsStylingRaw from './graph-visualization-unique-colors-styling.story?raw';\nimport PreviewGraphVisualizationSrcRaw from './preview-graph-visualization.story?raw';\n\nexport const GraphVisualizationDefaultSrc = removeLicenseHeader(\n GraphVisualizationDefaultSrcRaw,\n);\n\nexport const GraphVisualizationBarebonesSrc = removeLicenseHeader(\n GraphVisualizationBarebonesSrcRaw,\n);\n\nexport const GraphVisualizationMaximalistSrc = removeLicenseHeader(\n GraphVisualizationMaximalistSrcRaw,\n);\n\nexport const GraphVisualizationCustomSrc = removeLicenseHeader(\n GraphVisualizationCustomSrcRaw,\n);\n\nexport const GraphVisualizationHighlightingSrc = removeLicenseHeader(\n GraphVisualizationHighlightingSrcRaw,\n);\n\nexport const GraphVisualizationSimpleStylingSrc = removeLicenseHeader(\n GraphVisualizationSimpleStylingSrcRaw,\n);\n\nexport const GraphVisualizationRuleBasedStylingSrc = removeLicenseHeader(\n GraphVisualizationRuleBasedStylingSrcRaw,\n);\n\nexport const GraphVisualizationSearchSrc = removeLicenseHeader(\n GraphVisualizationSearchSrcRaw,\n);\n\nexport const GraphVisualizationRuleBasedStylingAdvancedSrc =\n removeLicenseHeader(GraphVisualizationRuleBasedStylingAdvancedSrcRaw);\n\nexport const GraphVisualizationRangeStylingSrc = removeLicenseHeader(\n GraphVisualizationRangeStylingRaw,\n);\n\nexport const GraphVisualizationUniqueColorsStylingRawSrc = removeLicenseHeader(\n GraphVisualizationUniqueColorsStylingRaw,\n);\n\nexport const PreviewGraphVisualizationSrc = removeLicenseHeader(\n PreviewGraphVisualizationSrcRaw,\n);\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/stories/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,6FAA+F;AAAtF,mKAAA,OAAO,OAA+B;AAC/C,uFAAyF;AAAhF,6JAAA,OAAO,OAA4B;AAC5C,yFAA2F;AAAlF,+JAAA,OAAO,OAA6B;AAC7C,mGAAqG;AAA5F,yKAAA,OAAO,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CAA6C,GACxD,IAAA,2BAAmB,EAAC,mEAAgD,CAAC,CAAC;AAE3D,QAAA,iCAAiC,GAAG,IAAA,2BAAmB,EAClE,qDAAiC,CAClC,CAAC;AAEW,QAAA,2CAA2C,GAAG,IAAA,2BAAmB,EAC5E,6DAAwC,CACzC,CAAC;AAEW,QAAA,4BAA4B,GAAG,IAAA,2BAAmB,EAC7D,+CAA+B,CAChC,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\nexport { default as GraphVisualizationBarebones } from './graph-visualization-barebones.story';\nexport { default as GraphVisualizationCustom } from './graph-visualization-custom.story';\nexport { default as GraphVisualizationDefault } from './graph-visualization-default.story';\nexport { default as GraphVisualizationHighlighting } from './graph-visualization-highlighting.story';\nexport { default as GraphVisualizationMaximalist } from './graph-visualization-maximalist.story';\nexport { default as GraphVisualizationRangeStyling } from './graph-visualization-range-styling.story';\nexport { default as GraphVisualizationRuleBasedStylingAdvanced } from './graph-visualization-rule-based-styling-advanced.story';\nexport { default as GraphVisualizationRuleBasedStylingDateTime } from './graph-visualization-rule-based-styling-datetime.story';\nexport { default as GraphVisualizationRuleBasedStyling } from './graph-visualization-rule-based-styling.story';\nexport { default as GraphVisualizationSearch } from './graph-visualization-search.story';\nexport { default as GraphVisualizationSimpleStyling } from './graph-visualization-simple-styling.story';\nexport { default as GraphVisualizationUniqueColorsStyling } from './graph-visualization-unique-colors-styling.story';\nexport { default as PreviewGraphVisualization } from './preview-graph-visualization.story';\n\nimport { removeLicenseHeader } from '../utils';\nimport GraphVisualizationBarebonesSrcRaw from './graph-visualization-barebones.story?raw';\nimport GraphVisualizationCustomSrcRaw from './graph-visualization-custom.story?raw';\nimport GraphVisualizationDefaultSrcRaw from './graph-visualization-default.story?raw';\nimport GraphVisualizationHighlightingSrcRaw from './graph-visualization-highlighting.story?raw';\nimport GraphVisualizationMaximalistSrcRaw from './graph-visualization-maximalist.story?raw';\nimport GraphVisualizationRangeStylingRaw from './graph-visualization-range-styling.story?raw';\nimport GraphVisualizationRuleBasedStylingSrcRaw from './graph-visualization-rule-based-styling.story?raw';\nimport GraphVisualizationRuleBasedStylingAdvancedSrcRaw from './graph-visualization-rule-based-styling-advanced.story?raw';\nimport GraphVisualizationRuleBasedStylingDateTimeSrcRaw from './graph-visualization-rule-based-styling-datetime.story?raw';\nimport GraphVisualizationSearchSrcRaw from './graph-visualization-search.story?raw';\nimport GraphVisualizationSimpleStylingSrcRaw from './graph-visualization-simple-styling.story?raw';\nimport GraphVisualizationUniqueColorsStylingRaw from './graph-visualization-unique-colors-styling.story?raw';\nimport PreviewGraphVisualizationSrcRaw from './preview-graph-visualization.story?raw';\n\nexport const GraphVisualizationDefaultSrc = removeLicenseHeader(\n GraphVisualizationDefaultSrcRaw,\n);\n\nexport const GraphVisualizationBarebonesSrc = removeLicenseHeader(\n GraphVisualizationBarebonesSrcRaw,\n);\n\nexport const GraphVisualizationMaximalistSrc = removeLicenseHeader(\n GraphVisualizationMaximalistSrcRaw,\n);\n\nexport const GraphVisualizationCustomSrc = removeLicenseHeader(\n GraphVisualizationCustomSrcRaw,\n);\n\nexport const GraphVisualizationHighlightingSrc = removeLicenseHeader(\n GraphVisualizationHighlightingSrcRaw,\n);\n\nexport const GraphVisualizationSimpleStylingSrc = removeLicenseHeader(\n GraphVisualizationSimpleStylingSrcRaw,\n);\n\nexport const GraphVisualizationRuleBasedStylingSrc = removeLicenseHeader(\n GraphVisualizationRuleBasedStylingSrcRaw,\n);\n\nexport const GraphVisualizationSearchSrc = removeLicenseHeader(\n GraphVisualizationSearchSrcRaw,\n);\n\nexport const GraphVisualizationRuleBasedStylingAdvancedSrc =\n removeLicenseHeader(GraphVisualizationRuleBasedStylingAdvancedSrcRaw);\n\nexport const GraphVisualizationRuleBasedStylingDateTimeSrc =\n removeLicenseHeader(GraphVisualizationRuleBasedStylingDateTimeSrcRaw);\n\nexport const GraphVisualizationRangeStylingSrc = removeLicenseHeader(\n GraphVisualizationRangeStylingRaw,\n);\n\nexport const GraphVisualizationUniqueColorsStylingRawSrc = removeLicenseHeader(\n GraphVisualizationUniqueColorsStylingRaw,\n);\n\nexport const PreviewGraphVisualizationSrc = removeLicenseHeader(\n PreviewGraphVisualizationSrcRaw,\n);\n"]}
|