@deck.gl-community/graph-layers 9.2.0-beta.8 → 9.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_deprecated/old-constants.d.ts.map +1 -1
- package/dist/_deprecated/old-constants.js.map +1 -1
- package/dist/core/graph-layout.d.ts.map +1 -1
- package/dist/core/graph-layout.js.map +1 -1
- package/dist/core/interaction-manager.d.ts.map +1 -1
- package/dist/core/interaction-manager.js.map +1 -1
- package/dist/graph/arrow-graph.d.ts.map +1 -1
- package/dist/graph/arrow-graph.js.map +1 -1
- package/dist/graph/classic-graph.d.ts.map +1 -1
- package/dist/graph/classic-graph.js +1 -3
- package/dist/graph/classic-graph.js.map +1 -1
- package/dist/graph/functions/arrow-utils.d.ts.map +1 -1
- package/dist/graph/functions/arrow-utils.js +5 -3
- package/dist/graph/functions/arrow-utils.js.map +1 -1
- package/dist/graph/functions/create-graph-from-data.d.ts.map +1 -1
- package/dist/graph/functions/create-graph-from-data.js.map +1 -1
- package/dist/graph/graph-normalization.d.ts.map +1 -1
- package/dist/graph/graph-normalization.js.map +1 -1
- package/dist/graph-data/arrow-graph-data-builder.d.ts.map +1 -1
- package/dist/graph-data/arrow-graph-data-builder.js.map +1 -1
- package/dist/graph-data/graph-data-builder.d.ts.map +1 -1
- package/dist/graph-data/plain-graph-data-builder.d.ts.map +1 -1
- package/dist/graph-style-schema.cdn.js +1 -1
- package/dist/graph-style-schema.json +1 -1
- package/dist/index.cjs +42 -39
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/layers/common-layers/grid-layer/grid-layer.d.ts.map +1 -1
- package/dist/layers/common-layers/grid-layer/grid-layer.js +6 -16
- package/dist/layers/common-layers/grid-layer/grid-layer.js.map +1 -1
- package/dist/layers/edge-attachment-helper.d.ts.map +1 -1
- package/dist/layers/edge-attachment-helper.js +1 -3
- package/dist/layers/edge-attachment-helper.js.map +1 -1
- package/dist/layers/edge-layer.js +4 -4
- package/dist/layers/edge-layer.js.map +1 -1
- package/dist/layers/edge-layers/arrow-2d-geometry.js +1 -8
- package/dist/layers/edge-layers/arrow-2d-geometry.js.map +1 -1
- package/dist/layers/graph-layer.d.ts.map +1 -1
- package/dist/layers/graph-layer.js +9 -11
- package/dist/layers/graph-layer.js.map +1 -1
- package/dist/layouts/d3-dag/collapsable-d3-dag-layout.d.ts.map +1 -1
- package/dist/layouts/d3-dag/collapsable-d3-dag-layout.js.map +1 -1
- package/dist/layouts/d3-dag/d3-dag-layout.d.ts.map +1 -1
- package/dist/layouts/d3-dag/d3-dag-layout.js +9 -2
- package/dist/layouts/d3-dag/d3-dag-layout.js.map +1 -1
- package/dist/layouts/experimental/radial-layout.d.ts.map +1 -1
- package/dist/layouts/experimental/radial-layout.js.map +1 -1
- package/dist/layouts/simple-layout.d.ts.map +1 -1
- package/dist/layouts/simple-layout.js +4 -1
- package/dist/layouts/simple-layout.js.map +1 -1
- package/dist/loaders/dot-graph-loader.d.ts.map +1 -1
- package/dist/loaders/dot-graph-loader.js +10 -3
- package/dist/loaders/dot-graph-loader.js.map +1 -1
- package/dist/loaders/json-graph-loader.d.ts.map +1 -1
- package/dist/loaders/json-graph-loader.js +2 -2
- package/dist/loaders/json-graph-loader.js.map +1 -1
- package/dist/loaders/parsers/parse-json-graph.js +2 -1
- package/dist/loaders/parsers/parse-json-graph.js.map +1 -1
- package/dist/style/graph-layer-stylesheet.d.ts.map +1 -1
- package/dist/style/graph-layer-stylesheet.js +7 -7
- package/dist/style/graph-layer-stylesheet.js.map +1 -1
- package/dist/style/graph-style-engine.js +3 -1
- package/dist/style/graph-style-engine.js.map +1 -1
- package/dist/style/graph-stylesheet-schema.d.ts.map +1 -1
- package/dist/style/graph-stylesheet-schema.js +9 -17
- package/dist/style/graph-stylesheet-schema.js.map +1 -1
- package/dist/style/style-property.d.ts.map +1 -1
- package/dist/style/style-property.js +17 -5
- package/dist/style/style-property.js.map +1 -1
- package/dist/style/stylesheet-engine.d.ts.map +1 -1
- package/dist/style/stylesheet-engine.js +1 -1
- package/dist/style/stylesheet-engine.js.map +1 -1
- package/dist/utils/collapsed-chains.d.ts.map +1 -1
- package/dist/utils/collapsed-chains.js.map +1 -1
- package/dist/utils/node-boundary.d.ts.map +1 -1
- package/dist/utils/node-boundary.js +1 -1
- package/dist/utils/node-boundary.js.map +1 -1
- package/dist/utils/rank-grid.d.ts.map +1 -1
- package/dist/utils/rank-grid.js +5 -2
- package/dist/utils/rank-grid.js.map +1 -1
- package/package.json +8 -8
- package/src/_deprecated/old-constants.ts +12 -6
- package/src/core/graph-layout.ts +2 -6
- package/src/core/interaction-manager.ts +2 -1
- package/src/graph/arrow-graph.ts +17 -10
- package/src/graph/classic-graph.ts +8 -5
- package/src/graph/functions/arrow-utils.ts +8 -4
- package/src/graph/functions/create-graph-from-data.ts +2 -2
- package/src/graph/graph-normalization.ts +8 -2
- package/src/graph-data/arrow-graph-data-builder.ts +6 -3
- package/src/graph-data/graph-data-builder.ts +1 -1
- package/src/graph-data/plain-graph-data-builder.ts +1 -1
- package/src/index.ts +33 -16
- package/src/layers/common-layers/grid-layer/grid-layer.ts +26 -19
- package/src/layers/edge-attachment-helper.ts +53 -41
- package/src/layers/edge-layer.ts +4 -4
- package/src/layers/edge-layers/arrow-2d-geometry.ts +1 -8
- package/src/layers/graph-layer.ts +86 -82
- package/src/layouts/d3-dag/collapsable-d3-dag-layout.ts +14 -7
- package/src/layouts/d3-dag/d3-dag-layout.ts +31 -19
- package/src/layouts/experimental/radial-layout.ts +4 -1
- package/src/layouts/simple-layout.ts +6 -4
- package/src/loaders/dot-graph-loader.ts +19 -7
- package/src/loaders/json-graph-loader.ts +3 -5
- package/src/loaders/parsers/parse-json-graph.ts +2 -1
- package/src/style/graph-layer-stylesheet.ts +15 -15
- package/src/style/graph-style-engine.ts +9 -4
- package/src/style/graph-stylesheet-schema.ts +32 -80
- package/src/style/style-property.ts +26 -11
- package/src/style/stylesheet-engine.ts +44 -29
- package/src/utils/collapsed-chains.ts +6 -2
- package/src/utils/node-boundary.ts +2 -3
- package/src/utils/rank-grid.ts +31 -17
package/dist/index.cjs
CHANGED
|
@@ -2389,10 +2389,7 @@ var GraphStyleLeafValueSchema = import_zod.z.union([
|
|
|
2389
2389
|
]);
|
|
2390
2390
|
var RESERVED_STATE_KEYS = /* @__PURE__ */ new Set(["attribute", "fallback", "scale"]);
|
|
2391
2391
|
var GraphStyleStateMapSchema = import_zod.z.record(import_zod.z.string().refine((key) => !RESERVED_STATE_KEYS.has(key), "State overrides must not use reserved keys."), GraphStyleLeafValueSchema);
|
|
2392
|
-
var GraphStyleValueSchema = import_zod.z.union([
|
|
2393
|
-
GraphStyleLeafValueSchema,
|
|
2394
|
-
GraphStyleStateMapSchema
|
|
2395
|
-
]);
|
|
2392
|
+
var GraphStyleValueSchema = import_zod.z.union([GraphStyleLeafValueSchema, GraphStyleStateMapSchema]);
|
|
2396
2393
|
var GraphStyleSelectorKeySchema = import_zod.z.string().regex(/^:[^\s]+/, 'Selectors must start with ":".');
|
|
2397
2394
|
function createSelectorRefinement(allowedKeys, propertiesSchema) {
|
|
2398
2395
|
const allowedKeySet = new Set(allowedKeys);
|
|
@@ -2594,13 +2591,14 @@ var GraphEdgeStylesheetVariants = [
|
|
|
2594
2591
|
FlowStylesheetSchema,
|
|
2595
2592
|
ArrowStylesheetSchema
|
|
2596
2593
|
];
|
|
2597
|
-
var GraphStyleRuleVariants = [
|
|
2598
|
-
...GraphNodeStylesheetVariants,
|
|
2599
|
-
...GraphEdgeStylesheetVariants
|
|
2600
|
-
];
|
|
2594
|
+
var GraphStyleRuleVariants = [...GraphNodeStylesheetVariants, ...GraphEdgeStylesheetVariants];
|
|
2601
2595
|
var GraphStyleRuleSchema = import_zod.z.discriminatedUnion("type", GraphStyleRuleVariants);
|
|
2602
2596
|
var GraphNodeStyleRuleSchema = import_zod.z.discriminatedUnion("type", GraphNodeStylesheetVariants);
|
|
2603
|
-
var GraphEdgeDecoratorRuleSchema = import_zod.z.discriminatedUnion("type", [
|
|
2597
|
+
var GraphEdgeDecoratorRuleSchema = import_zod.z.discriminatedUnion("type", [
|
|
2598
|
+
EdgeLabelStylesheetSchema,
|
|
2599
|
+
FlowStylesheetSchema,
|
|
2600
|
+
ArrowStylesheetSchema
|
|
2601
|
+
]);
|
|
2604
2602
|
var EdgeUpperWithDecoratorsSchema = EdgeUpperStylesheetSchema.safeExtend({
|
|
2605
2603
|
decorators: import_zod.z.array(GraphEdgeDecoratorRuleSchema).optional()
|
|
2606
2604
|
});
|
|
@@ -3025,7 +3023,10 @@ var _SimpleLayout = class extends GraphLayout {
|
|
|
3025
3023
|
this._graph = graph;
|
|
3026
3024
|
const nodes = Array.from(graph.getNodes());
|
|
3027
3025
|
this._nodeMap = new Map(nodes.map((node) => [node.getId(), node]));
|
|
3028
|
-
this._nodePositionMap = new Map(nodes.map((node) => [
|
|
3026
|
+
this._nodePositionMap = new Map(nodes.map((node) => [
|
|
3027
|
+
node.getId(),
|
|
3028
|
+
this._normalizePosition(this.props.nodePositionAccessor(node))
|
|
3029
|
+
]));
|
|
3029
3030
|
}
|
|
3030
3031
|
setNodePositionAccessor = (accessor) => {
|
|
3031
3032
|
this.props.nodePositionAccessor = accessor;
|
|
@@ -3616,7 +3617,10 @@ var _D3DagLayout = class extends GraphLayout {
|
|
|
3616
3617
|
if (!edge) {
|
|
3617
3618
|
continue;
|
|
3618
3619
|
}
|
|
3619
|
-
const points = link.points && link.points.length ? link.points : [
|
|
3620
|
+
const points = link.points && link.points.length ? link.points : [
|
|
3621
|
+
[link.source.x ?? 0, link.source.y ?? 0],
|
|
3622
|
+
[link.target.x ?? 0, link.target.y ?? 0]
|
|
3623
|
+
];
|
|
3620
3624
|
this._rawEdgePoints.set(edge.getId(), points.map((point) => [...point]));
|
|
3621
3625
|
}
|
|
3622
3626
|
this._updateTransformedGeometry();
|
|
@@ -4715,11 +4719,13 @@ var import_layers13 = require("@deck.gl/layers");
|
|
|
4715
4719
|
// dist/style/graph-layer-stylesheet.js
|
|
4716
4720
|
var DEFAULT_GRAPH_LAYER_STYLESHEET_INPUT = {
|
|
4717
4721
|
nodes: [],
|
|
4718
|
-
edges: [
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4722
|
+
edges: [
|
|
4723
|
+
{
|
|
4724
|
+
type: "edge",
|
|
4725
|
+
stroke: "black",
|
|
4726
|
+
strokeWidth: 1
|
|
4727
|
+
}
|
|
4728
|
+
]
|
|
4723
4729
|
};
|
|
4724
4730
|
var DEFAULT_EDGE_STYLE = {
|
|
4725
4731
|
...DEFAULT_GRAPH_LAYER_STYLESHEET_INPUT.edges[0],
|
|
@@ -5790,8 +5796,8 @@ __publicField(CurvedEdgeLayer, "layerName", "CurvedEdgeLayer");
|
|
|
5790
5796
|
|
|
5791
5797
|
// dist/layers/edge-layer.js
|
|
5792
5798
|
var EDGE_LAYER_MAP = {
|
|
5793
|
-
|
|
5794
|
-
|
|
5799
|
+
line: StraightLineEdgeLayer,
|
|
5800
|
+
path: PathEdgeLayer,
|
|
5795
5801
|
"spline-curve": CurvedEdgeLayer
|
|
5796
5802
|
};
|
|
5797
5803
|
var EdgeLayer = class extends import_core13.CompositeLayer {
|
|
@@ -5808,8 +5814,8 @@ var EdgeLayer = class extends import_core13.CompositeLayer {
|
|
|
5808
5814
|
res[type].push(d);
|
|
5809
5815
|
return res;
|
|
5810
5816
|
}, {
|
|
5811
|
-
|
|
5812
|
-
|
|
5817
|
+
line: [],
|
|
5818
|
+
path: [],
|
|
5813
5819
|
"spline-curve": []
|
|
5814
5820
|
});
|
|
5815
5821
|
this.setState({ typedEdgeData });
|
|
@@ -6148,14 +6154,7 @@ function getArrowAttributes({ length = 1, headWidth = 1 }) {
|
|
|
6148
6154
|
0
|
|
6149
6155
|
]);
|
|
6150
6156
|
const normals = new Float32Array([0, 0, 1, 0, 0, 1, 0, 0, 1]);
|
|
6151
|
-
const texCoords = new Float32Array([
|
|
6152
|
-
0.5,
|
|
6153
|
-
1,
|
|
6154
|
-
0,
|
|
6155
|
-
0,
|
|
6156
|
-
1,
|
|
6157
|
-
0
|
|
6158
|
-
]);
|
|
6157
|
+
const texCoords = new Float32Array([0.5, 1, 0, 0, 1, 0]);
|
|
6159
6158
|
return {
|
|
6160
6159
|
positions: { size: 3, value: positions },
|
|
6161
6160
|
normals: { size: 3, value: normals },
|
|
@@ -7459,18 +7458,18 @@ function createGraphFromData(data, props = {}) {
|
|
|
7459
7458
|
|
|
7460
7459
|
// dist/layers/graph-layer.js
|
|
7461
7460
|
var NODE_LAYER_MAP = {
|
|
7462
|
-
|
|
7461
|
+
rectangle: RectangleLayer,
|
|
7463
7462
|
"rounded-rectangle": RoundedRectangleLayer,
|
|
7464
7463
|
"path-rounded-rectangle": PathBasedRoundedRectangleLayer,
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7464
|
+
icon: ImageLayer,
|
|
7465
|
+
circle: CircleLayer,
|
|
7466
|
+
label: LabelLayer,
|
|
7467
|
+
marker: ZoomableMarkerLayer
|
|
7469
7468
|
};
|
|
7470
7469
|
var EDGE_DECORATOR_LAYER_MAP = {
|
|
7471
7470
|
"edge-label": EdgeLabelLayer,
|
|
7472
|
-
|
|
7473
|
-
|
|
7471
|
+
flow: FlowLayer,
|
|
7472
|
+
arrow: EdgeArrowLayer
|
|
7474
7473
|
};
|
|
7475
7474
|
var SHARED_LAYER_PROPS = {
|
|
7476
7475
|
coordinateSystem: import_core18.COORDINATE_SYSTEM.CARTESIAN,
|
|
@@ -8209,7 +8208,7 @@ function isPlainObject(value) {
|
|
|
8209
8208
|
}
|
|
8210
8209
|
|
|
8211
8210
|
// dist/loaders/json-graph-loader.js
|
|
8212
|
-
var VERSION = true ? "9.2.
|
|
8211
|
+
var VERSION = true ? "9.2.5" : "latest";
|
|
8213
8212
|
var JSONGraphLoader = {
|
|
8214
8213
|
dataType: null,
|
|
8215
8214
|
batchType: null,
|
|
@@ -8222,7 +8221,7 @@ var JSONGraphLoader = {
|
|
|
8222
8221
|
mimeTypes: ["application/json"],
|
|
8223
8222
|
text: true,
|
|
8224
8223
|
options: {
|
|
8225
|
-
|
|
8224
|
+
jsongraph: {}
|
|
8226
8225
|
},
|
|
8227
8226
|
parse: async (arrayBuffer, options) => {
|
|
8228
8227
|
const text = new TextDecoder().decode(arrayBuffer);
|
|
@@ -8234,7 +8233,7 @@ var JSONGraphLoader = {
|
|
|
8234
8233
|
};
|
|
8235
8234
|
|
|
8236
8235
|
// dist/loaders/dot-graph-loader.js
|
|
8237
|
-
var VERSION2 = true ? "9.2.
|
|
8236
|
+
var VERSION2 = true ? "9.2.5" : "latest";
|
|
8238
8237
|
var DOTGraphLoader = {
|
|
8239
8238
|
dataType: null,
|
|
8240
8239
|
batchType: null,
|
|
@@ -8515,7 +8514,11 @@ var DOTParser = class {
|
|
|
8515
8514
|
graphAttributes: {}
|
|
8516
8515
|
};
|
|
8517
8516
|
this.scopes.push(context);
|
|
8518
|
-
this.result.subgraphs.set(subgraphId, {
|
|
8517
|
+
this.result.subgraphs.set(subgraphId, {
|
|
8518
|
+
id: subgraphId,
|
|
8519
|
+
attributes: context.graphAttributes,
|
|
8520
|
+
parentId
|
|
8521
|
+
});
|
|
8519
8522
|
let shouldContinue = true;
|
|
8520
8523
|
while (shouldContinue) {
|
|
8521
8524
|
if (this.match("rbrace")) {
|