@neo4j-ndl/react-graph 2.0.3 → 2.0.4

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 (51) hide show
  1. package/lib/cjs/{styling/color-interpolation.js → _generated/style-rules/color-utils.js} +19 -4
  2. package/lib/cjs/_generated/style-rules/color-utils.js.map +1 -0
  3. package/lib/cjs/_generated/style-rules/date-utils.js +145 -0
  4. package/lib/cjs/_generated/style-rules/date-utils.js.map +1 -0
  5. package/lib/cjs/_generated/style-rules/index.js +38 -0
  6. package/lib/cjs/_generated/style-rules/index.js.map +1 -0
  7. package/lib/cjs/_generated/style-rules/literal-schemas.js +64 -0
  8. package/lib/cjs/_generated/style-rules/literal-schemas.js.map +1 -0
  9. package/lib/cjs/stories/graph-visualization-rule-based-styling-datetime.story.js +181 -0
  10. package/lib/cjs/stories/graph-visualization-rule-based-styling-datetime.story.js.map +1 -0
  11. package/lib/cjs/stories/index.js +5 -1
  12. package/lib/cjs/stories/index.js.map +1 -1
  13. package/lib/cjs/styling/compile-graph-styles.js +34 -8
  14. package/lib/cjs/styling/compile-graph-styles.js.map +1 -1
  15. package/lib/cjs/styling/style-types.js +4 -1
  16. package/lib/cjs/styling/style-types.js.map +1 -1
  17. package/lib/esm/{styling/color-interpolation.js → _generated/style-rules/color-utils.js} +18 -3
  18. package/lib/esm/_generated/style-rules/color-utils.js.map +1 -0
  19. package/lib/esm/_generated/style-rules/date-utils.js +141 -0
  20. package/lib/esm/_generated/style-rules/date-utils.js.map +1 -0
  21. package/lib/esm/_generated/style-rules/index.js +29 -0
  22. package/lib/esm/_generated/style-rules/index.js.map +1 -0
  23. package/lib/esm/_generated/style-rules/literal-schemas.js +61 -0
  24. package/lib/esm/_generated/style-rules/literal-schemas.js.map +1 -0
  25. package/lib/esm/stories/graph-visualization-rule-based-styling-datetime.story.js +178 -0
  26. package/lib/esm/stories/graph-visualization-rule-based-styling-datetime.story.js.map +1 -0
  27. package/lib/esm/stories/index.js +3 -0
  28. package/lib/esm/stories/index.js.map +1 -1
  29. package/lib/esm/styling/compile-graph-styles.js +27 -1
  30. package/lib/esm/styling/compile-graph-styles.js.map +1 -1
  31. package/lib/esm/styling/style-types.js +4 -1
  32. package/lib/esm/styling/style-types.js.map +1 -1
  33. package/lib/types/_generated/style-rules/color-utils.d.ts +33 -0
  34. package/lib/types/_generated/style-rules/color-utils.d.ts.map +1 -0
  35. package/lib/types/_generated/style-rules/date-utils.d.ts +54 -0
  36. package/lib/types/_generated/style-rules/date-utils.d.ts.map +1 -0
  37. package/lib/types/_generated/style-rules/index.d.ts +25 -0
  38. package/lib/types/_generated/style-rules/index.d.ts.map +1 -0
  39. package/lib/types/_generated/style-rules/literal-schemas.d.ts +53 -0
  40. package/lib/types/_generated/style-rules/literal-schemas.d.ts.map +1 -0
  41. package/lib/types/{styling/color-interpolation.d.ts → stories/graph-visualization-rule-based-styling-datetime.story.d.ts} +5 -4
  42. package/lib/types/stories/graph-visualization-rule-based-styling-datetime.story.d.ts.map +1 -0
  43. package/lib/types/stories/index.d.ts +2 -0
  44. package/lib/types/stories/index.d.ts.map +1 -1
  45. package/lib/types/styling/compile-graph-styles.d.ts.map +1 -1
  46. package/lib/types/styling/style-types.d.ts +12 -3
  47. package/lib/types/styling/style-types.d.ts.map +1 -1
  48. package/package.json +6 -4
  49. package/lib/cjs/styling/color-interpolation.js.map +0 -1
  50. package/lib/esm/styling/color-interpolation.js.map +0 -1
  51. package/lib/types/styling/color-interpolation.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-utils.js","sourceRoot":"","sources":["../../../../src/_generated/style-rules/date-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,UAAU,GAAG,QAAU,CAAC;AAE9B,SAAS,aAAa,CAAC,EAAsB;IAC3C,OAAO,CACL,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AAC,WAAM,CAAC;QACP,WAAW;IACb,CAAC;IAED,qCAAqC;IACrC,6EAA6E;IAC7E,iEAAiE;IACjE,IAAI,CAAC;QACH,OAAO,QAAQ,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,29 @@
