@jbrowse/bandage-core 11.12.0 → 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/chunks/{chunk-5UIYXKTA.js → chunk-7AZ57C5C.js} +5 -5
- package/dist/chunks/{chunk-QOY6SPOS.js → chunk-ANWUCJZB.js} +2 -2
- package/dist/chunks/{chunk-Q2AMKXAX.js → chunk-C5FEIJFK.js} +6 -6
- package/dist/chunks/{chunk-JQYK6GVJ.js → chunk-EOB4Y3EM.js} +1 -1
- package/dist/chunks/{chunk-6ROK45LO.js → chunk-HL4U73TC.js} +2 -2
- package/dist/chunks/{chunk-EH5OIV2E.js → chunk-JUYPCLF4.js} +102 -36
- package/dist/chunks/{chunk-GGFR4SYO.js → chunk-K4RGSISK.js} +1 -1
- package/dist/chunks/{chunk-TOGXPJK7.js → chunk-OCYQIHFA.js} +1 -1
- package/dist/chunks/{chunk-A6ABMJR5.js → chunk-OYBYCF2O.js} +1 -1
- package/dist/chunks/{chunk-T2LYWZ5Q.js → chunk-QL673EK5.js} +1 -1
- package/dist/chunks/chunk-YUIKEUKY.js +919 -0
- package/dist/chunks/{chunk-UFF34SGO.js → chunk-ZHCQOC67.js} +1 -1
- package/dist/cli/figure.js +10 -10
- package/dist/figure.js +9 -9
- package/dist/figureData.js +7 -7
- package/dist/figureScene.js +5 -5
- package/dist/index.js +12 -12
- package/dist/layout/walkRowDraw.js +3 -3
- package/dist/layout/walkStrip.js +4 -4
- package/dist/referenceStrip.js +3 -3
- package/dist/renderer/GeometryBuilder.js +2 -2
- package/dist/renderer/walkLanes.js +3 -1
- package/dist/tubeMap/nodeColors.js +3 -3
- 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/walkEncoding.js +3 -3
- package/dist/walkHighlight.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/chunk-4KBZ7WPP.js +0 -579
|
@@ -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
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,
|
|
@@ -247,7 +247,7 @@ function figureData(graph, layout, o = {}) {
|
|
|
247
247
|
pass: s.pass ?? null,
|
|
248
248
|
nx: s.normals?.[k]?.nx ?? 0,
|
|
249
249
|
ny: s.normals?.[k]?.ny ?? 0,
|
|
250
|
-
offset: (s.offsetX ?? 0) * axis.scaleX
|
|
250
|
+
offset: (s.offsets?.[k] ?? s.offsetX ?? 0) * axis.scaleX
|
|
251
251
|
});
|
|
252
252
|
});
|
|
253
253
|
}
|
|
@@ -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
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";
|
|
@@ -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";
|
|
@@ -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,
|
|
@@ -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
|
}
|