@jbrowse/bandage-core 6.1.1 → 7.0.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-GOY6REMT.js → chunk-2LQ5BWT7.js} +1 -1
- package/dist/chunks/{chunk-N62KBLFC.js → chunk-3ZZSX5HN.js} +1 -1
- package/dist/chunks/{chunk-R6ZUK4Y3.js → chunk-4FQTTG5F.js} +1 -1
- package/dist/chunks/{chunk-7UIMNBJT.js → chunk-6UFS3EWI.js} +6 -5
- package/dist/chunks/{chunk-OSDI57GY.js → chunk-7PWMTUAK.js} +27 -24
- package/dist/chunks/{chunk-XJWN753L.js → chunk-AWCMVPVP.js} +1 -1
- package/dist/chunks/{chunk-ZZA2AFB4.js → chunk-CNQSHEBS.js} +1 -1
- package/dist/chunks/{chunk-CS3E4ETM.js → chunk-DRA7733Q.js} +1 -1
- package/dist/chunks/{chunk-X5L37W4J.js → chunk-E7FWQQHP.js} +1 -1
- package/dist/chunks/{chunk-XH43CLO2.js → chunk-EOSVRILX.js} +1 -1
- package/dist/chunks/{chunk-SMQ545MU.js → chunk-EXSXBIMH.js} +1 -1
- package/dist/chunks/{chunk-YMSSF2RK.js → chunk-FP4H7SFT.js} +1 -1
- package/dist/chunks/{chunk-DKOB2OPC.js → chunk-GJMC3PGM.js} +3 -3
- package/dist/chunks/{chunk-PJESIRDU.js → chunk-JFNPL4UT.js} +2 -2
- package/dist/chunks/chunk-L53SXJZI.js +22 -0
- package/dist/chunks/{chunk-ZKGM7VLA.js → chunk-MH5IA57M.js} +1 -1
- package/dist/chunks/{chunk-MREQ7GIA.js → chunk-MLSWIMZO.js} +1 -1
- package/dist/chunks/{chunk-V5BPIOLS.js → chunk-MZ7QQRUJ.js} +1 -1
- package/dist/chunks/{chunk-4EMPBO7S.js → chunk-N6FECAXP.js} +51 -1
- package/dist/chunks/chunk-O4TGF4WS.js +503 -0
- package/dist/chunks/{chunk-CTSBC2O6.js → chunk-OWFPAIJI.js} +1 -1
- package/dist/chunks/{chunk-X4VVPLI5.js → chunk-TQ7VCGJR.js} +1 -1
- package/dist/chunks/{chunk-ZHCDYSA5.js → chunk-VECR253P.js} +1 -1
- package/dist/chunks/{chunk-RX5CSWJW.js → chunk-VST5SR4C.js} +6 -6
- package/dist/chunks/{chunk-T43W7NKK.js → chunk-WEMKWLDF.js} +1 -1
- package/dist/chunks/{chunk-Y3IOTZJA.js → chunk-WFB5TXRA.js} +1 -1
- package/dist/chunks/{chunk-STNG3Y5X.js → chunk-YZ5CCEDH.js} +0 -30
- package/dist/cli/figure.js +33 -36
- package/dist/deletionEdges.js +5 -1
- package/dist/figure.js +22 -22
- package/dist/graphLabels.js +2 -2
- package/dist/index.js +59 -47
- package/dist/labelLayout.js +6 -6
- package/dist/layout/deletionRoutes.js +1 -3
- package/dist/layout/stressEngine.js +11 -0
- package/dist/layout/tubeMapLayout.js +4 -4
- package/dist/layout/walkRowDraw.js +9 -9
- package/dist/layout/walkStrip.js +10 -10
- package/dist/layoutEngines.js +9 -0
- package/dist/layoutModes.js +7 -7
- package/dist/pathColors.js +3 -3
- package/dist/pipeline.js +4 -4
- package/dist/referenceRampCss.js +8 -8
- package/dist/referenceStrip.js +8 -8
- package/dist/renderer/GeometryBuilder.js +7 -7
- package/dist/tubeMap/axis.js +3 -3
- package/dist/tubeMap/coarsen.js +4 -4
- package/dist/tubeMap/genes.js +4 -4
- package/dist/tubeMap/nodeColors.js +8 -8
- package/dist/types/cli/figure.d.ts +2 -0
- package/dist/types/deletionEdges.d.ts +7 -0
- package/dist/types/index.d.ts +5 -2
- package/dist/types/labelLayout.d.ts +0 -1
- package/dist/types/layout/deletionRoutes.d.ts +0 -1
- package/dist/types/layout/stressEngine.d.ts +19 -0
- package/dist/types/layoutEngines.d.ts +2 -0
- package/dist/types/pipeline.d.ts +2 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/util/SpatialIndex.js +3 -3
- package/dist/util/edgeCurves.js +2 -2
- package/dist/util/hitDetection.js +4 -4
- package/dist/version.js +1 -1
- package/dist/viewport.js +5 -5
- package/dist/walkEncoding.js +8 -8
- package/dist/walkHighlight.js +9 -9
- package/dist/walkKey.js +3 -3
- package/package.json +1 -1
|
@@ -11,11 +11,10 @@ import {
|
|
|
11
11
|
parseGFA
|
|
12
12
|
} from "./chunk-CDLPYR5O.js";
|
|
13
13
|
import {
|
|
14
|
-
closableDeletions,
|
|
15
14
|
routeNodes,
|
|
16
15
|
takeRoutes,
|
|
17
16
|
withDeletionRoutes
|
|
18
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-YZ5CCEDH.js";
|
|
19
18
|
import {
|
|
20
19
|
anchorGraph
|
|
21
20
|
} from "./chunk-ST2IBUAN.js";
|
|
@@ -32,8 +31,9 @@ import {
|
|
|
32
31
|
layoutScaling
|
|
33
32
|
} from "./chunk-6JEWNXCQ.js";
|
|
34
33
|
import {
|
|
34
|
+
closableDeletions,
|
|
35
35
|
deletionEdges
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-N6FECAXP.js";
|
|
37
37
|
import {
|
|
38
38
|
isBackbone
|
|
39
39
|
} from "./chunk-FYQWPEEY.js";
|
|
@@ -74,13 +74,14 @@ function engineRequest(graph, scaling, settings) {
|
|
|
74
74
|
linearLayout: settings.linearLayout,
|
|
75
75
|
...spaced.opts,
|
|
76
76
|
componentSeparation: COMPONENT_SEPARATION * (settings.componentSeparation ?? 1),
|
|
77
|
-
...anchored ? { rotateComponents: false } : {}
|
|
77
|
+
...anchored ? { rotateComponents: false } : {},
|
|
78
|
+
engine: settings.engine ?? "fmmm"
|
|
78
79
|
}
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
82
|
function engineKey(graph, settings) {
|
|
82
83
|
const anchored = graph.nodes.some(isBackbone);
|
|
83
|
-
return `${settings.quality}|${settings.linearLayout}|${settings.bubbleSpread}|${settings.spacing ?? 1}|${settings.componentSeparation ?? 1}|${settings.showDeletionEdges !== false}|${anchored}|${graph.referencePath ?? ""}`;
|
|
84
|
+
return `${settings.engine ?? "fmmm"}|${settings.quality}|${settings.linearLayout}|${settings.bubbleSpread}|${settings.spacing ?? 1}|${settings.componentSeparation ?? 1}|${settings.showDeletionEdges !== false}|${anchored}|${graph.referencePath ?? ""}`;
|
|
84
85
|
}
|
|
85
86
|
async function forceLayout(graph, settings, engine) {
|
|
86
87
|
const spread = spreadFor(settings.bubbleSpread);
|
|
@@ -5,61 +5,64 @@ import {
|
|
|
5
5
|
stripGeneGaps,
|
|
6
6
|
walkStripFrame,
|
|
7
7
|
walkStripLabelsTree
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MZ7QQRUJ.js";
|
|
9
9
|
import {
|
|
10
10
|
walkRowsKey,
|
|
11
11
|
walkRowsKeyTree,
|
|
12
12
|
walkRowsTree
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JFNPL4UT.js";
|
|
14
14
|
import {
|
|
15
15
|
Canvas2DRenderer
|
|
16
16
|
} from "./chunk-CH3DLBUT.js";
|
|
17
|
-
import {
|
|
18
|
-
genePins
|
|
19
|
-
} from "./chunk-BUBZ32IC.js";
|
|
20
17
|
import {
|
|
21
18
|
EXON_COLOR,
|
|
22
19
|
exonOutlineTree,
|
|
23
20
|
exonStretches
|
|
24
21
|
} from "./chunk-3S3YVOJ7.js";
|
|
22
|
+
import {
|
|
23
|
+
genePins
|
|
24
|
+
} from "./chunk-BUBZ32IC.js";
|
|
25
25
|
import {
|
|
26
26
|
version
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-EOSVRILX.js";
|
|
28
28
|
import {
|
|
29
29
|
axisScaleOf
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-AWCMVPVP.js";
|
|
31
31
|
import {
|
|
32
32
|
facetLifts,
|
|
33
33
|
walkLift
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-MH5IA57M.js";
|
|
35
35
|
import {
|
|
36
36
|
encodingStops
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-TQ7VCGJR.js";
|
|
38
38
|
import {
|
|
39
39
|
rangeText,
|
|
40
40
|
walkKey
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-2LQ5BWT7.js";
|
|
42
42
|
import {
|
|
43
43
|
FIT_PADDING,
|
|
44
44
|
drawingBounds,
|
|
45
45
|
fitTransform
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-6UFS3EWI.js";
|
|
47
47
|
import {
|
|
48
48
|
buildGeometry,
|
|
49
49
|
computeReferenceRamp
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-VST5SR4C.js";
|
|
51
|
+
import {
|
|
52
|
+
nodeInk
|
|
53
|
+
} from "./chunk-PBENCR5L.js";
|
|
51
54
|
import {
|
|
52
55
|
geneLabelCandidates
|
|
53
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-GJMC3PGM.js";
|
|
54
57
|
import {
|
|
55
58
|
nodesUnderBox
|
|
56
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-FP4H7SFT.js";
|
|
57
60
|
import {
|
|
58
61
|
walkRowsExtent
|
|
59
62
|
} from "./chunk-EZPBJPK6.js";
|
|
60
63
|
import {
|
|
61
64
|
pathLegend
|
|
62
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-E7FWQQHP.js";
|
|
63
66
|
import {
|
|
64
67
|
LABEL_CHAR_PX,
|
|
65
68
|
LABEL_PAD,
|
|
@@ -67,15 +70,13 @@ import {
|
|
|
67
70
|
occupancy,
|
|
68
71
|
placeLabels
|
|
69
72
|
} from "./chunk-AB35TJST.js";
|
|
70
|
-
import {
|
|
71
|
-
nodeInk
|
|
72
|
-
} from "./chunk-PBENCR5L.js";
|
|
73
73
|
import {
|
|
74
74
|
resolveColorScheme
|
|
75
75
|
} from "./chunk-JKJWSY4V.js";
|
|
76
76
|
import {
|
|
77
|
+
deletionDrawing,
|
|
77
78
|
deletionEdges
|
|
78
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-N6FECAXP.js";
|
|
79
80
|
import {
|
|
80
81
|
ROW_HEIGHT_PX
|
|
81
82
|
} from "./chunk-CPMHA4W5.js";
|
|
@@ -163,7 +164,11 @@ function figureSvg(graph, layout, o = {}) {
|
|
|
163
164
|
start: referenceRamp.start,
|
|
164
165
|
end: referenceRamp.start + referenceRamp.span
|
|
165
166
|
};
|
|
166
|
-
const
|
|
167
|
+
const drawnDeletions = deletionDrawing(
|
|
168
|
+
graph,
|
|
169
|
+
layout.tubeMap ? [] : deletionEdges(graph),
|
|
170
|
+
o.showDeletionEdges
|
|
171
|
+
);
|
|
167
172
|
const layers = o.walks ?? [];
|
|
168
173
|
const walkRamp = layers.some((l) => l.color?.field === "reference") ? referenceRamp ?? computeReferenceRamp(graph, rampDomain) : void 0;
|
|
169
174
|
const lift = layers.length > 0 && !layout.tubeMap ? walkLift(graph, layers, walkRamp) : void 0;
|
|
@@ -276,12 +281,10 @@ function figureSvg(graph, layout, o = {}) {
|
|
|
276
281
|
highlight,
|
|
277
282
|
axis,
|
|
278
283
|
referenceRamp,
|
|
279
|
-
deletions:
|
|
284
|
+
deletions: drawnDeletions.bypassed,
|
|
280
285
|
deletionRoutes: layout.deletionRoutes,
|
|
281
286
|
stranded: layout.stranded,
|
|
282
|
-
hiddenEdges:
|
|
283
|
-
o.showDeletionEdges ? [] : deletions.map((d) => d.edgeIndex)
|
|
284
|
-
)
|
|
287
|
+
hiddenEdges: drawnDeletions.hidden
|
|
285
288
|
})
|
|
286
289
|
);
|
|
287
290
|
const t = {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
nodesUnderBox
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FP4H7SFT.js";
|
|
4
4
|
import {
|
|
5
5
|
nodeLabelBudget,
|
|
6
6
|
placeSizeLabels,
|
|
7
7
|
rowLabelBox,
|
|
8
8
|
sizeLabelCandidates
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3ZZSX5HN.js";
|
|
10
10
|
import {
|
|
11
11
|
LABEL_CHAR_PX,
|
|
12
12
|
LABEL_PAD,
|
|
@@ -127,7 +127,7 @@ function layoutLabels(m) {
|
|
|
127
127
|
const sizeCandidates = m.nodePositions && m.labelsNodeSizes ? sizeLabelCandidates({
|
|
128
128
|
nodePositions: m.nodePositions,
|
|
129
129
|
nodeLengths: m.nodeLengths,
|
|
130
|
-
deletions: m.
|
|
130
|
+
deletions: m.deletions,
|
|
131
131
|
deletionRoutes: m.deletionRoutes,
|
|
132
132
|
stranded: m.stranded,
|
|
133
133
|
alleleDeletions: m.alleleDeletions,
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
RAMP_GRADIENT_STOPS,
|
|
4
4
|
rampHueCss,
|
|
5
5
|
rampStops
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VECR253P.js";
|
|
7
7
|
import {
|
|
8
8
|
REFERENCE_RAMP_ALT_CSS
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VST5SR4C.js";
|
|
10
10
|
import {
|
|
11
11
|
LABEL_CHAR_PX
|
|
12
12
|
} from "./chunk-AB35TJST.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
stressLayout
|
|
3
|
+
} from "./chunk-O4TGF4WS.js";
|
|
4
|
+
import {
|
|
5
|
+
loadBandage
|
|
6
|
+
} from "./chunk-7XHHVYG7.js";
|
|
7
|
+
|
|
8
|
+
// src/layoutEngines.ts
|
|
9
|
+
var layoutEngine = async (request) => {
|
|
10
|
+
const start = performance.now();
|
|
11
|
+
if (request.options.engine === "stress") {
|
|
12
|
+
const result2 = stressLayout(request);
|
|
13
|
+
return { result: result2, duration: performance.now() - start };
|
|
14
|
+
}
|
|
15
|
+
const bandage = await loadBandage();
|
|
16
|
+
const result = bandage.computeLayout(request.graph, request.options);
|
|
17
|
+
return { result, duration: performance.now() - start };
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
layoutEngine
|
|
22
|
+
};
|
|
@@ -109,9 +109,59 @@ function deletionEdges(graph) {
|
|
|
109
109
|
}
|
|
110
110
|
return found;
|
|
111
111
|
}
|
|
112
|
+
function closableDeletions(graph, deletions) {
|
|
113
|
+
const parent = /* @__PURE__ */ new Map();
|
|
114
|
+
const root = (id) => {
|
|
115
|
+
let r = id;
|
|
116
|
+
while (parent.has(r)) {
|
|
117
|
+
r = parent.get(r);
|
|
118
|
+
}
|
|
119
|
+
if (r !== id) {
|
|
120
|
+
parent.set(id, r);
|
|
121
|
+
}
|
|
122
|
+
return r;
|
|
123
|
+
};
|
|
124
|
+
const join = (a, b) => {
|
|
125
|
+
const [ra, rb] = [root(a), root(b)];
|
|
126
|
+
if (ra !== rb) {
|
|
127
|
+
parent.set(ra, rb);
|
|
128
|
+
}
|
|
129
|
+
return ra !== rb;
|
|
130
|
+
};
|
|
131
|
+
const candidates = new Set(deletions.map((d) => d.edgeIndex));
|
|
132
|
+
graph.edges.forEach((e, ei) => {
|
|
133
|
+
if (!candidates.has(ei)) {
|
|
134
|
+
join(e.from, e.to);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
return new Set(
|
|
138
|
+
deletions.filter((d) => !join(d.from, d.to)).map((d) => d.edgeIndex)
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
var drawings = /* @__PURE__ */ new WeakMap();
|
|
142
|
+
function deletionDrawing(graph, deletions, show = true) {
|
|
143
|
+
let byShow = drawings.get(deletions);
|
|
144
|
+
if (!byShow) {
|
|
145
|
+
byShow = /* @__PURE__ */ new Map();
|
|
146
|
+
drawings.set(deletions, byShow);
|
|
147
|
+
}
|
|
148
|
+
let drawing = byShow.get(show);
|
|
149
|
+
if (!drawing) {
|
|
150
|
+
const hidden = show ? /* @__PURE__ */ new Set() : closableDeletions(graph, deletions);
|
|
151
|
+
drawing = {
|
|
152
|
+
shown: deletions.filter((d) => !hidden.has(d.edgeIndex)),
|
|
153
|
+
bypassed: new Map(deletions.map((d) => [d.edgeIndex, d.bypassed])),
|
|
154
|
+
hidden
|
|
155
|
+
};
|
|
156
|
+
byShow.set(show, drawing);
|
|
157
|
+
}
|
|
158
|
+
return drawing;
|
|
159
|
+
}
|
|
112
160
|
|
|
113
161
|
export {
|
|
114
162
|
bypassedPoints,
|
|
115
163
|
deletionArcCurves,
|
|
116
|
-
deletionEdges
|
|
164
|
+
deletionEdges,
|
|
165
|
+
closableDeletions,
|
|
166
|
+
deletionDrawing
|
|
117
167
|
};
|