@neo4j-ndl/react-graph 2.1.6 → 2.1.7
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/_generated/style-rules/index.js +7 -1
- package/lib/cjs/_generated/style-rules/index.js.map +1 -1
- package/lib/cjs/_generated/style-rules/literal-schemas.js +32 -1
- package/lib/cjs/_generated/style-rules/literal-schemas.js.map +1 -1
- package/lib/cjs/_generated/style-rules/range-utils.js +46 -0
- package/lib/cjs/_generated/style-rules/range-utils.js.map +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/styling/compile-graph-styles.js +14 -5
- package/lib/cjs/styling/compile-graph-styles.js.map +1 -1
- package/lib/cjs/styling/style-types.js +19 -19
- package/lib/cjs/styling/style-types.js.map +1 -1
- package/lib/esm/_generated/style-rules/index.js +2 -1
- package/lib/esm/_generated/style-rules/index.js.map +1 -1
- package/lib/esm/_generated/style-rules/literal-schemas.js +28 -0
- package/lib/esm/_generated/style-rules/literal-schemas.js.map +1 -1
- package/lib/esm/_generated/style-rules/range-utils.js +43 -0
- package/lib/esm/_generated/style-rules/range-utils.js.map +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/styling/compile-graph-styles.js +15 -6
- package/lib/esm/styling/compile-graph-styles.js.map +1 -1
- package/lib/esm/styling/style-types.js +19 -19
- package/lib/esm/styling/style-types.js.map +1 -1
- package/lib/types/_generated/style-rules/index.d.ts +3 -2
- package/lib/types/_generated/style-rules/index.d.ts.map +1 -1
- package/lib/types/_generated/style-rules/literal-schemas.d.ts +20 -0
- package/lib/types/_generated/style-rules/literal-schemas.d.ts.map +1 -1
- package/lib/types/_generated/style-rules/range-utils.d.ts +26 -0
- package/lib/types/_generated/style-rules/range-utils.d.ts.map +1 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/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 +168 -33
- package/lib/types/styling/style-types.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
import { z } from 'zod';
|
|
22
|
-
import { BigintLiteralSchema, DatetimeLiteralSchema, LocalDatetimeLiteralSchema, NumericLiteralSchema, TimeLiteralSchema, } from '../_generated/style-rules';
|
|
22
|
+
import { BigintLiteralSchema, DatetimeLiteralSchema, LocalDatetimeLiteralSchema, NumericLiteralSchema, RangeLiteralSchema, TimeLiteralSchema, } from '../_generated/style-rules';
|
|
23
23
|
/*
|
|
24
24
|
* Style types defined in Zod, so that we can use the schemas to generate JSON Schema.
|
|
25
25
|
* This is useful for generating documentation, importing and for future integration into editors.
|
|
@@ -65,6 +65,8 @@ export const CypherValueSchema = z.union([
|
|
|
65
65
|
export const GraphBigintLiteralSchema = BigintLiteralSchema;
|
|
66
66
|
/** A number, native bigint, or JSON-safe bigint literal. */
|
|
67
67
|
export const GraphNumericLiteralSchema = NumericLiteralSchema;
|
|
68
|
+
/** A numeric, datetime, localdatetime, or time literal used as a range boundary. */
|
|
69
|
+
export const GraphRangeLiteralSchema = RangeLiteralSchema;
|
|
68
70
|
export const ValueSchema = z
|
|
69
71
|
.union([SelectorSchema, CypherValueSchema])
|
|
70
72
|
.describe('Either a property/label/reltype selector (e.g., {property: "name"}), a literal value (string, number, bigint, {bigint: "42"}, boolean, null), or a datetime/time literal (e.g., {datetime: "2024-01-01T00:00:00Z"}, {time: "14:30:00"}).');
|
|
@@ -112,50 +114,48 @@ const NvlOverlayIconSchema = z.object({
|
|
|
112
114
|
isDisabled: z.boolean().optional(),
|
|
113
115
|
});
|
|
114
116
|
/**
|
|
115
|
-
* Gradient coloring based on a continuous
|
|
116
|
-
* boundaries accept
|
|
117
|
+
* Gradient coloring based on a continuous orderable property value. Range
|
|
118
|
+
* boundaries accept numeric and temporal literals.
|
|
117
119
|
* Colors must be a standard hex string (#rrggbb).
|
|
118
|
-
* If the property is missing, non-
|
|
120
|
+
* If the property is missing, non-orderable, or any color is invalid, the
|
|
119
121
|
* colorRange is silently ignored — other style properties still apply.
|
|
120
122
|
*/
|
|
121
123
|
export const ColorRangeSchema = z.object({
|
|
122
124
|
onProperty: z.string(),
|
|
123
|
-
minValue:
|
|
125
|
+
minValue: GraphRangeLiteralSchema,
|
|
124
126
|
minColor: z.string(),
|
|
125
|
-
maxValue:
|
|
127
|
+
maxValue: GraphRangeLiteralSchema,
|
|
126
128
|
maxColor: z.string(),
|
|
127
|
-
midValue:
|
|
129
|
+
midValue: GraphRangeLiteralSchema.optional(),
|
|
128
130
|
midColor: z.string().optional(),
|
|
129
131
|
isDisabled: z.boolean().optional(),
|
|
130
132
|
});
|
|
131
133
|
/**
|
|
132
|
-
* Size interpolation for nodes based on a continuous
|
|
133
|
-
* Range boundaries accept
|
|
134
|
-
* literals.
|
|
134
|
+
* Size interpolation for nodes based on a continuous orderable property value.
|
|
135
|
+
* Range boundaries accept numeric and temporal literals.
|
|
135
136
|
* Maps a property value in [minValue, maxValue] to a size in [minSize, maxSize].
|
|
136
|
-
* If the property is missing or non-
|
|
137
|
+
* If the property is missing or non-orderable, sizeRange is silently ignored —
|
|
137
138
|
* other style properties still apply.
|
|
138
139
|
*/
|
|
139
140
|
export const SizeRangeSchema = z.object({
|
|
140
141
|
onProperty: z.string(),
|
|
141
|
-
minValue:
|
|
142
|
-
maxValue:
|
|
142
|
+
minValue: GraphRangeLiteralSchema,
|
|
143
|
+
maxValue: GraphRangeLiteralSchema,
|
|
143
144
|
minSize: z.number(),
|
|
144
145
|
maxSize: z.number(),
|
|
145
146
|
isDisabled: z.boolean().optional(),
|
|
146
147
|
});
|
|
147
148
|
/**
|
|
148
|
-
* Width interpolation for relationships based on a continuous
|
|
149
|
-
* value. Range boundaries accept
|
|
150
|
-
* literals.
|
|
149
|
+
* Width interpolation for relationships based on a continuous orderable
|
|
150
|
+
* property value. Range boundaries accept numeric and temporal literals.
|
|
151
151
|
* Maps a property value in [minValue, maxValue] to a width in [minWidth, maxWidth].
|
|
152
|
-
* If the property is missing or non-
|
|
152
|
+
* If the property is missing or non-orderable, widthRange is silently ignored —
|
|
153
153
|
* other style properties still apply.
|
|
154
154
|
*/
|
|
155
155
|
export const WidthRangeSchema = z.object({
|
|
156
156
|
onProperty: z.string(),
|
|
157
|
-
minValue:
|
|
158
|
-
maxValue:
|
|
157
|
+
minValue: GraphRangeLiteralSchema,
|
|
158
|
+
maxValue: GraphRangeLiteralSchema,
|
|
159
159
|
minWidth: z.number(),
|
|
160
160
|
maxWidth: z.number(),
|
|
161
161
|
isDisabled: z.boolean().optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-types.js","sourceRoot":"","sources":["../../../src/styling/style-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEL,mBAAmB,EAEnB,qBAAqB,EAErB,0BAA0B,EAE1B,oBAAoB,EAEpB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;GAUG;AAEH,+DAA+D;AAC/D,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC;IACpC,mBAAmB;IACnB,qBAAqB;IACrB,sBA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AAG,IAAI,cAAc,EAAE,CAAC;QACjC,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,MAAgD,CAAC;AAC1D,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { type Node, type Relationship } from '@neo4j-nvl/base';\nimport { z } from 'zod';\n\nimport {\n type BigintLiteral,\n BigintLiteralSchema,\n type DatetimeLiteral,\n DatetimeLiteralSchema,\n type LocalDatetimeLiteral,\n LocalDatetimeLiteralSchema,\n type NumericLiteral,\n NumericLiteralSchema,\n type TimeLiteral,\n TimeLiteralSchema,\n} from '../_generated/style-rules';\n\n/*\n * Style types defined in Zod, so that we can use the schemas to generate JSON Schema.\n * This is useful for generating documentation, importing and for future integration into editors.\n *\n * Some simple examples of rules:\n * - Match all nodes with label \"Person\" and apply red color\n * { match: { label: \"Person\" }, apply: { color: \"red\" } }\n *\n * - Match all relationships with type \"KNOWS\" which have the property \"name\" equal to \"John\" and apply width 10\n * { match: { reltype: \"KNOWS\" }, where: { equal: [{ property: \"name\" }, \"John\"] }, apply: { width: 10 } }\n */\n\n// Selector schemas. This is what can go under the `match` key.\nconst LabelSelectorSchema = z.object({\n label: z.string().nullable(),\n});\n\nconst ReltypeSelectorSchema = z.object({\n reltype: z.string().nullable(),\n});\n\nconst PropertySelectorSchema = z.object({\n property: z.string(),\n});\n\nexport const SelectorSchema = z.union([\n LabelSelectorSchema,\n ReltypeSelectorSchema,\n PropertySelectorSchema,\n]);\ntype Selector = z.infer<typeof SelectorSchema>;\n\nexport const MatchSchema = z.union([\n LabelSelectorSchema,\n ReltypeSelectorSchema,\n PropertySelectorSchema,\n]);\n\n// Schemas for the values that can go under the `where` key. Starts with defining the literal values.\nexport const CypherValueSchema = z.union([\n z.string(),\n NumericLiteralSchema,\n z.boolean(),\n z.null(),\n DatetimeLiteralSchema,\n LocalDatetimeLiteralSchema,\n TimeLiteralSchema,\n]);\nexport type CypherValue = z.infer<typeof CypherValueSchema>;\n/** A JSON-safe bigint literal represented by a signed decimal string. */\nexport const GraphBigintLiteralSchema = BigintLiteralSchema;\n/** A number, native bigint, or JSON-safe bigint literal. */\nexport const GraphNumericLiteralSchema = NumericLiteralSchema;\nexport type GraphBigintLiteral = BigintLiteral;\nexport type GraphNumericLiteral = NumericLiteral;\n\nexport const ValueSchema = z\n .union([SelectorSchema, CypherValueSchema])\n .describe(\n 'Either a property/label/reltype selector (e.g., {property: \"name\"}), a literal value (string, number, bigint, {bigint: \"42\"}, boolean, null), or a datetime/time literal (e.g., {datetime: \"2024-01-01T00:00:00Z\"}, {time: \"14:30:00\"}).',\n );\nexport type Value = z.infer<typeof ValueSchema>;\n\nexport type { DatetimeLiteral, LocalDatetimeLiteral, TimeLiteral };\n\n/**\n * Where clause - recursive type for conditional expressions\n * The type is manually defined for the export, since zod doesn't support exporting inferred recursive types.\n */\nexport type Where =\n // Selector is useful for finding nodes with multiple labels.\n // for example: {match: {label: \"Person\"}, where: {label: \"Actor\"}}\n // matches nodes with label Person AND Actor\n | Selector\n | { not: Where }\n | { and: Where[] }\n | { or: Where[] }\n | { equal: [Value, Value] }\n | { lessThan: [Value, Value] }\n | { lessThanOrEqual: [Value, Value] }\n | { greaterThan: [Value, Value] }\n | { greaterThanOrEqual: [Value, Value] }\n | { contains: [Value, Value] }\n | { startsWith: [Value, Value] }\n | { endsWith: [Value, Value] }\n\n // Null check matching Cypher's IS NULL\n // Returns true/false (not null), making it safe for null checking\n // Use { not: { isNull: ... } } for IS NOT NULL\n // @see https://neo4j.com/docs/cypher-manual/current/values-and-types/working-with-null/\n | { isNull: Value };\n\nexport const WhereSchema: z.ZodType<Where> = z.lazy(() =>\n z.union([\n SelectorSchema,\n z.object({ not: WhereSchema }),\n z.object({ and: z.array(WhereSchema) }),\n z.object({ or: z.array(WhereSchema) }),\n z.object({ equal: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ lessThan: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ lessThanOrEqual: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ greaterThan: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ greaterThanOrEqual: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ contains: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ startsWith: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ endsWith: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ isNull: ValueSchema }),\n ]),\n);\n\n// Schemas that go under the `apply` key.\nexport const CaptionValueSchema = z.union([\n z.string(),\n z.object({ property: z.string() }),\n z.object({ useType: z.literal(true) }),\n]);\nexport type CaptionValue = z.infer<typeof CaptionValueSchema>;\n\nexport const CaptionVariationSchema = z.enum(['bold', 'italic', 'underline']);\nexport type CaptionVariation = z.infer<typeof CaptionVariationSchema>;\n\nexport const NvlCaptionSchema = z.object({\n styles: z.array(z.string()).optional(),\n value: CaptionValueSchema.optional(),\n key: z.string().optional(),\n});\nexport type Caption = z.infer<typeof NvlCaptionSchema>;\n\nconst CaptionsSchema = z.object({\n text: z.array(NvlCaptionSchema).optional(),\n align: z.enum(['top', 'bottom', 'center']).optional(),\n size: z.number().optional(),\n isDisabled: z.boolean().optional(),\n});\n\n/**\n * OverlayIcon from NVL - icon displayed on top of a graph element\n * @see @neo4j-nvl/base Node.overlayIcon\n */\nconst NvlOverlayIconSchema = z.object({\n url: z.string(),\n position: z.array(z.number()).optional(),\n size: z.number().optional(),\n isDisabled: z.boolean().optional(),\n});\n\n/**\n * Gradient coloring based on a continuous numeric property value. Range\n * boundaries accept numbers, native bigints, and JSON-safe bigint literals.\n * Colors must be a standard hex string (#rrggbb).\n * If the property is missing, non-numeric, or any color is invalid, the\n * colorRange is silently ignored — other style properties still apply.\n */\nexport const ColorRangeSchema = z.object({\n onProperty: z.string(),\n minValue: GraphNumericLiteralSchema,\n minColor: z.string(),\n maxValue: GraphNumericLiteralSchema,\n maxColor: z.string(),\n midValue: GraphNumericLiteralSchema.optional(),\n midColor: z.string().optional(),\n isDisabled: z.boolean().optional(),\n});\nexport type ColorRange = z.infer<typeof ColorRangeSchema>;\n\n/**\n * Size interpolation for nodes based on a continuous numeric property value.\n * Range boundaries accept numbers, native bigints, and JSON-safe bigint\n * literals.\n * Maps a property value in [minValue, maxValue] to a size in [minSize, maxSize].\n * If the property is missing or non-numeric, sizeRange is silently ignored —\n * other style properties still apply.\n */\nexport const SizeRangeSchema = z.object({\n onProperty: z.string(),\n minValue: GraphNumericLiteralSchema,\n maxValue: GraphNumericLiteralSchema,\n minSize: z.number(),\n maxSize: z.number(),\n isDisabled: z.boolean().optional(),\n});\nexport type SizeRange = z.infer<typeof SizeRangeSchema>;\n\n/**\n * Width interpolation for relationships based on a continuous numeric property\n * value. Range boundaries accept numbers, native bigints, and JSON-safe bigint\n * literals.\n * Maps a property value in [minValue, maxValue] to a width in [minWidth, maxWidth].\n * If the property is missing or non-numeric, widthRange is silently ignored —\n * other style properties still apply.\n */\nexport const WidthRangeSchema = z.object({\n onProperty: z.string(),\n minValue: GraphNumericLiteralSchema,\n maxValue: GraphNumericLiteralSchema,\n minWidth: z.number(),\n maxWidth: z.number(),\n isDisabled: z.boolean().optional(),\n});\nexport type WidthRange = z.infer<typeof WidthRangeSchema>;\n\n/**\n * Assigns a unique color per distinct value of a property.\n * Colors are assigned in first-come, first-served order from a categorical palette.\n * If the property is missing or null, uniqueColors is silently ignored —\n * other style properties still apply.\n */\nexport const UniqueColorsSchema = z.object({\n onProperty: z.string(),\n isDisabled: z.boolean().optional(),\n});\nexport type UniqueColors = z.infer<typeof UniqueColorsSchema>;\n\nconst ColorSchema = z.object({\n value: z.string(),\n isDisabled: z.boolean().optional(),\n});\n\nconst IconSchema = z.object({\n value: z.string(),\n isDisabled: z.boolean().optional(),\n});\n\nconst SizeSchema = z.object({\n value: z.number(),\n isDisabled: z.boolean().optional(),\n});\n\nconst WidthSchema = z.object({\n value: z.number(),\n isDisabled: z.boolean().optional(),\n});\n\nexport const StyleSchema = z.object({\n captions: CaptionsSchema.optional(),\n color: ColorSchema.optional(),\n colorRange: ColorRangeSchema.optional(),\n icon: IconSchema.optional(),\n sizeRange: SizeRangeSchema.optional(),\n overlayIcon: NvlOverlayIconSchema.optional(),\n widthRange: WidthRangeSchema.optional(),\n size: SizeSchema.optional(),\n uniqueColors: UniqueColorsSchema.optional(),\n width: WidthSchema.optional(),\n});\nexport type Style = z.infer<typeof StyleSchema>;\n\n/**\n * metaData is an free-form object that can be used to store additional information about a style rule.\n * The data is not taken into account when evaluationg the rule.\n */\nconst metaDataSchema = z.record(z.string(), z.unknown());\n\nexport const GraphStyleRuleSchema = z.object({\n match: MatchSchema,\n where: WhereSchema.optional(),\n apply: StyleSchema,\n isDisabled: z.boolean().optional(),\n priority: z.number().nonnegative().optional(),\n metaData: metaDataSchema.optional(),\n});\n// exporting this type with the graph prefix for clarity when used in the same context as other rules (grid, chart)\nexport type GraphStyleRule = z.infer<typeof GraphStyleRuleSchema>;\n\n/**\n * Runtime type guard for {@link GraphStyleRule}, backed by the internal Zod\n * schema. Narrows an `unknown` value to `GraphStyleRule` when it is a valid\n * style rule.\n *\n * This lets consumers validate values without taking a dependency on Zod or on\n * our schema export. For example, it can be passed to another validation\n * library's custom check:\n *\n * @example\n * ```ts\n * import { z } from 'zod';\n * import { isGraphStyleRule, type GraphStyleRule } from '@neo4j-ndl/react-graph';\n *\n * const formSchema = z.object({\n * rule: z.custom<GraphStyleRule>(isGraphStyleRule),\n * notes: z.string(),\n * });\n * ```\n */\nexport const isGraphStyleRule = (value: unknown): value is GraphStyleRule =>\n GraphStyleRuleSchema.safeParse(value).success;\n\nexport type NonStaticStyles =\n | 'captions'\n | 'colorRange'\n | 'sizeRange'\n | 'widthRange'\n | 'uniqueColors';\n\ntype NodeStyleKey =\n | 'icon'\n | 'overlayIcon'\n | 'color'\n | 'size'\n | 'captions'\n | 'captionSize'\n | 'captionAlign';\n\ntype RelStyleKey =\n | 'width'\n | 'color'\n | 'captions'\n | 'captionSize'\n | 'captionAlign'\n | 'overlayIcon';\n\nexport type EvaluatedNvlNodeStyle = Pick<Node, NodeStyleKey>;\nexport type EvaluatedNvlRelationshipStyle = Pick<Relationship, RelStyleKey>;\n\nconst NODE_STYLE_KEYS: readonly NodeStyleKey[] = [\n 'color',\n 'size',\n 'icon',\n 'overlayIcon',\n 'captions',\n 'captionSize',\n 'captionAlign',\n];\n\nconst REL_STYLE_KEYS: readonly RelStyleKey[] = [\n 'color',\n 'width',\n 'captions',\n 'captionSize',\n 'captionAlign',\n 'overlayIcon',\n];\n\n/**\n * Extract consumer-set style properties from a node.\n * Only includes properties that are explicitly defined (not undefined),\n * so they can be spread over rule-derived styles to take precedence.\n */\nexport function pickConsumerNodeStyles(\n node: Partial<EvaluatedNvlNodeStyle>,\n): Partial<EvaluatedNvlNodeStyle> {\n const result: Record<string, unknown> = {};\n for (const key of NODE_STYLE_KEYS) {\n if (node[key] !== undefined) {\n result[key] = node[key];\n }\n }\n return result as Partial<EvaluatedNvlNodeStyle>;\n}\n\n/**\n * Extract consumer-set style properties from a relationship.\n * Only includes properties that are explicitly defined (not undefined),\n * so they can be spread over rule-derived styles to take precedence.\n */\nexport function pickConsumerRelationshipStyles(\n rel: Partial<EvaluatedNvlRelationshipStyle>,\n): Partial<EvaluatedNvlRelationshipStyle> {\n const result: Record<string, unknown> = {};\n for (const key of REL_STYLE_KEYS) {\n if (rel[key] !== undefined) {\n result[key] = rel[key];\n }\n }\n return result as Partial<EvaluatedNvlRelationshipStyle>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"style-types.js","sourceRoot":"","sources":["../../../src/styling/style-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEL,mBAAmB,EAEnB,qBAAqB,EAErB,0BAA0B,EAE1B,oBAAoB,EAEpB,kBAAkB,EAElB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;GAUG;AAEH,+DAA+D;AAC/D,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC;IACpC,mBAAmB;IACnB,qBAAqB;IACrB,sBAAsB;CACvB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC;IACjC,mBAAmB;IACnB,qBAAqB;IACrB,sBAAsB;CACvB,CAAC,CAAC;AAEH,qGAAqG;AACrG,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC;IACvC,CAAC,CAAC,MAAM,EAAE;IACV,oBAAoB;IACpB,CAAC,CAAC,OAAO,EAAE;IACX,C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* 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 Node, type Relationship } from '@neo4j-nvl/base';\nimport { z } from 'zod';\n\nimport {\n type BigintLiteral,\n BigintLiteralSchema,\n type DatetimeLiteral,\n DatetimeLiteralSchema,\n type LocalDatetimeLiteral,\n LocalDatetimeLiteralSchema,\n type NumericLiteral,\n NumericLiteralSchema,\n type RangeLiteral,\n RangeLiteralSchema,\n type TimeLiteral,\n TimeLiteralSchema,\n} from '../_generated/style-rules';\n\n/*\n * Style types defined in Zod, so that we can use the schemas to generate JSON Schema.\n * This is useful for generating documentation, importing and for future integration into editors.\n *\n * Some simple examples of rules:\n * - Match all nodes with label \"Person\" and apply red color\n * { match: { label: \"Person\" }, apply: { color: \"red\" } }\n *\n * - Match all relationships with type \"KNOWS\" which have the property \"name\" equal to \"John\" and apply width 10\n * { match: { reltype: \"KNOWS\" }, where: { equal: [{ property: \"name\" }, \"John\"] }, apply: { width: 10 } }\n */\n\n// Selector schemas. This is what can go under the `match` key.\nconst LabelSelectorSchema = z.object({\n label: z.string().nullable(),\n});\n\nconst ReltypeSelectorSchema = z.object({\n reltype: z.string().nullable(),\n});\n\nconst PropertySelectorSchema = z.object({\n property: z.string(),\n});\n\nexport const SelectorSchema = z.union([\n LabelSelectorSchema,\n ReltypeSelectorSchema,\n PropertySelectorSchema,\n]);\ntype Selector = z.infer<typeof SelectorSchema>;\n\nexport const MatchSchema = z.union([\n LabelSelectorSchema,\n ReltypeSelectorSchema,\n PropertySelectorSchema,\n]);\n\n// Schemas for the values that can go under the `where` key. Starts with defining the literal values.\nexport const CypherValueSchema = z.union([\n z.string(),\n NumericLiteralSchema,\n z.boolean(),\n z.null(),\n DatetimeLiteralSchema,\n LocalDatetimeLiteralSchema,\n TimeLiteralSchema,\n]);\nexport type CypherValue = z.infer<typeof CypherValueSchema>;\n/** A JSON-safe bigint literal represented by a signed decimal string. */\nexport const GraphBigintLiteralSchema = BigintLiteralSchema;\n/** A number, native bigint, or JSON-safe bigint literal. */\nexport const GraphNumericLiteralSchema = NumericLiteralSchema;\n/** A numeric, datetime, localdatetime, or time literal used as a range boundary. */\nexport const GraphRangeLiteralSchema = RangeLiteralSchema;\nexport type GraphBigintLiteral = BigintLiteral;\nexport type GraphNumericLiteral = NumericLiteral;\nexport type GraphRangeLiteral = RangeLiteral;\n\nexport const ValueSchema = z\n .union([SelectorSchema, CypherValueSchema])\n .describe(\n 'Either a property/label/reltype selector (e.g., {property: \"name\"}), a literal value (string, number, bigint, {bigint: \"42\"}, boolean, null), or a datetime/time literal (e.g., {datetime: \"2024-01-01T00:00:00Z\"}, {time: \"14:30:00\"}).',\n );\nexport type Value = z.infer<typeof ValueSchema>;\n\nexport type { DatetimeLiteral, LocalDatetimeLiteral, TimeLiteral };\n\n/**\n * Where clause - recursive type for conditional expressions\n * The type is manually defined for the export, since zod doesn't support exporting inferred recursive types.\n */\nexport type Where =\n // Selector is useful for finding nodes with multiple labels.\n // for example: {match: {label: \"Person\"}, where: {label: \"Actor\"}}\n // matches nodes with label Person AND Actor\n | Selector\n | { not: Where }\n | { and: Where[] }\n | { or: Where[] }\n | { equal: [Value, Value] }\n | { lessThan: [Value, Value] }\n | { lessThanOrEqual: [Value, Value] }\n | { greaterThan: [Value, Value] }\n | { greaterThanOrEqual: [Value, Value] }\n | { contains: [Value, Value] }\n | { startsWith: [Value, Value] }\n | { endsWith: [Value, Value] }\n\n // Null check matching Cypher's IS NULL\n // Returns true/false (not null), making it safe for null checking\n // Use { not: { isNull: ... } } for IS NOT NULL\n // @see https://neo4j.com/docs/cypher-manual/current/values-and-types/working-with-null/\n | { isNull: Value };\n\nexport const WhereSchema: z.ZodType<Where> = z.lazy(() =>\n z.union([\n SelectorSchema,\n z.object({ not: WhereSchema }),\n z.object({ and: z.array(WhereSchema) }),\n z.object({ or: z.array(WhereSchema) }),\n z.object({ equal: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ lessThan: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ lessThanOrEqual: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ greaterThan: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ greaterThanOrEqual: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ contains: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ startsWith: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ endsWith: z.tuple([ValueSchema, ValueSchema]) }),\n z.object({ isNull: ValueSchema }),\n ]),\n);\n\n// Schemas that go under the `apply` key.\nexport const CaptionValueSchema = z.union([\n z.string(),\n z.object({ property: z.string() }),\n z.object({ useType: z.literal(true) }),\n]);\nexport type CaptionValue = z.infer<typeof CaptionValueSchema>;\n\nexport const CaptionVariationSchema = z.enum(['bold', 'italic', 'underline']);\nexport type CaptionVariation = z.infer<typeof CaptionVariationSchema>;\n\nexport const NvlCaptionSchema = z.object({\n styles: z.array(z.string()).optional(),\n value: CaptionValueSchema.optional(),\n key: z.string().optional(),\n});\nexport type Caption = z.infer<typeof NvlCaptionSchema>;\n\nconst CaptionsSchema = z.object({\n text: z.array(NvlCaptionSchema).optional(),\n align: z.enum(['top', 'bottom', 'center']).optional(),\n size: z.number().optional(),\n isDisabled: z.boolean().optional(),\n});\n\n/**\n * OverlayIcon from NVL - icon displayed on top of a graph element\n * @see @neo4j-nvl/base Node.overlayIcon\n */\nconst NvlOverlayIconSchema = z.object({\n url: z.string(),\n position: z.array(z.number()).optional(),\n size: z.number().optional(),\n isDisabled: z.boolean().optional(),\n});\n\n/**\n * Gradient coloring based on a continuous orderable property value. Range\n * boundaries accept numeric and temporal literals.\n * Colors must be a standard hex string (#rrggbb).\n * If the property is missing, non-orderable, or any color is invalid, the\n * colorRange is silently ignored — other style properties still apply.\n */\nexport const ColorRangeSchema = z.object({\n onProperty: z.string(),\n minValue: GraphRangeLiteralSchema,\n minColor: z.string(),\n maxValue: GraphRangeLiteralSchema,\n maxColor: z.string(),\n midValue: GraphRangeLiteralSchema.optional(),\n midColor: z.string().optional(),\n isDisabled: z.boolean().optional(),\n});\nexport type ColorRange = z.infer<typeof ColorRangeSchema>;\n\n/**\n * Size interpolation for nodes based on a continuous orderable property value.\n * Range boundaries accept numeric and temporal literals.\n * Maps a property value in [minValue, maxValue] to a size in [minSize, maxSize].\n * If the property is missing or non-orderable, sizeRange is silently ignored —\n * other style properties still apply.\n */\nexport const SizeRangeSchema = z.object({\n onProperty: z.string(),\n minValue: GraphRangeLiteralSchema,\n maxValue: GraphRangeLiteralSchema,\n minSize: z.number(),\n maxSize: z.number(),\n isDisabled: z.boolean().optional(),\n});\nexport type SizeRange = z.infer<typeof SizeRangeSchema>;\n\n/**\n * Width interpolation for relationships based on a continuous orderable\n * property value. Range boundaries accept numeric and temporal literals.\n * Maps a property value in [minValue, maxValue] to a width in [minWidth, maxWidth].\n * If the property is missing or non-orderable, widthRange is silently ignored —\n * other style properties still apply.\n */\nexport const WidthRangeSchema = z.object({\n onProperty: z.string(),\n minValue: GraphRangeLiteralSchema,\n maxValue: GraphRangeLiteralSchema,\n minWidth: z.number(),\n maxWidth: z.number(),\n isDisabled: z.boolean().optional(),\n});\nexport type WidthRange = z.infer<typeof WidthRangeSchema>;\n\n/**\n * Assigns a unique color per distinct value of a property.\n * Colors are assigned in first-come, first-served order from a categorical palette.\n * If the property is missing or null, uniqueColors is silently ignored —\n * other style properties still apply.\n */\nexport const UniqueColorsSchema = z.object({\n onProperty: z.string(),\n isDisabled: z.boolean().optional(),\n});\nexport type UniqueColors = z.infer<typeof UniqueColorsSchema>;\n\nconst ColorSchema = z.object({\n value: z.string(),\n isDisabled: z.boolean().optional(),\n});\n\nconst IconSchema = z.object({\n value: z.string(),\n isDisabled: z.boolean().optional(),\n});\n\nconst SizeSchema = z.object({\n value: z.number(),\n isDisabled: z.boolean().optional(),\n});\n\nconst WidthSchema = z.object({\n value: z.number(),\n isDisabled: z.boolean().optional(),\n});\n\nexport const StyleSchema = z.object({\n captions: CaptionsSchema.optional(),\n color: ColorSchema.optional(),\n colorRange: ColorRangeSchema.optional(),\n icon: IconSchema.optional(),\n sizeRange: SizeRangeSchema.optional(),\n overlayIcon: NvlOverlayIconSchema.optional(),\n widthRange: WidthRangeSchema.optional(),\n size: SizeSchema.optional(),\n uniqueColors: UniqueColorsSchema.optional(),\n width: WidthSchema.optional(),\n});\nexport type Style = z.infer<typeof StyleSchema>;\n\n/**\n * metaData is an free-form object that can be used to store additional information about a style rule.\n * The data is not taken into account when evaluationg the rule.\n */\nconst metaDataSchema = z.record(z.string(), z.unknown());\n\nexport const GraphStyleRuleSchema = z.object({\n match: MatchSchema,\n where: WhereSchema.optional(),\n apply: StyleSchema,\n isDisabled: z.boolean().optional(),\n priority: z.number().nonnegative().optional(),\n metaData: metaDataSchema.optional(),\n});\n// exporting this type with the graph prefix for clarity when used in the same context as other rules (grid, chart)\nexport type GraphStyleRule = z.infer<typeof GraphStyleRuleSchema>;\n\n/**\n * Runtime type guard for {@link GraphStyleRule}, backed by the internal Zod\n * schema. Narrows an `unknown` value to `GraphStyleRule` when it is a valid\n * style rule.\n *\n * This lets consumers validate values without taking a dependency on Zod or on\n * our schema export. For example, it can be passed to another validation\n * library's custom check:\n *\n * @example\n * ```ts\n * import { z } from 'zod';\n * import { isGraphStyleRule, type GraphStyleRule } from '@neo4j-ndl/react-graph';\n *\n * const formSchema = z.object({\n * rule: z.custom<GraphStyleRule>(isGraphStyleRule),\n * notes: z.string(),\n * });\n * ```\n */\nexport const isGraphStyleRule = (value: unknown): value is GraphStyleRule =>\n GraphStyleRuleSchema.safeParse(value).success;\n\nexport type NonStaticStyles =\n | 'captions'\n | 'colorRange'\n | 'sizeRange'\n | 'widthRange'\n | 'uniqueColors';\n\ntype NodeStyleKey =\n | 'icon'\n | 'overlayIcon'\n | 'color'\n | 'size'\n | 'captions'\n | 'captionSize'\n | 'captionAlign';\n\ntype RelStyleKey =\n | 'width'\n | 'color'\n | 'captions'\n | 'captionSize'\n | 'captionAlign'\n | 'overlayIcon';\n\nexport type EvaluatedNvlNodeStyle = Pick<Node, NodeStyleKey>;\nexport type EvaluatedNvlRelationshipStyle = Pick<Relationship, RelStyleKey>;\n\nconst NODE_STYLE_KEYS: readonly NodeStyleKey[] = [\n 'color',\n 'size',\n 'icon',\n 'overlayIcon',\n 'captions',\n 'captionSize',\n 'captionAlign',\n];\n\nconst REL_STYLE_KEYS: readonly RelStyleKey[] = [\n 'color',\n 'width',\n 'captions',\n 'captionSize',\n 'captionAlign',\n 'overlayIcon',\n];\n\n/**\n * Extract consumer-set style properties from a node.\n * Only includes properties that are explicitly defined (not undefined),\n * so they can be spread over rule-derived styles to take precedence.\n */\nexport function pickConsumerNodeStyles(\n node: Partial<EvaluatedNvlNodeStyle>,\n): Partial<EvaluatedNvlNodeStyle> {\n const result: Record<string, unknown> = {};\n for (const key of NODE_STYLE_KEYS) {\n if (node[key] !== undefined) {\n result[key] = node[key];\n }\n }\n return result as Partial<EvaluatedNvlNodeStyle>;\n}\n\n/**\n * Extract consumer-set style properties from a relationship.\n * Only includes properties that are explicitly defined (not undefined),\n * so they can be spread over rule-derived styles to take precedence.\n */\nexport function pickConsumerRelationshipStyles(\n rel: Partial<EvaluatedNvlRelationshipStyle>,\n): Partial<EvaluatedNvlRelationshipStyle> {\n const result: Record<string, unknown> = {};\n for (const key of REL_STYLE_KEYS) {\n if (rel[key] !== undefined) {\n result[key] = rel[key];\n }\n }\n return result as Partial<EvaluatedNvlRelationshipStyle>;\n}\n"]}
|
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
*/
|
|
21
21
|
export { getWeight, lerpColor } from './color-utils';
|
|
22
22
|
export { parseDateString, parseLocalDateString, parseTimeString, } from './date-utils';
|
|
23
|
-
export { BigintLiteralSchema, DatetimeLiteralSchema, LocalDatetimeLiteralSchema, NumericLiteralSchema, TimeLiteralSchema, } from './literal-schemas';
|
|
24
|
-
export type { BigintLiteral, DatetimeLiteral, LocalDatetimeLiteral, NumericLiteral, TimeLiteral, } from './literal-schemas';
|
|
23
|
+
export { BigintLiteralSchema, DatetimeLiteralSchema, isDatetimeLiteral, isLocalDatetimeLiteral, isTimeLiteral, LocalDatetimeLiteralSchema, NumericLiteralSchema, RangeLiteralSchema, TimeLiteralSchema, } from './literal-schemas';
|
|
24
|
+
export type { BigintLiteral, DatetimeLiteral, LocalDatetimeLiteral, NumericLiteral, RangeLiteral, TimeLiteral, } from './literal-schemas';
|
|
25
25
|
export { clampNumericValue, compareNumericValues, getNumericWeight, isBigintLiteral, numericValuesEqual, resolveNumericLiteral, } from './numeric-utils';
|
|
26
26
|
export type { NumericValue } from './numeric-utils';
|
|
27
|
+
export { resolveRangeLiteral } from './range-utils';
|
|
27
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/_generated/style-rules/index.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/_generated/style-rules/index.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACb,0BAA0B,EAC1B,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -80,4 +80,24 @@ export declare const TimeLiteralSchema: z.ZodObject<{
|
|
|
80
80
|
time: z.ZodString;
|
|
81
81
|
}, z.core.$strip>;
|
|
82
82
|
export type TimeLiteral = z.infer<typeof TimeLiteralSchema>;
|
|
83
|
+
/** Returns whether a value is a `{ datetime: string }` wrapper. Does not validate the string. */
|
|
84
|
+
export declare function isDatetimeLiteral(value: unknown): value is DatetimeLiteral;
|
|
85
|
+
/** Returns whether a value is a `{ localdatetime: string }` wrapper. Does not validate the string. */
|
|
86
|
+
export declare function isLocalDatetimeLiteral(value: unknown): value is LocalDatetimeLiteral;
|
|
87
|
+
/** Returns whether a value is a `{ time: string }` wrapper. Does not validate the string. */
|
|
88
|
+
export declare function isTimeLiteral(value: unknown): value is TimeLiteral;
|
|
89
|
+
/**
|
|
90
|
+
* A continuous, orderable literal that can be used as a range boundary.
|
|
91
|
+
* Temporal literals resolve to numbers before range interpolation.
|
|
92
|
+
*/
|
|
93
|
+
export declare const RangeLiteralSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
94
|
+
bigint: z.ZodString;
|
|
95
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
96
|
+
datetime: z.ZodString;
|
|
97
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
98
|
+
localdatetime: z.ZodString;
|
|
99
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
100
|
+
time: z.ZodString;
|
|
101
|
+
}, z.core.$strip>]>;
|
|
102
|
+
export type RangeLiteral = z.infer<typeof RangeLiteralSchema>;
|
|
83
103
|
//# sourceMappingURL=literal-schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"literal-schemas.d.ts","sourceRoot":"","sources":["../../../../src/_generated/style-rules/literal-schemas.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;iBAI9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,4EAA4E;AAC5E,eAAO,MAAM,oBAAoB;;mBAI/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;;;;;;GASG;AACH,eAAO,MAA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M,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAc5D,iGAAiG;AACjG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAE1E;AAED,sGAAsG;AACtG,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,oBAAoB,CAE/B;AAED,6FAA6F;AAC7F,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;mBAK7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import type { RangeLiteral } from './literal-schemas';
|
|
23
|
+
import { type NumericValue } from './numeric-utils';
|
|
24
|
+
/** Resolves a range literal to the numeric representation used for interpolation. */
|
|
25
|
+
export declare function resolveRangeLiteral(value: RangeLiteral): NumericValue | null;
|
|
26
|
+
//# sourceMappingURL=range-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range-utils.d.ts","sourceRoot":"","sources":["../../../../src/_generated/style-rules/range-utils.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,KAAK,YAAY,EAAyB,MAAM,iBAAiB,CAAC;AAE3E,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,GAAG,IAAI,CAa5E"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
export { GraphVisualization } from './graph-visualization';
|
|
22
22
|
export { useGraphVisualizationContext, type ColorCount, type Gesture, type GraphItemMetaData, type GraphSelection, type GraphVisualizationContextData, type InteractionMode, type MetadataLookupTable, type NeoNode, type NeoRel, type NodeData, type NvlGraph, type PortableProperty, type RelData, type Sidepanel, } from './graph-visualization-context';
|
|
23
23
|
export { isGraphStyleRule } from './styling/style-types';
|
|
24
|
-
export type { GraphStyleRule, GraphBigintLiteral, GraphNumericLiteral, Style as GraphStyle, Where as GraphWhere, Value as GraphValue, CypherValue as GraphCypherValue, Caption as GraphCaption, CaptionValue as GraphCaptionValue, CaptionVariation as GraphCaptionVariation, ColorRange as GraphColorRange, SizeRange as GraphSizeRange, WidthRange as GraphWidthRange, UniqueColors as GraphUniqueColors, DatetimeLiteral as GraphDatetimeLiteral, LocalDatetimeLiteral as GraphLocalDatetimeLiteral, TimeLiteral as GraphTimeLiteral, } from './styling/style-types';
|
|
24
|
+
export type { GraphStyleRule, GraphBigintLiteral, GraphNumericLiteral, GraphRangeLiteral, Style as GraphStyle, Where as GraphWhere, Value as GraphValue, CypherValue as GraphCypherValue, Caption as GraphCaption, CaptionValue as GraphCaptionValue, CaptionVariation as GraphCaptionVariation, ColorRange as GraphColorRange, SizeRange as GraphSizeRange, WidthRange as GraphWidthRange, UniqueColors as GraphUniqueColors, DatetimeLiteral as GraphDatetimeLiteral, LocalDatetimeLiteral as GraphLocalDatetimeLiteral, TimeLiteral as GraphTimeLiteral, } from './styling/style-types';
|
|
25
25
|
export { compileGraphStyleRules, doesGraphStyleRuleMatch, } from './styling/compile-graph-styles';
|
|
26
26
|
export { parseStyleRules } from './styling/parse-style-rules';
|
|
27
27
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,4BAA4B,EAC5B,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,6BAA6B,EAClC,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,SAAS,GACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,IAAI,UAAU,EACnB,KAAK,IAAI,UAAU,EACnB,KAAK,IAAI,UAAU,EACnB,WAAW,IAAI,gBAAgB,EAC/B,OAAO,IAAI,YAAY,EACvB,YAAY,IAAI,iBAAiB,EACjC,gBAAgB,IAAI,qBAAqB,EACzC,UAAU,IAAI,eAAe,EAC7B,SAAS,IAAI,cAAc,EAC3B,UAAU,IAAI,eAAe,EAC7B,YAAY,IAAI,iBAAiB,EACjC,eAAe,I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AAuB,GACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-graph-styles.d.ts","sourceRoot":"","sources":["../../../src/styling/compile-graph-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"compile-graph-styles.d.ts","sourceRoot":"","sources":["../../../src/styling/compile-graph-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAoBH,OAAO,EACL,KAAK,QAAQ,EAEb,KAAK,OAAO,EACb,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAClC,KAAK,cAAc,EAMpB,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,iBAAiB,QAA+B,CAAC;AAG9D,eAAO,MAAM,qBAAqB,gBAEjC,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,gBAAgB,EAAE,cAAc,EAAE,CAAC;IACnC,kBAAkB,EAAE,cAAc,EAAE,CAAC;IACrC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IAC5C,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;CAC5C,CAAC;AAubF;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,QAAQ,GAAG,OAAO,EACxB,IAAI,EAAE,cAAc,GACnB,OAAO,CA2BT;AAkYD,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,GAAG,EAAE,OAAO,KAAK,6BAA6B,CAAC;IAC1E,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,qBAAqB,CAAC;CACvD,CAAC;AAkFF,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,cAAc,EAAE,GAAG,IAAI,GAAG,SAAS,GAC9C,uBAAuB,CAyBzB"}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import { type Node, type Relationship } from '@neo4j-nvl/base';
|
|
22
22
|
import { z } from 'zod';
|
|
23
|
-
import { type BigintLiteral, type DatetimeLiteral, type LocalDatetimeLiteral, type NumericLiteral, type TimeLiteral } from '../_generated/style-rules';
|
|
23
|
+
import { type BigintLiteral, type DatetimeLiteral, type LocalDatetimeLiteral, type NumericLiteral, type RangeLiteral, type TimeLiteral } from '../_generated/style-rules';
|
|
24
24
|
export declare const SelectorSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
25
25
|
label: z.ZodNullable<z.ZodString>;
|
|
26
26
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -54,8 +54,19 @@ export declare const GraphBigintLiteralSchema: z.ZodObject<{
|
|
|
54
54
|
export declare const GraphNumericLiteralSchema: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
55
55
|
bigint: z.ZodString;
|
|
56
56
|
}, z.core.$strip>]>;
|
|
57
|
+
/** A numeric, datetime, localdatetime, or time literal used as a range boundary. */
|
|
58
|
+
export declare const GraphRangeLiteralSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
59
|
+
bigint: z.ZodString;
|
|
60
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
61
|
+
datetime: z.ZodString;
|
|
62
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
63
|
+
localdatetime: z.ZodString;
|
|
64
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
65
|
+
time: z.ZodString;
|
|
66
|
+
}, z.core.$strip>]>;
|
|
57
67
|
export type GraphBigintLiteral = BigintLiteral;
|
|
58
68
|
export type GraphNumericLiteral = NumericLiteral;
|
|
69
|
+
export type GraphRangeLiteral = RangeLiteral;
|
|
59
70
|
export declare const ValueSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
60
71
|
label: z.ZodNullable<z.ZodString>;
|
|
61
72
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -126,44 +137,73 @@ export declare const NvlCaptionSchema: z.ZodObject<{
|
|
|
126
137
|
}, z.core.$strip>;
|
|
127
138
|
export type Caption = z.infer<typeof NvlCaptionSchema>;
|
|
128
139
|
/**
|
|
129
|
-
* Gradient coloring based on a continuous
|
|
130
|
-
* boundaries accept
|
|
140
|
+
* Gradient coloring based on a continuous orderable property value. Range
|
|
141
|
+
* boundaries accept numeric and temporal literals.
|
|
131
142
|
* Colors must be a standard hex string (#rrggbb).
|
|
132
|
-
* If the property is missing, non-
|
|
143
|
+
* If the property is missing, non-orderable, or any color is invalid, the
|
|
133
144
|
* colorRange is silently ignored — other style properties still apply.
|
|
134
145
|
*/
|
|
135
146
|
export declare const ColorRangeSchema: z.ZodObject<{
|
|
136
147
|
onProperty: z.ZodString;
|
|
137
|
-
minValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
148
|
+
minValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
138
149
|
bigint: z.ZodString;
|
|
150
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
151
|
+
datetime: z.ZodString;
|
|
152
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
153
|
+
localdatetime: z.ZodString;
|
|
154
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
155
|
+
time: z.ZodString;
|
|
139
156
|
}, z.core.$strip>]>;
|
|
140
157
|
minColor: z.ZodString;
|
|
141
|
-
maxValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
158
|
+
maxValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
142
159
|
bigint: z.ZodString;
|
|
160
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
161
|
+
datetime: z.ZodString;
|
|
162
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
163
|
+
localdatetime: z.ZodString;
|
|
164
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
165
|
+
time: z.ZodString;
|
|
143
166
|
}, z.core.$strip>]>;
|
|
144
167
|
maxColor: z.ZodString;
|
|
145
|
-
midValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
168
|
+
midValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
146
169
|
bigint: z.ZodString;
|
|
170
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
171
|
+
datetime: z.ZodString;
|
|
172
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
173
|
+
localdatetime: z.ZodString;
|
|
174
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
175
|
+
time: z.ZodString;
|
|
147
176
|
}, z.core.$strip>]>>;
|
|
148
177
|
midColor: z.ZodOptional<z.ZodString>;
|
|
149
178
|
isDisabled: z.ZodOptional<z.ZodBoolean>;
|
|
150
179
|
}, z.core.$strip>;
|
|
151
180
|
export type ColorRange = z.infer<typeof ColorRangeSchema>;
|
|
152
181
|
/**
|
|
153
|
-
* Size interpolation for nodes based on a continuous
|
|
154
|
-
* Range boundaries accept
|
|
155
|
-
* literals.
|
|
182
|
+
* Size interpolation for nodes based on a continuous orderable property value.
|
|
183
|
+
* Range boundaries accept numeric and temporal literals.
|
|
156
184
|
* Maps a property value in [minValue, maxValue] to a size in [minSize, maxSize].
|
|
157
|
-
* If the property is missing or non-
|
|
185
|
+
* If the property is missing or non-orderable, sizeRange is silently ignored —
|
|
158
186
|
* other style properties still apply.
|
|
159
187
|
*/
|
|
160
188
|
export declare const SizeRangeSchema: z.ZodObject<{
|
|
161
189
|
onProperty: z.ZodString;
|
|
162
|
-
minValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
190
|
+
minValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
163
191
|
bigint: z.ZodString;
|
|
192
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
193
|
+
datetime: z.ZodString;
|
|
194
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
195
|
+
localdatetime: z.ZodString;
|
|
196
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
197
|
+
time: z.ZodString;
|
|
164
198
|
}, z.core.$strip>]>;
|
|
165
|
-
maxValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
199
|
+
maxValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
166
200
|
bigint: z.ZodString;
|
|
201
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
202
|
+
datetime: z.ZodString;
|
|
203
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
204
|
+
localdatetime: z.ZodString;
|
|
205
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
206
|
+
time: z.ZodString;
|
|
167
207
|
}, z.core.$strip>]>;
|
|
168
208
|
minSize: z.ZodNumber;
|
|
169
209
|
maxSize: z.ZodNumber;
|
|
@@ -171,20 +211,31 @@ export declare const SizeRangeSchema: z.ZodObject<{
|
|
|
171
211
|
}, z.core.$strip>;
|
|
172
212
|
export type SizeRange = z.infer<typeof SizeRangeSchema>;
|
|
173
213
|
/**
|
|
174
|
-
* Width interpolation for relationships based on a continuous
|
|
175
|
-
* value. Range boundaries accept
|
|
176
|
-
* literals.
|
|
214
|
+
* Width interpolation for relationships based on a continuous orderable
|
|
215
|
+
* property value. Range boundaries accept numeric and temporal literals.
|
|
177
216
|
* Maps a property value in [minValue, maxValue] to a width in [minWidth, maxWidth].
|
|
178
|
-
* If the property is missing or non-
|
|
217
|
+
* If the property is missing or non-orderable, widthRange is silently ignored —
|
|
179
218
|
* other style properties still apply.
|
|
180
219
|
*/
|
|
181
220
|
export declare const WidthRangeSchema: z.ZodObject<{
|
|
182
221
|
onProperty: z.ZodString;
|
|
183
|
-
minValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
222
|
+
minValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
184
223
|
bigint: z.ZodString;
|
|
224
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
225
|
+
datetime: z.ZodString;
|
|
226
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
227
|
+
localdatetime: z.ZodString;
|
|
228
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
229
|
+
time: z.ZodString;
|
|
185
230
|
}, z.core.$strip>]>;
|
|
186
|
-
maxValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
231
|
+
maxValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
187
232
|
bigint: z.ZodString;
|
|
233
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
234
|
+
datetime: z.ZodString;
|
|
235
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
236
|
+
localdatetime: z.ZodString;
|
|
237
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
238
|
+
time: z.ZodString;
|
|
188
239
|
}, z.core.$strip>]>;
|
|
189
240
|
minWidth: z.ZodNumber;
|
|
190
241
|
maxWidth: z.ZodNumber;
|
|
@@ -227,16 +278,34 @@ export declare const StyleSchema: z.ZodObject<{
|
|
|
227
278
|
}, z.core.$strip>>;
|
|
228
279
|
colorRange: z.ZodOptional<z.ZodObject<{
|
|
229
280
|
onProperty: z.ZodString;
|
|
230
|
-
minValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
281
|
+
minValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
231
282
|
bigint: z.ZodString;
|
|
283
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
284
|
+
datetime: z.ZodString;
|
|
285
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
286
|
+
localdatetime: z.ZodString;
|
|
287
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
288
|
+
time: z.ZodString;
|
|
232
289
|
}, z.core.$strip>]>;
|
|
233
290
|
minColor: z.ZodString;
|
|
234
|
-
maxValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
291
|
+
maxValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
235
292
|
bigint: z.ZodString;
|
|
293
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
294
|
+
datetime: z.ZodString;
|
|
295
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
296
|
+
localdatetime: z.ZodString;
|
|
297
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
298
|
+
time: z.ZodString;
|
|
236
299
|
}, z.core.$strip>]>;
|
|
237
300
|
maxColor: z.ZodString;
|
|
238
|
-
midValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
301
|
+
midValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
239
302
|
bigint: z.ZodString;
|
|
303
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
304
|
+
datetime: z.ZodString;
|
|
305
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
306
|
+
localdatetime: z.ZodString;
|
|
307
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
308
|
+
time: z.ZodString;
|
|
240
309
|
}, z.core.$strip>]>>;
|
|
241
310
|
midColor: z.ZodOptional<z.ZodString>;
|
|
242
311
|
isDisabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -247,11 +316,23 @@ export declare const StyleSchema: z.ZodObject<{
|
|
|
247
316
|
}, z.core.$strip>>;
|
|
248
317
|
sizeRange: z.ZodOptional<z.ZodObject<{
|
|
249
318
|
onProperty: z.ZodString;
|
|
250
|
-
minValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
319
|
+
minValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
251
320
|
bigint: z.ZodString;
|
|
321
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
322
|
+
datetime: z.ZodString;
|
|
323
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
324
|
+
localdatetime: z.ZodString;
|
|
325
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
326
|
+
time: z.ZodString;
|
|
252
327
|
}, z.core.$strip>]>;
|
|
253
|
-
maxValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
328
|
+
maxValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
254
329
|
bigint: z.ZodString;
|
|
330
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
331
|
+
datetime: z.ZodString;
|
|
332
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
333
|
+
localdatetime: z.ZodString;
|
|
334
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
335
|
+
time: z.ZodString;
|
|
255
336
|
}, z.core.$strip>]>;
|
|
256
337
|
minSize: z.ZodNumber;
|
|
257
338
|
maxSize: z.ZodNumber;
|
|
@@ -265,11 +346,23 @@ export declare const StyleSchema: z.ZodObject<{
|
|
|
265
346
|
}, z.core.$strip>>;
|
|
266
347
|
widthRange: z.ZodOptional<z.ZodObject<{
|
|
267
348
|
onProperty: z.ZodString;
|
|
268
|
-
minValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
349
|
+
minValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
269
350
|
bigint: z.ZodString;
|
|
351
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
352
|
+
datetime: z.ZodString;
|
|
353
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
354
|
+
localdatetime: z.ZodString;
|
|
355
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
356
|
+
time: z.ZodString;
|
|
270
357
|
}, z.core.$strip>]>;
|
|
271
|
-
maxValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
358
|
+
maxValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
272
359
|
bigint: z.ZodString;
|
|
360
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
361
|
+
datetime: z.ZodString;
|
|
362
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
363
|
+
localdatetime: z.ZodString;
|
|
364
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
365
|
+
time: z.ZodString;
|
|
273
366
|
}, z.core.$strip>]>;
|
|
274
367
|
minWidth: z.ZodNumber;
|
|
275
368
|
maxWidth: z.ZodNumber;
|
|
@@ -323,16 +416,34 @@ export declare const GraphStyleRuleSchema: z.ZodObject<{
|
|
|
323
416
|
}, z.core.$strip>>;
|
|
324
417
|
colorRange: z.ZodOptional<z.ZodObject<{
|
|
325
418
|
onProperty: z.ZodString;
|
|
326
|
-
minValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
419
|
+
minValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
327
420
|
bigint: z.ZodString;
|
|
421
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
422
|
+
datetime: z.ZodString;
|
|
423
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
424
|
+
localdatetime: z.ZodString;
|
|
425
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
426
|
+
time: z.ZodString;
|
|
328
427
|
}, z.core.$strip>]>;
|
|
329
428
|
minColor: z.ZodString;
|
|
330
|
-
maxValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
429
|
+
maxValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
331
430
|
bigint: z.ZodString;
|
|
431
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
432
|
+
datetime: z.ZodString;
|
|
433
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
434
|
+
localdatetime: z.ZodString;
|
|
435
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
436
|
+
time: z.ZodString;
|
|
332
437
|
}, z.core.$strip>]>;
|
|
333
438
|
maxColor: z.ZodString;
|
|
334
|
-
midValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
439
|
+
midValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
335
440
|
bigint: z.ZodString;
|
|
441
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
442
|
+
datetime: z.ZodString;
|
|
443
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
444
|
+
localdatetime: z.ZodString;
|
|
445
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
446
|
+
time: z.ZodString;
|
|
336
447
|
}, z.core.$strip>]>>;
|
|
337
448
|
midColor: z.ZodOptional<z.ZodString>;
|
|
338
449
|
isDisabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -343,11 +454,23 @@ export declare const GraphStyleRuleSchema: z.ZodObject<{
|
|
|
343
454
|
}, z.core.$strip>>;
|
|
344
455
|
sizeRange: z.ZodOptional<z.ZodObject<{
|
|
345
456
|
onProperty: z.ZodString;
|
|
346
|
-
minValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
457
|
+
minValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
347
458
|
bigint: z.ZodString;
|
|
459
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
460
|
+
datetime: z.ZodString;
|
|
461
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
462
|
+
localdatetime: z.ZodString;
|
|
463
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
464
|
+
time: z.ZodString;
|
|
348
465
|
}, z.core.$strip>]>;
|
|
349
|
-
maxValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
466
|
+
maxValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
350
467
|
bigint: z.ZodString;
|
|
468
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
469
|
+
datetime: z.ZodString;
|
|
470
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
471
|
+
localdatetime: z.ZodString;
|
|
472
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
473
|
+
time: z.ZodString;
|
|
351
474
|
}, z.core.$strip>]>;
|
|
352
475
|
minSize: z.ZodNumber;
|
|
353
476
|
maxSize: z.ZodNumber;
|
|
@@ -361,11 +484,23 @@ export declare const GraphStyleRuleSchema: z.ZodObject<{
|
|
|
361
484
|
}, z.core.$strip>>;
|
|
362
485
|
widthRange: z.ZodOptional<z.ZodObject<{
|
|
363
486
|
onProperty: z.ZodString;
|
|
364
|
-
minValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
487
|
+
minValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
365
488
|
bigint: z.ZodString;
|
|
489
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
490
|
+
datetime: z.ZodString;
|
|
491
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
492
|
+
localdatetime: z.ZodString;
|
|
493
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
494
|
+
time: z.ZodString;
|
|
366
495
|
}, z.core.$strip>]>;
|
|
367
|
-
maxValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
496
|
+
maxValue: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt, z.ZodObject<{
|
|
368
497
|
bigint: z.ZodString;
|
|
498
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
499
|
+
datetime: z.ZodString;
|
|
500
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
501
|
+
localdatetime: z.ZodString;
|
|
502
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
503
|
+
time: z.ZodString;
|
|
369
504
|
}, z.core.$strip>]>;
|
|
370
505
|
minWidth: z.ZodNumber;
|
|
371
506
|
maxWidth: z.ZodNumber;
|