@hpcc-js/graph 3.3.1 → 3.3.3
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/index.js +159 -130
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +10 -10
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +8 -8
- package/src/common/graphT.ts +0 -55
- package/src/common/layouts/layout.ts +2 -3
- package/src/common/layouts/placeholders.ts +0 -2
- package/src/html/component.ts +7 -3
- package/src/html/edge.ts +15 -0
- package/src/html/graphHtml.ts +4 -2
- package/src/html/graphHtmlT.ts +72 -4
- package/src/html/icon.ts +1 -1
- package/src/html/intersection.ts +110 -0
- package/src/html/shape.ts +7 -2
- package/src/html/textBox.ts +5 -1
- package/src/html/vertex.ts +4 -2
- package/types/common/graphT.d.ts +0 -1
- package/types/common/layouts/placeholders.d.ts +0 -2
- package/types/html/component.d.ts +5 -5
- package/types/html/edge.d.ts +6 -0
- package/types/html/graphHtml.d.ts +3 -2
- package/types/html/graphHtmlT.d.ts +8 -0
- package/types/html/intersection.d.ts +20 -0
- package/src/common/layouts/pathIntersection.ts +0 -67
- package/types/common/layouts/pathIntersection.d.ts +0 -24
package/dist/index.js
CHANGED
|
@@ -3042,22 +3042,22 @@ function requireGraph() {
|
|
|
3042
3042
|
var e2 = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v2, w, name);
|
|
3043
3043
|
return _2.has(this._edgeLabels, e2);
|
|
3044
3044
|
}, Graph3.prototype.removeEdge = function(v2, w, name) {
|
|
3045
|
-
var e2 = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v2, w, name),
|
|
3046
|
-
return
|
|
3045
|
+
var e2 = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v2, w, name), edge2 = this._edgeObjs[e2];
|
|
3046
|
+
return edge2 && (v2 = edge2.v, w = edge2.w, delete this._edgeLabels[e2], delete this._edgeObjs[e2], decrementOrRemoveEntry(this._preds[w], v2), decrementOrRemoveEntry(this._sucs[v2], w), delete this._in[w][e2], delete this._out[v2][e2], this._edgeCount--), this;
|
|
3047
3047
|
}, Graph3.prototype.inEdges = function(v2, u2) {
|
|
3048
3048
|
var inV = this._in[v2];
|
|
3049
3049
|
if (inV) {
|
|
3050
3050
|
var edges = _2.values(inV);
|
|
3051
|
-
return u2 ? _2.filter(edges, function(
|
|
3052
|
-
return
|
|
3051
|
+
return u2 ? _2.filter(edges, function(edge2) {
|
|
3052
|
+
return edge2.v === u2;
|
|
3053
3053
|
}) : edges;
|
|
3054
3054
|
}
|
|
3055
3055
|
}, Graph3.prototype.outEdges = function(v2, w) {
|
|
3056
3056
|
var outV = this._out[v2];
|
|
3057
3057
|
if (outV) {
|
|
3058
3058
|
var edges = _2.values(outV);
|
|
3059
|
-
return w ? _2.filter(edges, function(
|
|
3060
|
-
return
|
|
3059
|
+
return w ? _2.filter(edges, function(edge2) {
|
|
3060
|
+
return edge2.w === w;
|
|
3061
3061
|
}) : edges;
|
|
3062
3062
|
}
|
|
3063
3063
|
}, Graph3.prototype.nodeEdges = function(v2, w) {
|
|
@@ -3133,8 +3133,8 @@ function requireJson() {
|
|
|
3133
3133
|
}
|
|
3134
3134
|
function writeEdges(g2) {
|
|
3135
3135
|
return _2.map(g2.edges(), function(e2) {
|
|
3136
|
-
var edgeValue = g2.edge(e2),
|
|
3137
|
-
return _2.isUndefined(e2.name) || (
|
|
3136
|
+
var edgeValue = g2.edge(e2), edge2 = { v: e2.v, w: e2.w };
|
|
3137
|
+
return _2.isUndefined(e2.name) || (edge2.name = e2.name), _2.isUndefined(edgeValue) || (edge2.value = edgeValue), edge2;
|
|
3138
3138
|
});
|
|
3139
3139
|
}
|
|
3140
3140
|
function read(json2) {
|
|
@@ -3234,10 +3234,10 @@ function requireDijkstra() {
|
|
|
3234
3234
|
);
|
|
3235
3235
|
}
|
|
3236
3236
|
function runDijkstra(g2, source, weightFn, edgeFn) {
|
|
3237
|
-
var results = {}, pq = new PriorityQueue(), v2, vEntry, updateNeighbors = function(
|
|
3238
|
-
var w =
|
|
3237
|
+
var results = {}, pq = new PriorityQueue(), v2, vEntry, updateNeighbors = function(edge2) {
|
|
3238
|
+
var w = edge2.v !== v2 ? edge2.v : edge2.w, wEntry = results[w], weight = weightFn(edge2), distance2 = vEntry.distance + weight;
|
|
3239
3239
|
if (weight < 0)
|
|
3240
|
-
throw new Error("dijkstra does not allow negative edge weights. Bad edge: " +
|
|
3240
|
+
throw new Error("dijkstra does not allow negative edge weights. Bad edge: " + edge2 + " Weight: " + weight);
|
|
3241
3241
|
distance2 < wEntry.distance && (wEntry.distance = distance2, wEntry.predecessor = v2, pq.decrease(w, distance2));
|
|
3242
3242
|
};
|
|
3243
3243
|
for (g2.nodes().forEach(function(v3) {
|
|
@@ -3326,8 +3326,8 @@ function requireFloydWarshall() {
|
|
|
3326
3326
|
return nodes.forEach(function(v2) {
|
|
3327
3327
|
results[v2] = {}, results[v2][v2] = { distance: 0 }, nodes.forEach(function(w) {
|
|
3328
3328
|
v2 !== w && (results[v2][w] = { distance: Number.POSITIVE_INFINITY });
|
|
3329
|
-
}), edgeFn(v2).forEach(function(
|
|
3330
|
-
var w =
|
|
3329
|
+
}), edgeFn(v2).forEach(function(edge2) {
|
|
3330
|
+
var w = edge2.v === v2 ? edge2.w : edge2.v, d2 = weightFn(edge2);
|
|
3331
3331
|
results[v2][w] = { distance: d2, predecessor: v2 };
|
|
3332
3332
|
});
|
|
3333
3333
|
}), nodes.forEach(function(k2) {
|
|
@@ -3434,10 +3434,10 @@ function requirePrim() {
|
|
|
3434
3434
|
prim_1 = prim;
|
|
3435
3435
|
function prim(g2, weightFunc) {
|
|
3436
3436
|
var result = new Graph3(), parents = {}, pq = new PriorityQueue(), v2;
|
|
3437
|
-
function updateNeighbors(
|
|
3438
|
-
var w =
|
|
3437
|
+
function updateNeighbors(edge2) {
|
|
3438
|
+
var w = edge2.v === v2 ? edge2.w : edge2.v, pri = pq.priority(w);
|
|
3439
3439
|
if (pri !== void 0) {
|
|
3440
|
-
var edgeWeight = weightFunc(
|
|
3440
|
+
var edgeWeight = weightFunc(edge2);
|
|
3441
3441
|
edgeWeight < pri && (parents[w] = v2, pq.decrease(w, edgeWeight));
|
|
3442
3442
|
}
|
|
3443
3443
|
}
|
|
@@ -4195,11 +4195,11 @@ function requireGreedyFas() {
|
|
|
4195
4195
|
}
|
|
4196
4196
|
function removeNode(g2, buckets, zeroIdx, entry, collectPredecessors) {
|
|
4197
4197
|
var results = collectPredecessors ? [] : void 0;
|
|
4198
|
-
return _2.forEach(g2.inEdges(entry.v), function(
|
|
4199
|
-
var weight = g2.edge(
|
|
4200
|
-
collectPredecessors && results.push({ v:
|
|
4201
|
-
}), _2.forEach(g2.outEdges(entry.v), function(
|
|
4202
|
-
var weight = g2.edge(
|
|
4198
|
+
return _2.forEach(g2.inEdges(entry.v), function(edge2) {
|
|
4199
|
+
var weight = g2.edge(edge2), uEntry = g2.node(edge2.v);
|
|
4200
|
+
collectPredecessors && results.push({ v: edge2.v, w: edge2.w }), uEntry.out -= weight, assignBucket(buckets, zeroIdx, uEntry);
|
|
4201
|
+
}), _2.forEach(g2.outEdges(entry.v), function(edge2) {
|
|
4202
|
+
var weight = g2.edge(edge2), w = edge2.w, wEntry = g2.node(w);
|
|
4203
4203
|
wEntry.in -= weight, assignBucket(buckets, zeroIdx, wEntry);
|
|
4204
4204
|
}), g2.removeNode(entry.v), results;
|
|
4205
4205
|
}
|
|
@@ -4414,8 +4414,8 @@ function requireNormalize() {
|
|
|
4414
4414
|
undo
|
|
4415
4415
|
};
|
|
4416
4416
|
function run(g2) {
|
|
4417
|
-
g2.graph().dummyChains = [], _2.forEach(g2.edges(), function(
|
|
4418
|
-
normalizeEdge(g2,
|
|
4417
|
+
g2.graph().dummyChains = [], _2.forEach(g2.edges(), function(edge2) {
|
|
4418
|
+
normalizeEdge(g2, edge2);
|
|
4419
4419
|
});
|
|
4420
4420
|
}
|
|
4421
4421
|
function normalizeEdge(g2, e2) {
|
|
@@ -4482,8 +4482,8 @@ function requireFeasibleTree() {
|
|
|
4482
4482
|
function feasibleTree(g2) {
|
|
4483
4483
|
var t2 = new Graph3({ directed: !1 }), start = g2.nodes()[0], size = g2.nodeCount();
|
|
4484
4484
|
t2.setNode(start, {});
|
|
4485
|
-
for (var
|
|
4486
|
-
|
|
4485
|
+
for (var edge2, delta; tightTree(t2, g2) < size; )
|
|
4486
|
+
edge2 = findMinSlackEdge(t2, g2), delta = t2.hasNode(edge2.v) ? slack(g2, edge2) : -slack(g2, edge2), shiftRanks(t2, g2, delta);
|
|
4487
4487
|
return t2;
|
|
4488
4488
|
}
|
|
4489
4489
|
function tightTree(t2, g2) {
|
|
@@ -4558,16 +4558,16 @@ function requireNetworkSimplex() {
|
|
|
4558
4558
|
return tree2.edge(e2).cutvalue < 0;
|
|
4559
4559
|
});
|
|
4560
4560
|
}
|
|
4561
|
-
function enterEdge(t2, g2,
|
|
4562
|
-
var v2 =
|
|
4563
|
-
g2.hasEdge(v2, w) || (v2 =
|
|
4561
|
+
function enterEdge(t2, g2, edge2) {
|
|
4562
|
+
var v2 = edge2.v, w = edge2.w;
|
|
4563
|
+
g2.hasEdge(v2, w) || (v2 = edge2.w, w = edge2.v);
|
|
4564
4564
|
var vLabel = t2.node(v2), wLabel = t2.node(w), tailLabel = vLabel, flip = !1;
|
|
4565
4565
|
vLabel.lim > wLabel.lim && (tailLabel = wLabel, flip = !0);
|
|
4566
|
-
var candidates = _2.filter(g2.edges(), function(
|
|
4567
|
-
return flip === isDescendant(t2, t2.node(
|
|
4566
|
+
var candidates = _2.filter(g2.edges(), function(edge3) {
|
|
4567
|
+
return flip === isDescendant(t2, t2.node(edge3.v), tailLabel) && flip !== isDescendant(t2, t2.node(edge3.w), tailLabel);
|
|
4568
4568
|
});
|
|
4569
|
-
return _2.minBy(candidates, function(
|
|
4570
|
-
return slack(g2,
|
|
4569
|
+
return _2.minBy(candidates, function(edge3) {
|
|
4570
|
+
return slack(g2, edge3);
|
|
4571
4571
|
});
|
|
4572
4572
|
}
|
|
4573
4573
|
function exchangeEdges(t2, g2, e2, f2) {
|
|
@@ -4579,8 +4579,8 @@ function requireNetworkSimplex() {
|
|
|
4579
4579
|
return !g2.node(v2).parent;
|
|
4580
4580
|
}), vs = preorder(t2, root);
|
|
4581
4581
|
vs = vs.slice(1), _2.forEach(vs, function(v2) {
|
|
4582
|
-
var parent = t2.node(v2).parent,
|
|
4583
|
-
|
|
4582
|
+
var parent = t2.node(v2).parent, edge2 = g2.edge(v2, parent), flipped = !1;
|
|
4583
|
+
edge2 || (edge2 = g2.edge(parent, v2), flipped = !0), g2.node(v2).rank = g2.node(parent).rank + (flipped ? edge2.minlen : -edge2.minlen);
|
|
4584
4584
|
});
|
|
4585
4585
|
}
|
|
4586
4586
|
function isTreeEdge(tree2, u2, v2) {
|
|
@@ -4725,8 +4725,8 @@ function requireNestingGraph() {
|
|
|
4725
4725
|
function cleanup(g2) {
|
|
4726
4726
|
var graphLabel = g2.graph();
|
|
4727
4727
|
g2.removeNode(graphLabel.nestingRoot), delete graphLabel.nestingRoot, _2.forEach(g2.edges(), function(e2) {
|
|
4728
|
-
var
|
|
4729
|
-
|
|
4728
|
+
var edge2 = g2.edge(e2);
|
|
4729
|
+
edge2.nestingEdge && g2.removeEdge(e2);
|
|
4730
4730
|
});
|
|
4731
4731
|
}
|
|
4732
4732
|
return nestingGraph;
|
|
@@ -4786,8 +4786,8 @@ function requireCoordinateSystem() {
|
|
|
4786
4786
|
_2.forEach(g2.nodes(), function(v2) {
|
|
4787
4787
|
reverseYOne(g2.node(v2));
|
|
4788
4788
|
}), _2.forEach(g2.edges(), function(e2) {
|
|
4789
|
-
var
|
|
4790
|
-
_2.forEach(
|
|
4789
|
+
var edge2 = g2.edge(e2);
|
|
4790
|
+
_2.forEach(edge2.points, reverseYOne), _2.has(edge2, "y") && reverseYOne(edge2);
|
|
4791
4791
|
});
|
|
4792
4792
|
}
|
|
4793
4793
|
function reverseYOne(attrs) {
|
|
@@ -4797,8 +4797,8 @@ function requireCoordinateSystem() {
|
|
|
4797
4797
|
_2.forEach(g2.nodes(), function(v2) {
|
|
4798
4798
|
swapXYOne(g2.node(v2));
|
|
4799
4799
|
}), _2.forEach(g2.edges(), function(e2) {
|
|
4800
|
-
var
|
|
4801
|
-
_2.forEach(
|
|
4800
|
+
var edge2 = g2.edge(e2);
|
|
4801
|
+
_2.forEach(edge2.points, swapXYOne), _2.has(edge2, "x") && swapXYOne(edge2);
|
|
4802
4802
|
});
|
|
4803
4803
|
}
|
|
4804
4804
|
function swapXYOne(attrs) {
|
|
@@ -4883,10 +4883,10 @@ function requireBarycenter() {
|
|
|
4883
4883
|
var inV = g2.inEdges(v2);
|
|
4884
4884
|
if (inV.length) {
|
|
4885
4885
|
var result = _2.reduce(inV, function(acc, e2) {
|
|
4886
|
-
var
|
|
4886
|
+
var edge2 = g2.edge(e2), nodeU = g2.node(e2.v);
|
|
4887
4887
|
return {
|
|
4888
|
-
sum: acc.sum +
|
|
4889
|
-
weight: acc.weight +
|
|
4888
|
+
sum: acc.sum + edge2.weight * nodeU.order,
|
|
4889
|
+
weight: acc.weight + edge2.weight
|
|
4890
4890
|
};
|
|
4891
4891
|
}, { sum: 0, weight: 0 });
|
|
4892
4892
|
return {
|
|
@@ -5039,7 +5039,7 @@ function requireBuildLayerGraph() {
|
|
|
5039
5039
|
return _2.forEach(g2.nodes(), function(v2) {
|
|
5040
5040
|
var node = g2.node(v2), parent = g2.parent(v2);
|
|
5041
5041
|
(node.rank === rank || node.minRank <= rank && rank <= node.maxRank) && (result.setNode(v2), result.setParent(v2, parent || root), _2.forEach(g2[relationship](v2), function(e2) {
|
|
5042
|
-
var u2 = e2.v === v2 ? e2.w : e2.v,
|
|
5042
|
+
var u2 = e2.v === v2 ? e2.w : e2.v, edge2 = result.edge(u2, v2), weight = _2.isUndefined(edge2) ? 0 : edge2.weight;
|
|
5043
5043
|
result.setEdge(u2, v2, { weight: g2.edge(e2).weight + weight });
|
|
5044
5044
|
}), _2.has(node, "minRank") && result.setNode(v2, {
|
|
5045
5045
|
borderLeft: node.borderLeft[rank],
|
|
@@ -5459,26 +5459,26 @@ function requireLayout() {
|
|
|
5459
5459
|
var node = canonicalize(inputGraph.node(v2));
|
|
5460
5460
|
g2.setNode(v2, _2.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults)), g2.setParent(v2, inputGraph.parent(v2));
|
|
5461
5461
|
}), _2.forEach(inputGraph.edges(), function(e2) {
|
|
5462
|
-
var
|
|
5462
|
+
var edge2 = canonicalize(inputGraph.edge(e2));
|
|
5463
5463
|
g2.setEdge(e2, _2.merge(
|
|
5464
5464
|
{},
|
|
5465
5465
|
edgeDefaults,
|
|
5466
|
-
selectNumberAttrs(
|
|
5467
|
-
_2.pick(
|
|
5466
|
+
selectNumberAttrs(edge2, edgeNumAttrs),
|
|
5467
|
+
_2.pick(edge2, edgeAttrs)
|
|
5468
5468
|
));
|
|
5469
5469
|
}), g2;
|
|
5470
5470
|
}
|
|
5471
5471
|
function makeSpaceForEdgeLabels(g2) {
|
|
5472
5472
|
var graph2 = g2.graph();
|
|
5473
5473
|
graph2.ranksep /= 2, _2.forEach(g2.edges(), function(e2) {
|
|
5474
|
-
var
|
|
5475
|
-
|
|
5474
|
+
var edge2 = g2.edge(e2);
|
|
5475
|
+
edge2.minlen *= 2, edge2.labelpos.toLowerCase() !== "c" && (graph2.rankdir === "TB" || graph2.rankdir === "BT" ? edge2.width += edge2.labeloffset : edge2.height += edge2.labeloffset);
|
|
5476
5476
|
});
|
|
5477
5477
|
}
|
|
5478
5478
|
function injectEdgeLabelProxies(g2) {
|
|
5479
5479
|
_2.forEach(g2.edges(), function(e2) {
|
|
5480
|
-
var
|
|
5481
|
-
if (
|
|
5480
|
+
var edge2 = g2.edge(e2);
|
|
5481
|
+
if (edge2.width && edge2.height) {
|
|
5482
5482
|
var v2 = g2.node(e2.v), w = g2.node(e2.w), label = { rank: (w.rank - v2.rank) / 2 + v2.rank, e: e2 };
|
|
5483
5483
|
util2.addDummyNode(g2, "edge-proxy", label, "_ep");
|
|
5484
5484
|
}
|
|
@@ -5506,42 +5506,42 @@ function requireLayout() {
|
|
|
5506
5506
|
_2.forEach(g2.nodes(), function(v2) {
|
|
5507
5507
|
getExtremes(g2.node(v2));
|
|
5508
5508
|
}), _2.forEach(g2.edges(), function(e2) {
|
|
5509
|
-
var
|
|
5510
|
-
_2.has(
|
|
5509
|
+
var edge2 = g2.edge(e2);
|
|
5510
|
+
_2.has(edge2, "x") && getExtremes(edge2);
|
|
5511
5511
|
}), minX -= marginX, minY -= marginY, _2.forEach(g2.nodes(), function(v2) {
|
|
5512
5512
|
var node = g2.node(v2);
|
|
5513
5513
|
node.x -= minX, node.y -= minY;
|
|
5514
5514
|
}), _2.forEach(g2.edges(), function(e2) {
|
|
5515
|
-
var
|
|
5516
|
-
_2.forEach(
|
|
5515
|
+
var edge2 = g2.edge(e2);
|
|
5516
|
+
_2.forEach(edge2.points, function(p2) {
|
|
5517
5517
|
p2.x -= minX, p2.y -= minY;
|
|
5518
|
-
}), _2.has(
|
|
5518
|
+
}), _2.has(edge2, "x") && (edge2.x -= minX), _2.has(edge2, "y") && (edge2.y -= minY);
|
|
5519
5519
|
}), graphLabel.width = maxX - minX + marginX, graphLabel.height = maxY2 - minY + marginY;
|
|
5520
5520
|
}
|
|
5521
5521
|
function assignNodeIntersects(g2) {
|
|
5522
5522
|
_2.forEach(g2.edges(), function(e2) {
|
|
5523
|
-
var
|
|
5524
|
-
|
|
5523
|
+
var edge2 = g2.edge(e2), nodeV = g2.node(e2.v), nodeW = g2.node(e2.w), p1, p2;
|
|
5524
|
+
edge2.points ? (p1 = edge2.points[0], p2 = edge2.points[edge2.points.length - 1]) : (edge2.points = [], p1 = nodeW, p2 = nodeV), edge2.points.unshift(util2.intersectRect(nodeV, p1)), edge2.points.push(util2.intersectRect(nodeW, p2));
|
|
5525
5525
|
});
|
|
5526
5526
|
}
|
|
5527
5527
|
function fixupEdgeLabelCoords(g2) {
|
|
5528
5528
|
_2.forEach(g2.edges(), function(e2) {
|
|
5529
|
-
var
|
|
5530
|
-
if (_2.has(
|
|
5531
|
-
switch ((
|
|
5529
|
+
var edge2 = g2.edge(e2);
|
|
5530
|
+
if (_2.has(edge2, "x"))
|
|
5531
|
+
switch ((edge2.labelpos === "l" || edge2.labelpos === "r") && (edge2.width -= edge2.labeloffset), edge2.labelpos) {
|
|
5532
5532
|
case "l":
|
|
5533
|
-
|
|
5533
|
+
edge2.x -= edge2.width / 2 + edge2.labeloffset;
|
|
5534
5534
|
break;
|
|
5535
5535
|
case "r":
|
|
5536
|
-
|
|
5536
|
+
edge2.x += edge2.width / 2 + edge2.labeloffset;
|
|
5537
5537
|
break;
|
|
5538
5538
|
}
|
|
5539
5539
|
});
|
|
5540
5540
|
}
|
|
5541
5541
|
function reversePointsForReversedEdges(g2) {
|
|
5542
5542
|
_2.forEach(g2.edges(), function(e2) {
|
|
5543
|
-
var
|
|
5544
|
-
|
|
5543
|
+
var edge2 = g2.edge(e2);
|
|
5544
|
+
edge2.reversed && edge2.points.reverse();
|
|
5545
5545
|
});
|
|
5546
5546
|
}
|
|
5547
5547
|
function removeBorderNodes(g2) {
|
|
@@ -5694,8 +5694,8 @@ class GraphData {
|
|
|
5694
5694
|
(!merge || !this._g.hasNode(entity._id)) && (this._g.setNode(entity._id, entity), retVal.addedVertices.push(entity));
|
|
5695
5695
|
}
|
|
5696
5696
|
for (let i2 = 0; i2 < edges.length; ++i2) {
|
|
5697
|
-
const
|
|
5698
|
-
(!merge || !this._g.hasEdge(
|
|
5697
|
+
const edge2 = edges[i2];
|
|
5698
|
+
(!merge || !this._g.hasEdge(edge2._id)) && (edge2._sourceVertex && edge2._targetVertex ? (this._g.setEdge(edge2._sourceVertex._id, edge2._targetVertex._id, edge2, edge2._id), retVal.addedEdges.push(edge2)) : console.warn("Bad edge definition"));
|
|
5699
5699
|
}
|
|
5700
5700
|
if (hierarchy2)
|
|
5701
5701
|
for (let i2 = 0; i2 < hierarchy2.length; ++i2)
|
|
@@ -6354,8 +6354,8 @@ class Hierarchy {
|
|
|
6354
6354
|
nodePos(u2) {
|
|
6355
6355
|
return this.digraph.node(u2);
|
|
6356
6356
|
}
|
|
6357
|
-
edgePoints(
|
|
6358
|
-
return this.digraph.edge(
|
|
6357
|
+
edgePoints(edge2) {
|
|
6358
|
+
return this.digraph.edge(edge2._sourceVertex.id(), edge2._targetVertex.id(), edge2._id).points;
|
|
6359
6359
|
}
|
|
6360
6360
|
}
|
|
6361
6361
|
const TITLE_SIZE = 14, MINMAX_SIZE = 18;
|
|
@@ -6675,8 +6675,8 @@ const _Graph = class _Graph extends SVGZoomWidget {
|
|
|
6675
6675
|
for (; nextSibling; )
|
|
6676
6676
|
target.parentNode.insertBefore(nextSibling, target), nextSibling = target.nextSibling;
|
|
6677
6677
|
Platform.svgMarkerGlitch && this._graphData.nodeEdges(d2.id()).forEach((glEdge) => {
|
|
6678
|
-
const
|
|
6679
|
-
this._pushMarkers(
|
|
6678
|
+
const edge2 = this._graphData.edge(glEdge);
|
|
6679
|
+
this._pushMarkers(edge2.element());
|
|
6680
6680
|
});
|
|
6681
6681
|
}
|
|
6682
6682
|
}
|
|
@@ -6711,8 +6711,8 @@ const _Graph = class _Graph extends SVGZoomWidget {
|
|
|
6711
6711
|
});
|
|
6712
6712
|
}
|
|
6713
6713
|
this._neighborOffsets = [], Platform.svgMarkerGlitch && this._graphData.nodeEdges(d2.id()).forEach(function(id) {
|
|
6714
|
-
const
|
|
6715
|
-
this._popMarkers(
|
|
6714
|
+
const edge2 = this._graphData.edge(id);
|
|
6715
|
+
this._popMarkers(edge2.element());
|
|
6716
6716
|
});
|
|
6717
6717
|
}
|
|
6718
6718
|
}
|
|
@@ -6930,8 +6930,8 @@ const _Graph = class _Graph extends SVGZoomWidget {
|
|
|
6930
6930
|
if (vertex2) {
|
|
6931
6931
|
const nedges = this._graphData.nodeEdges(vertex2.id());
|
|
6932
6932
|
for (let i2 = 0; i2 < nedges.length; ++i2) {
|
|
6933
|
-
const
|
|
6934
|
-
edges[
|
|
6933
|
+
const edge2 = this._graphData.edge(nedges[i2]);
|
|
6934
|
+
edges[edge2.id()] = edge2, edge2._sourceVertex.id() !== vertex2.id() && (vertices[edge2._sourceVertex.id()] = edge2._sourceVertex), edge2._targetVertex.id() !== vertex2.id() && (vertices[edge2._targetVertex.id()] = edge2._targetVertex);
|
|
6935
6935
|
}
|
|
6936
6936
|
}
|
|
6937
6937
|
return {
|
|
@@ -7886,35 +7886,6 @@ function interpolatePath(a2, b2, interpolateOptions) {
|
|
|
7886
7886
|
return interpolatedString;
|
|
7887
7887
|
};
|
|
7888
7888
|
}
|
|
7889
|
-
function rectEdges(rect) {
|
|
7890
|
-
return [
|
|
7891
|
-
{ start: rect.topLeft, end: rect.topRight },
|
|
7892
|
-
{ start: rect.topRight, end: rect.bottomRight },
|
|
7893
|
-
{ start: rect.bottomRight, end: rect.bottomLeft },
|
|
7894
|
-
{ start: rect.bottomLeft, end: rect.topLeft }
|
|
7895
|
-
];
|
|
7896
|
-
}
|
|
7897
|
-
function lineIntersection(segment1, segment2) {
|
|
7898
|
-
const { x: x1, y: y1 } = segment1.start, { x: x2, y: y2 } = segment1.end, { x: x3, y: y3 } = segment2.start, { x: x4, y: y4 } = segment2.end, denom = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
|
|
7899
|
-
if (denom === 0) return null;
|
|
7900
|
-
const t2 = ((x1 - x3) * (y3 - y4) - (y1 - y3) * (x3 - x4)) / denom, u2 = -((x1 - x2) * (y1 - y3) - (y1 - y2) * (x1 - x3)) / denom;
|
|
7901
|
-
return t2 > 0 && t2 < 1 && u2 > 0 && u2 < 1 ? {
|
|
7902
|
-
x: x1 + t2 * (x2 - x1),
|
|
7903
|
-
y: y1 + t2 * (y2 - y1)
|
|
7904
|
-
} : null;
|
|
7905
|
-
}
|
|
7906
|
-
function intersection(rect, line) {
|
|
7907
|
-
for (const edge of rectEdges({
|
|
7908
|
-
topLeft: { x: rect.x - rect.w / 2, y: rect.y - rect.h / 2 },
|
|
7909
|
-
topRight: { x: rect.x + rect.w / 2, y: rect.y - rect.h / 2 },
|
|
7910
|
-
bottomRight: { x: rect.x + rect.w / 2, y: rect.y + rect.h / 2 },
|
|
7911
|
-
bottomLeft: { x: rect.x - rect.w / 2, y: rect.y + rect.h / 2 }
|
|
7912
|
-
})) {
|
|
7913
|
-
const intersectionPoint = lineIntersection(edge, line);
|
|
7914
|
-
if (intersectionPoint) return intersectionPoint;
|
|
7915
|
-
}
|
|
7916
|
-
return null;
|
|
7917
|
-
}
|
|
7918
7889
|
const lineBasis$2 = d3Line().x((d2) => d2[0]).y((d2) => d2[1]).curve(d3CurveBasis), lineCardinal = d3Line().x((d2) => d2[0]).y((d2) => d2[1]).curve(d3CurveCardinal);
|
|
7919
7890
|
class Layout {
|
|
7920
7891
|
constructor(graph2) {
|
|
@@ -7946,8 +7917,8 @@ class Layout {
|
|
|
7946
7917
|
};
|
|
7947
7918
|
}
|
|
7948
7919
|
edgeLine(ep) {
|
|
7949
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
7950
|
-
const sPos = { ...this._graph.projectPlacholder(ep.source), w: ((_c = (_b2 = (_a2 = ep.source) == null ? void 0 : _a2.renderResult) == null ? void 0 : _b2.extent) == null ? void 0 : _c.width) ?? 0, h: ((_f = (_e = (_d = ep.source) == null ? void 0 : _d.renderResult) == null ? void 0 : _e.extent) == null ? void 0 : _f.height) ?? 0 }, tPos = { ...this._graph.projectPlacholder(ep.target), w: ((_i = (_h = (_g = ep.target) == null ? void 0 : _g.renderResult) == null ? void 0 : _h.extent) == null ? void 0 : _i.width) ?? 0, h: ((_l = (_k = (_j = ep.target) == null ? void 0 : _j.renderResult) == null ? void 0 : _k.extent) == null ? void 0 : _l.height) ?? 0 }, sIntersect = intersection(sPos, { start: sPos, end: tPos }), tIntersect = intersection(tPos, { start: sPos, end: tPos });
|
|
7920
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
7921
|
+
const sPos = { ...this._graph.projectPlacholder(ep.source), w: ((_c = (_b2 = (_a2 = ep.source) == null ? void 0 : _a2.renderResult) == null ? void 0 : _b2.extent) == null ? void 0 : _c.width) ?? 0, h: ((_f = (_e = (_d = ep.source) == null ? void 0 : _d.renderResult) == null ? void 0 : _e.extent) == null ? void 0 : _f.height) ?? 0 }, tPos = { ...this._graph.projectPlacholder(ep.target), w: ((_i = (_h = (_g = ep.target) == null ? void 0 : _g.renderResult) == null ? void 0 : _h.extent) == null ? void 0 : _i.width) ?? 0, h: ((_l = (_k = (_j = ep.target) == null ? void 0 : _j.renderResult) == null ? void 0 : _k.extent) == null ? void 0 : _l.height) ?? 0 }, sIntersect = (_m = ep.source.renderResult) != null && _m.intersection ? ep.source.renderResult.intersection(sPos, { start: sPos, end: tPos }) : null, tIntersect = (_n = ep.target.renderResult) != null && _n.intersection ? ep.target.renderResult.intersection(tPos, { start: sPos, end: tPos }) : null;
|
|
7951
7922
|
return {
|
|
7952
7923
|
source: {
|
|
7953
7924
|
x: sIntersect ? sIntersect.x : sPos.x,
|
|
@@ -8904,8 +8875,8 @@ class GraphT extends SVGZoomWidget {
|
|
|
8904
8875
|
if (vertex2) {
|
|
8905
8876
|
const nedges = this._graphData.vertexEdges(vertex2.id);
|
|
8906
8877
|
for (let i2 = 0; i2 < nedges.length; ++i2) {
|
|
8907
|
-
const
|
|
8908
|
-
edges[
|
|
8878
|
+
const edge2 = this._graphData.edge(nedges[i2].id);
|
|
8879
|
+
edges[edge2.id] = edge2, edge2.source.id !== vertex2.id && (vertices[edge2.source.id] = edge2.source), edge2.target.id !== vertex2.id && (vertices[edge2.target.id] = edge2.target);
|
|
8909
8880
|
}
|
|
8910
8881
|
}
|
|
8911
8882
|
return {
|
|
@@ -8991,9 +8962,7 @@ class GraphT extends SVGZoomWidget {
|
|
|
8991
8962
|
}
|
|
8992
8963
|
moveEdgePlaceholder(ep, transition) {
|
|
8993
8964
|
const edgeLayout = {
|
|
8994
|
-
...this._layoutAlgo.edgePath(ep, this.edgeArcDepth())
|
|
8995
|
-
markerStart: `url(#${this.id()}_circleFoot)`,
|
|
8996
|
-
markerEnd: `url(#${this.id()}_arrowHead)`
|
|
8965
|
+
...this._layoutAlgo.edgePath(ep, this.edgeArcDepth())
|
|
8997
8966
|
}, context = this;
|
|
8998
8967
|
if (this._edgeRenderer && ep.element) {
|
|
8999
8968
|
const previousEdgeLayout = ep.previousEdgeLayout ?? edgeLayout;
|
|
@@ -9166,13 +9135,10 @@ class GraphT extends SVGZoomWidget {
|
|
|
9166
9135
|
context.moveSubgraphPlaceholder(d2, !1);
|
|
9167
9136
|
}), this;
|
|
9168
9137
|
}
|
|
9169
|
-
addMarkers(clearFirst = !1) {
|
|
9170
|
-
clearFirst && (this._svgDefs.select("#" + this._id + "_arrowHead").remove(), this._svgDefs.select("#" + this._id + "_circleFoot").remove(), this._svgDefs.select("#" + this._id + "_circleHead").remove()), this._svgDefs.append("marker").attr("class", "marker").attr("id", this._id + "_arrowHead").attr("viewBox", "0 0 10 10").attr("refX", 10).attr("refY", 5).attr("markerWidth", 8).attr("markerHeight", 8).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("polyline").attr("points", "0,0 10,5 0,10 1,5"), this._svgDefs.append("marker").attr("class", "marker").attr("id", this._id + "_circleFoot").attr("viewBox", "0 0 10 10").attr("refX", 1).attr("refY", 5).attr("markerWidth", 7).attr("markerHeight", 7).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("circle").attr("cx", 5).attr("cy", 5).attr("r", 4), this._svgDefs.append("marker").attr("class", "marker").attr("id", this._id + "_circleHead").attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerWidth", 7).attr("markerHeight", 7).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("circle").attr("cx", 5).attr("cy", 5).attr("r", 4);
|
|
9171
|
-
}
|
|
9172
9138
|
enter(domNode, element) {
|
|
9173
9139
|
super.enter(domNode, element);
|
|
9174
9140
|
const svg = this.locateSVGNode(domNode);
|
|
9175
|
-
this._svgDefs = select(svg).select("defs"), this._centroidFilter = new SVGGlowFilter(this._svgDefs, this._id + "_glow"), this._svgDefsCat = this._svgDefs.append("g"), this._svgDefsAnn = this._svgDefs.append("g"), this.
|
|
9141
|
+
this._svgDefs = select(svg).select("defs"), this._centroidFilter = new SVGGlowFilter(this._svgDefs, this._id + "_glow"), this._svgDefsCat = this._svgDefs.append("g"), this._svgDefsAnn = this._svgDefs.append("g"), this._subgraphG = this._renderElement.append("g"), this._edgeG = this._renderElement.append("g"), this._vertexG = this._renderElement.append("g"), this._tooltip.target(domNode), this.on("startMarqueeSelection", () => {
|
|
9176
9142
|
}).on("updateMarqueeSelection", (rect) => {
|
|
9177
9143
|
const vertices = this._graphData.allVertices().filter((v2) => v2.x >= rect.x && v2.x <= rect.x + rect.width && v2.y >= rect.y && v2.y <= rect.y + rect.height);
|
|
9178
9144
|
this.selection(vertices.map((v2) => v2.props));
|
|
@@ -10080,11 +10046,60 @@ const B = (t2, i2, s2) => {
|
|
|
10080
10046
|
let h2 = e2._$litPart$;
|
|
10081
10047
|
return h2 === void 0 && (e2._$litPart$ = h2 = new R(i2.insertBefore(l(), null), null, void 0, {})), h2._$AI(t2), h2;
|
|
10082
10048
|
};
|
|
10083
|
-
function extend(result, width, height) {
|
|
10049
|
+
function extend(result, width, height, intersection = (pos, line) => null) {
|
|
10084
10050
|
return {
|
|
10085
10051
|
...result,
|
|
10086
|
-
extent: { width, height }
|
|
10052
|
+
extent: { width, height },
|
|
10053
|
+
intersection
|
|
10054
|
+
};
|
|
10055
|
+
}
|
|
10056
|
+
function segmentSegment(s1, s2) {
|
|
10057
|
+
const { x: x1, y: y1 } = s1.start, { x: x2, y: y2 } = s1.end, { x: x3, y: y3 } = s2.start, { x: x4, y: y4 } = s2.end, denom = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
|
|
10058
|
+
if (denom === 0)
|
|
10059
|
+
return;
|
|
10060
|
+
const t2 = ((x1 - x3) * (y3 - y4) - (y1 - y3) * (x3 - x4)) / denom, u2 = -((x1 - x2) * (y1 - y3) - (y1 - y2) * (x1 - x3)) / denom;
|
|
10061
|
+
if (t2 > 0 && t2 < 1 && u2 > 0 && u2 < 1)
|
|
10062
|
+
return {
|
|
10063
|
+
x: x1 + t2 * (x2 - x1),
|
|
10064
|
+
y: y1 + t2 * (y2 - y1)
|
|
10065
|
+
};
|
|
10066
|
+
}
|
|
10067
|
+
function rectEdges(rect) {
|
|
10068
|
+
const r2 = {
|
|
10069
|
+
topLeft: { x: rect.x - rect.width / 2, y: rect.y - rect.height / 2 },
|
|
10070
|
+
topRight: { x: rect.x + rect.width / 2, y: rect.y - rect.height / 2 },
|
|
10071
|
+
bottomRight: { x: rect.x + rect.width / 2, y: rect.y + rect.height / 2 },
|
|
10072
|
+
bottomLeft: { x: rect.x - rect.width / 2, y: rect.y + rect.height / 2 }
|
|
10087
10073
|
};
|
|
10074
|
+
return [
|
|
10075
|
+
{ start: r2.bottomLeft, end: r2.topLeft },
|
|
10076
|
+
{ start: r2.topLeft, end: r2.topRight },
|
|
10077
|
+
{ start: r2.topRight, end: r2.bottomRight },
|
|
10078
|
+
{ start: r2.bottomRight, end: r2.bottomLeft }
|
|
10079
|
+
];
|
|
10080
|
+
}
|
|
10081
|
+
function rectangleSegment(rect, line) {
|
|
10082
|
+
for (const edge2 of rectEdges(rect)) {
|
|
10083
|
+
const intersectionPoint = segmentSegment(edge2, line);
|
|
10084
|
+
if (intersectionPoint)
|
|
10085
|
+
return intersectionPoint;
|
|
10086
|
+
}
|
|
10087
|
+
}
|
|
10088
|
+
function sortSegment(pos, line) {
|
|
10089
|
+
const distStart = Math.hypot(line.start.x - pos.x, line.start.y - pos.y), distEnd = Math.hypot(line.end.x - pos.x, line.end.y - pos.y);
|
|
10090
|
+
return distStart <= distEnd ? line : { start: line.end, end: line.start };
|
|
10091
|
+
}
|
|
10092
|
+
function circleSegment(pos, r2, line) {
|
|
10093
|
+
line = sortSegment(pos, line);
|
|
10094
|
+
const { x: x1, y: y1 } = line.start, { x: x2, y: y2 } = line.end, dx = x2 - x1, dy = y2 - y1, a2 = dx * dx + dy * dy, b2 = 2 * (dx * (x1 - pos.x) + dy * (y1 - pos.y)), c2 = (x1 - pos.x) * (x1 - pos.x) + (y1 - pos.y) * (y1 - pos.y) - r2 * r2, discriminant = b2 * b2 - 4 * a2 * c2;
|
|
10095
|
+
if (discriminant < 0)
|
|
10096
|
+
return;
|
|
10097
|
+
const t1 = (-b2 + Math.sqrt(discriminant)) / (2 * a2);
|
|
10098
|
+
if (t1 >= 0 && t1 <= 1)
|
|
10099
|
+
return {
|
|
10100
|
+
x: x1 + t1 * dx,
|
|
10101
|
+
y: y1 + t1 * dy
|
|
10102
|
+
};
|
|
10088
10103
|
}
|
|
10089
10104
|
const DEFAULT_SHAPE_SIZE = 32, circle = ({
|
|
10090
10105
|
diameter = DEFAULT_SHAPE_SIZE,
|
|
@@ -10099,7 +10114,7 @@ const DEFAULT_SHAPE_SIZE = 32, circle = ({
|
|
|
10099
10114
|
stroke=${stroke}
|
|
10100
10115
|
stroke-width=${strokeWidth}
|
|
10101
10116
|
shape-rendering=${shapeRendering}
|
|
10102
|
-
/>`, diameter, diameter), rectangle = ({
|
|
10117
|
+
/>`, diameter, diameter, (pos, line) => circleSegment(pos, diameter / 2, line)), rectangle = ({
|
|
10103
10118
|
width = DEFAULT_SHAPE_SIZE,
|
|
10104
10119
|
height = DEFAULT_SHAPE_SIZE,
|
|
10105
10120
|
cornerRadius = 4,
|
|
@@ -10119,7 +10134,7 @@ const DEFAULT_SHAPE_SIZE = 32, circle = ({
|
|
|
10119
10134
|
stroke=${stroke}
|
|
10120
10135
|
stroke-width=${strokeWidth}
|
|
10121
10136
|
shape-rendering=${shapeRendering}
|
|
10122
|
-
/>`, width, height), square = ({
|
|
10137
|
+
/>`, width, height, (pos, line) => rectangleSegment({ x: pos.x, y: pos.y, width, height }, line)), square = ({
|
|
10123
10138
|
width = DEFAULT_SHAPE_SIZE,
|
|
10124
10139
|
cornerRadius,
|
|
10125
10140
|
fill,
|
|
@@ -10223,9 +10238,14 @@ const DEFAULT_SHAPE_SIZE = 32, circle = ({
|
|
|
10223
10238
|
strokeWidth,
|
|
10224
10239
|
cornerRadius
|
|
10225
10240
|
});
|
|
10226
|
-
return extend(
|
|
10241
|
+
return extend(
|
|
10242
|
+
b`\
|
|
10227
10243
|
${rectTpl}
|
|
10228
|
-
${textTpl}`,
|
|
10244
|
+
${textTpl}`,
|
|
10245
|
+
rectTpl.extent.width,
|
|
10246
|
+
rectTpl.extent.height,
|
|
10247
|
+
rectTpl.intersection
|
|
10248
|
+
);
|
|
10229
10249
|
}, annotation = ({
|
|
10230
10250
|
text,
|
|
10231
10251
|
fontFamily = "FontAwesome",
|
|
@@ -10331,7 +10351,7 @@ function icon({
|
|
|
10331
10351
|
<g>
|
|
10332
10352
|
${shapeTpl}
|
|
10333
10353
|
${imageTpl}
|
|
10334
|
-
</g>`, shapeTpl.extent.width, shapeTpl.extent.height);
|
|
10354
|
+
</g>`, shapeTpl.extent.width, shapeTpl.extent.height, shapeTpl.intersection);
|
|
10335
10355
|
}
|
|
10336
10356
|
function adapter(component) {
|
|
10337
10357
|
return (props, element) => {
|
|
@@ -10348,18 +10368,23 @@ const defaultSubgraphRenderer = ({
|
|
|
10348
10368
|
${TextBox({ text: { text } })}
|
|
10349
10369
|
`, defaultEdgeRenderer = ({
|
|
10350
10370
|
strokeWidth,
|
|
10351
|
-
path: path2
|
|
10352
|
-
|
|
10353
|
-
markerEnd
|
|
10354
|
-
}) => b`<path d="${path2}" marker-start="${markerStart}" marker-end="${markerEnd}" style="stroke-width:${strokeWidth}px"></path>`;
|
|
10371
|
+
path: path2
|
|
10372
|
+
}) => b`<path d="${path2}" style="stroke-width:${strokeWidth}px"></path>`;
|
|
10355
10373
|
class GraphHtmlT extends GraphT {
|
|
10356
10374
|
constructor(subgraphRenderer = defaultSubgraphRenderer, vertexRenderer = defaultVertexRenderer, edgeRenderer = defaultEdgeRenderer) {
|
|
10357
10375
|
super(adapter(subgraphRenderer), adapter(vertexRenderer), adapter(edgeRenderer));
|
|
10358
10376
|
}
|
|
10377
|
+
enterMarkers(clearFirst = !1) {
|
|
10378
|
+
clearFirst && (this._svgDefs.select("#" + this._id + "_sourceDot").remove(), this._svgDefs.select("#" + this._id + "_targetDot").remove(), this._svgDefs.select("#" + this._id + "_targetArrow").remove()), this._svgDefs.append("marker").attr("class", "marker").attr("id", this._id + "_sourceDot").attr("refX", 1).attr("refY", 3).attr("markerWidth", 6).attr("markerHeight", 6).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("circle").attr("cx", 3).attr("cy", 3).attr("r", 1.5).attr("fill", "context-stroke").attr("stroke", "context-stroke"), this._svgDefs.append("marker").attr("class", "marker").attr("id", this._id + "_targetDot").attr("refX", 5).attr("refY", 3).attr("markerWidth", 6).attr("markerHeight", 6).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("circle").attr("cx", 3).attr("cy", 3).attr("r", 1.5).attr("fill", "context-stroke").attr("stroke", "context-stroke"), this._svgDefs.append("marker").attr("class", "marker").attr("id", this._id + "_targetArrow").attr("viewBox", "0 0 10 10").attr("refX", 10).attr("refY", 5).attr("markerWidth", 5).attr("markerHeight", 5).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("polyline").attr("points", "0,0 10,5 0,10 0,5").attr("fill", "context-stroke").attr("stroke", "context-stroke");
|
|
10379
|
+
}
|
|
10380
|
+
enter(domNode, element) {
|
|
10381
|
+
super.enter(domNode, element), this.enterMarkers();
|
|
10382
|
+
}
|
|
10359
10383
|
}
|
|
10360
10384
|
GraphHtmlT.prototype._class += " graph_GraphHtmlT";
|
|
10385
|
+
GraphHtmlT.prototype.publish("sourceMarker", "Dot", "set", "Target Marker", ["Dot", "None"]);
|
|
10386
|
+
GraphHtmlT.prototype.publish("targetMarker", "Arrow", "set", "Target Marker", ["Arrow", "Dot", "None"]);
|
|
10361
10387
|
const vertex = ({
|
|
10362
|
-
id,
|
|
10363
10388
|
text,
|
|
10364
10389
|
textBox,
|
|
10365
10390
|
textBoxAnnotationsE = [],
|
|
@@ -10391,11 +10416,15 @@ ${textBoxTpl}
|
|
|
10391
10416
|
<g transform="translate(${iconAnnotationsTpl.extent.width / 2 + xIconAnnotationOffset} ${yIconOffset - yIconAnnotationOffset})">
|
|
10392
10417
|
${iconAnnotationsTpl}
|
|
10393
10418
|
</g>
|
|
10394
|
-
`, textBoxTpl.extent.width, textBoxTpl.extent.height);
|
|
10395
|
-
}
|
|
10419
|
+
`, textBoxTpl.extent.width, textBoxTpl.extent.height, (pos, line) => iconTpl.intersection({ x: pos.x, y: yIconOffset + pos.y }, line) ?? textBoxTpl.intersection({ x: pos.x, y: pos.y }, line));
|
|
10420
|
+
}, edge = ({
|
|
10421
|
+
graphInstance,
|
|
10422
|
+
strokeWidth,
|
|
10423
|
+
path: path2
|
|
10424
|
+
}) => b`<path d="${path2}" marker-start="url(#${graphInstance.id()}_source${graphInstance.sourceMarker()})" marker-end="url(#${graphInstance.id()}_target${graphInstance.targetMarker()})" style="stroke-width:${strokeWidth}px"></path>`;
|
|
10396
10425
|
class GraphHtml extends GraphHtmlT {
|
|
10397
10426
|
constructor() {
|
|
10398
|
-
super(void 0, vertex);
|
|
10427
|
+
super(void 0, vertex, edge);
|
|
10399
10428
|
}
|
|
10400
10429
|
}
|
|
10401
10430
|
GraphHtml.prototype._class += " graph_GraphHtml";
|