@neo4j-ndl/react-graph 1.3.2 → 1.3.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.
- package/lib/cjs/styling/create-vis-data-structures.js +3 -2
- package/lib/cjs/styling/create-vis-data-structures.js.map +1 -1
- package/lib/cjs/styling/style-types.js +47 -0
- package/lib/cjs/styling/style-types.js.map +1 -1
- package/lib/esm/styling/create-vis-data-structures.js +3 -2
- package/lib/esm/styling/create-vis-data-structures.js.map +1 -1
- package/lib/esm/styling/style-types.js +45 -0
- package/lib/esm/styling/style-types.js.map +1 -1
- package/lib/types/styling/create-vis-data-structures.d.ts.map +1 -1
- package/lib/types/styling/style-types.d.ts +16 -2
- package/lib/types/styling/style-types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
23
|
exports.NO_LABEL = void 0;
|
|
24
24
|
exports.createVisualizationDataStructures = createVisualizationDataStructures;
|
|
25
25
|
const utils_1 = require("../utils");
|
|
26
|
+
const style_types_1 = require("./style-types");
|
|
26
27
|
exports.NO_LABEL = '(no label)';
|
|
27
28
|
function buildColorDistribution(colorCounts) {
|
|
28
29
|
return Object.entries(colorCounts)
|
|
@@ -44,7 +45,7 @@ function createVisualizationDataStructures(rawNodes, rawRels, compiledStyleRules
|
|
|
44
45
|
};
|
|
45
46
|
nodeData[rawNode.id] = data;
|
|
46
47
|
const appliedStyle = compiledStyleRules.byLabelSet(data);
|
|
47
|
-
const styledNode = Object.assign(Object.assign(Object.assign(Object.assign({}, rawNode), { labels: undefined, properties: undefined }), appliedStyle), (
|
|
48
|
+
const styledNode = Object.assign(Object.assign(Object.assign(Object.assign({}, rawNode), { labels: undefined, properties: undefined }), appliedStyle), (0, style_types_1.pickConsumerNodeStyles)(rawNode));
|
|
48
49
|
// Accumulate color distribution
|
|
49
50
|
const labels = data.labelsSorted.length > 0 ? data.labelsSorted : [exports.NO_LABEL];
|
|
50
51
|
const color = styledNode.color;
|
|
@@ -84,7 +85,7 @@ function createVisualizationDataStructures(rawNodes, rawRels, compiledStyleRules
|
|
|
84
85
|
};
|
|
85
86
|
relData[rawRel.id] = data;
|
|
86
87
|
const appliedStyle = compiledStyleRules.byType(data.type)(data);
|
|
87
|
-
const styledRel = Object.assign(Object.assign(Object.assign(Object.assign({}, rawRel), { properties: undefined, type: undefined }), appliedStyle), (
|
|
88
|
+
const styledRel = Object.assign(Object.assign(Object.assign(Object.assign({}, rawRel), { properties: undefined, type: undefined }), appliedStyle), (0, style_types_1.pickConsumerRelationshipStyles)(rawRel));
|
|
88
89
|
// Accumulate color distribution and type counts
|
|
89
90
|
relTypeCounts[data.type] = ((_a = relTypeCounts[data.type]) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
90
91
|
const color = styledRel.color;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-vis-data-structures.js","sourceRoot":"","sources":["../../../src/styling/create-vis-data-structures.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;
|
|
1
|
+
{"version":3,"file":"create-vis-data-structures.js","sourceRoot":"","sources":["../../../src/styling/create-vis-data-structures.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AA6BH,8EAoIC;AArJD,oCAA8C;AAE9C,+CAGuB;AAEV,QAAA,QAAQ,GAAG,YAAY,CAAC;AAErC,SAAS,sBAAsB,CAC7B,WAAmC;IAEnC,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC;SAC/B,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;SAC3C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC;AAED,S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AClB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,cAAc,EAAE;YACd,iBAAiB;YACjB,aAAa;YACb,MAAM;YACN,eAAe;YACf,QAAQ;SACT;QACD,WAAW,EAAE;YACX,QAAQ;YACR,KAAK,EAAE,WAAW;YAClB,OAAO;YACP,IAAI,EAAE,UAAU;SACjB;KACF,CAAC;AACJ,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 {\n ColorCount,\n GraphItemMetaData,\n MetadataLookupTable,\n NeoNode,\n NeoRel,\n NodeData,\n NvlGraph,\n RelData,\n} from '../graph-visualization-context';\nimport { sortAlphabetically } from '../utils';\nimport type { CompiledStyleRules } from './compile-graph-styles';\nimport {\n pickConsumerNodeStyles,\n pickConsumerRelationshipStyles,\n} from './style-types';\n\nexport const NO_LABEL = '(no label)';\n\nfunction buildColorDistribution(\n colorCounts: Record<string, number>,\n): ColorCount[] {\n return Object.entries(colorCounts)\n .map(([color, count]) => ({ color, count }))\n .sort((a, b) => b.count - a.count);\n}\n\nexport function createVisualizationDataStructures(\n rawNodes: NeoNode[],\n rawRels: NeoRel[],\n compiledStyleRules: CompiledStyleRules,\n): {\n styledGraph: NvlGraph;\n metadataLookup: MetadataLookupTable;\n} {\n const nodeData: Record<string, NodeData> = {};\n const labelColorCounts: Record<string, Record<string, number>> = {};\n const labelTotalCounts: Record<string, number> = {};\n\n // Single pass: extract data, apply styles, count colors\n const styledNodes = rawNodes.map((rawNode) => {\n const data: NodeData = {\n id: rawNode.id,\n labelsSorted: [...rawNode.labels].sort(sortAlphabetically),\n properties: rawNode.properties,\n };\n nodeData[rawNode.id] = data;\n\n const appliedStyle = compiledStyleRules.byLabelSet(data);\n\n const styledNode = {\n ...rawNode,\n labels: undefined,\n properties: undefined,\n ...appliedStyle,\n // Consumer-set style properties on NeoNode take precedence over style rules\n ...pickConsumerNodeStyles(rawNode),\n };\n\n // Accumulate color distribution\n const labels =\n data.labelsSorted.length > 0 ? data.labelsSorted : [NO_LABEL];\n const color = styledNode.color;\n\n for (const label of labels) {\n labelTotalCounts[label] = (labelTotalCounts[label] ?? 0) + 1;\n\n if (color !== undefined) {\n const counts = labelColorCounts[label] ?? {};\n counts[color] = (counts[color] ?? 0) + 1;\n labelColorCounts[label] = counts;\n }\n }\n\n return styledNode;\n });\n\n const labels = Object.keys(labelTotalCounts).sort(sortAlphabetically);\n const labelMetaData: Record<string, GraphItemMetaData> = {};\n let hasMultipleColors = false;\n for (const label of labels) {\n const colorDistribution = buildColorDistribution(\n labelColorCounts[label] ?? {},\n );\n if (colorDistribution.length > 1) {\n hasMultipleColors = true;\n }\n labelMetaData[label] = {\n totalCount: labelTotalCounts[label]!,\n colorDistribution,\n };\n }\n\n const relData: Record<string, RelData> = {};\n const relTypeCounts: Record<string, number> = {};\n const relColorCounts: Record<string, Record<string, number>> = {};\n\n // Single pass: extract data, apply styles, count colors\n const styledRels = rawRels.map((rawRel) => {\n const data: RelData = {\n id: rawRel.id,\n properties: rawRel.properties,\n type: rawRel.type,\n };\n relData[rawRel.id] = data;\n\n const appliedStyle = compiledStyleRules.byType(data.type)(data);\n\n const styledRel = {\n ...rawRel,\n properties: undefined,\n type: undefined,\n ...appliedStyle,\n // Consumer-set style properties on NeoRel take precedence over style rules\n ...pickConsumerRelationshipStyles(rawRel),\n };\n\n // Accumulate color distribution and type counts\n relTypeCounts[data.type] = (relTypeCounts[data.type] ?? 0) + 1;\n const color = styledRel.color;\n if (color !== undefined) {\n const counts = relColorCounts[data.type] ?? {};\n counts[color] = (counts[color] ?? 0) + 1;\n relColorCounts[data.type] = counts;\n }\n\n return styledRel;\n });\n\n const reltypes = Object.keys(relTypeCounts).sort(sortAlphabetically);\n const reltypeMetaData: Record<string, GraphItemMetaData> = {};\n for (const type of reltypes) {\n const colorDistribution = buildColorDistribution(\n relColorCounts[type] ?? {},\n );\n if (colorDistribution.length > 1) {\n hasMultipleColors = true;\n }\n reltypeMetaData[type] = {\n totalCount: relTypeCounts[type]!,\n colorDistribution,\n };\n }\n\n return {\n metadataLookup: {\n hasMultipleColors,\n labelMetaData,\n labels,\n reltypeMetaData,\n reltypes,\n },\n styledGraph: {\n nodeData,\n nodes: styledNodes,\n relData,\n rels: styledRels,\n },\n };\n}\n"]}
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
*/
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.StyleRuleSchema = exports.StyleSchema = exports.NvlCaptionSchema = exports.CaptionVariationSchema = exports.CaptionValueSchema = exports.WhereSchema = exports.ValueSchema = exports.CypherValueSchema = exports.MatchSchema = exports.SelectorSchema = void 0;
|
|
24
|
+
exports.pickConsumerNodeStyles = pickConsumerNodeStyles;
|
|
25
|
+
exports.pickConsumerRelationshipStyles = pickConsumerRelationshipStyles;
|
|
24
26
|
const zod_1 = require("zod");
|
|
25
27
|
/*
|
|
26
28
|
* Style types defined in Zod, so that we can use the schemas to generate JSON Schema.
|
|
@@ -116,4 +118,49 @@ exports.StyleRuleSchema = zod_1.z.object({
|
|
|
116
118
|
disabled: zod_1.z.boolean().optional(),
|
|
117
119
|
priority: zod_1.z.number().optional(),
|
|
118
120
|
});
|
|
121
|
+
const NODE_STYLE_KEYS = [
|
|
122
|
+
'color',
|
|
123
|
+
'size',
|
|
124
|
+
'icon',
|
|
125
|
+
'overlayIcon',
|
|
126
|
+
'captions',
|
|
127
|
+
'captionSize',
|
|
128
|
+
'captionAlign',
|
|
129
|
+
];
|
|
130
|
+
const REL_STYLE_KEYS = [
|
|
131
|
+
'color',
|
|
132
|
+
'width',
|
|
133
|
+
'captions',
|
|
134
|
+
'captionSize',
|
|
135
|
+
'captionAlign',
|
|
136
|
+
'overlayIcon',
|
|
137
|
+
];
|
|
138
|
+
/**
|
|
139
|
+
* Extract consumer-set style properties from a node.
|
|
140
|
+
* Only includes properties that are explicitly defined (not undefined),
|
|
141
|
+
* so they can be spread over rule-derived styles to take precedence.
|
|
142
|
+
*/
|
|
143
|
+
function pickConsumerNodeStyles(node) {
|
|
144
|
+
const result = {};
|
|
145
|
+
for (const key of NODE_STYLE_KEYS) {
|
|
146
|
+
if (node[key] !== undefined) {
|
|
147
|
+
result[key] = node[key];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return result;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Extract consumer-set style properties from a relationship.
|
|
154
|
+
* Only includes properties that are explicitly defined (not undefined),
|
|
155
|
+
* so they can be spread over rule-derived styles to take precedence.
|
|
156
|
+
*/
|
|
157
|
+
function pickConsumerRelationshipStyles(rel) {
|
|
158
|
+
const result = {};
|
|
159
|
+
for (const key of REL_STYLE_KEYS) {
|
|
160
|
+
if (rel[key] !== undefined) {
|
|
161
|
+
result[key] = rel[key];
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return result;
|
|
165
|
+
}
|
|
119
166
|
//# sourceMappingURL=style-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-types.js","sourceRoot":"","sources":["../../../src/styling/style-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAGH,6BAAwB;AAExB;;;;;;;;;;GAUG;AAEH,+DAA+D;AAC/D,MAAM,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IACnC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;A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EAAE,CAAC,QAAQ,EAAE;IAC3B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAGU,QAAA,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,KAAK,EAAE,mBAAW;IAClB,KAAK,EAAE,mBAAW,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,mBAAW;IAClB,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,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\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 z.number(),\n z.boolean(),\n z.null(),\n]);\nexport type CypherValue = z.infer<typeof CypherValueSchema>;\n\nexport const ValueSchema = z\n .union([SelectorSchema, CypherValueSchema])\n .describe(\n 'Either a property/label/reltype selector (e.g., {property: \"name\"}) or a literal value (string, number, boolean, null).',\n );\nexport type Value = z.infer<typeof ValueSchema>;\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 */\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\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});\n\nexport const StyleSchema = z.object({\n captionAlign: z.enum(['top', 'bottom', 'center']).optional(),\n captionSize: z.number().optional(),\n captions: z.array(NvlCaptionSchema).optional(),\n color: z.string().optional(),\n icon: z.string().optional(),\n overlayIcon: NvlOverlayIconSchema.optional(),\n size: z.number().optional(),\n width: z.number().optional(),\n});\nexport type Style = z.infer<typeof StyleSchema>;\n\nexport const StyleRuleSchema = z.object({\n match: MatchSchema,\n where: WhereSchema.optional(),\n apply: StyleSchema,\n disabled: z.boolean().optional(),\n priority: z.number().optional(),\n});\nexport type StyleRule = z.infer<typeof StyleRuleSchema>;\n\n// Evaluated style values that NVL expects\nexport type EvaluatedNvlNodeStyle = Pick<\n Node,\n | 'icon'\n | 'overlayIcon'\n | 'color'\n | 'size'\n | 'captions'\n | 'captionSize'\n | 'captionAlign'\n>;\nexport type EvaluatedNvlRelationshipStyle = Pick<\n Relationship,\n | 'width'\n | 'color'\n | 'captions'\n | 'captionSize'\n | 'captionAlign'\n | 'overlayIcon'\n>;\n"]}
|
|
1
|
+
{"version":3,"file":"style-types.js","sourceRoot":"","sources":["../../../src/styling/style-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAuMH,wDAUC;AAOD,wEAUC;AA/ND,6BAAwB;AAExB;;;;;;;;;;GAUG;AAEH,+DAA+D;AAC/D,MAAM,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IACnC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAEU,QAAA,cAAc,GAAG,OAAC,CAAC,KAAK,CAAC;IACpC,mBAAmB;IACnB,qBAAqB;IACrB,sBAAsB;CACvB,CAAC,CAAC;AAGU,QAAA,WAAW,GAAG,OAAC,CAAC,KAAK,CAAC;IACjC,mBAAmB;IACnB,qBAAqB;IACrB,sBAAsB;CACvB,CAAC,CAAC;AAEH,qGAAqG;AACxF,QAAA,iBAAiB,GAAG,OAAC,CAAC,KAAK,CAAC;IACvC,OAAC,CAAC,MAAM,EAAE;IACV,OAAC,CAAC,MAAM,EAAE;IACV,OAAC,CAAC,OAAO,EAAE;IACX,OAAC,CAAC,IAAI,EAAE;CACT,CAAC,CAAC;AAGU,QAAA,WAAW,GAAG,OAAC;KAC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AE,CAAC;IAC3C,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QAClC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,OAAO,MAAwC,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,SAAgB,8BAA8B,CAC5C,GAA2C;IAE3C,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,KAAK,MAAM,GAAG,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\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 z.number(),\n z.boolean(),\n z.null(),\n]);\nexport type CypherValue = z.infer<typeof CypherValueSchema>;\n\nexport const ValueSchema = z\n .union([SelectorSchema, CypherValueSchema])\n .describe(\n 'Either a property/label/reltype selector (e.g., {property: \"name\"}) or a literal value (string, number, boolean, null).',\n );\nexport type Value = z.infer<typeof ValueSchema>;\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 */\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\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});\n\nexport const StyleSchema = z.object({\n captionAlign: z.enum(['top', 'bottom', 'center']).optional(),\n captionSize: z.number().optional(),\n captions: z.array(NvlCaptionSchema).optional(),\n color: z.string().optional(),\n icon: z.string().optional(),\n overlayIcon: NvlOverlayIconSchema.optional(),\n size: z.number().optional(),\n width: z.number().optional(),\n});\nexport type Style = z.infer<typeof StyleSchema>;\n\nexport const StyleRuleSchema = z.object({\n match: MatchSchema,\n where: WhereSchema.optional(),\n apply: StyleSchema,\n disabled: z.boolean().optional(),\n priority: z.number().optional(),\n});\nexport type StyleRule = z.infer<typeof StyleRuleSchema>;\n\n// Evaluated style values that NVL expects\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"]}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
import { sortAlphabetically } from '../utils';
|
|
22
|
+
import { pickConsumerNodeStyles, pickConsumerRelationshipStyles, } from './style-types';
|
|
22
23
|
export const NO_LABEL = '(no label)';
|
|
23
24
|
function buildColorDistribution(colorCounts) {
|
|
24
25
|
return Object.entries(colorCounts)
|
|
@@ -40,7 +41,7 @@ export function createVisualizationDataStructures(rawNodes, rawRels, compiledSty
|
|
|
40
41
|
};
|
|
41
42
|
nodeData[rawNode.id] = data;
|
|
42
43
|
const appliedStyle = compiledStyleRules.byLabelSet(data);
|
|
43
|
-
const styledNode = Object.assign(Object.assign(Object.assign(Object.assign({}, rawNode), { labels: undefined, properties: undefined }), appliedStyle), (rawNode
|
|
44
|
+
const styledNode = Object.assign(Object.assign(Object.assign(Object.assign({}, rawNode), { labels: undefined, properties: undefined }), appliedStyle), pickConsumerNodeStyles(rawNode));
|
|
44
45
|
// Accumulate color distribution
|
|
45
46
|
const labels = data.labelsSorted.length > 0 ? data.labelsSorted : [NO_LABEL];
|
|
46
47
|
const color = styledNode.color;
|
|
@@ -80,7 +81,7 @@ export function createVisualizationDataStructures(rawNodes, rawRels, compiledSty
|
|
|
80
81
|
};
|
|
81
82
|
relData[rawRel.id] = data;
|
|
82
83
|
const appliedStyle = compiledStyleRules.byType(data.type)(data);
|
|
83
|
-
const styledRel = Object.assign(Object.assign(Object.assign(Object.assign({}, rawRel), { properties: undefined, type: undefined }), appliedStyle), (rawRel
|
|
84
|
+
const styledRel = Object.assign(Object.assign(Object.assign(Object.assign({}, rawRel), { properties: undefined, type: undefined }), appliedStyle), pickConsumerRelationshipStyles(rawRel));
|
|
84
85
|
// Accumulate color distribution and type counts
|
|
85
86
|
relTypeCounts[data.type] = ((_a = relTypeCounts[data.type]) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
86
87
|
const color = styledRel.color;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-vis-data-structures.js","sourceRoot":"","sources":["../../../src/styling/create-vis-data-structures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAYH,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"create-vis-data-structures.js","sourceRoot":"","sources":["../../../src/styling/create-vis-data-structures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAYH,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EACL,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC;AAErC,SAAS,sBAAsB,CAC7B,WAAmC;IAEnC,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC;SAC/B,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;SAC3C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,QAAmB,EACnB,OAAiB,EACjB,kBAAsC;;IAKtC,MAAM,QAAQ,GAA6B,EAAE,CAAC;IAC9C,MAAM,gBAAgB,GAA2C,EAAE,CAAC;IACpE,MAAM,gBAAgB,GAA2B,EAAE,CAAC;IAEpD,wDAAwD;IACxD,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;;QAC3C,MAAM,IAAI,GAAa;YACrB,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,YAAY,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,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AK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,MAAM,GAAG,MAAA,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAC;YAC/C,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAA,MAAM,CAAC,KAAK,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YACzC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;QACrC,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACrE,MAAM,eAAe,GAAsC,EAAE,CAAC;IAC9D,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,MAAM,iBAAiB,GAAG,sBAAsB,CAC9C,MAAA,cAAc,CAAC,IAAI,CAAC,mCAAI,EAAE,CAC3B,CAAC;QACF,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjC,iBAAiB,GAAG,IAAI,CAAC;QAC3B,CAAC;QACD,eAAe,CAAC,IAAI,CAAC,GAAG;YACtB,UAAU,EAAE,aAAa,CAAC,IAAI,CAAE;YAChC,iBAAiB;SAClB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,cAAc,EAAE;YACd,iBAAiB;YACjB,aAAa;YACb,MAAM;YACN,eAAe;YACf,QAAQ;SACT;QACD,WAAW,EAAE;YACX,QAAQ;YACR,KAAK,EAAE,WAAW;YAClB,OAAO;YACP,IAAI,EAAE,UAAU;SACjB;KACF,CAAC;AACJ,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 {\n ColorCount,\n GraphItemMetaData,\n MetadataLookupTable,\n NeoNode,\n NeoRel,\n NodeData,\n NvlGraph,\n RelData,\n} from '../graph-visualization-context';\nimport { sortAlphabetically } from '../utils';\nimport type { CompiledStyleRules } from './compile-graph-styles';\nimport {\n pickConsumerNodeStyles,\n pickConsumerRelationshipStyles,\n} from './style-types';\n\nexport const NO_LABEL = '(no label)';\n\nfunction buildColorDistribution(\n colorCounts: Record<string, number>,\n): ColorCount[] {\n return Object.entries(colorCounts)\n .map(([color, count]) => ({ color, count }))\n .sort((a, b) => b.count - a.count);\n}\n\nexport function createVisualizationDataStructures(\n rawNodes: NeoNode[],\n rawRels: NeoRel[],\n compiledStyleRules: CompiledStyleRules,\n): {\n styledGraph: NvlGraph;\n metadataLookup: MetadataLookupTable;\n} {\n const nodeData: Record<string, NodeData> = {};\n const labelColorCounts: Record<string, Record<string, number>> = {};\n const labelTotalCounts: Record<string, number> = {};\n\n // Single pass: extract data, apply styles, count colors\n const styledNodes = rawNodes.map((rawNode) => {\n const data: NodeData = {\n id: rawNode.id,\n labelsSorted: [...rawNode.labels].sort(sortAlphabetically),\n properties: rawNode.properties,\n };\n nodeData[rawNode.id] = data;\n\n const appliedStyle = compiledStyleRules.byLabelSet(data);\n\n const styledNode = {\n ...rawNode,\n labels: undefined,\n properties: undefined,\n ...appliedStyle,\n // Consumer-set style properties on NeoNode take precedence over style rules\n ...pickConsumerNodeStyles(rawNode),\n };\n\n // Accumulate color distribution\n const labels =\n data.labelsSorted.length > 0 ? data.labelsSorted : [NO_LABEL];\n const color = styledNode.color;\n\n for (const label of labels) {\n labelTotalCounts[label] = (labelTotalCounts[label] ?? 0) + 1;\n\n if (color !== undefined) {\n const counts = labelColorCounts[label] ?? {};\n counts[color] = (counts[color] ?? 0) + 1;\n labelColorCounts[label] = counts;\n }\n }\n\n return styledNode;\n });\n\n const labels = Object.keys(labelTotalCounts).sort(sortAlphabetically);\n const labelMetaData: Record<string, GraphItemMetaData> = {};\n let hasMultipleColors = false;\n for (const label of labels) {\n const colorDistribution = buildColorDistribution(\n labelColorCounts[label] ?? {},\n );\n if (colorDistribution.length > 1) {\n hasMultipleColors = true;\n }\n labelMetaData[label] = {\n totalCount: labelTotalCounts[label]!,\n colorDistribution,\n };\n }\n\n const relData: Record<string, RelData> = {};\n const relTypeCounts: Record<string, number> = {};\n const relColorCounts: Record<string, Record<string, number>> = {};\n\n // Single pass: extract data, apply styles, count colors\n const styledRels = rawRels.map((rawRel) => {\n const data: RelData = {\n id: rawRel.id,\n properties: rawRel.properties,\n type: rawRel.type,\n };\n relData[rawRel.id] = data;\n\n const appliedStyle = compiledStyleRules.byType(data.type)(data);\n\n const styledRel = {\n ...rawRel,\n properties: undefined,\n type: undefined,\n ...appliedStyle,\n // Consumer-set style properties on NeoRel take precedence over style rules\n ...pickConsumerRelationshipStyles(rawRel),\n };\n\n // Accumulate color distribution and type counts\n relTypeCounts[data.type] = (relTypeCounts[data.type] ?? 0) + 1;\n const color = styledRel.color;\n if (color !== undefined) {\n const counts = relColorCounts[data.type] ?? {};\n counts[color] = (counts[color] ?? 0) + 1;\n relColorCounts[data.type] = counts;\n }\n\n return styledRel;\n });\n\n const reltypes = Object.keys(relTypeCounts).sort(sortAlphabetically);\n const reltypeMetaData: Record<string, GraphItemMetaData> = {};\n for (const type of reltypes) {\n const colorDistribution = buildColorDistribution(\n relColorCounts[type] ?? {},\n );\n if (colorDistribution.length > 1) {\n hasMultipleColors = true;\n }\n reltypeMetaData[type] = {\n totalCount: relTypeCounts[type]!,\n colorDistribution,\n };\n }\n\n return {\n metadataLookup: {\n hasMultipleColors,\n labelMetaData,\n labels,\n reltypeMetaData,\n reltypes,\n },\n styledGraph: {\n nodeData,\n nodes: styledNodes,\n relData,\n rels: styledRels,\n },\n };\n}\n"]}
|
|
@@ -113,4 +113,49 @@ export const StyleRuleSchema = z.object({
|
|
|
113
113
|
disabled: z.boolean().optional(),
|
|
114
114
|
priority: z.number().optional(),
|
|
115
115
|
});
|
|
116
|
+
const NODE_STYLE_KEYS = [
|
|
117
|
+
'color',
|
|
118
|
+
'size',
|
|
119
|
+
'icon',
|
|
120
|
+
'overlayIcon',
|
|
121
|
+
'captions',
|
|
122
|
+
'captionSize',
|
|
123
|
+
'captionAlign',
|
|
124
|
+
];
|
|
125
|
+
const REL_STYLE_KEYS = [
|
|
126
|
+
'color',
|
|
127
|
+
'width',
|
|
128
|
+
'captions',
|
|
129
|
+
'captionSize',
|
|
130
|
+
'captionAlign',
|
|
131
|
+
'overlayIcon',
|
|
132
|
+
];
|
|
133
|
+
/**
|
|
134
|
+
* Extract consumer-set style properties from a node.
|
|
135
|
+
* Only includes properties that are explicitly defined (not undefined),
|
|
136
|
+
* so they can be spread over rule-derived styles to take precedence.
|
|
137
|
+
*/
|
|
138
|
+
export function pickConsumerNodeStyles(node) {
|
|
139
|
+
const result = {};
|
|
140
|
+
for (const key of NODE_STYLE_KEYS) {
|
|
141
|
+
if (node[key] !== undefined) {
|
|
142
|
+
result[key] = node[key];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Extract consumer-set style properties from a relationship.
|
|
149
|
+
* Only includes properties that are explicitly defined (not undefined),
|
|
150
|
+
* so they can be spread over rule-derived styles to take precedence.
|
|
151
|
+
*/
|
|
152
|
+
export function pickConsumerRelationshipStyles(rel) {
|
|
153
|
+
const result = {};
|
|
154
|
+
for (const key of REL_STYLE_KEYS) {
|
|
155
|
+
if (rel[key] !== undefined) {
|
|
156
|
+
result[key] = rel[key];
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return result;
|
|
160
|
+
}
|
|
116
161
|
//# sourceMappingURL=style-types.js.map
|
|
@@ -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;;;;;;;;;;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,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,OAAO,EAAE;IACX,CAAC,CAAC,IAAI,EAAE;CACT,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACzB,KAAK,CAAC,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;KAC1C,QAAQ,CACP,yHAAyH,CAC1H,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CAAC,CAAC,MAAM,CAAC;IAClC,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC5D,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE;IAC9C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,WAAW,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC5C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,WAAW;IAClB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,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\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 z.number(),\n z.boolean(),\n z.null(),\n]);\nexport type CypherValue = z.infer<typeof CypherValueSchema>;\n\nexport const ValueSchema = z\n .union([SelectorSchema, CypherValueSchema])\n .describe(\n 'Either a property/label/reltype selector (e.g., {property: \"name\"}) or a literal value (string, number, boolean, null).',\n );\nexport type Value = z.infer<typeof ValueSchema>;\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 */\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\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});\n\nexport const StyleSchema = z.object({\n captionAlign: z.enum(['top', 'bottom', 'center']).optional(),\n captionSize: z.number().optional(),\n captions: z.array(NvlCaptionSchema).optional(),\n color: z.string().optional(),\n icon: z.string().optional(),\n overlayIcon: NvlOverlayIconSchema.optional(),\n size: z.number().optional(),\n width: z.number().optional(),\n});\nexport type Style = z.infer<typeof StyleSchema>;\n\nexport const StyleRuleSchema = z.object({\n match: MatchSchema,\n where: WhereSchema.optional(),\n apply: StyleSchema,\n disabled: z.boolean().optional(),\n priority: z.number().optional(),\n});\nexport type StyleRule = z.infer<typeof StyleRuleSchema>;\n\n// Evaluated style values that NVL expects\nexport type EvaluatedNvlNodeStyle = Pick<\n Node,\n | 'icon'\n | 'overlayIcon'\n | 'color'\n | 'size'\n | 'captions'\n | 'captionSize'\n | 'captionAlign'\n>;\nexport type EvaluatedNvlRelationshipStyle = Pick<\n Relationship,\n | 'width'\n | 'color'\n | 'captions'\n | 'captionSize'\n | 'captionAlign'\n | 'overlayIcon'\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;;;;;;;;;;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,EA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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\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 z.number(),\n z.boolean(),\n z.null(),\n]);\nexport type CypherValue = z.infer<typeof CypherValueSchema>;\n\nexport const ValueSchema = z\n .union([SelectorSchema, CypherValueSchema])\n .describe(\n 'Either a property/label/reltype selector (e.g., {property: \"name\"}) or a literal value (string, number, boolean, null).',\n );\nexport type Value = z.infer<typeof ValueSchema>;\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 */\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\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});\n\nexport const StyleSchema = z.object({\n captionAlign: z.enum(['top', 'bottom', 'center']).optional(),\n captionSize: z.number().optional(),\n captions: z.array(NvlCaptionSchema).optional(),\n color: z.string().optional(),\n icon: z.string().optional(),\n overlayIcon: NvlOverlayIconSchema.optional(),\n size: z.number().optional(),\n width: z.number().optional(),\n});\nexport type Style = z.infer<typeof StyleSchema>;\n\nexport const StyleRuleSchema = z.object({\n match: MatchSchema,\n where: WhereSchema.optional(),\n apply: StyleSchema,\n disabled: z.boolean().optional(),\n priority: z.number().optional(),\n});\nexport type StyleRule = z.infer<typeof StyleRuleSchema>;\n\n// Evaluated style values that NVL expects\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-vis-data-structures.d.ts","sourceRoot":"","sources":["../../../src/styling/create-vis-data-structures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAGV,mBAAmB,EACnB,OAAO,EACP,MAAM,EAEN,QAAQ,EAET,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"create-vis-data-structures.d.ts","sourceRoot":"","sources":["../../../src/styling/create-vis-data-structures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAGV,mBAAmB,EACnB,OAAO,EACP,MAAM,EAEN,QAAQ,EAET,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAMjE,eAAO,MAAM,QAAQ,eAAe,CAAC;AAUrC,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,OAAO,EAAE,EACnB,OAAO,EAAE,MAAM,EAAE,EACjB,kBAAkB,EAAE,kBAAkB,GACrC;IACD,WAAW,EAAE,QAAQ,CAAC;IACtB,cAAc,EAAE,mBAAmB,CAAC;CACrC,CA6HA"}
|
|
@@ -163,7 +163,21 @@ export declare const StyleRuleSchema: z.ZodObject<{
|
|
|
163
163
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
164
164
|
}, z.core.$strip>;
|
|
165
165
|
export type StyleRule = z.infer<typeof StyleRuleSchema>;
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
type NodeStyleKey = 'icon' | 'overlayIcon' | 'color' | 'size' | 'captions' | 'captionSize' | 'captionAlign';
|
|
167
|
+
type RelStyleKey = 'width' | 'color' | 'captions' | 'captionSize' | 'captionAlign' | 'overlayIcon';
|
|
168
|
+
export type EvaluatedNvlNodeStyle = Pick<Node, NodeStyleKey>;
|
|
169
|
+
export type EvaluatedNvlRelationshipStyle = Pick<Relationship, RelStyleKey>;
|
|
170
|
+
/**
|
|
171
|
+
* Extract consumer-set style properties from a node.
|
|
172
|
+
* Only includes properties that are explicitly defined (not undefined),
|
|
173
|
+
* so they can be spread over rule-derived styles to take precedence.
|
|
174
|
+
*/
|
|
175
|
+
export declare function pickConsumerNodeStyles(node: Partial<EvaluatedNvlNodeStyle>): Partial<EvaluatedNvlNodeStyle>;
|
|
176
|
+
/**
|
|
177
|
+
* Extract consumer-set style properties from a relationship.
|
|
178
|
+
* Only includes properties that are explicitly defined (not undefined),
|
|
179
|
+
* so they can be spread over rule-derived styles to take precedence.
|
|
180
|
+
*/
|
|
181
|
+
export declare function pickConsumerRelationshipStyles(rel: Partial<EvaluatedNvlRelationshipStyle>): Partial<EvaluatedNvlRelationshipStyle>;
|
|
168
182
|
export {};
|
|
169
183
|
//# sourceMappingURL=style-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-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,6BAA6B,CAAC,CAQxC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react-graph",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React implementation of the graph visualization from Neo4j Design System",
|
|
6
6
|
"keywords": [
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@neo4j-nvl/interaction-handlers": "^1.0.0",
|
|
58
58
|
"@neo4j-nvl/react": "^1.0.0",
|
|
59
59
|
"@neo4j-ndl/base": "^4.9.16",
|
|
60
|
-
"@neo4j-ndl/react": "^4.9.
|
|
60
|
+
"@neo4j-ndl/react": "^4.9.29"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"classnames": "2.5.1",
|