@deck.gl-community/graph-layers 9.1.0-beta.8 → 9.2.0-beta.2
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/LICENSE +1 -1
- package/dist/_deprecated/old-constants.d.ts +107 -0
- package/dist/_deprecated/old-constants.d.ts.map +1 -0
- package/dist/_deprecated/old-constants.js +111 -0
- package/dist/_deprecated/old-constants.js.map +1 -0
- package/dist/core/cache.d.ts +0 -1
- package/dist/core/cache.js +0 -1
- package/dist/core/constants.d.ts +12 -100
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +3 -44
- package/dist/core/constants.js.map +1 -1
- package/dist/core/graph-engine.d.ts +12 -11
- package/dist/core/graph-engine.d.ts.map +1 -1
- package/dist/core/graph-engine.js +22 -11
- package/dist/core/graph-engine.js.map +1 -1
- package/dist/core/graph-layout.d.ts +48 -21
- package/dist/core/graph-layout.d.ts.map +1 -1
- package/dist/core/graph-layout.js +91 -24
- package/dist/core/graph-layout.js.map +1 -1
- package/dist/core/interaction-manager.d.ts +6 -4
- package/dist/core/interaction-manager.d.ts.map +1 -1
- package/dist/core/interaction-manager.js +59 -17
- package/dist/core/interaction-manager.js.map +1 -1
- package/dist/graph/edge.d.ts +7 -7
- package/dist/graph/edge.d.ts.map +1 -1
- package/dist/graph/edge.js +3 -6
- package/dist/graph/edge.js.map +1 -1
- package/dist/graph/graph.d.ts +2 -3
- package/dist/graph/graph.js +8 -9
- package/dist/graph/graph.js.map +1 -1
- package/dist/graph/node.d.ts +7 -8
- package/dist/graph/node.d.ts.map +1 -1
- package/dist/graph/node.js +3 -5
- package/dist/graph/node.js.map +1 -1
- package/dist/graph-style-schema.cdn.d.ts +2 -0
- package/dist/graph-style-schema.cdn.js +2 -0
- package/dist/graph-style-schema.json +12 -0
- package/dist/index.cjs +2821 -549
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +28 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -21
- package/dist/index.js.map +1 -1
- package/dist/layers/common-layers/flow-path-layer/flow-path-layer-fragment.glsl.d.ts +0 -1
- package/dist/layers/common-layers/flow-path-layer/flow-path-layer-fragment.glsl.js +0 -1
- package/dist/layers/common-layers/flow-path-layer/flow-path-layer-vertex-tf.glsl.d.ts +0 -1
- package/dist/layers/common-layers/flow-path-layer/flow-path-layer-vertex-tf.glsl.js +0 -1
- package/dist/layers/common-layers/flow-path-layer/flow-path-layer-vertex.glsl.d.ts +0 -1
- package/dist/layers/common-layers/flow-path-layer/flow-path-layer-vertex.glsl.js +0 -1
- package/dist/layers/common-layers/flow-path-layer/flow-path-layer.d.ts +0 -1
- package/dist/layers/common-layers/flow-path-layer/flow-path-layer.js +0 -1
- package/dist/layers/common-layers/marker-layer/atlas-data-url.d.ts +0 -1
- package/dist/layers/common-layers/marker-layer/atlas-data-url.js +0 -1
- package/dist/layers/common-layers/marker-layer/marker-layer.d.ts +0 -1
- package/dist/layers/common-layers/marker-layer/marker-layer.js +2 -3
- package/dist/layers/common-layers/marker-layer/marker-list.d.ts +2 -63
- package/dist/layers/common-layers/marker-layer/marker-list.d.ts.map +1 -1
- package/dist/layers/common-layers/marker-layer/marker-list.js +1 -65
- package/dist/layers/common-layers/marker-layer/marker-list.js.map +1 -1
- package/dist/layers/common-layers/marker-layer/marker-mapping.d.ts +0 -1
- package/dist/layers/common-layers/marker-layer/marker-mapping.js +0 -1
- package/dist/layers/common-layers/spline-layer/spline-layer.d.ts +0 -1
- package/dist/layers/common-layers/spline-layer/spline-layer.js +0 -1
- package/dist/layers/common-layers/zoomable-text-layer/zoomable-text-layer.d.ts +0 -1
- package/dist/layers/common-layers/zoomable-text-layer/zoomable-text-layer.js +0 -1
- package/dist/layers/edge-attachment-helper.d.ts +15 -0
- package/dist/layers/edge-attachment-helper.d.ts.map +1 -0
- package/dist/layers/edge-attachment-helper.js +230 -0
- package/dist/layers/edge-attachment-helper.js.map +1 -0
- package/dist/layers/edge-layer.d.ts +1 -5
- package/dist/layers/edge-layer.d.ts.map +1 -1
- package/dist/layers/edge-layer.js +9 -11
- package/dist/layers/edge-layer.js.map +1 -1
- package/dist/layers/edge-layers/arrow-2d-geometry.d.ts +4 -0
- package/dist/layers/edge-layers/arrow-2d-geometry.d.ts.map +1 -0
- package/dist/layers/edge-layers/arrow-2d-geometry.js +42 -0
- package/dist/layers/edge-layers/arrow-2d-geometry.js.map +1 -0
- package/dist/layers/edge-layers/curved-edge-layer.d.ts +1 -2
- package/dist/layers/edge-layers/curved-edge-layer.js +1 -2
- package/dist/layers/edge-layers/edge-arrow-layer.d.ts +21 -0
- package/dist/layers/edge-layers/edge-arrow-layer.d.ts.map +1 -0
- package/dist/layers/edge-layers/edge-arrow-layer.js +131 -0
- package/dist/layers/edge-layers/edge-arrow-layer.js.map +1 -0
- package/dist/layers/edge-layers/edge-label-layer.d.ts +1 -2
- package/dist/layers/edge-layers/edge-label-layer.js +1 -2
- package/dist/layers/edge-layers/flow-layer.d.ts +1 -2
- package/dist/layers/edge-layers/flow-layer.js +1 -2
- package/dist/layers/edge-layers/path-edge-layer.d.ts +0 -1
- package/dist/layers/edge-layers/path-edge-layer.js +0 -1
- package/dist/layers/edge-layers/straight-line-edge-layer.d.ts +0 -1
- package/dist/layers/edge-layers/straight-line-edge-layer.js +0 -1
- package/dist/layers/graph-layer.d.ts +22 -23
- package/dist/layers/graph-layer.d.ts.map +1 -1
- package/dist/layers/graph-layer.js +218 -62
- package/dist/layers/graph-layer.js.map +1 -1
- package/dist/layers/node-layers/circle-layer.d.ts +0 -1
- package/dist/layers/node-layers/circle-layer.js +0 -1
- package/dist/layers/node-layers/image-layer.d.ts +0 -1
- package/dist/layers/node-layers/image-layer.js +0 -1
- package/dist/layers/node-layers/label-layer.d.ts +1 -2
- package/dist/layers/node-layers/label-layer.js +1 -2
- package/dist/layers/node-layers/path-rounded-rectangle-layer.d.ts +0 -1
- package/dist/layers/node-layers/path-rounded-rectangle-layer.js +1 -2
- package/dist/layers/node-layers/rectangle-layer.d.ts +0 -1
- package/dist/layers/node-layers/rectangle-layer.js +0 -1
- package/dist/layers/node-layers/rounded-rectangle-layer-fragment.d.ts +0 -1
- package/dist/layers/node-layers/rounded-rectangle-layer-fragment.js +0 -1
- package/dist/layers/node-layers/rounded-rectangle-layer.d.ts +1 -2
- package/dist/layers/node-layers/rounded-rectangle-layer.js +2 -3
- package/dist/layers/node-layers/zoomable-marker-layer.d.ts +1 -2
- package/dist/layers/node-layers/zoomable-marker-layer.js +1 -2
- package/dist/layouts/d3-dag/d3-dag-layout.d.ts +117 -0
- package/dist/layouts/d3-dag/d3-dag-layout.d.ts.map +1 -0
- package/dist/layouts/d3-dag/d3-dag-layout.js +716 -0
- package/dist/layouts/d3-dag/d3-dag-layout.js.map +1 -0
- package/dist/layouts/d3-force/d3-force-layout.d.ts +4 -4
- package/dist/layouts/d3-force/d3-force-layout.d.ts.map +1 -1
- package/dist/layouts/d3-force/d3-force-layout.js +25 -10
- package/dist/layouts/d3-force/d3-force-layout.js.map +1 -1
- package/dist/layouts/d3-force/worker.d.ts +0 -1
- package/dist/layouts/d3-force/worker.js +0 -1
- package/dist/layouts/experimental/force-multi-graph-layout.d.ts +9 -8
- package/dist/layouts/experimental/force-multi-graph-layout.d.ts.map +1 -1
- package/dist/layouts/experimental/force-multi-graph-layout.js +15 -11
- package/dist/layouts/experimental/force-multi-graph-layout.js.map +1 -1
- package/dist/layouts/experimental/hive-plot-layout.d.ts +11 -8
- package/dist/layouts/experimental/hive-plot-layout.d.ts.map +1 -1
- package/dist/layouts/experimental/hive-plot-layout.js +12 -7
- package/dist/layouts/experimental/hive-plot-layout.js.map +1 -1
- package/dist/layouts/experimental/radial-layout.d.ts +10 -7
- package/dist/layouts/experimental/radial-layout.d.ts.map +1 -1
- package/dist/layouts/experimental/radial-layout.js +11 -6
- package/dist/layouts/experimental/radial-layout.js.map +1 -1
- package/dist/layouts/gpu-force/gpu-force-layout.d.ts +4 -4
- package/dist/layouts/gpu-force/gpu-force-layout.d.ts.map +1 -1
- package/dist/layouts/gpu-force/gpu-force-layout.js +18 -9
- package/dist/layouts/gpu-force/gpu-force-layout.js.map +1 -1
- package/dist/layouts/gpu-force/worker.d.ts +0 -1
- package/dist/layouts/gpu-force/worker.js +0 -1
- package/dist/layouts/simple-layout.d.ts +19 -12
- package/dist/layouts/simple-layout.d.ts.map +1 -1
- package/dist/layouts/simple-layout.js +26 -15
- package/dist/layouts/simple-layout.js.map +1 -1
- package/dist/loaders/create-graph.d.ts +1 -2
- package/dist/loaders/create-graph.js +3 -4
- package/dist/loaders/edge-parsers.d.ts +1 -2
- package/dist/loaders/edge-parsers.js +2 -3
- package/dist/loaders/edge-parsers.js.map +1 -1
- package/dist/loaders/json-loader.d.ts +2 -3
- package/dist/loaders/json-loader.d.ts.map +1 -1
- package/dist/loaders/json-loader.js +5 -6
- package/dist/loaders/json-loader.js.map +1 -1
- package/dist/loaders/node-parsers.d.ts +1 -2
- package/dist/loaders/node-parsers.js +2 -3
- package/dist/loaders/node-parsers.js.map +1 -1
- package/dist/loaders/simple-json-graph-loader.d.ts +0 -1
- package/dist/loaders/simple-json-graph-loader.d.ts.map +1 -1
- package/dist/loaders/simple-json-graph-loader.js +5 -6
- package/dist/loaders/simple-json-graph-loader.js.map +1 -1
- package/dist/loaders/table-graph-loader.d.ts +3 -4
- package/dist/loaders/table-graph-loader.js +5 -6
- package/dist/loaders/table-graph-loader.js.map +1 -1
- package/dist/style/graph-layer-stylesheet.d.ts +34 -0
- package/dist/style/graph-layer-stylesheet.d.ts.map +1 -0
- package/dist/style/graph-layer-stylesheet.js +39 -0
- package/dist/style/graph-layer-stylesheet.js.map +1 -0
- package/dist/style/graph-style-accessor-map.d.ts +93 -0
- package/dist/style/graph-style-accessor-map.d.ts.map +1 -0
- package/dist/style/graph-style-accessor-map.js +93 -0
- package/dist/style/graph-style-accessor-map.js.map +1 -0
- package/dist/style/graph-style-engine.d.ts +10 -0
- package/dist/style/graph-style-engine.d.ts.map +1 -0
- package/dist/style/graph-style-engine.js +163 -0
- package/dist/style/graph-style-engine.js.map +1 -0
- package/dist/style/graph-stylesheet.schema.d.ts +310 -0
- package/dist/style/graph-stylesheet.schema.d.ts.map +1 -0
- package/dist/style/graph-stylesheet.schema.js +237 -0
- package/dist/style/graph-stylesheet.schema.js.map +1 -0
- package/dist/style/style-engine.d.ts +33 -0
- package/dist/style/style-engine.d.ts.map +1 -0
- package/dist/style/style-engine.js +121 -0
- package/dist/style/style-engine.js.map +1 -0
- package/dist/style/style-property.d.ts +2 -3
- package/dist/style/style-property.d.ts.map +1 -1
- package/dist/style/style-property.js +224 -48
- package/dist/style/style-property.js.map +1 -1
- package/dist/utils/collapsed-chains.d.ts +17 -0
- package/dist/utils/collapsed-chains.d.ts.map +1 -0
- package/dist/utils/collapsed-chains.js +197 -0
- package/dist/utils/collapsed-chains.js.map +1 -0
- package/dist/utils/layer-utils.d.ts +0 -1
- package/dist/utils/layer-utils.d.ts.map +1 -1
- package/dist/utils/layer-utils.js +0 -1
- package/dist/utils/log.d.ts +2 -1
- package/dist/utils/log.d.ts.map +1 -1
- package/dist/utils/log.js +12 -2
- package/dist/utils/log.js.map +1 -1
- package/dist/utils/node-boundary.d.ts +10 -0
- package/dist/utils/node-boundary.d.ts.map +1 -0
- package/dist/utils/node-boundary.js +130 -0
- package/dist/utils/node-boundary.js.map +1 -0
- package/dist/utils/polygon-calculations.d.ts +0 -1
- package/dist/utils/polygon-calculations.js +0 -1
- package/dist/widgets/long-press-button.d.ts +0 -1
- package/dist/widgets/long-press-button.js +0 -1
- package/dist/widgets/view-control-widget.d.ts +4 -5
- package/dist/widgets/view-control-widget.d.ts.map +1 -1
- package/dist/widgets/view-control-widget.js +10 -8
- package/dist/widgets/view-control-widget.js.map +1 -1
- package/package.json +23 -7
- package/src/_deprecated/old-constants.ts +122 -0
- package/src/core/constants.ts +21 -43
- package/src/core/graph-engine.ts +24 -9
- package/src/core/graph-layout.ts +133 -28
- package/src/core/interaction-manager.ts +80 -20
- package/src/graph/edge.ts +6 -6
- package/src/graph/graph.ts +7 -7
- package/src/graph/node.ts +6 -6
- package/src/index.ts +31 -6
- package/src/layers/common-layers/marker-layer/marker-list.ts +62 -64
- package/src/layers/edge-attachment-helper.ts +355 -0
- package/src/layers/edge-layer.ts +6 -7
- package/src/layers/edge-layers/arrow-2d-geometry.ts +51 -0
- package/src/layers/edge-layers/edge-arrow-layer.ts +171 -0
- package/src/layers/graph-layer.ts +304 -86
- package/src/layouts/d3-dag/d3-dag-layout.ts +969 -0
- package/src/layouts/d3-force/d3-force-layout.ts +33 -11
- package/src/layouts/experimental/force-multi-graph-layout.ts +22 -13
- package/src/layouts/experimental/hive-plot-layout.ts +22 -10
- package/src/layouts/experimental/radial-layout.ts +20 -8
- package/src/layouts/gpu-force/gpu-force-layout.ts +22 -10
- package/src/layouts/simple-layout.ts +48 -25
- package/src/loaders/edge-parsers.ts +2 -2
- package/src/loaders/json-loader.ts +2 -2
- package/src/loaders/node-parsers.ts +2 -2
- package/src/loaders/simple-json-graph-loader.ts +2 -2
- package/src/loaders/table-graph-loader.ts +2 -2
- package/src/style/graph-layer-stylesheet.ts +99 -0
- package/src/style/graph-style-accessor-map.ts +103 -0
- package/src/style/graph-style-engine.ts +229 -0
- package/src/style/graph-stylesheet.schema.ts +344 -0
- package/src/style/style-engine.ts +168 -0
- package/src/style/style-property.ts +314 -51
- package/src/utils/collapsed-chains.ts +261 -0
- package/src/utils/log.ts +15 -1
- package/src/utils/node-boundary.ts +238 -0
- package/src/widgets/view-control-widget.tsx +15 -13
- package/dist/style/style-sheet.d.ts +0 -11
- package/dist/style/style-sheet.d.ts.map +0 -1
- package/dist/style/style-sheet.js +0 -253
- package/dist/style/style-sheet.js.map +0 -1
- package/src/style/style-sheet.ts +0 -277
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// deck.gl-community
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { GraphLayout } from
|
|
5
|
-
import { EDGE_TYPE } from "../../core/constants.js";
|
|
4
|
+
import { GraphLayout } from '../../core/graph-layout';
|
|
6
5
|
const traverseTree = (nodeId, nodeMap) => {
|
|
7
6
|
const node = nodeMap[nodeId];
|
|
8
7
|
if (node.isLeaf) {
|
|
@@ -41,7 +40,7 @@ const getPath = (node, targetId, path) => {
|
|
|
41
40
|
return false;
|
|
42
41
|
};
|
|
43
42
|
export class RadialLayout extends GraphLayout {
|
|
44
|
-
static
|
|
43
|
+
static defaultProps = {
|
|
45
44
|
radius: 500
|
|
46
45
|
};
|
|
47
46
|
_name = 'RadialLayout';
|
|
@@ -52,7 +51,7 @@ export class RadialLayout extends GraphLayout {
|
|
|
52
51
|
constructor(options = {}) {
|
|
53
52
|
super(options);
|
|
54
53
|
this._options = {
|
|
55
|
-
...RadialLayout.
|
|
54
|
+
...RadialLayout.defaultProps,
|
|
56
55
|
...options
|
|
57
56
|
};
|
|
58
57
|
}
|
|
@@ -111,6 +110,9 @@ export class RadialLayout extends GraphLayout {
|
|
|
111
110
|
this._onLayoutChange();
|
|
112
111
|
this._onLayoutDone();
|
|
113
112
|
}
|
|
113
|
+
stop() { }
|
|
114
|
+
resume() { }
|
|
115
|
+
update() { }
|
|
114
116
|
getNodePosition = (node) => {
|
|
115
117
|
return this._hierarchicalPoints[node.id];
|
|
116
118
|
};
|
|
@@ -142,7 +144,7 @@ export class RadialLayout extends GraphLayout {
|
|
|
142
144
|
wayPoints.push(this._hierarchicalPoints[nodeId]);
|
|
143
145
|
}
|
|
144
146
|
return {
|
|
145
|
-
type:
|
|
147
|
+
type: 'spline-curve',
|
|
146
148
|
sourcePosition: sourceNodePos,
|
|
147
149
|
targetPosition: targetNodePos,
|
|
148
150
|
controlPoints: wayPoints
|
|
@@ -153,6 +155,10 @@ export class RadialLayout extends GraphLayout {
|
|
|
153
155
|
this._onLayoutChange();
|
|
154
156
|
this._onLayoutDone();
|
|
155
157
|
};
|
|
158
|
+
_updateBounds() {
|
|
159
|
+
const positions = Object.values(this._hierarchicalPoints ?? {}).map((position) => this._normalizePosition(position));
|
|
160
|
+
this._bounds = this._calculateBounds(positions);
|
|
161
|
+
}
|
|
156
162
|
}
|
|
157
163
|
function rotate(cx, cy, x, y, angle) {
|
|
158
164
|
const radians = (Math.PI / 180) * angle;
|
|
@@ -162,4 +168,3 @@ function rotate(cx, cy, x, y, angle) {
|
|
|
162
168
|
const ny = cos * (y - cy) - sin * (x - cx) + cy;
|
|
163
169
|
return [nx, ny];
|
|
164
170
|
}
|
|
165
|
-
//# sourceMappingURL=radial-layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radial-layout.js","sourceRoot":"","sources":["../../../src/layouts/experimental/radial-layout.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"radial-layout.js","sourceRoot":"","sources":["../../../src/layouts/experimental/radial-layout.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,EAAmB,mCAAgC;AAQtE,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;IACvC,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO;QACL,GAAG,IAAI;QACP,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACjE,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;IACvC,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,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a,EAAE,CAAC;IACvB,CAAC,CAAC;IAEiB,aAAa;QAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAC/E,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAClC,CAAC;QACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC;;AAGH,SAAS,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK;IACjC,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;IACxC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC9B,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;IAChD,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;IAChD,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GraphLayout,
|
|
2
|
-
export type GPUForceLayoutOptions =
|
|
1
|
+
import { GraphLayout, GraphLayoutProps } from '../../core/graph-layout';
|
|
2
|
+
export type GPUForceLayoutOptions = GraphLayoutProps & {
|
|
3
3
|
alpha?: number;
|
|
4
4
|
resumeAlpha?: number;
|
|
5
5
|
nBodyStrength?: number;
|
|
@@ -11,7 +11,7 @@ export type GPUForceLayoutOptions = GraphLayoutOptions & {
|
|
|
11
11
|
* @todo this layout should be updated with the organizational and logic improvements made in d3-force
|
|
12
12
|
*/
|
|
13
13
|
export declare class GPUForceLayout extends GraphLayout<GPUForceLayoutOptions> {
|
|
14
|
-
static
|
|
14
|
+
static defaultProps: Required<GPUForceLayoutOptions>;
|
|
15
15
|
protected readonly _name: string;
|
|
16
16
|
private _d3Graph;
|
|
17
17
|
private _nodeMap;
|
|
@@ -39,5 +39,5 @@ export declare class GPUForceLayout extends GraphLayout<GPUForceLayoutOptions> {
|
|
|
39
39
|
};
|
|
40
40
|
lockNodePosition: (node: any, x: any, y: any) => void;
|
|
41
41
|
unlockNodePosition: (node: any) => void;
|
|
42
|
+
protected _updateBounds(): void;
|
|
42
43
|
}
|
|
43
|
-
//# sourceMappingURL=gpu-force-layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpu-force-layout.d.ts","sourceRoot":"","sources":["../../../src/layouts/gpu-force/gpu-force-layout.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"gpu-force-layout.d.ts","sourceRoot":"","sources":["../../../src/layouts/gpu-force/gpu-force-layout.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,WAAW,EAAE,gBAAgB,EAAC,mCAAgC;AAEtE,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW,CAAC,qBAAqB,CAAC;IACpE,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,qBAAqB,CAAC,CAOlD;IAEF,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,UAAU,CAAM;gBAEZ,OAAO,GAAE,qBAA0B;IAoB/C,eAAe,CAAC,KAAK,KAAA;IAuCrB,KAAK;IAIL,MAAM;IAIN,aAAa;IAiCb,MAAM,CAAC,IAAI,KAAA;IACX,KAAK,CAAC,IAAI,KAAA;IAMV,MAAM;IAGN,IAAI;IAQJ,WAAW,CAAC,KAAK,KAAA;IA0CjB,aAAa,CAAC,KAAK,KAAA;IA6BnB,eAAe,GAAI,SAAI,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxC;IAEF,eAAe,GAAI,SAAI;;;;;MAkBrB;IAEF,gBAAgB,GAAI,SAAI,EAAE,MAAC,EAAE,MAAC,UAQ5B;IAEF,kBAAkB,GAAI,SAAI,UAIxB;cAEiB,aAAa,IAAI,IAAI;CAMzC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
// deck.gl-community
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { GraphLayout } from
|
|
5
|
-
import { EDGE_TYPE } from "../../core/constants.js";
|
|
4
|
+
import { GraphLayout } from '../../core/graph-layout';
|
|
6
5
|
/**
|
|
7
6
|
* @todo this layout should be updated with the organizational and logic improvements made in d3-force
|
|
8
7
|
*/
|
|
9
8
|
export class GPUForceLayout extends GraphLayout {
|
|
10
|
-
static
|
|
9
|
+
static defaultProps = {
|
|
11
10
|
alpha: 0.3,
|
|
12
11
|
resumeAlpha: 0.1,
|
|
13
12
|
nBodyStrength: -900,
|
|
@@ -20,11 +19,11 @@ export class GPUForceLayout extends GraphLayout {
|
|
|
20
19
|
_nodeMap;
|
|
21
20
|
_edgeMap;
|
|
22
21
|
_graph;
|
|
23
|
-
_worker;
|
|
22
|
+
_worker = null;
|
|
24
23
|
_callbacks;
|
|
25
24
|
constructor(options = {}) {
|
|
26
25
|
const _options = {
|
|
27
|
-
...GPUForceLayout.
|
|
26
|
+
...GPUForceLayout.defaultProps,
|
|
28
27
|
...options
|
|
29
28
|
};
|
|
30
29
|
super(_options);
|
|
@@ -34,6 +33,10 @@ export class GPUForceLayout extends GraphLayout {
|
|
|
34
33
|
this._d3Graph = { nodes: [], edges: [] };
|
|
35
34
|
this._nodeMap = {};
|
|
36
35
|
this._edgeMap = {};
|
|
36
|
+
this._callbacks = {
|
|
37
|
+
onLayoutChange: this._onLayoutChange,
|
|
38
|
+
onLayoutDone: this._onLayoutDone
|
|
39
|
+
};
|
|
37
40
|
}
|
|
38
41
|
initializeGraph(graph) {
|
|
39
42
|
this._graph = graph;
|
|
@@ -121,7 +124,10 @@ export class GPUForceLayout extends GraphLayout {
|
|
|
121
124
|
throw new Error('Resume unavailable');
|
|
122
125
|
}
|
|
123
126
|
stop() {
|
|
124
|
-
this._worker
|
|
127
|
+
if (this._worker) {
|
|
128
|
+
this._worker.terminate();
|
|
129
|
+
this._worker = null;
|
|
130
|
+
}
|
|
125
131
|
}
|
|
126
132
|
// for steaming new data on the same graph
|
|
127
133
|
updateGraph(graph) {
|
|
@@ -204,14 +210,14 @@ export class GPUForceLayout extends GraphLayout {
|
|
|
204
210
|
const targetPosition = d3Edge && d3Edge.target;
|
|
205
211
|
if (d3Edge && sourcePosition && targetPosition) {
|
|
206
212
|
return {
|
|
207
|
-
type:
|
|
213
|
+
type: 'line',
|
|
208
214
|
sourcePosition: [sourcePosition.x, sourcePosition.y],
|
|
209
215
|
targetPosition: [targetPosition.x, targetPosition.y],
|
|
210
216
|
controlPoints: []
|
|
211
217
|
};
|
|
212
218
|
}
|
|
213
219
|
return {
|
|
214
|
-
type:
|
|
220
|
+
type: 'line',
|
|
215
221
|
sourcePosition: [0, 0],
|
|
216
222
|
targetPosition: [0, 0],
|
|
217
223
|
controlPoints: []
|
|
@@ -231,5 +237,8 @@ export class GPUForceLayout extends GraphLayout {
|
|
|
231
237
|
d3Node.fx = null;
|
|
232
238
|
d3Node.fy = null;
|
|
233
239
|
};
|
|
240
|
+
_updateBounds() {
|
|
241
|
+
const positions = Object.values(this._nodeMap ?? {}).map((node) => this._normalizePosition(node));
|
|
242
|
+
this._bounds = this._calculateBounds(positions);
|
|
243
|
+
}
|
|
234
244
|
}
|
|
235
|
-
//# sourceMappingURL=gpu-force-layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpu-force-layout.js","sourceRoot":"","sources":["../../../src/layouts/gpu-force/gpu-force-layout.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"gpu-force-layout.js","sourceRoot":"","sources":["../../../src/layouts/gpu-force/gpu-force-layout.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,EAAmB,mCAAgC;AAWtE;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAkC;IACpE,MAAM,CAAC,YAAY,GAAoC;QACrD,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,GAAG;QAChB,aAAa,EAAE,CAAC,GAAG;QACnB,gBAAgB,EAAE,GAAG;QACrB,gBAAgB,EAAE,GAAG;QACrB,kBAAkB,EAAE,CAAC;KACtB,CAAC;IAEiB,KAAK,GAAW,KAAK,CAAC;IACjC,QAAQ,CAAM;IACd,QAAQ,CAAM;IACd,QAAQ,CAAM;IACd,MAAM,CAAM;IACZ,OAAO,GAAkB,IAAI,CAAC;IAC9B,UAAU,CAAM;IAExB,YAAY,UAAiC,EAAE;QAC7C,MAAM,QAAQ,GAAG;YACf,GAAG,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EAAE,GAAG,IAAI,CAAC;QACjB,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IACnB,CAAC,CAAC;IAEiB,aAAa;QAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAChE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAC9B,CAAC;QACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=worker.d.ts.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { GraphLayout,
|
|
2
|
-
import { Node } from
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { GraphLayout, GraphLayoutProps } from '../core/graph-layout';
|
|
2
|
+
import { Node } from '../graph/node';
|
|
3
|
+
import { Edge } from '../graph/edge';
|
|
4
|
+
import { Graph } from '../graph/graph';
|
|
5
|
+
export type SimpleLayoutProps = GraphLayoutProps & {
|
|
5
6
|
/** The accessor lets the application supply the position ([x, y]) of each node.
|
|
6
7
|
* @example
|
|
7
8
|
```js
|
|
@@ -21,22 +22,28 @@ export type SimpleLayoutOptions = GraphLayoutOptions & {
|
|
|
21
22
|
nodePositionAccessor?: (node: Node) => [number, number];
|
|
22
23
|
};
|
|
23
24
|
/** A basic layout where the application controls positions of each node */
|
|
24
|
-
export declare class SimpleLayout extends GraphLayout<
|
|
25
|
-
static
|
|
25
|
+
export declare class SimpleLayout extends GraphLayout<SimpleLayoutProps> {
|
|
26
|
+
static defaultProps: Required<SimpleLayoutProps>;
|
|
26
27
|
protected readonly _name = "SimpleLayout";
|
|
27
28
|
protected _graph: Graph | null;
|
|
28
29
|
protected _nodeMap: Record<string, Node>;
|
|
29
|
-
protected _nodePositionMap: Record<string,
|
|
30
|
-
constructor(options?:
|
|
30
|
+
protected _nodePositionMap: Record<string, [number, number] | null>;
|
|
31
|
+
constructor(options?: SimpleLayoutProps);
|
|
31
32
|
initializeGraph(graph: Graph): void;
|
|
32
|
-
_notifyLayoutComplete(): void;
|
|
33
33
|
start(): void;
|
|
34
|
+
stop(): void;
|
|
34
35
|
update(): void;
|
|
35
36
|
resume(): void;
|
|
36
37
|
updateGraph(graph: Graph): void;
|
|
37
38
|
setNodePositionAccessor: (accessor: any) => void;
|
|
38
|
-
getNodePosition: (node:
|
|
39
|
-
getEdgePosition: (edge:
|
|
39
|
+
getNodePosition: (node: Node | null) => [number, number];
|
|
40
|
+
getEdgePosition: (edge: Edge) => {
|
|
41
|
+
type: string;
|
|
42
|
+
sourcePosition: number[];
|
|
43
|
+
targetPosition: number[];
|
|
44
|
+
controlPoints: any[];
|
|
45
|
+
};
|
|
40
46
|
lockNodePosition: (node: any, x: any, y: any) => void;
|
|
47
|
+
_notifyLayoutComplete(): void;
|
|
48
|
+
protected _updateBounds(): void;
|
|
41
49
|
}
|
|
42
|
-
//# sourceMappingURL=simple-layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-layout.d.ts","sourceRoot":"","sources":["../../src/layouts/simple-layout.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"simple-layout.d.ts","sourceRoot":"","sources":["../../src/layouts/simple-layout.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,WAAW,EAAE,gBAAgB,EAAC,gCAA6B;AACnE,OAAO,EAAC,IAAI,EAAC,yBAAsB;AACnC,OAAO,EAAC,IAAI,EAAC,yBAAsB;AACnC,OAAO,EAAC,KAAK,EAAC,0BAAuB;AAErC,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG;IACjD;;;;;;;;;;;;;;;MAeE;IACF,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzD,CAAC;AAEF,2EAA2E;AAC3E,qBAAa,YAAa,SAAQ,WAAW,CAAC,iBAAiB,CAAC;IAC9D,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAG9C;IAEF,SAAS,CAAC,QAAQ,CAAC,KAAK,kBAAkB;IAC1C,SAAS,CAAC,MAAM,EAAE,KAAK,GAAG,IAAI,CAAQ;IACtC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAM;IAC9C,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,CAAM;gBAE7D,OAAO,GAAE,iBAAsB;IAI3C,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAInC,KAAK,IAAI,IAAI;IAIb,IAAI,IAAK,IAAI;IAEb,MAAM,IAAI,IAAI;IAId,MAAM,IAAI,IAAI;IAId,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAiB/B,uBAAuB,GAAI,aAAQ,UAEjC;IAEF,eAAe,GAAI,MAAM,IAAI,GAAG,IAAI,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAMrD;IAEF,eAAe,GAAI,MAAM,IAAI;;;;;MAW3B;IAEF,gBAAgB,GAAI,SAAI,EAAE,MAAC,EAAE,MAAC,UAI5B;IAEF,qBAAqB,IAAI,IAAI;cAOV,aAAa,IAAI,IAAI;CAMzC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// deck.gl-community
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { GraphLayout } from
|
|
5
|
-
import { EDGE_TYPE } from "../core/constants.js";
|
|
4
|
+
import { GraphLayout } from '../core/graph-layout';
|
|
6
5
|
/** A basic layout where the application controls positions of each node */
|
|
7
6
|
export class SimpleLayout extends GraphLayout {
|
|
8
|
-
static
|
|
7
|
+
static defaultProps = {
|
|
9
8
|
nodePositionAccessor: (node) => [node.getPropertyValue('x'), node.getPropertyValue('y')]
|
|
10
9
|
};
|
|
11
10
|
_name = 'SimpleLayout';
|
|
@@ -13,19 +12,15 @@ export class SimpleLayout extends GraphLayout {
|
|
|
13
12
|
_nodeMap = {};
|
|
14
13
|
_nodePositionMap = {};
|
|
15
14
|
constructor(options = {}) {
|
|
16
|
-
super({ ...SimpleLayout.
|
|
15
|
+
super({ ...SimpleLayout.defaultProps, ...options });
|
|
17
16
|
}
|
|
18
17
|
initializeGraph(graph) {
|
|
19
18
|
this.updateGraph(graph);
|
|
20
19
|
}
|
|
21
|
-
_notifyLayoutComplete() {
|
|
22
|
-
this._onLayoutStart();
|
|
23
|
-
this._onLayoutChange();
|
|
24
|
-
this._onLayoutDone();
|
|
25
|
-
}
|
|
26
20
|
start() {
|
|
27
21
|
this._notifyLayoutComplete();
|
|
28
22
|
}
|
|
23
|
+
stop() { }
|
|
29
24
|
update() {
|
|
30
25
|
this._notifyLayoutComplete();
|
|
31
26
|
}
|
|
@@ -39,19 +34,27 @@ export class SimpleLayout extends GraphLayout {
|
|
|
39
34
|
return res;
|
|
40
35
|
}, {});
|
|
41
36
|
this._nodePositionMap = graph.getNodes().reduce((res, node) => {
|
|
42
|
-
res[node.getId()] = this._options.nodePositionAccessor(node);
|
|
37
|
+
res[node.getId()] = this._normalizePosition(this._options.nodePositionAccessor(node));
|
|
43
38
|
return res;
|
|
44
39
|
}, {});
|
|
45
40
|
}
|
|
46
41
|
setNodePositionAccessor = (accessor) => {
|
|
47
42
|
this._options.nodePositionAccessor = accessor;
|
|
48
43
|
};
|
|
49
|
-
getNodePosition = (node) =>
|
|
44
|
+
getNodePosition = (node) => {
|
|
45
|
+
if (!node) {
|
|
46
|
+
return [0, 0];
|
|
47
|
+
}
|
|
48
|
+
const position = this._nodePositionMap[node.getId()];
|
|
49
|
+
return position ?? [0, 0];
|
|
50
|
+
};
|
|
50
51
|
getEdgePosition = (edge) => {
|
|
51
|
-
const
|
|
52
|
-
const
|
|
52
|
+
const sourceNode = this._nodeMap[edge.getSourceNodeId()];
|
|
53
|
+
const targetNode = this._nodeMap[edge.getTargetNodeId()];
|
|
54
|
+
const sourcePos = sourceNode ? this.getNodePosition(sourceNode) : [0, 0];
|
|
55
|
+
const targetPos = targetNode ? this.getNodePosition(targetNode) : [0, 0];
|
|
53
56
|
return {
|
|
54
|
-
type:
|
|
57
|
+
type: 'line',
|
|
55
58
|
sourcePosition: sourcePos,
|
|
56
59
|
targetPosition: targetPos,
|
|
57
60
|
controlPoints: []
|
|
@@ -62,5 +65,13 @@ export class SimpleLayout extends GraphLayout {
|
|
|
62
65
|
this._onLayoutChange();
|
|
63
66
|
this._onLayoutDone();
|
|
64
67
|
};
|
|
68
|
+
_notifyLayoutComplete() {
|
|
69
|
+
this._onLayoutStart();
|
|
70
|
+
this._onLayoutChange();
|
|
71
|
+
this._onLayoutDone();
|
|
72
|
+
}
|
|
73
|
+
_updateBounds() {
|
|
74
|
+
const positions = Object.values(this._nodePositionMap).map((position) => this._normalizePosition(position));
|
|
75
|
+
this._bounds = this._calculateBounds(positions);
|
|
76
|
+
}
|
|
65
77
|
}
|
|
66
|
-
//# sourceMappingURL=simple-layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-layout.js","sourceRoot":"","sources":["../../src/layouts/simple-layout.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"simple-layout.js","sourceRoot":"","sources":["../../src/layouts/simple-layout.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,EAAmB,gCAA6B;AAyBnE,2EAA2E;AAC3E,MAAM,OAAO,YAAa,SAAQ,WAA8B;IAC9D,MAAM,CAAC,YAAY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EAAE;QAChC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7C,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC,CAAC;IAEF,qBAAqB;QACnB,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAGkB,aAAa;QAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CACtE,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAClC,CAAC;QACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Graph } from
|
|
1
|
+
import { Graph } from '../graph/graph';
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated Use `new Graph(name, nodes, edges)`
|
|
4
4
|
* Create a graph from a list of Nodes and edges
|
|
@@ -10,4 +10,3 @@ export declare function createGraph(props: {
|
|
|
10
10
|
nodeParser: any;
|
|
11
11
|
edgeParser: any;
|
|
12
12
|
}): Graph;
|
|
13
|
-
//# sourceMappingURL=create-graph.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// deck.gl-community
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { Edge } from
|
|
5
|
-
import { Node } from
|
|
6
|
-
import { Graph } from
|
|
4
|
+
import { Edge } from '../graph/edge';
|
|
5
|
+
import { Node } from '../graph/node';
|
|
6
|
+
import { Graph } from '../graph/graph';
|
|
7
7
|
/**
|
|
8
8
|
* @deprecated Use `new Graph(name, nodes, edges)`
|
|
9
9
|
* Create a graph from a list of Nodes and edges
|
|
@@ -36,4 +36,3 @@ export function createGraph(props) {
|
|
|
36
36
|
graph.batchAddEdges(glEdges);
|
|
37
37
|
return graph;
|
|
38
38
|
}
|
|
39
|
-
//# sourceMappingURL=create-graph.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// deck.gl-community
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import {
|
|
4
|
+
import { error } from '../utils/log';
|
|
5
5
|
export function basicEdgeParser(edge) {
|
|
6
6
|
const { id, directed, sourceId, targetId } = edge;
|
|
7
7
|
if (sourceId === undefined || targetId === undefined) {
|
|
8
|
-
|
|
8
|
+
error('Invalid edge: sourceId or targetId is missing.');
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
11
|
return {
|
|
@@ -15,4 +15,3 @@ export function basicEdgeParser(edge) {
|
|
|
15
15
|
targetId
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
//# sourceMappingURL=edge-parsers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge-parsers.js","sourceRoot":"","sources":["../../src/loaders/edge-parsers.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"edge-parsers.js","sourceRoot":"","sources":["../../src/loaders/edge-parsers.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,KAAK,EAAC,wBAAqB;AAEnC,MAAM,UAAU,eAAe,CAAC,IAAS;IACvC,MAAM,EAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAC,GAAG,IAAI,CAAC;IAEhD,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QACrD,KAAK,CAAC,gDAAgD,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,EAAE;QACF,QAAQ,EAAE,QAAQ,IAAI,KAAK;QAC3B,QAAQ;QACR,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { basicNodeParser } from
|
|
2
|
-
import { basicEdgeParser } from
|
|
1
|
+
import { basicNodeParser } from './node-parsers';
|
|
2
|
+
import { basicEdgeParser } from './edge-parsers';
|
|
3
3
|
export declare const JSONLoader: ({ json, nodeParser, edgeParser }: {
|
|
4
4
|
json: any;
|
|
5
5
|
nodeParser?: typeof basicNodeParser;
|
|
6
6
|
edgeParser?: typeof basicEdgeParser;
|
|
7
7
|
}) => import("..").Graph;
|
|
8
|
-
//# sourceMappingURL=json-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-loader.d.ts","sourceRoot":"","sources":["../../src/loaders/json-loader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,eAAe,EAAC,0BAAuB;AAC/C,OAAO,EAAC,eAAe,EAAC,0BAAuB;AAG/C,eAAO,MAAM,UAAU;;;;
|
|
1
|
+
{"version":3,"file":"json-loader.d.ts","sourceRoot":"","sources":["../../src/loaders/json-loader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,eAAe,EAAC,0BAAuB;AAC/C,OAAO,EAAC,eAAe,EAAC,0BAAuB;AAG/C,eAAO,MAAM,UAAU,GAAI;;;;CAAkE,uBAS5F,CAAC"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
// deck.gl-community
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { createGraph } from
|
|
5
|
-
import { basicNodeParser } from
|
|
6
|
-
import { basicEdgeParser } from
|
|
7
|
-
import {
|
|
4
|
+
import { createGraph } from './create-graph';
|
|
5
|
+
import { basicNodeParser } from './node-parsers';
|
|
6
|
+
import { basicEdgeParser } from './edge-parsers';
|
|
7
|
+
import { error } from '../utils/log';
|
|
8
8
|
export const JSONLoader = ({ json, nodeParser = basicNodeParser, edgeParser = basicEdgeParser }) => {
|
|
9
9
|
const { name = 'default', nodes, edges } = json;
|
|
10
10
|
if (!nodes) {
|
|
11
|
-
|
|
11
|
+
error('Invalid graph: nodes is missing.');
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
14
|
const graph = createGraph({ name, nodes, edges, nodeParser, edgeParser });
|
|
15
15
|
return graph;
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=json-loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-loader.js","sourceRoot":"","sources":["../../src/loaders/json-loader.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,EAAC,0BAAuB;AAC3C,OAAO,EAAC,eAAe,EAAC,0BAAuB;AAC/C,OAAO,EAAC,eAAe,EAAC,0BAAuB;AAC/C,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"json-loader.js","sourceRoot":"","sources":["../../src/loaders/json-loader.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,EAAC,0BAAuB;AAC3C,OAAO,EAAC,eAAe,EAAC,0BAAuB;AAC/C,OAAO,EAAC,eAAe,EAAC,0BAAuB;AAC/C,OAAO,EAAC,KAAK,EAAC,wBAAqB;AAEnC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAC,IAAI,EAAE,UAAU,GAAG,eAAe,EAAE,UAAU,GAAG,eAAe,EAAC,EAAE,EAAE;IAC/F,MAAM,EAAC,IAAI,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,EAAC,GAAG,IAAI,CAAC;IAC9C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAG,WAAW,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC;IACxE,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
// deck.gl-community
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import {
|
|
4
|
+
import { error } from '../utils/log';
|
|
5
5
|
export function basicNodeParser(node) {
|
|
6
6
|
if (node.id === undefined) {
|
|
7
|
-
|
|
7
|
+
error('Invalid node: id is missing.');
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
10
|
return { id: node.id };
|
|
11
11
|
}
|
|
12
|
-
//# sourceMappingURL=node-parsers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-parsers.js","sourceRoot":"","sources":["../../src/loaders/node-parsers.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"node-parsers.js","sourceRoot":"","sources":["../../src/loaders/node-parsers.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,KAAK,EAAC,wBAAqB;AAEnC,MAAM,UAAU,eAAe,CAAC,IAAS;IACvC,IAAI,IAAI,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;QAC1B,KAAK,CAAC,8BAA8B,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,EAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAC,CAAC;AACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-json-graph-loader.d.ts","sourceRoot":"","sources":["../../src/loaders/simple-json-graph-loader.ts"],"names":[],"mappings":"AASA,0CAA0C;AAC1C,eAAO,MAAM,UAAU;;;;
|
|
1
|
+
{"version":3,"file":"simple-json-graph-loader.d.ts","sourceRoot":"","sources":["../../src/loaders/simple-json-graph-loader.ts"],"names":[],"mappings":"AASA,0CAA0C;AAC1C,eAAO,MAAM,UAAU,GAAI;;;;CAA8B,uBACJ,CAAC;AAEtD,0CAA0C;AAC1C,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE;IAAC,UAAU,MAAC;IAAC,UAAU,MAAA;CAAC,sBAWnC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// deck.gl-community
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { createGraph } from
|
|
5
|
-
import {
|
|
6
|
-
import { basicNodeParser } from
|
|
7
|
-
import { basicEdgeParser } from
|
|
4
|
+
import { createGraph } from './create-graph';
|
|
5
|
+
import { error } from '../utils/log';
|
|
6
|
+
import { basicNodeParser } from './node-parsers';
|
|
7
|
+
import { basicEdgeParser } from './edge-parsers';
|
|
8
8
|
/** @deprecated Use loadSimpleJSONGraph */
|
|
9
9
|
export const JSONLoader = ({ json, nodeParser, edgeParser }) => loadSimpleJSONGraph(json, { nodeParser, edgeParser });
|
|
10
10
|
/** A loader for a simple graph format */
|
|
@@ -12,10 +12,9 @@ export function loadSimpleJSONGraph(json, options) {
|
|
|
12
12
|
const { nodeParser = basicNodeParser, edgeParser = basicEdgeParser } = options;
|
|
13
13
|
const { name = 'default', nodes, edges } = json;
|
|
14
14
|
if (!nodes) {
|
|
15
|
-
|
|
15
|
+
error('Invalid graph: nodes is missing.');
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
18
|
const graph = createGraph({ name, nodes, edges, nodeParser, edgeParser });
|
|
19
19
|
return graph;
|
|
20
20
|
}
|
|
21
|
-
//# sourceMappingURL=simple-json-graph-loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-json-graph-loader.js","sourceRoot":"","sources":["../../src/loaders/simple-json-graph-loader.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,EAAC,0BAAuB;AAC3C,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"simple-json-graph-loader.js","sourceRoot":"","sources":["../../src/loaders/simple-json-graph-loader.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,EAAC,0BAAuB;AAC3C,OAAO,EAAC,KAAK,EAAC,wBAAqB;AACnC,OAAO,EAAC,eAAe,EAAC,0BAAuB;AAC/C,OAAO,EAAC,eAAe,EAAC,0BAAuB;AAE/C,0CAA0C;AAC1C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAC,EAAE,EAAE,CAC3D,mBAAmB,CAAC,IAAI,EAAE,EAAC,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC;AAEtD,0CAA0C;AAC1C,MAAM,UAAU,mBAAmB,CACjC,IAA6B,EAC7B,OAAkC;IAElC,MAAM,EAAC,UAAU,GAAG,eAAe,EAAE,UAAU,GAAG,eAAe,EAAC,GAAG,OAAO,CAAC;IAC7E,MAAM,EAAC,IAAI,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,EAAC,GAAG,IAAI,CAAC;IAC9C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAG,WAAW,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC;IACxE,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { NodeOptions } from
|
|
2
|
-
import type { EdgeOptions } from
|
|
3
|
-
import { Graph } from
|
|
1
|
+
import type { NodeOptions } from '../graph/node';
|
|
2
|
+
import type { EdgeOptions } from '../graph/edge';
|
|
3
|
+
import { Graph } from '../graph/graph';
|
|
4
4
|
export type ParseGraphOptions = {
|
|
5
5
|
nodeIdField?: string;
|
|
6
6
|
edgeSourceField?: string;
|
|
@@ -14,4 +14,3 @@ export declare function tableGraphLoader(tables: {
|
|
|
14
14
|
nodes: any[];
|
|
15
15
|
edges: any[];
|
|
16
16
|
}, options?: ParseGraphOptions): Graph;
|
|
17
|
-
//# sourceMappingURL=table-graph-loader.d.ts.map
|