1
+ /*
2
+ * AUTO-GENERATED FILE — DO NOT EDIT.
3
+ * Source of truth: packages/style-rules/src/
4
+ * Regenerate with `pnpm generate:shared` (runs automatically at build/dev/install).
5
+ */
6
+ /**
7
+ *
8
+ * Copyright (c) "Neo4j"
9
+ * Neo4j Sweden AB [http://neo4j.com]
10
+ *
11
+ * This file is part of Neo4j.
12
+ *
13
+ * Neo4j is free software: you can redistribute it and/or modify
14
+ * it under the terms of the GNU General Public License as published by
15
+ * the Free Software Foundation, either version 3 of the License, or
16
+ * (at your option) any later version.
17
+ *
18
+ * This program is distributed in the hope that it will be useful,
19
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ * GNU General Public License for more details.
22
+ *
23
+ * You should have received a copy of the GNU General Public License
24
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
25
+ */
26
+ export { getWeight, lerpColor } from './color-utils';
27
+ export { parseDateString, parseTimeString } from './date-utils';
28
+ export { DatetimeLiteralSchema, TimeLiteralSchema } from './literal-schemas';
29
+ //# 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,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,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\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,61 @@
1
+ /*
2
+ * AUTO-GENERATED FILE — DO NOT EDIT.
3
+ * Source of truth: packages/style-rules/src/
4
+ * Regenerate with `pnpm generate:shared` (runs automatically at build/dev/install).
5
+ */
6
+ /**
7
+ *
8
+ * Copyright (c) "Neo4j"
9
+ * Neo4j Sweden AB [http://neo4j.com]
10
+ *
11
+ * This file is part of Neo4j.
12
+ *
13
+ * Neo4j is free software: you can redistribute it and/or modify
14
+ * it under the terms of the GNU General Public License as published by
15
+ * the Free Software Foundation, either version 3 of the License, or
16
+ * (at your option) any later version.
17
+ *
18
+ * This program is distributed in the hope that it will be useful,
19
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ * GNU General Public License for more details.
22
+ *
23
+ * You should have received a copy of the GNU General Public License
24
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
25
+ */
26
+ import { z } from 'zod';
27
+ import { parseDateString, parseTimeString } from './date-utils';
28
+ /**
29
+ * An ISO 8601 or RFC 9557 datetime literal that resolves to a Unix millisecond
30
+ * timestamp at evaluation time. Supported formats:
31
+ * - RFC 9557 with IANA timezone: `"2024-06-15T14:00:00[Europe/Stockholm]"` (offset
32
+ * inferred from the named zone, DST-aware) or `"2024-06-15T14:00:00+02:00[Europe/Stockholm]"`
33
+ * (offset explicit)
34
+ * - UTC or offset datetime: `"2024-01-01T00:00:00Z"`, `"2024-01-01T00:00:00+02:00"`
35
+ * - Plain datetime (treated as UTC): `"2024-01-01T14:30:00"`, `"2024-01-01T14:30:00.500"`
36
+ * - Date-only (treated as UTC midnight): `"2024-01-01"`
37
+ */
38
+ export const DatetimeLiteralSchema = z.object({
39
+ datetime: z.string().refine((s) => parseDateString(s) !== null, {
40
+ message: 'datetime must be a valid ISO 8601 / RFC 9557 date or datetime string',
41
+ }),
42
+ });
43
+ /**
44
+ * An ISO 8601 time literal that resolves to milliseconds since UTC midnight
45
+ * at evaluation time. Supported formats:
46
+ * - Local time (treated as UTC): `"14:30:00"`, `"14:30:00.500"`
47
+ * - UTC time: `"14:30:00Z"` — identical to local form
48
+ * - Offset time (UTC-normalised): `"14:30:00+02:00"` → 45,000,000 ms (12:30 UTC)
49
+ *
50
+ * IANA timezone brackets (e.g. `[Europe/Stockholm]`) are **not** accepted — a
51
+ * time-of-day value has no calendar date so DST cannot be resolved. Use
52
+ * `{ datetime }` literals for timezone-aware instants.
53
+ *
54
+ * Full datetime strings (containing `T`) are rejected.
55
+ */
56
+ export const TimeLiteralSchema = z.object({
57
+ time: z.string().refine((s) => parseTimeString(s) !== null, {
58
+ message: 'time must be a valid ISO 8601 time string (e.g. "14:30:00" or "14:30:00+02:00")',
59
+ }),
60
+ });
61
+ //# 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,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEhE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;QAC9D,OAAO,EACL,sEAAsE;KACzE,CAAC;CACH,CAAC,CAAC;AAGH;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,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,178 @@
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
@@ -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,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,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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ACxB,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"]}
@@ -25,6 +25,7 @@ export { default as GraphVisualizationHighlighting } from './graph-visualization
25
25
  export { default as GraphVisualizationMaximalist } from './graph-visualization-maximalist.story';
