@jbrowse/bandage-core 7.2.1 → 7.4.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-MH5IA57M.js → chunk-3LXG54PN.js} +1 -1
- package/dist/chunks/{chunk-Y7UR3MDE.js → chunk-4UBWXZVX.js} +1 -1
- package/dist/chunks/{chunk-MQSOTYVF.js → chunk-5XHORHYK.js} +43 -49
- package/dist/chunks/{chunk-2T3SRIFH.js → chunk-7G7TFATC.js} +5 -5
- package/dist/chunks/{chunk-E7FWQQHP.js → chunk-7GBL7SJY.js} +15 -4
- package/dist/chunks/{chunk-VECR253P.js → chunk-AVJK272H.js} +1 -1
- package/dist/chunks/{chunk-4FQTTG5F.js → chunk-AYOSNXLQ.js} +1 -1
- package/dist/chunks/chunk-AZFVORTC.js +19 -0
- package/dist/chunks/{chunk-JKXE6CIP.js → chunk-FRR2RGBT.js} +5 -5
- package/dist/chunks/chunk-H5S2ONCJ.js +27 -0
- package/dist/chunks/chunk-K5SIJGAE.js +12 -0
- package/dist/chunks/{chunk-CNQSHEBS.js → chunk-KEVQ46GG.js} +1 -1
- package/dist/chunks/{chunk-BZKEMAWC.js → chunk-LNSAKOXP.js} +1 -1
- package/dist/chunks/chunk-LOCJN3BZ.js +14 -0
- package/dist/chunks/{chunk-3JANT2SW.js → chunk-MP7LXLWV.js} +13 -0
- package/dist/chunks/{chunk-OY3CDWFN.js → chunk-PY7EZFL3.js} +4 -4
- package/dist/chunks/{chunk-VST5SR4C.js → chunk-RCWYY6XA.js} +4 -4
- package/dist/chunks/{chunk-EXSXBIMH.js → chunk-UJ6GYL6T.js} +1 -1
- package/dist/chunks/{chunk-EPWYRSHH.js → chunk-WZATPZNH.js} +30 -8
- package/dist/chunks/chunk-XVSBZ4ZW.js +54 -0
- package/dist/chunks/{chunk-TQ7VCGJR.js → chunk-ZNMHIPUZ.js} +1 -1
- package/dist/cli/figure.js +60 -70
- package/dist/figure.js +28 -27
- package/dist/figureSettings.js +25 -0
- package/dist/hoverText.js +8 -0
- package/dist/index.js +153 -121
- package/dist/layout/forceCache.js +23 -0
- package/dist/layout/tubeMapLayout.js +4 -4
- package/dist/layout/walkRowDraw.js +8 -8
- package/dist/layout/walkRowLayout.js +4 -2
- package/dist/layout/walkStrip.js +9 -9
- package/dist/layoutModes.js +9 -9
- package/dist/layoutQualities.js +6 -0
- package/dist/pathColors.js +7 -5
- package/dist/pipeline.js +8 -4
- package/dist/referenceRampCss.js +6 -6
- package/dist/referenceStrip.js +6 -6
- package/dist/renderer/GeometryBuilder.js +5 -5
- package/dist/renderer/geometryInputs.js +6 -0
- package/dist/tubeMap/coarsen.js +5 -5
- package/dist/tubeMap/nodeColors.js +6 -6
- package/dist/types/figure.d.ts +1 -0
- package/dist/types/figureSettings.d.ts +15 -0
- package/dist/types/hoverText.d.ts +17 -0
- package/dist/types/index.d.ts +11 -2
- package/dist/types/layout/forceCache.d.ts +11 -0
- package/dist/types/layout/walkRowLayout.d.ts +2 -1
- package/dist/types/layoutQualities.d.ts +17 -0
- package/dist/types/pathColors.d.ts +4 -0
- package/dist/types/pipeline.d.ts +2 -0
- package/dist/types/renderer/geometryInputs.d.ts +11 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/viewport.js +5 -5
- package/dist/walkEncoding.js +6 -6
- package/dist/walkHighlight.js +7 -7
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
layoutGeometryInputs
|
|
3
|
+
} from "./chunk-LOCJN3BZ.js";
|
|
4
4
|
import {
|
|
5
5
|
svgCanvas
|
|
6
6
|
} from "./chunk-47DYCZOK.js";
|
|
@@ -8,12 +8,15 @@ import {
|
|
|
8
8
|
stripGeneGaps,
|
|
9
9
|
walkStripFrame,
|
|
10
10
|
walkStripLabelsTree
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PY7EZFL3.js";
|
|
12
12
|
import {
|
|
13
13
|
walkRowsKey,
|
|
14
14
|
walkRowsKeyTree,
|
|
15
15
|
walkRowsTree
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7G7TFATC.js";
|
|
17
|
+
import {
|
|
18
|
+
Canvas2DRenderer
|
|
19
|
+
} from "./chunk-CH3DLBUT.js";
|
|
17
20
|
import {
|
|
18
21
|
EXON_COLOR,
|
|
19
22
|
exonOutlineTree,
|
|
@@ -22,47 +25,47 @@ import {
|
|
|
22
25
|
import {
|
|
23
26
|
genePins
|
|
24
27
|
} from "./chunk-BUBZ32IC.js";
|
|
25
|
-
import {
|
|
26
|
-
version
|
|
27
|
-
} from "./chunk-BZKEMAWC.js";
|
|
28
|
-
import {
|
|
29
|
-
axisScaleOf
|
|
30
|
-
} from "./chunk-Y7UR3MDE.js";
|
|
31
28
|
import {
|
|
32
29
|
facetLifts,
|
|
33
30
|
walkLift
|
|
34
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-3LXG54PN.js";
|
|
35
32
|
import {
|
|
36
33
|
encodingStops
|
|
37
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-ZNMHIPUZ.js";
|
|
38
35
|
import {
|
|
39
36
|
rangeText,
|
|
40
37
|
walkKey
|
|
41
38
|
} from "./chunk-2LQ5BWT7.js";
|
|
42
|
-
import {
|
|
43
|
-
FIT_PADDING,
|
|
44
|
-
drawingBounds,
|
|
45
|
-
fitTransform
|
|
46
|
-
} from "./chunk-EPWYRSHH.js";
|
|
47
39
|
import {
|
|
48
40
|
buildGeometry,
|
|
49
41
|
computeReferenceRamp
|
|
50
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-RCWYY6XA.js";
|
|
43
|
+
import {
|
|
44
|
+
version
|
|
45
|
+
} from "./chunk-LNSAKOXP.js";
|
|
46
|
+
import {
|
|
47
|
+
axisScaleOf
|
|
48
|
+
} from "./chunk-4UBWXZVX.js";
|
|
49
|
+
import {
|
|
50
|
+
walkRowLabels,
|
|
51
|
+
walkRowsExtent
|
|
52
|
+
} from "./chunk-MP7LXLWV.js";
|
|
51
53
|
import {
|
|
52
54
|
nodeInk
|
|
53
55
|
} from "./chunk-PBENCR5L.js";
|
|
56
|
+
import {
|
|
57
|
+
pathLegend,
|
|
58
|
+
walkLabelsOf
|
|
59
|
+
} from "./chunk-7GBL7SJY.js";
|
|
60
|
+
import {
|
|
61
|
+
referenceLabel
|
|
62
|
+
} from "./chunk-RAKOB6IV.js";
|
|
54
63
|
import {
|
|
55
64
|
geneLabelCandidates
|
|
56
65
|
} from "./chunk-GJMC3PGM.js";
|
|
57
66
|
import {
|
|
58
67
|
nodesUnderBox
|
|
59
68
|
} from "./chunk-FP4H7SFT.js";
|
|
60
|
-
import {
|
|
61
|
-
walkRowsExtent
|
|
62
|
-
} from "./chunk-3JANT2SW.js";
|
|
63
|
-
import {
|
|
64
|
-
pathLegend
|
|
65
|
-
} from "./chunk-E7FWQQHP.js";
|
|
66
69
|
import {
|
|
67
70
|
LABEL_CHAR_PX,
|
|
68
71
|
LABEL_PAD,
|
|
@@ -73,13 +76,6 @@ import {
|
|
|
73
76
|
import {
|
|
74
77
|
resolveColorScheme
|
|
75
78
|
} from "./chunk-JKJWSY4V.js";
|
|
76
|
-
import {
|
|
77
|
-
deletionDrawing,
|
|
78
|
-
deletionEdges
|
|
79
|
-
} from "./chunk-N6FECAXP.js";
|
|
80
|
-
import {
|
|
81
|
-
ROW_HEIGHT_PX
|
|
82
|
-
} from "./chunk-CPMHA4W5.js";
|
|
83
79
|
import {
|
|
84
80
|
serializeEl
|
|
85
81
|
} from "./chunk-NNODIW4U.js";
|
|
@@ -92,8 +88,14 @@ import {
|
|
|
92
88
|
facetSettingOf
|
|
93
89
|
} from "./chunk-6SBUFFTB.js";
|
|
94
90
|
import {
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
FIT_PADDING,
|
|
92
|
+
drawingBounds,
|
|
93
|
+
fitTransform
|
|
94
|
+
} from "./chunk-WZATPZNH.js";
|
|
95
|
+
import {
|
|
96
|
+
deletionDrawing,
|
|
97
|
+
deletionEdges
|
|
98
|
+
} from "./chunk-N6FECAXP.js";
|
|
97
99
|
|
|
98
100
|
// src/figure.ts
|
|
99
101
|
var FONT = 'font-family="Helvetica, Arial, sans-serif" font-size="11"';
|
|
@@ -174,11 +176,8 @@ function figureSvg(graph, layout, o = {}) {
|
|
|
174
176
|
const lift = layers.length > 0 && !layout.tubeMap ? walkLift(graph, layers, walkRamp) : void 0;
|
|
175
177
|
const facet = facetSettingOf(o.facet);
|
|
176
178
|
const panels = facet.field && lift && lift.walks.length > 1 ? facetLifts(graph, lift, layers, walkRamp) : void 0;
|
|
177
|
-
const labels =
|
|
178
|
-
|
|
179
|
-
p.name,
|
|
180
|
-
p.label
|
|
181
|
-
])
|
|
179
|
+
const labels = walkLabelsOf(
|
|
180
|
+
graph.paths?.length ? pathLegend(graph.paths) : []
|
|
182
181
|
);
|
|
183
182
|
const labelOf = (name) => labels.get(name) ?? name;
|
|
184
183
|
const referenceName = o.referenceName ?? referenceLabel(graph, region);
|
|
@@ -235,11 +234,7 @@ function figureSvg(graph, layout, o = {}) {
|
|
|
235
234
|
)
|
|
236
235
|
);
|
|
237
236
|
}
|
|
238
|
-
const
|
|
239
|
-
const rowLabels = rows ? pitch && !pitch.labelled ? [] : [rows.reference, ...rows.rows].map((r, i) => ({
|
|
240
|
-
label: r.label,
|
|
241
|
-
y: i * (pitch?.rowPx ?? ROW_HEIGHT_PX)
|
|
242
|
-
})) : layout.rowLabels ?? [];
|
|
237
|
+
const rowLabels = walkRowLabels(rows, layout, o.walkRowPitch);
|
|
243
238
|
for (const { label, y } of rowLabels) {
|
|
244
239
|
const sy = y * t.scaleY + t.translateY;
|
|
245
240
|
if (sy >= 0 && sy <= h) {
|
|
@@ -271,7 +266,9 @@ function figureSvg(graph, layout, o = {}) {
|
|
|
271
266
|
const renderer = new Canvas2DRenderer(canvas);
|
|
272
267
|
renderer.uploadGeometry(
|
|
273
268
|
buildGeometry({
|
|
274
|
-
|
|
269
|
+
...layoutGeometryInputs(layout, drawnDeletions, {
|
|
270
|
+
drawsRows: !!rows
|
|
271
|
+
}),
|
|
275
272
|
graph,
|
|
276
273
|
nodeById,
|
|
277
274
|
colorScheme,
|
|
@@ -279,13 +276,10 @@ function figureSvg(graph, layout, o = {}) {
|
|
|
279
276
|
connectorThickness: o.connectorThickness ?? 2,
|
|
280
277
|
drawPaths: false,
|
|
281
278
|
nodeWidth,
|
|
279
|
+
linearLayout: o.linearLayout,
|
|
282
280
|
highlight,
|
|
283
281
|
axis,
|
|
284
|
-
referenceRamp
|
|
285
|
-
deletions: drawnDeletions.bypassed,
|
|
286
|
-
deletionRoutes: layout.deletionRoutes,
|
|
287
|
-
stranded: layout.stranded,
|
|
288
|
-
hiddenEdges: drawnDeletions.hidden
|
|
282
|
+
referenceRamp
|
|
289
283
|
})
|
|
290
284
|
);
|
|
291
285
|
const t = {
|
|
@@ -3,19 +3,19 @@ import {
|
|
|
3
3
|
RAMP_GRADIENT_STOPS,
|
|
4
4
|
rampHueCss,
|
|
5
5
|
rampStops
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AVJK272H.js";
|
|
7
7
|
import {
|
|
8
8
|
REFERENCE_RAMP_ALT_CSS
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RCWYY6XA.js";
|
|
10
10
|
import {
|
|
11
11
|
LABEL_CHAR_PX
|
|
12
12
|
} from "./chunk-AB35TJST.js";
|
|
13
|
-
import {
|
|
14
|
-
ROW_HEIGHT_PX
|
|
15
|
-
} from "./chunk-CPMHA4W5.js";
|
|
16
13
|
import {
|
|
17
14
|
el
|
|
18
15
|
} from "./chunk-NNODIW4U.js";
|
|
16
|
+
import {
|
|
17
|
+
ROW_HEIGHT_PX
|
|
18
|
+
} from "./chunk-CPMHA4W5.js";
|
|
19
19
|
|
|
20
20
|
// src/layout/walkRowDraw.ts
|
|
21
21
|
var ON_REFERENCE = "#2f8fd6";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
pathOrigin
|
|
3
|
-
} from "./chunk-ST2IBUAN.js";
|
|
4
1
|
import {
|
|
5
2
|
groupDigits
|
|
6
3
|
} from "./chunk-3ZZSX5HN.js";
|
|
4
|
+
import {
|
|
5
|
+
pathOrigin
|
|
6
|
+
} from "./chunk-ST2IBUAN.js";
|
|
7
7
|
import {
|
|
8
8
|
isGenericSample
|
|
9
9
|
} from "./chunk-BPLIXMH7.js";
|
|
@@ -68,6 +68,16 @@ function pathLegend(paths, colors) {
|
|
|
68
68
|
color: colors?.[i] ?? pathCssColor(i, paths.length)
|
|
69
69
|
}));
|
|
70
70
|
}
|
|
71
|
+
function walkLabelsOf(entries) {
|
|
72
|
+
const seen = /* @__PURE__ */ new Map();
|
|
73
|
+
return new Map(
|
|
74
|
+
[...entries].sort((a, b) => a.label.localeCompare(b.label)).map((e) => {
|
|
75
|
+
const n = (seen.get(e.label) ?? 0) + 1;
|
|
76
|
+
seen.set(e.label, n);
|
|
77
|
+
return [e.name, n > 1 ? `${e.label} (${n})` : e.label];
|
|
78
|
+
})
|
|
79
|
+
);
|
|
80
|
+
}
|
|
71
81
|
|
|
72
82
|
export {
|
|
73
83
|
nameHue,
|
|
@@ -78,5 +88,6 @@ export {
|
|
|
78
88
|
pathColorsLegible,
|
|
79
89
|
pathCssColor,
|
|
80
90
|
pathGreyCssColor,
|
|
81
|
-
pathLegend
|
|
91
|
+
pathLegend,
|
|
92
|
+
walkLabelsOf
|
|
82
93
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// src/hoverText.ts
|
|
2
|
+
function regionLabel(loc) {
|
|
3
|
+
return `${loc.refName}:${(loc.start + 1).toLocaleString()}-${loc.end.toLocaleString()}`;
|
|
4
|
+
}
|
|
5
|
+
function edgeHoverText(edge, deletion, nameOf = (id) => id) {
|
|
6
|
+
return deletion ? {
|
|
7
|
+
deletion: {
|
|
8
|
+
bp: `${deletion.bp.toLocaleString()} bp`,
|
|
9
|
+
where: regionLabel(deletion)
|
|
10
|
+
}
|
|
11
|
+
} : {
|
|
12
|
+
ends: `${nameOf(edge.from)}${edge.fromStrand ?? ""} \u2192 ${nameOf(edge.to)}${edge.toStrand ?? ""}`
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
regionLabel,
|
|
18
|
+
edgeHoverText
|
|
19
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sampleRowLayout
|
|
3
|
+
} from "./chunk-LOEA5IHZ.js";
|
|
1
4
|
import {
|
|
2
5
|
hasTubeMapPaths,
|
|
3
6
|
tubeMapLayout,
|
|
4
7
|
tubeMapReferenceLayout
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
sampleRowLayout
|
|
8
|
-
} from "./chunk-LOEA5IHZ.js";
|
|
8
|
+
} from "./chunk-AYOSNXLQ.js";
|
|
9
9
|
import {
|
|
10
10
|
anchoredLayout
|
|
11
11
|
} from "./chunk-L3O7AWLI.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-HNQPEMYE.js";
|
|
15
15
|
import {
|
|
16
16
|
walkRowLayout
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-MP7LXLWV.js";
|
|
18
18
|
import {
|
|
19
19
|
isBackbone,
|
|
20
20
|
isOffReference
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ENGINE_DEFAULTS
|
|
3
|
+
} from "./chunk-WZATPZNH.js";
|
|
4
|
+
|
|
5
|
+
// src/figureSettings.ts
|
|
6
|
+
var FIGURE_DEFAULTS = {
|
|
7
|
+
...ENGINE_DEFAULTS,
|
|
8
|
+
colorScheme: "auto",
|
|
9
|
+
nodeWidth: "depth",
|
|
10
|
+
contigThickness: 6,
|
|
11
|
+
connectorThickness: 2
|
|
12
|
+
};
|
|
13
|
+
function figureSpecSettings(s) {
|
|
14
|
+
const defaults = FIGURE_DEFAULTS;
|
|
15
|
+
const out = {};
|
|
16
|
+
for (const [k, v] of Object.entries(s)) {
|
|
17
|
+
if (v !== void 0 && v !== defaults[k]) {
|
|
18
|
+
out[k] = v;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return out;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
FIGURE_DEFAULTS,
|
|
26
|
+
figureSpecSettings
|
|
27
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/layoutQualities.ts
|
|
2
|
+
var LAYOUT_QUALITIES = [
|
|
3
|
+
{ value: 0, label: "Fastest" },
|
|
4
|
+
{ value: 1, label: "Fast" },
|
|
5
|
+
{ value: 2, label: "Default" },
|
|
6
|
+
{ value: 3, label: "Fine" },
|
|
7
|
+
{ value: 4, label: "Best" }
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
LAYOUT_QUALITIES
|
|
12
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/renderer/geometryInputs.ts
|
|
2
|
+
function layoutGeometryInputs(layout, drawing, o = {}) {
|
|
3
|
+
return {
|
|
4
|
+
nodePositions: o.drawsRows ? {} : layout.nodePositions,
|
|
5
|
+
deletions: drawing.bypassed,
|
|
6
|
+
deletionRoutes: layout.deletionRoutes,
|
|
7
|
+
stranded: layout.stranded,
|
|
8
|
+
hiddenEdges: drawing.hidden
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
layoutGeometryInputs
|
|
14
|
+
};
|
|
@@ -25,6 +25,18 @@ function walkRowsExtent(walks, pitch = {
|
|
|
25
25
|
maxY: walks.rows.length * pitch.rowPx
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
+
function walkRowLabels(rows, layout, pitch) {
|
|
29
|
+
if (!rows) {
|
|
30
|
+
return layout?.rowLabels ?? [];
|
|
31
|
+
}
|
|
32
|
+
if (pitch && !pitch.labelled) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
return [rows.reference, ...rows.rows].map((row, i) => ({
|
|
36
|
+
label: row.label,
|
|
37
|
+
y: i * (pitch?.rowPx ?? ROW_HEIGHT_PX)
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
28
40
|
function walkRowLayout(graph, region) {
|
|
29
41
|
const backbone = backboneNodes(graph);
|
|
30
42
|
const walks = walkRows(graph, region);
|
|
@@ -53,5 +65,6 @@ function walkRowLayout(graph, region) {
|
|
|
53
65
|
|
|
54
66
|
export {
|
|
55
67
|
walkRowsExtent,
|
|
68
|
+
walkRowLabels,
|
|
56
69
|
walkRowLayout
|
|
57
70
|
};
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
alongRow,
|
|
3
3
|
boxesGenes,
|
|
4
4
|
rowPitch
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
pathOrigin
|
|
8
|
-
} from "./chunk-ST2IBUAN.js";
|
|
5
|
+
} from "./chunk-7G7TFATC.js";
|
|
9
6
|
import {
|
|
10
7
|
LABEL_CHAR_PX
|
|
11
8
|
} from "./chunk-AB35TJST.js";
|
|
12
9
|
import {
|
|
13
10
|
el
|
|
14
11
|
} from "./chunk-NNODIW4U.js";
|
|
12
|
+
import {
|
|
13
|
+
pathOrigin
|
|
14
|
+
} from "./chunk-ST2IBUAN.js";
|
|
15
15
|
|
|
16
16
|
// src/layout/walkStrip.ts
|
|
17
17
|
var PAD_PX = 6;
|
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
meanDepth,
|
|
8
8
|
nodeWidthPx
|
|
9
9
|
} from "./chunk-PBENCR5L.js";
|
|
10
|
-
import {
|
|
11
|
-
baseEdgeCurves
|
|
12
|
-
} from "./chunk-WFB5TXRA.js";
|
|
13
10
|
import {
|
|
14
11
|
PATH_LIGHTNESS,
|
|
15
12
|
PATH_SATURATION,
|
|
16
13
|
nameHue,
|
|
17
14
|
pathHueAt
|
|
18
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-7GBL7SJY.js";
|
|
16
|
+
import {
|
|
17
|
+
baseEdgeCurves
|
|
18
|
+
} from "./chunk-WFB5TXRA.js";
|
|
19
19
|
import {
|
|
20
20
|
referenceMidpoints
|
|
21
21
|
} from "./chunk-ES2N6V56.js";
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
orientToReference
|
|
3
|
-
} from "./chunk-PUG7LXDF.js";
|
|
4
1
|
import {
|
|
5
2
|
seededNodes
|
|
6
3
|
} from "./chunk-IGVV37VI.js";
|
|
4
|
+
import {
|
|
5
|
+
orientToReference
|
|
6
|
+
} from "./chunk-PUG7LXDF.js";
|
|
7
7
|
import {
|
|
8
8
|
convertGFAToGraph
|
|
9
9
|
} from "./chunk-72N5DJHZ.js";
|
|
10
10
|
import {
|
|
11
11
|
parseGFA
|
|
12
12
|
} from "./chunk-CDLPYR5O.js";
|
|
13
|
-
import {
|
|
14
|
-
routeNodes,
|
|
15
|
-
takeRoutes,
|
|
16
|
-
withDeletionRoutes
|
|
17
|
-
} from "./chunk-JVLURPFW.js";
|
|
18
13
|
import {
|
|
19
14
|
anchorGraph
|
|
20
15
|
} from "./chunk-ST2IBUAN.js";
|
|
@@ -22,6 +17,11 @@ import {
|
|
|
22
17
|
mergeRuns,
|
|
23
18
|
splitRuns
|
|
24
19
|
} from "./chunk-TAMCZHLW.js";
|
|
20
|
+
import {
|
|
21
|
+
routeNodes,
|
|
22
|
+
takeRoutes,
|
|
23
|
+
withDeletionRoutes
|
|
24
|
+
} from "./chunk-JVLURPFW.js";
|
|
25
25
|
import {
|
|
26
26
|
spreadFor
|
|
27
27
|
} from "./chunk-UVBGRJQX.js";
|
|
@@ -54,6 +54,26 @@ function loadGraph(text, name, opts = {}) {
|
|
|
54
54
|
}
|
|
55
55
|
return graph;
|
|
56
56
|
}
|
|
57
|
+
var ENGINE_DEFAULTS = {
|
|
58
|
+
engine: "fmmm",
|
|
59
|
+
quality: 2,
|
|
60
|
+
linearLayout: false,
|
|
61
|
+
bubbleSpread: "auto",
|
|
62
|
+
spacing: 1,
|
|
63
|
+
componentSeparation: 1,
|
|
64
|
+
showDeletionEdges: true
|
|
65
|
+
};
|
|
66
|
+
function engineSettingsOf(s = {}) {
|
|
67
|
+
return {
|
|
68
|
+
engine: s.engine ?? ENGINE_DEFAULTS.engine,
|
|
69
|
+
quality: s.quality ?? ENGINE_DEFAULTS.quality,
|
|
70
|
+
linearLayout: s.linearLayout ?? ENGINE_DEFAULTS.linearLayout,
|
|
71
|
+
bubbleSpread: s.bubbleSpread ?? ENGINE_DEFAULTS.bubbleSpread,
|
|
72
|
+
spacing: s.spacing ?? ENGINE_DEFAULTS.spacing,
|
|
73
|
+
componentSeparation: s.componentSeparation ?? ENGINE_DEFAULTS.componentSeparation,
|
|
74
|
+
showDeletionEdges: s.showDeletionEdges ?? ENGINE_DEFAULTS.showDeletionEdges
|
|
75
|
+
};
|
|
76
|
+
}
|
|
57
77
|
var COMPONENT_SEPARATION = 15;
|
|
58
78
|
function engineRequest(graph, scaling, settings) {
|
|
59
79
|
const anchored = graph.nodes.some(isBackbone);
|
|
@@ -210,6 +230,8 @@ function drawingBounds(layout, opts = {}) {
|
|
|
210
230
|
|
|
211
231
|
export {
|
|
212
232
|
loadGraph,
|
|
233
|
+
ENGINE_DEFAULTS,
|
|
234
|
+
engineSettingsOf,
|
|
213
235
|
engineRequest,
|
|
214
236
|
engineKey,
|
|
215
237
|
forceLayout,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
engineKey,
|
|
3
|
+
forceLayout
|
|
4
|
+
} from "./chunk-WZATPZNH.js";
|
|
5
|
+
|
|
6
|
+
// src/layout/forceCache.ts
|
|
7
|
+
var DEFAULT_SIZE = 4;
|
|
8
|
+
function createForceLayoutCache(size = DEFAULT_SIZE) {
|
|
9
|
+
const caches = /* @__PURE__ */ new WeakMap();
|
|
10
|
+
const cacheOf = (graph) => {
|
|
11
|
+
let cache = caches.get(graph);
|
|
12
|
+
if (!cache) {
|
|
13
|
+
cache = /* @__PURE__ */ new Map();
|
|
14
|
+
caches.set(graph, cache);
|
|
15
|
+
}
|
|
16
|
+
return cache;
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
layout(graph, settings, engine) {
|
|
20
|
+
const cache = cacheOf(graph);
|
|
21
|
+
const key = engineKey(graph, settings);
|
|
22
|
+
const hit = cache.get(key);
|
|
23
|
+
if (hit) {
|
|
24
|
+
return hit.run;
|
|
25
|
+
}
|
|
26
|
+
if (cache.size >= size) {
|
|
27
|
+
cache.delete(cache.keys().next().value);
|
|
28
|
+
}
|
|
29
|
+
const started = performance.now();
|
|
30
|
+
const entry = {
|
|
31
|
+
run: forceLayout(graph, settings, engine).then((r) => {
|
|
32
|
+
entry.done = r.result;
|
|
33
|
+
return { ...r, duration: r.duration || performance.now() - started };
|
|
34
|
+
})
|
|
35
|
+
};
|
|
36
|
+
entry.run.catch(() => cache.delete(key));
|
|
37
|
+
cache.set(key, entry);
|
|
38
|
+
return entry.run;
|
|
39
|
+
},
|
|
40
|
+
ready(graph, settings) {
|
|
41
|
+
return caches.get(graph)?.get(engineKey(graph, settings))?.done;
|
|
42
|
+
},
|
|
43
|
+
inherit(from, to) {
|
|
44
|
+
const cache = caches.get(from);
|
|
45
|
+
if (cache && from !== to) {
|
|
46
|
+
caches.set(to, cache);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
createForceLayoutCache
|
|
54
|
+
};
|