@jbrowse/bandage-core 11.16.0 → 11.18.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-F3254CLY.js → chunk-47R7GMU3.js} +4 -4
- package/dist/chunks/{chunk-NIB2A2UZ.js → chunk-4BTGSRIK.js} +1 -1
- package/dist/chunks/{chunk-3KGUENAV.js → chunk-5LTWXDXK.js} +1 -1
- package/dist/chunks/{chunk-JWXSEGEA.js → chunk-BDMISSNR.js} +1 -1
- package/dist/chunks/{chunk-5KQRVX4N.js → chunk-BGKJMLVW.js} +6 -5
- package/dist/chunks/{chunk-7UR5EXC2.js → chunk-CIMRLDRO.js} +1 -1
- package/dist/chunks/{chunk-BMO5MVPB.js → chunk-D4HCHKMA.js} +1 -1
- package/dist/chunks/{chunk-72JZSR4B.js → chunk-DTBQNR7P.js} +7 -7
- package/dist/chunks/{chunk-U7JDTZSK.js → chunk-GZ2F2CDT.js} +1 -1
- package/dist/chunks/{chunk-TUMJNAOL.js → chunk-MSVYSCAH.js} +2 -0
- package/dist/chunks/{chunk-Z5T6EOPF.js → chunk-OND5MXTK.js} +1 -1
- package/dist/chunks/{chunk-WRSI6VK7.js → chunk-PL6X2IJC.js} +2 -2
- package/dist/chunks/{chunk-SR6LCQ5U.js → chunk-RUO5PAPY.js} +10 -10
- package/dist/chunks/{chunk-KMYMAPQ3.js → chunk-X35OZAJ5.js} +22 -9
- package/dist/chunks/{chunk-CF2AXV5I.js → chunk-XESCKKKT.js} +1 -1
- package/dist/chunks/chunk-XWH4LB56.js +115 -0
- package/dist/chunks/{chunk-ZB5ADQYK.js → chunk-ZZUSCQVT.js} +1 -1
- package/dist/cli/figure.js +14 -14
- package/dist/cli/fold.js +2 -2
- package/dist/figure.js +13 -13
- package/dist/figureData.js +11 -11
- package/dist/figureScene.js +8 -8
- package/dist/figureSettings.js +3 -3
- package/dist/gfa/gfaConverter.js +1 -1
- package/dist/index.js +28 -18
- package/dist/layout/forceCache.js +3 -3
- package/dist/layout/walkRowDraw.js +3 -3
- package/dist/layout/walkStrip.js +4 -4
- package/dist/nodeWidths.js +14 -3
- package/dist/pipeline.js +2 -2
- package/dist/referenceStrip.js +3 -3
- package/dist/renderer/GeometryBuilder.js +2 -2
- package/dist/tubeMap/nodeColors.js +3 -3
- package/dist/types/figureData.d.ts +11 -0
- package/dist/types/figureScene.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/layout/walkRowDraw.d.ts +1 -0
- package/dist/types/nodeWidths.d.ts +13 -1
- package/dist/types/types.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/viewport.js +3 -3
- package/dist/walkEncoding.js +3 -3
- package/dist/walkHighlight.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/chunk-ZANALBSX.js +0 -65
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// src/nodeWidths.ts
|
|
2
|
-
var NODE_WIDTHS = [
|
|
3
|
-
{
|
|
4
|
-
value: "depth",
|
|
5
|
-
label: "By depth",
|
|
6
|
-
description: "Thicker the more paths carry a node, on the square root of its depth against the mean. A graph with one depth everywhere draws uniform."
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
value: "uniform",
|
|
10
|
-
label: "Uniform",
|
|
11
|
-
description: "Every node the same thickness."
|
|
12
|
-
}
|
|
13
|
-
];
|
|
14
|
-
var MIN_FACTOR = 0.3;
|
|
15
|
-
var MAX_FACTOR = 3;
|
|
16
|
-
function meanDepth(graph) {
|
|
17
|
-
let weighted = 0;
|
|
18
|
-
let length = 0;
|
|
19
|
-
for (const node of graph.nodes) {
|
|
20
|
-
weighted += node.depth * node.length;
|
|
21
|
-
length += node.length;
|
|
22
|
-
}
|
|
23
|
-
return length > 0 ? weighted / length : 0;
|
|
24
|
-
}
|
|
25
|
-
function depthWidthFactor(node, mean) {
|
|
26
|
-
if (!(mean > 0) || !(node.depth > 0)) {
|
|
27
|
-
return 1;
|
|
28
|
-
}
|
|
29
|
-
return Math.min(
|
|
30
|
-
MAX_FACTOR,
|
|
31
|
-
Math.max(MIN_FACTOR, Math.sqrt(node.depth / mean))
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
function nodeWidthPx(node, contigThickness, nodeWidth, mean) {
|
|
35
|
-
return contigThickness * (nodeWidth === "depth" ? depthWidthFactor(node, mean) : 1);
|
|
36
|
-
}
|
|
37
|
-
function maxNodeWidthPx(contigThickness, nodeWidth) {
|
|
38
|
-
return contigThickness * (nodeWidth === "depth" ? MAX_FACTOR : 1);
|
|
39
|
-
}
|
|
40
|
-
var MIN_WALK_LANE_PX = 4;
|
|
41
|
-
function walkLaneWidthPx(width, lanes) {
|
|
42
|
-
return Math.max(width / lanes, MIN_WALK_LANE_PX);
|
|
43
|
-
}
|
|
44
|
-
function nodeInk(graph, nodeById, contigThickness, nodeWidth, lanes = 0) {
|
|
45
|
-
const mean = graph ? meanDepth(graph) : 0;
|
|
46
|
-
const reach = (width) => lanes > 0 ? walkLaneWidthPx(width, lanes) * lanes / 2 : width / 2;
|
|
47
|
-
return {
|
|
48
|
-
maxHalfWidthPx: reach(maxNodeWidthPx(contigThickness, nodeWidth)),
|
|
49
|
-
halfWidthPx: (id) => {
|
|
50
|
-
const node = nodeById?.get(id);
|
|
51
|
-
return reach(
|
|
52
|
-
node ? nodeWidthPx(node, contigThickness, nodeWidth, mean) : contigThickness
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export {
|
|
59
|
-
NODE_WIDTHS,
|
|
60
|
-
meanDepth,
|
|
61
|
-
nodeWidthPx,
|
|
62
|
-
maxNodeWidthPx,
|
|
63
|
-
walkLaneWidthPx,
|
|
64
|
-
nodeInk
|
|
65
|
-
};
|