26
26
  export { default as GraphVisualizationRangeStyling } from './graph-visualization-range-styling.story';
27
27
  export { default as GraphVisualizationRuleBasedStylingAdvanced } from './graph-visualization-rule-based-styling-advanced.story';
28
+ export { default as GraphVisualizationRuleBasedStylingDateTime } from './graph-visualization-rule-based-styling-datetime.story';
28
29
  export { default as GraphVisualizationRuleBasedStyling } from './graph-visualization-rule-based-styling.story';
29
30
  export { default as GraphVisualizationSearch } from './graph-visualization-search.story';
30
31
  export { default as GraphVisualizationSimpleStyling } from './graph-visualization-simple-styling.story';
@@ -39,6 +40,7 @@ import GraphVisualizationMaximalistSrcRaw from './graph-visualization-maximalist
39
40
  import GraphVisualizationRangeStylingRaw from './graph-visualization-range-styling.story?raw';
40
41
  import GraphVisualizationRuleBasedStylingSrcRaw from './graph-visualization-rule-based-styling.story?raw';
41
42
  import GraphVisualizationRuleBasedStylingAdvancedSrcRaw from './graph-visualization-rule-based-styling-advanced.story?raw';
43
+ import GraphVisualizationRuleBasedStylingDateTimeSrcRaw from './graph-visualization-rule-based-styling-datetime.story?raw';
42
44
  import GraphVisualizationSearchSrcRaw from './graph-visualization-search.story?raw';
43
45
  import GraphVisualizationSimpleStylingSrcRaw from './graph-visualization-simple-styling.story?raw';
44
46
  import GraphVisualizationUniqueColorsStylingRaw from './graph-visualization-unique-colors-styling.story?raw';
