@jbrowse/bandage-core 11.11.1 → 11.13.0
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/alleleProjection/projectAlleles.js +2 -2
- package/dist/bubbles/bubblesFromGraph.js +3 -3
- package/dist/bubbles/superbubbles.js +4 -4
- package/dist/chunks/{chunk-JVT3XTKN.js → chunk-2AVTTUP2.js} +1 -1
- package/dist/chunks/{chunk-XR2HMGAS.js → chunk-3JDGPLCL.js} +1 -1
- package/dist/chunks/{chunk-CKUVEHSS.js → chunk-4FRX2SPT.js} +1 -1
- package/dist/chunks/{chunk-PYK4JKYW.js → chunk-5SW3PTHO.js} +1 -1
- package/dist/chunks/{chunk-4CK2SN7U.js → chunk-7AZ57C5C.js} +15 -10
- package/dist/chunks/{chunk-27QSY2OI.js → chunk-ANWUCJZB.js} +2 -2
- package/dist/chunks/{chunk-LF7V3QSH.js → chunk-C5FEIJFK.js} +9 -9
- package/dist/chunks/{chunk-GJLZ2MKE.js → chunk-CNWAVRLF.js} +1 -1
- package/dist/chunks/{chunk-J7RNXBXA.js → chunk-DOCI5O5R.js} +1 -1
- package/dist/chunks/{chunk-2A6Z2DHF.js → chunk-EIMRD6L7.js} +1 -1
- package/dist/chunks/{chunk-EB4Q35QD.js → chunk-EOB4Y3EM.js} +1 -1
- package/dist/chunks/{chunk-U2UPDVH4.js → chunk-HL4U73TC.js} +4 -4
- package/dist/chunks/{chunk-GXCMBPC6.js → chunk-JUYPCLF4.js} +103 -37
- package/dist/chunks/{chunk-LNLYK3Y5.js → chunk-K4RGSISK.js} +1 -1
- package/dist/chunks/{chunk-VX656OAZ.js → chunk-L4DBSRA2.js} +20 -1
- package/dist/chunks/{chunk-MYLAJDKB.js → chunk-LLTISBAA.js} +2 -2
- package/dist/chunks/{chunk-OWNGPF73.js → chunk-OCYQIHFA.js} +1 -1
- package/dist/chunks/{chunk-3DHGSHC3.js → chunk-OKPSS5PG.js} +1 -1
- package/dist/chunks/{chunk-SVP2CQTA.js → chunk-OYBYCF2O.js} +1 -1
- package/dist/chunks/{chunk-UAFATXYA.js → chunk-Q7OFBTBW.js} +1 -1
- package/dist/chunks/{chunk-KYTV5EAZ.js → chunk-QL673EK5.js} +1 -1
- package/dist/chunks/{chunk-WE7CLY2E.js → chunk-TEFNVUGD.js} +3 -3
- package/dist/chunks/{chunk-RFG42VIO.js → chunk-V6WSDZPL.js} +1 -1
- package/dist/chunks/{chunk-3GLG3ZLE.js → chunk-VYFNEF53.js} +1 -1
- package/dist/chunks/chunk-YUIKEUKY.js +919 -0
- package/dist/chunks/{chunk-I5HVXRAO.js → chunk-ZHCQOC67.js} +1 -1
- package/dist/cli/figure.js +21 -21
- package/dist/cli/fold.js +3 -3
- package/dist/figure.js +14 -14
- package/dist/figureData.js +18 -18
- package/dist/figureScene.js +9 -9
- package/dist/figureSettings.js +4 -4
- package/dist/index.js +26 -26
- package/dist/layout/anchoredLayout.js +4 -4
- package/dist/layout/forceCache.js +4 -4
- package/dist/layout/orderedLayout.js +2 -2
- package/dist/layout/placeOffReference.js +3 -3
- package/dist/layout/referenceSeeds.js +2 -2
- package/dist/layout/sampleRowLayout.js +4 -4
- package/dist/layout/walkRowDraw.js +4 -4
- package/dist/layout/walkStrip.js +5 -5
- package/dist/layoutModes.js +7 -7
- package/dist/pipeline.js +3 -3
- package/dist/referenceSpan.js +5 -3
- package/dist/referenceStrip.js +4 -4
- package/dist/renderer/GeometryBuilder.js +3 -3
- package/dist/renderer/walkLanes.js +3 -1
- package/dist/tubeMap/nodeColors.js +4 -4
- package/dist/types/figureData.d.ts +2 -0
- package/dist/types/referenceSpan.d.ts +1 -0
- package/dist/types/renderer/types.d.ts +1 -0
- package/dist/types/renderer/walkLanes.d.ts +32 -18
- package/dist/types/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/viewport.js +4 -4
- package/dist/walkEncoding.js +4 -4
- package/dist/walkHighlight.js +5 -5
- package/package.json +1 -1
- package/dist/chunks/chunk-4KBZ7WPP.js +0 -579
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
projectAlleles
|
|
3
|
-
} from "../chunks/chunk-
|
|
4
|
-
import "../chunks/chunk-
|
|
3
|
+
} from "../chunks/chunk-VYFNEF53.js";
|
|
4
|
+
import "../chunks/chunk-L4DBSRA2.js";
|
|
5
5
|
import "../chunks/chunk-BSOZW3FC.js";
|
|
6
6
|
import "../chunks/chunk-RJWPJCIB.js";
|
|
7
7
|
import "../chunks/chunk-HOAIOEI7.js";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
relax,
|
|
5
5
|
walkIndexOf,
|
|
6
6
|
walkRoutes
|
|
7
|
-
} from "../chunks/chunk-
|
|
7
|
+
} from "../chunks/chunk-V6WSDZPL.js";
|
|
8
8
|
import "../chunks/chunk-FX4RDMDN.js";
|
|
9
|
-
import "../chunks/chunk-
|
|
10
|
-
import "../chunks/chunk-
|
|
9
|
+
import "../chunks/chunk-Q7OFBTBW.js";
|
|
10
|
+
import "../chunks/chunk-L4DBSRA2.js";
|
|
11
11
|
import "../chunks/chunk-CPMHA4W5.js";
|
|
12
12
|
import "../chunks/chunk-BSOZW3FC.js";
|
|
13
13
|
import "../chunks/chunk-RJWPJCIB.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
graphBubbles,
|
|
3
3
|
superbubblesFromGraph
|
|
4
|
-
} from "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-DOCI5O5R.js";
|
|
5
5
|
import "../chunks/chunk-SZYFZNCO.js";
|
|
6
|
-
import "../chunks/chunk-
|
|
6
|
+
import "../chunks/chunk-V6WSDZPL.js";
|
|
7
7
|
import "../chunks/chunk-NWEVR2OQ.js";
|
|
8
8
|
import "../chunks/chunk-FX4RDMDN.js";
|
|
9
9
|
import "../chunks/chunk-MHZTTLBU.js";
|
|
10
|
-
import "../chunks/chunk-
|
|
11
|
-
import "../chunks/chunk-
|
|
10
|
+
import "../chunks/chunk-Q7OFBTBW.js";
|
|
11
|
+
import "../chunks/chunk-L4DBSRA2.js";
|
|
12
12
|
import "../chunks/chunk-AURNOR27.js";
|
|
13
13
|
import "../chunks/chunk-HMXCN6PG.js";
|
|
14
14
|
import "../chunks/chunk-AB35TJST.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-CO6RGQAD.js";
|
|
4
4
|
import {
|
|
5
5
|
layoutModeByValue
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TEFNVUGD.js";
|
|
7
7
|
import {
|
|
8
8
|
parseRegion
|
|
9
9
|
} from "./chunk-FNDNSDKW.js";
|
|
@@ -12,21 +12,21 @@ import {
|
|
|
12
12
|
} from "./chunk-HEYIAMTC.js";
|
|
13
13
|
import {
|
|
14
14
|
version
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-OCYQIHFA.js";
|
|
16
16
|
import {
|
|
17
17
|
axisScaleOf
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-OKPSS5PG.js";
|
|
19
19
|
import {
|
|
20
20
|
figureScene
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-HL4U73TC.js";
|
|
22
22
|
import {
|
|
23
23
|
encodingStops
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-EOB4Y3EM.js";
|
|
25
25
|
import {
|
|
26
26
|
laneSlideAt,
|
|
27
27
|
passesKey,
|
|
28
28
|
threadsPasses
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-YUIKEUKY.js";
|
|
30
30
|
import {
|
|
31
31
|
abgrAlpha,
|
|
32
32
|
abgrBlue,
|
|
@@ -35,13 +35,16 @@ import {
|
|
|
35
35
|
} from "./chunk-G2FD7S3C.js";
|
|
36
36
|
import {
|
|
37
37
|
FIGURE_DEFAULTS
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-5SW3PTHO.js";
|
|
39
39
|
import {
|
|
40
40
|
engineSettingsOf,
|
|
41
41
|
fitTransform,
|
|
42
42
|
forceLayout,
|
|
43
43
|
loadGraph
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-2AVTTUP2.js";
|
|
45
|
+
import {
|
|
46
|
+
referencePositions
|
|
47
|
+
} from "./chunk-L4DBSRA2.js";
|
|
45
48
|
import {
|
|
46
49
|
referenceVisitStarts
|
|
47
50
|
} from "./chunk-3YBP46PB.js";
|
|
@@ -244,7 +247,7 @@ function figureData(graph, layout, o = {}) {
|
|
|
244
247
|
pass: s.pass ?? null,
|
|
245
248
|
nx: s.normals?.[k]?.nx ?? 0,
|
|
246
249
|
ny: s.normals?.[k]?.ny ?? 0,
|
|
247
|
-
offset: (s.offsetX ?? 0) * axis.scaleX
|
|
250
|
+
offset: (s.offsets?.[k] ?? s.offsetX ?? 0) * axis.scaleX
|
|
248
251
|
});
|
|
249
252
|
});
|
|
250
253
|
}
|
|
@@ -298,6 +301,7 @@ function figureData(graph, layout, o = {}) {
|
|
|
298
301
|
}
|
|
299
302
|
}
|
|
300
303
|
const startsOf = referenceVisitStarts(graph);
|
|
304
|
+
const positions = referencePositions(graph);
|
|
301
305
|
return {
|
|
302
306
|
meta: {
|
|
303
307
|
generator: `@jbrowse/bandage-core@${version}`,
|
|
@@ -336,7 +340,8 @@ function figureData(graph, layout, o = {}) {
|
|
|
336
340
|
backbone: graph.nodes.map((n) => isBackbone(n)),
|
|
337
341
|
referenceVisits: graph.nodes.map(
|
|
338
342
|
(n) => isBackbone(n) ? startsOf(n).length : 0
|
|
339
|
-
)
|
|
343
|
+
),
|
|
344
|
+
position: graph.nodes.map((n) => positions.get(n.id) ?? null)
|
|
340
345
|
},
|
|
341
346
|
rowLabels: {
|
|
342
347
|
label: (layout.rowLabels ?? []).map((r) => r.label),
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
encodedColor,
|
|
3
3
|
resolveEncoding,
|
|
4
4
|
splitFamilies
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EOB4Y3EM.js";
|
|
6
6
|
import {
|
|
7
7
|
rampFraction
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JUYPCLF4.js";
|
|
9
9
|
import {
|
|
10
10
|
gapParts
|
|
11
11
|
} from "./chunk-LG2UK4MB.js";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
stripGeneGaps,
|
|
6
6
|
walkStripFrame,
|
|
7
7
|
walkStripLabelsTree
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QL673EK5.js";
|
|
9
9
|
import {
|
|
10
10
|
Canvas2DRenderer
|
|
11
11
|
} from "./chunk-4DMSPNYV.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
walkRowsKey,
|
|
14
14
|
walkRowsKeyTree,
|
|
15
15
|
walkRowsTree
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OYBYCF2O.js";
|
|
17
17
|
import {
|
|
18
18
|
EXON_COLOR,
|
|
19
19
|
exonOutlineTree,
|
|
@@ -30,21 +30,21 @@ import {
|
|
|
30
30
|
} from "./chunk-HEYIAMTC.js";
|
|
31
31
|
import {
|
|
32
32
|
version
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-OCYQIHFA.js";
|
|
34
34
|
import {
|
|
35
35
|
axisScaleOf
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-OKPSS5PG.js";
|
|
37
37
|
import {
|
|
38
38
|
figureScene
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-HL4U73TC.js";
|
|
40
40
|
import {
|
|
41
41
|
encodingStops
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-EOB4Y3EM.js";
|
|
43
43
|
import {
|
|
44
44
|
THREAD_PX,
|
|
45
45
|
passesKey,
|
|
46
46
|
threadsPasses
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-YUIKEUKY.js";
|
|
48
48
|
import {
|
|
49
49
|
rangeText
|
|
50
50
|
} from "./chunk-IZKM4NY7.js";
|
|
@@ -56,11 +56,11 @@ import {
|
|
|
56
56
|
} from "./chunk-ZANALBSX.js";
|
|
57
57
|
import {
|
|
58
58
|
FIGURE_DEFAULTS
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-5SW3PTHO.js";
|
|
60
60
|
import {
|
|
61
61
|
FIT_PADDING,
|
|
62
62
|
fitTransform
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-2AVTTUP2.js";
|
|
64
64
|
import {
|
|
65
65
|
LABEL_CHAR_PX,
|
|
66
66
|
LABEL_PAD,
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
facetLifts,
|
|
6
6
|
walkLift
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ANWUCJZB.js";
|
|
8
8
|
import {
|
|
9
9
|
buildGeometry,
|
|
10
10
|
computeReferenceRamp
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JUYPCLF4.js";
|
|
12
12
|
import {
|
|
13
13
|
walkKey
|
|
14
14
|
} from "./chunk-IZKM4NY7.js";
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
} from "./chunk-VQ353UDK.js";
|
|
22
22
|
import {
|
|
23
23
|
FIGURE_DEFAULTS
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-5SW3PTHO.js";
|
|
25
25
|
import {
|
|
26
26
|
drawingBounds
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-2AVTTUP2.js";
|
|
28
28
|
import {
|
|
29
29
|
referenceLabel
|
|
30
30
|
} from "./chunk-5ORP7EFJ.js";
|
|
@@ -6,8 +6,9 @@ import {
|
|
|
6
6
|
laneSlideAt,
|
|
7
7
|
liftLanes,
|
|
8
8
|
slotCentres,
|
|
9
|
-
threadsPasses
|
|
10
|
-
|
|
9
|
+
threadsPasses,
|
|
10
|
+
walkSteps
|
|
11
|
+
} from "./chunk-YUIKEUKY.js";
|
|
11
12
|
import {
|
|
12
13
|
abgrToCssRgba,
|
|
13
14
|
fadeAbgr,
|
|
@@ -34,7 +35,7 @@ import {
|
|
|
34
35
|
} from "./chunk-ZANALBSX.js";
|
|
35
36
|
import {
|
|
36
37
|
referenceMidpoints
|
|
37
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-L4DBSRA2.js";
|
|
38
39
|
import {
|
|
39
40
|
weakMemo
|
|
40
41
|
} from "./chunk-HMXCN6PG.js";
|
|
@@ -214,9 +215,10 @@ function pointNormalsOf(rawPoints, yToX = 1) {
|
|
|
214
215
|
function offsetPolyline(points, normals, distance, yToX = 1) {
|
|
215
216
|
const out = new Array(points.length);
|
|
216
217
|
for (let i = 0; i < points.length; i++) {
|
|
218
|
+
const d = typeof distance === "number" ? distance : distance[i];
|
|
217
219
|
out[i] = {
|
|
218
|
-
x: points[i].x + normals[i].nx *
|
|
219
|
-
y: points[i].y + normals[i].ny *
|
|
220
|
+
x: points[i].x + normals[i].nx * d,
|
|
221
|
+
y: points[i].y + normals[i].ny * d / yToX
|
|
220
222
|
};
|
|
221
223
|
}
|
|
222
224
|
return out;
|
|
@@ -473,6 +475,7 @@ function pathSlotsOf(graph) {
|
|
|
473
475
|
return slots;
|
|
474
476
|
}
|
|
475
477
|
var lanesCache = weakMemo();
|
|
478
|
+
var stepsCache = weakMemo();
|
|
476
479
|
var linksCache = /* @__PURE__ */ new WeakMap();
|
|
477
480
|
function linksOf(graph) {
|
|
478
481
|
let links = linksCache.get(graph);
|
|
@@ -550,7 +553,20 @@ function buildGeometry(options) {
|
|
|
550
553
|
const fields = highlight && liftedWalks.length > 1 ? lanesCache(
|
|
551
554
|
highlight,
|
|
552
555
|
[nodePositions, version, axis.scaleX, axis.scaleY],
|
|
553
|
-
() => liftLanes(
|
|
556
|
+
() => liftLanes(
|
|
557
|
+
liftedWalks,
|
|
558
|
+
nodePositions,
|
|
559
|
+
yToX,
|
|
560
|
+
worldPerScreenPx,
|
|
561
|
+
stepsCache(
|
|
562
|
+
highlight,
|
|
563
|
+
[nodePositions, version],
|
|
564
|
+
() => walkSteps(
|
|
565
|
+
liftedWalks.map((w) => w.route),
|
|
566
|
+
nodePositions
|
|
567
|
+
)
|
|
568
|
+
)
|
|
569
|
+
)
|
|
554
570
|
) : void 0;
|
|
555
571
|
const lines = fields?.lines;
|
|
556
572
|
const threads = fields?.threads;
|
|
@@ -567,14 +583,32 @@ function buildGeometry(options) {
|
|
|
567
583
|
return centres;
|
|
568
584
|
};
|
|
569
585
|
const laneOffset = (nodeId, laneWidth, lane, pass) => threaded ? (centresOf(nodeId)[lane] + pass * THREAD_PITCH_PX) * thinned : (lane - (liftedWalks.length - 1) / 2) * laneWidth;
|
|
586
|
+
const threadOffsetAt = (frame, at, fallback) => {
|
|
587
|
+
const eased = frame?.offsets?.[at] ?? frame?.offset;
|
|
588
|
+
return eased === void 0 ? fallback : eased * thinned;
|
|
589
|
+
};
|
|
570
590
|
const laneHalfWidth = (laneWidth) => threaded ? THREAD_PX / 2 * thinned : laneWidth / 2;
|
|
571
|
-
const
|
|
572
|
-
const
|
|
573
|
-
|
|
591
|
+
const plainNormals = /* @__PURE__ */ new Map();
|
|
592
|
+
const visitNormals = /* @__PURE__ */ new WeakMap();
|
|
593
|
+
const visitOf = (lane, nodeId, thread) => threads?.[lane]?.threadPasses.get(nodeId)?.[thread] ?? 0;
|
|
594
|
+
const plainNormalsOf = (nodeId, segments) => {
|
|
595
|
+
let normals = plainNormals.get(nodeId);
|
|
596
|
+
if (!normals) {
|
|
597
|
+
normals = pointNormalsOf(segments, yToX);
|
|
598
|
+
plainNormals.set(nodeId, normals);
|
|
599
|
+
}
|
|
600
|
+
return normals;
|
|
601
|
+
};
|
|
602
|
+
const laneNormalsOf = (nodeId, segments, frame) => {
|
|
603
|
+
if (!frame) {
|
|
604
|
+
return plainNormalsOf(nodeId, segments);
|
|
605
|
+
}
|
|
606
|
+
let normals = visitNormals.get(frame.normals);
|
|
574
607
|
if (!normals) {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
608
|
+
normals = plainNormalsOf(nodeId, segments).map(
|
|
609
|
+
(n, i) => frame.normals[i] ?? n
|
|
610
|
+
);
|
|
611
|
+
visitNormals.set(frame.normals, normals);
|
|
578
612
|
}
|
|
579
613
|
return normals;
|
|
580
614
|
};
|
|
@@ -591,14 +625,14 @@ function buildGeometry(options) {
|
|
|
591
625
|
}
|
|
592
626
|
return width;
|
|
593
627
|
};
|
|
594
|
-
const
|
|
595
|
-
const laneEndOf = (id, segments, atStart) => {
|
|
628
|
+
const laneEndOf = (id, frames, segments, atStart, lane, thread) => {
|
|
596
629
|
const at = atStart ? 0 : segments.length - 1;
|
|
630
|
+
const frame = frames?.[lane]?.[visitOf(lane, id, thread)];
|
|
631
|
+
const eased = frame?.offsets?.[at] ?? frame?.offset;
|
|
597
632
|
return {
|
|
598
|
-
id,
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
shift: laneShiftOf(id, at)
|
|
633
|
+
normal: frame?.normals[at] ?? plainNormalsOf(id, segments)[at] ?? { nx: 0, ny: 0 },
|
|
634
|
+
shift: frame?.shifts[at] ?? NO_SHIFT,
|
|
635
|
+
offset: eased === void 0 ? laneOffset(id, laneWidthOf(id), lane, thread) : eased * thinned
|
|
602
636
|
};
|
|
603
637
|
};
|
|
604
638
|
const lanesMayShow = (curves, fromId) => {
|
|
@@ -628,10 +662,22 @@ function buildGeometry(options) {
|
|
|
628
662
|
return ahead ? [...ahead, ...turned] : turned;
|
|
629
663
|
};
|
|
630
664
|
const threadColor = (lane, nodeId, thread) => liftedWalks[lane]?.passColors.get(nodeId)?.[threads?.[lane]?.threadPasses.get(nodeId)?.[thread] ?? 0];
|
|
631
|
-
const
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
665
|
+
const visitPoints = /* @__PURE__ */ new WeakMap();
|
|
666
|
+
const lanePointsOf = (segments, frame) => {
|
|
667
|
+
if (!frame || !threaded) {
|
|
668
|
+
return segments;
|
|
669
|
+
}
|
|
670
|
+
let points = visitPoints.get(frame.shifts);
|
|
671
|
+
if (!points) {
|
|
672
|
+
const { shifts } = frame;
|
|
673
|
+
points = segments.map((p, i) => {
|
|
674
|
+
const { dx, dy } = shifts[i] ?? NO_SHIFT;
|
|
675
|
+
return { ...p, x: p.x + dx, y: p.y + dy };
|
|
676
|
+
});
|
|
677
|
+
visitPoints.set(frame.shifts, points);
|
|
678
|
+
}
|
|
679
|
+
return points;
|
|
680
|
+
};
|
|
635
681
|
const showArrows = scale > (linearLayout ? 1 : MIN_ARROW_SCALE);
|
|
636
682
|
for (let ei = 0; ei < graph.edges.length; ei++) {
|
|
637
683
|
const edge = graph.edges[ei];
|
|
@@ -718,27 +764,40 @@ function buildGeometry(options) {
|
|
|
718
764
|
continue;
|
|
719
765
|
}
|
|
720
766
|
if (laneWalks) {
|
|
721
|
-
const
|
|
722
|
-
edge
|
|
767
|
+
const fromAtStart = leavesStart(
|
|
768
|
+
edge,
|
|
723
769
|
fromSegments,
|
|
724
|
-
|
|
770
|
+
baseCurves[0],
|
|
771
|
+
stranded,
|
|
772
|
+
yToX
|
|
725
773
|
);
|
|
726
774
|
const last = baseCurves.at(-1);
|
|
727
|
-
const
|
|
728
|
-
|
|
775
|
+
const toAtStart = nearerStart(
|
|
776
|
+
{ x: last.x1, y: last.y1 },
|
|
729
777
|
toSegments,
|
|
730
|
-
|
|
731
|
-
)
|
|
778
|
+
yToX
|
|
779
|
+
);
|
|
732
780
|
const single = laneWalks.length === 1;
|
|
733
|
-
const thickness = laneHalfWidth(from
|
|
781
|
+
const thickness = laneHalfWidth(laneWidthOf(edge.from));
|
|
782
|
+
const fromFrames = lines?.frames.get(edge.from);
|
|
783
|
+
const toFrames = lines?.frames.get(edge.to);
|
|
734
784
|
for (let lane = 0; lane < laneWalks.length; lane++) {
|
|
735
785
|
const walk = laneWalks[lane];
|
|
736
786
|
if (!walk.edgeIndexes.has(ei)) {
|
|
737
787
|
continue;
|
|
738
788
|
}
|
|
739
789
|
for (const [pass, toPass] of threadPairs(lane, edge.from, edge.to)) {
|
|
740
|
-
const
|
|
741
|
-
|
|
790
|
+
const from = laneEndOf(
|
|
791
|
+
edge.from,
|
|
792
|
+
fromFrames,
|
|
793
|
+
fromSegments,
|
|
794
|
+
fromAtStart,
|
|
795
|
+
lane,
|
|
796
|
+
pass
|
|
797
|
+
);
|
|
798
|
+
const to = threaded ? laneEndOf(edge.to, toFrames, toSegments, toAtStart, lane, toPass) : from;
|
|
799
|
+
const offsetX = single ? 0 : from.offset * worldPerScreenPx;
|
|
800
|
+
const endOffsetX = threaded ? to.offset * worldPerScreenPx : offsetX;
|
|
742
801
|
const curves = threaded ? slideCurves(
|
|
743
802
|
baseCurves,
|
|
744
803
|
from.shift.dx + from.normal.nx * offsetX,
|
|
@@ -832,9 +891,8 @@ function buildGeometry(options) {
|
|
|
832
891
|
const lanes = highlight?.walks.length && !faded && !slots?.length ? highlight.walks : void 0;
|
|
833
892
|
if (drawable && lanes) {
|
|
834
893
|
const laneWidth = walkLaneWidthPx(width, lanes.length);
|
|
835
|
-
const normals = lanes.length > 1 ? laneNormalsOf(nodeId, segments) : [];
|
|
836
|
-
const points = lanes.length > 1 ? lanePointsOf(nodeId, segments) : segments;
|
|
837
894
|
const thickness = laneHalfWidth(laneWidth);
|
|
895
|
+
const frames = lines?.frames.get(nodeId);
|
|
838
896
|
for (let lane = 0; lane < lanes.length; lane++) {
|
|
839
897
|
const laneColor = lanes[lane].colors.get(nodeId);
|
|
840
898
|
if (laneColor === void 0) {
|
|
@@ -853,15 +911,23 @@ function buildGeometry(options) {
|
|
|
853
911
|
});
|
|
854
912
|
continue;
|
|
855
913
|
}
|
|
856
|
-
const
|
|
914
|
+
const frame = frames?.[lane]?.[visitOf(lane, nodeId, pass)];
|
|
915
|
+
const normals = laneNormalsOf(nodeId, segments, frame);
|
|
916
|
+
const points = lanePointsOf(segments, frame);
|
|
917
|
+
const plain = laneOffset(nodeId, laneWidth, lane, pass);
|
|
918
|
+
const offsets = frame?.offsets?.map(
|
|
919
|
+
(o) => o * thinned * worldPerScreenPx
|
|
920
|
+
);
|
|
921
|
+
const offsetX = offsets ? offsets[Math.floor(offsets.length / 2)] : threadOffsetAt(frame, 0, plain) * worldPerScreenPx;
|
|
857
922
|
nodeStrokes.push({
|
|
858
|
-
points: offsetPolyline(points, normals, offsetX, yToX),
|
|
923
|
+
points: offsetPolyline(points, normals, offsets ?? offsetX, yToX),
|
|
859
924
|
thickness,
|
|
860
925
|
color: color2,
|
|
861
926
|
walk: lane,
|
|
862
927
|
pass,
|
|
863
928
|
normals,
|
|
864
|
-
offsetX
|
|
929
|
+
offsetX,
|
|
930
|
+
...offsets && { offsets }
|
|
865
931
|
});
|
|
866
932
|
}
|
|
867
933
|
}
|
|
@@ -70,9 +70,28 @@ function referenceMidpoints(graph) {
|
|
|
70
70
|
}
|
|
71
71
|
return midpoints;
|
|
72
72
|
}
|
|
73
|
+
function referencePositions(graph) {
|
|
74
|
+
const positions = referenceMidpoints(graph);
|
|
75
|
+
const neighbors = buildNeighbors(graph);
|
|
76
|
+
let frontier = [...positions.keys()];
|
|
77
|
+
while (frontier.length > 0) {
|
|
78
|
+
const next = [];
|
|
79
|
+
for (const id of frontier) {
|
|
80
|
+
for (const neighborId of neighbors.get(id) ?? []) {
|
|
81
|
+
if (!positions.has(neighborId)) {
|
|
82
|
+
positions.set(neighborId, positions.get(id));
|
|
83
|
+
next.push(neighborId);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
frontier = next;
|
|
88
|
+
}
|
|
89
|
+
return positions;
|
|
90
|
+
}
|
|
73
91
|
|
|
74
92
|
export {
|
|
75
93
|
buildNeighbors,
|
|
76
94
|
nodeReferenceSpan,
|
|
77
|
-
referenceMidpoints
|
|
95
|
+
referenceMidpoints,
|
|
96
|
+
referencePositions
|
|
78
97
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sampleRowLayout
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3JDGPLCL.js";
|
|
4
4
|
import {
|
|
5
5
|
hasTubeMapBackbone,
|
|
6
6
|
hasTubeMapPaths,
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
} from "./chunk-BDS5VZYZ.js";
|
|
10
10
|
import {
|
|
11
11
|
anchoredLayout
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CNWAVRLF.js";
|
|
13
13
|
import {
|
|
14
14
|
orderedLayout
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-Q7OFBTBW.js";
|
|
16
16
|
import {
|
|
17
17
|
walkRowLayout
|
|
18
18
|
} from "./chunk-VCUOYVLC.js";
|