@@ -52,6 +54,7 @@ export const GraphVisualizationSimpleStylingSrc = removeLicenseHeader(GraphVisua
52
54
  export const GraphVisualizationRuleBasedStylingSrc = removeLicenseHeader(GraphVisualizationRuleBasedStylingSrcRaw);
53
55
  export const GraphVisualizationSearchSrc = removeLicenseHeader(GraphVisualizationSearchSrcRaw);
54
56
  export const GraphVisualizationRuleBasedStylingAdvancedSrc = removeLicenseHeader(GraphVisualizationRuleBasedStylingAdvancedSrcRaw);
57
+ export const GraphVisualizationRuleBasedStylingDateTimeSrc = removeLicenseHeader(GraphVisualizationRuleBasedStylingDateTimeSrcRaw);
55
58
  export const GraphVisualizationRangeStylingSrc = removeLicenseHeader(GraphVisualizationRangeStylingRaw);
56
59
  export const GraphVisualizationUniqueColorsStylingRawSrc = removeLicenseHeader(GraphVisualizationUniqueColorsStylingRaw);
57
60
  export const PreviewGraphVisualizationSrc = removeLicenseHeader(PreviewGraphVisualizationSrcRaw);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAC/F,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AACrG,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AACjG,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AACtG,OAAO,EAAE,OAAO,IAAI,0CAA0C,EAAE,MAAM,yDAAyD,CAAC;AAChI,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AAC/G,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AACxG,OAAO,EAAE,OAAO,IAAI,qCAAqC,EAAE,MAAM,mDAAmD,CAAC;AACrH,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAE3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,iCAAiC,MAAM,2CAA2C,CAAC;AAC1F,OAAO,8BAA8B,MAAM,wCAAwC,CAAC;AACpF,OAAO,+BAA+B,MAAM,yCAAyC,CAAC;AACtF,OAAO,oCAAoC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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 PreviewGraphVisualiz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M,CAAC,MAAM,4BAA4B,GAAG,mBAAmB,CAC7D,+BAA+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"]}
@@ -32,7 +32,7 @@ var __rest = (this && this.__rest) || function (s, e) {
32
32
  import { calculateDefaultNodeColors } from '@neo4j-devtools/word-color';
33
33
  import { tokens } from '@neo4j-ndl/base';
34
34
  import { color, rgbToHex, validHex } from '@uiw/react-color';
35
- import { getWeight, lerpColor } from './color-interpolation';
35
+ import { getWeight, lerpColor, parseDateString, parseTimeString, } from '../_generated/style-rules';
36
36
  export const DEFAULT_REL_COLOR = tokens.palette.neutral['40'];
37
37
  const NO_LABEL_FALLBACK_COLOR = tokens.palette.neutral['40'];
38
38
  export const UNIQUE_COLORS_PALETTE = Object.values(tokens.graph).filter(validHex);
@@ -179,6 +179,26 @@ function extractPropertyValue(prop) {
179
179
  return prop.stringified === 'true';
180
180
  case 'null':
181
181
  return null;
182
+ // Neo4j temporal types — parse to a number for comparison with
183
+ // { datetime } and { time } rule literals. An unparseable value resolves to
184
+ // null (treated as missing) rather than leaking a raw string into numeric
185
+ // comparisons, matching Cypher null semantics.
186
+ //
187
+ // DateTime / LocalDateTime → Unix milliseconds (epoch ms)
188
+ // LocalDateTime has no timezone; treated as UTC, same as date-only strings.
189
+ case 'DateTime':
190
+ case 'LocalDateTime':
191
+ case 'Date': {
192
+ const s = JSON.parse(prop.stringified);
193
+ return parseDateString(s);
194
+ }
195
+ // Time (ZonedTime) / LocalTime → UTC-normalised ms since midnight
196
+ // LocalTime has no offset; treated as UTC.
197
+ case 'Time':
198
+ case 'LocalTime': {
199
+ const s = JSON.parse(prop.stringified);
200
+ return parseTimeString(s);
201
+ }
182
202
  default:
183
203
  return prop.stringified;
184
204
  }
@@ -463,6 +483,12 @@ function evaluateValue(value, graphItem) {
463
483
  }
464
484
  return false;
465
485
  }
486
+ if ('datetime' in value) {
487
+ return parseDateString(value.datetime);
488
+ }
489
+ if ('time' in value) {
490
+ return parseTimeString(value.time);
491
+ }
466
492
  }
467
493
  return value;
468
494
  }