@jbrowse/bandage-core 10.2.2 → 10.2.4

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.
Files changed (140) hide show
  1. package/README.md +8 -7
  2. package/dist/bubbles/bubbleHalos.js +7 -3
  3. package/dist/bubbles/bubblesFromGraph.js +4 -2
  4. package/dist/bubbles/classifyBubble.js +10 -5
  5. package/dist/bubbles/superbubbles.js +10 -6
  6. package/dist/chunks/{chunk-N6FECAXP.js → chunk-24WITXQY.js} +17 -8
  7. package/dist/chunks/{chunk-EYK7DJZV.js → chunk-2CHS5LMM.js} +1 -1
  8. package/dist/chunks/{chunk-XTCNEKO5.js → chunk-2QLLQJ72.js} +15 -13
  9. package/dist/chunks/{chunk-TWRLC3KK.js → chunk-3XSM4OZU.js} +1 -1
  10. package/dist/chunks/{chunk-WEDZ76AK.js → chunk-4DRQTBBE.js} +1 -1
  11. package/dist/chunks/{chunk-2LQ5BWT7.js → chunk-4ETPXDO6.js} +1 -1
  12. package/dist/chunks/{chunk-FP4H7SFT.js → chunk-4HWM3FNK.js} +2 -2
  13. package/dist/chunks/{chunk-C7MZJSPT.js → chunk-54POIBVC.js} +2 -8
  14. package/dist/chunks/{chunk-PKFMP65V.js → chunk-5GMFEPWR.js} +1 -1
  15. package/dist/chunks/{chunk-CDLPYR5O.js → chunk-5I3K4R2G.js} +7 -6
  16. package/dist/chunks/{chunk-2CVHXFK7.js → chunk-7SRWJLSC.js} +19 -22
  17. package/dist/chunks/{chunk-SBMJNRTV.js → chunk-A4PFFC4Q.js} +37 -27
  18. package/dist/chunks/{chunk-FNGIQF43.js → chunk-ABUIN5AK.js} +6 -14
  19. package/dist/chunks/{chunk-IW6CYVX2.js → chunk-AR4BUBMU.js} +6 -1
  20. package/dist/chunks/{chunk-IUDJKOLB.js → chunk-B6IW3IRE.js} +15 -33
  21. package/dist/chunks/{chunk-JUIJI7RC.js → chunk-BAETMD3J.js} +9 -4
  22. package/dist/chunks/{chunk-L5WF4ZPS.js → chunk-BS4UZ44I.js} +1 -1
  23. package/dist/chunks/{chunk-HNQPEMYE.js → chunk-CM6LO6OC.js} +0 -1
  24. package/dist/chunks/{chunk-CLOP7UVD.js → chunk-CQHUZHET.js} +11 -8
  25. package/dist/chunks/{chunk-R456ME6J.js → chunk-CU6P5RUG.js} +17 -6
  26. package/dist/chunks/chunk-D5D36ZF6.js +107 -0
  27. package/dist/chunks/{chunk-AFP3NWSL.js → chunk-DY3JCAMX.js} +1 -1
  28. package/dist/chunks/{chunk-NRV7R36Q.js → chunk-EFQLEGWM.js} +3 -3
  29. package/dist/chunks/{chunk-BXEPA4KS.js → chunk-G6UIYQZR.js} +5 -2
  30. package/dist/chunks/{chunk-ASSNZXCF.js → chunk-GINYTQ43.js} +44 -103
  31. package/dist/chunks/{chunk-NNODIW4U.js → chunk-H2H4Y3TV.js} +1 -0
  32. package/dist/chunks/{chunk-MVFDSFV2.js → chunk-HNCXR2VS.js} +1 -1
  33. package/dist/chunks/chunk-JA2HJIYS.js +71 -0
  34. package/dist/chunks/{chunk-PBENCR5L.js → chunk-JBCZIBFC.js} +0 -2
  35. package/dist/chunks/{chunk-5BGP5Z64.js → chunk-JLSJMCDJ.js} +1 -1
  36. package/dist/chunks/{chunk-DT2GGH4D.js → chunk-JMABOQWL.js} +2 -6
  37. package/dist/chunks/{chunk-3S3YVOJ7.js → chunk-JSUCGZ6K.js} +1 -1
  38. package/dist/chunks/{chunk-MLSWIMZO.js → chunk-KBEP7VYK.js} +2 -2
  39. package/dist/chunks/{chunk-DRG4236Y.js → chunk-KC7T5RWG.js} +2 -20
  40. package/dist/chunks/{chunk-TAMCZHLW.js → chunk-N73TI3VG.js} +2 -2
  41. package/dist/chunks/chunk-O4EGE27I.js +10 -0
  42. package/dist/chunks/{chunk-3ZZSX5HN.js → chunk-PTABFYQ7.js} +10 -6
  43. package/dist/chunks/{chunk-WBCOREDZ.js → chunk-QLWI2PZ3.js} +16 -7
  44. package/dist/chunks/chunk-RBCE2OQH.js +32 -0
  45. package/dist/chunks/{chunk-BUBZ32IC.js → chunk-RPRHR56C.js} +4 -8
  46. package/dist/chunks/{chunk-47DYCZOK.js → chunk-RUCH6ZFL.js} +4 -0
  47. package/dist/chunks/{chunk-GNTTI6LA.js → chunk-T2PCSAFY.js} +1 -1
  48. package/dist/chunks/{chunk-XKWD2RY3.js → chunk-URZ3CH2R.js} +3 -10
  49. package/dist/chunks/{chunk-ALDGONEI.js → chunk-VQC7KELB.js} +1 -1
  50. package/dist/chunks/{chunk-FLFBYSJO.js → chunk-VQWHMWLF.js} +5 -1
  51. package/dist/chunks/{chunk-4R6QNG23.js → chunk-WL6ZKUVC.js} +3 -3
  52. package/dist/chunks/{chunk-CRTD2SBP.js → chunk-WZNPX7Q6.js} +6 -2
  53. package/dist/chunks/{chunk-TICYLD5F.js → chunk-XAWLIU54.js} +35 -78
  54. package/dist/chunks/{chunk-DK5P2YOL.js → chunk-XI3ZUTWF.js} +2 -2
  55. package/dist/chunks/{chunk-ZIUKZUPJ.js → chunk-XL472HHD.js} +1 -1
  56. package/dist/chunks/{chunk-BPRXQ2SS.js → chunk-XMW266WS.js} +1 -1
  57. package/dist/chunks/{chunk-WFB5TXRA.js → chunk-ZY2AFL4Y.js} +13 -31
  58. package/dist/cli/decodeText.js +6 -0
  59. package/dist/cli/figure.js +59 -60
  60. package/dist/cli/fold.js +13 -13
  61. package/dist/deletionEdges.js +6 -4
  62. package/dist/el.js +3 -1
  63. package/dist/figure.js +33 -31
  64. package/dist/figureData.js +32 -27
  65. package/dist/figureScene.js +43 -0
  66. package/dist/figureSettings.js +8 -8
  67. package/dist/foldVariants.js +2 -2
  68. package/dist/gbzCut.js +1 -1
  69. package/dist/genes/exonOutline.js +2 -2
  70. package/dist/genes/geneFiles.js +1 -1
  71. package/dist/genes/genePins.js +3 -3
  72. package/dist/gfa/gfaConverter.js +2 -2
  73. package/dist/gfa-core/gfaParser.js +1 -1
  74. package/dist/gfa-core/index.js +1 -1
  75. package/dist/graphLabels.js +4 -4
  76. package/dist/index.js +72 -73
  77. package/dist/labelLayout.js +8 -8
  78. package/dist/layout/forceCache.js +8 -8
  79. package/dist/layout/mergeRuns.js +2 -2
  80. package/dist/layout/orderedLayout.js +1 -3
  81. package/dist/layout/tubeMapLayout.js +6 -6
  82. package/dist/layout/walkRowDraw.js +11 -11
  83. package/dist/layout/walkRowLayout.js +3 -1
  84. package/dist/layout/walkStrip.js +14 -12
  85. package/dist/layoutEngines.js +1 -2
  86. package/dist/layoutModes.js +9 -9
  87. package/dist/nodeWidths.js +1 -3
  88. package/dist/pathColors.js +5 -5
  89. package/dist/pipeline.js +7 -7
  90. package/dist/referenceRampCss.js +9 -9
  91. package/dist/referenceStrip.js +9 -9
  92. package/dist/renderer/Canvas2DRenderer.js +2 -2
  93. package/dist/renderer/GeometryBuilder.js +8 -8
  94. package/dist/renderer/canvas.js +1 -1
  95. package/dist/renderer/svgCanvas.js +1 -1
  96. package/dist/tubeMap/axis.js +5 -5
  97. package/dist/tubeMap/bundle.js +7 -7
  98. package/dist/tubeMap/coarsen.js +6 -6
  99. package/dist/tubeMap/deviations.js +5 -5
  100. package/dist/tubeMap/draw.js +1 -1
  101. package/dist/tubeMap/genes.js +6 -6
  102. package/dist/tubeMap/nodeColors.js +9 -9
  103. package/dist/types/bubbles/bubbleHalos.d.ts +2 -8
  104. package/dist/types/bubbles/bubblesFromGraph.d.ts +1 -0
  105. package/dist/types/bubbles/classifyBubble.d.ts +0 -1
  106. package/dist/types/cli/decodeText.d.ts +1 -0
  107. package/dist/types/cli/figure.d.ts +4 -15
  108. package/dist/types/deletionEdges.d.ts +3 -5
  109. package/dist/types/el.d.ts +1 -0
  110. package/dist/types/figureData.d.ts +7 -26
  111. package/dist/types/figureScene.d.ts +31 -0
  112. package/dist/types/genes/geneFiles.d.ts +2 -1
  113. package/dist/types/index.d.ts +1 -1
  114. package/dist/types/labelLayout.d.ts +1 -5
  115. package/dist/types/layout/deletionRoutes.d.ts +1 -1
  116. package/dist/types/layout/orderedLayout.d.ts +0 -6
  117. package/dist/types/layout/walkRowLayout.d.ts +1 -0
  118. package/dist/types/nodeWidths.d.ts +0 -1
  119. package/dist/types/renderer/Canvas2DRenderer.d.ts +1 -0
  120. package/dist/types/renderer/canvas.d.ts +2 -2
  121. package/dist/types/tubeMap/draw.d.ts +1 -0
  122. package/dist/types/util/geometry.d.ts +3 -3
  123. package/dist/types/version.d.ts +1 -1
  124. package/dist/util/SpatialIndex.js +4 -4
  125. package/dist/util/edgeCurves.js +3 -3
  126. package/dist/util/geometry.js +3 -3
  127. package/dist/util/hitDetection.js +5 -5
  128. package/dist/version.js +1 -1
  129. package/dist/viewport.js +8 -8
  130. package/dist/walkEncoding.js +9 -9
  131. package/dist/walkHighlight.js +10 -10
  132. package/dist/walkKey.js +5 -5
  133. package/package.json +3 -6
  134. package/dist/chunks/bandage-layout-3AR6BCUD.js +0 -4694
  135. package/dist/chunks/chunk-4BYTEJGW.js +0 -44
  136. package/dist/chunks/chunk-7XHHVYG7.js +0 -13
  137. package/dist/chunks/chunk-EHUBJDDB.js +0 -135
  138. package/dist/loadBandage.js +0 -6
  139. package/dist/types/bandage/bandage-layout.d.ts +0 -14
  140. package/dist/types/loadBandage.d.ts +0 -3
@@ -1,44 +0,0 @@
1
- // src/renderer/canvas.ts
2
- var MAX_DPR = 2;
3
- var MAX_CANVAS_DIM_PX = 8192;
4
- function getDpr() {
5
- return typeof devicePixelRatio === "undefined" ? 1 : Math.min(devicePixelRatio, MAX_DPR);
6
- }
7
- var warnedCanvasClamp = false;
8
- function backingPx(cssSize, dpr, axis) {
9
- const value = Math.round(cssSize * dpr);
10
- if (value > MAX_CANVAS_DIM_PX) {
11
- if (!warnedCanvasClamp) {
12
- warnedCanvasClamp = true;
13
- console.warn(
14
- `Canvas ${axis} ${value}px exceeds the safe limit ${MAX_CANVAS_DIM_PX}px and was clamped`
15
- );
16
- }
17
- return MAX_CANVAS_DIM_PX;
18
- }
19
- return value;
20
- }
21
- function syncCanvasSize(canvas, width, height) {
22
- const dpr = getDpr();
23
- const pw = backingPx(width, dpr, "width");
24
- const ph = backingPx(height, dpr, "height");
25
- if (canvas.width !== pw || canvas.height !== ph) {
26
- canvas.width = pw;
27
- canvas.height = ph;
28
- }
29
- const cssWidth = `${width}px`;
30
- const cssHeight = `${height}px`;
31
- if (canvas.style.width !== cssWidth) {
32
- canvas.style.width = cssWidth;
33
- }
34
- if (canvas.style.height !== cssHeight) {
35
- canvas.style.height = cssHeight;
36
- }
37
- }
38
-
39
- export {
40
- MAX_DPR,
41
- MAX_CANVAS_DIM_PX,
42
- getDpr,
43
- syncCanvasSize
44
- };
@@ -1,13 +0,0 @@
1
- // src/loadBandage.ts
2
- var cached;
3
- function loadBandage() {
4
- cached ??= import("./bandage-layout-3AR6BCUD.js").then((mod) => mod.default()).catch((e) => {
5
- cached = void 0;
6
- throw e;
7
- });
8
- return cached;
9
- }
10
-
11
- export {
12
- loadBandage
13
- };
@@ -1,135 +0,0 @@
1
- import {
2
- bubbleSegmentIds,
3
- classifyBubble,
4
- formatBp
5
- } from "./chunk-XKWD2RY3.js";
6
- import {
7
- svgPath
8
- } from "./chunk-2CVHXFK7.js";
9
- import {
10
- isBackbone
11
- } from "./chunk-FYQWPEEY.js";
12
-
13
- // src/bubbles/bubbleHalos.ts
14
- var WHOLE_FRACTION = 0.9;
15
- function coversGraph(members, nodes) {
16
- return members + 2 >= nodes || members >= WHOLE_FRACTION * nodes;
17
- }
18
- var SMALL_VARIANT_BP = 50;
19
- var NAMED_WALKS = 2;
20
- var MIN_CHIPPED_BP = 1e3;
21
- function bubbleHalos(graph, bubbles, positions, walkLabel = (name) => name, repeats = []) {
22
- const byName = new Map(graph.nodes.map((n) => [n.name, n]));
23
- const halos = [];
24
- for (const bubble of bubbles) {
25
- const parts = [];
26
- let minX = Infinity;
27
- let maxX = -Infinity;
28
- let minY = Infinity;
29
- const nodeIds = [];
30
- const ends = [];
31
- const names = bubbleSegmentIds(bubble);
32
- for (const [i, name] of names.entries()) {
33
- const node = byName.get(name);
34
- const line = node && positions[node.id];
35
- if (!node || !line?.length) {
36
- continue;
37
- }
38
- if (bubble.key ? i === 0 || i === names.length - 1 : isBackbone(node) && (node.stable.start < bubble.start || node.stable.start >= bubble.end)) {
39
- ends.push(line[Math.floor(line.length / 2)]);
40
- continue;
41
- }
42
- nodeIds.push(node.id);
43
- parts.push(svgPath(line.length === 1 ? [line[0], line[0]] : line));
44
- for (const p of line) {
45
- minX = Math.min(minX, p.x);
46
- maxX = Math.max(maxX, p.x);
47
- minY = Math.min(minY, p.y);
48
- }
49
- }
50
- if (nodeIds.length === 0) {
51
- continue;
52
- }
53
- const labelAt = { x: (minX + maxX) / 2, y: minY };
54
- const anchor = ends.length ? {
55
- x: ends.reduce((s, p) => s + p.x, 0) / ends.length,
56
- y: ends.reduce((s, p) => s + p.y, 0) / ends.length
57
- } : labelAt;
58
- const routes = [];
59
- for (const [route, own] of ownStretches(bubble)) {
60
- let at;
61
- let far = -1;
62
- for (const id of own) {
63
- for (const p of positions[id] ?? []) {
64
- const d = Math.hypot(p.x - anchor.x, p.y - anchor.y);
65
- if (d > far) {
66
- far = d;
67
- at = p;
68
- }
69
- }
70
- }
71
- if (at) {
72
- routes.push({ route, at, text: routeText(route, walkLabel) });
73
- }
74
- }
75
- const whole = bubble.covering === true || coversGraph(nodeIds.length, graph.nodes.length);
76
- halos.push({
77
- bubble,
78
- ...classifyBubble(bubble, repeats),
79
- path: parts.join(""),
80
- labelAt,
81
- members: nodeIds.length,
82
- nodeIds,
83
- whole,
84
- // The drawing's own bubble keeps its name however small. A partial
85
- // bubble's lengths are a floor, so it may be no small variant.
86
- tick: !whole && !bubble.partial && bubble.longestAlleleLength < SMALL_VARIANT_BP,
87
- routes
88
- });
89
- }
90
- return halos;
91
- }
92
- var stretches = /* @__PURE__ */ new WeakMap();
93
- function ownStretches(bubble) {
94
- const cached = stretches.get(bubble);
95
- if (cached) {
96
- return cached;
97
- }
98
- const chipped = bubble.longestAlleleLength < MIN_CHIPPED_BP ? [] : bubble.routes ?? [];
99
- const sharing = /* @__PURE__ */ new Map();
100
- chipped.forEach((route, r) => {
101
- const counted = /* @__PURE__ */ new Map();
102
- for (const id of route.steps) {
103
- if (counted.get(id) !== r) {
104
- counted.set(id, r);
105
- sharing.set(id, (sharing.get(id) ?? 0) + 1);
106
- }
107
- }
108
- });
109
- const own = /* @__PURE__ */ new Map();
110
- for (const route of chipped) {
111
- let rarest = Infinity;
112
- for (const id of route.steps) {
113
- rarest = Math.min(rarest, sharing.get(id));
114
- }
115
- const steps = new Set(route.steps.filter((id) => sharing.get(id) === rarest));
116
- if (steps.size > 0) {
117
- own.set(route, [...steps]);
118
- }
119
- }
120
- stretches.set(bubble, own);
121
- return own;
122
- }
123
- function routeText(route, walkLabel) {
124
- const names = [...new Set(route.walks.map(walkLabel))].sort();
125
- const shown = names.slice(0, NAMED_WALKS).join(", ");
126
- const more = names.length > NAMED_WALKS ? ` +${names.length - NAMED_WALKS}` : "";
127
- return `${shown}${more} \xB7 ${formatBp(route.bp)}`;
128
- }
129
-
130
- export {
131
- WHOLE_FRACTION,
132
- coversGraph,
133
- SMALL_VARIANT_BP,
134
- bubbleHalos
135
- };
@@ -1,6 +0,0 @@
1
- import {
2
- loadBandage
3
- } from "./chunks/chunk-7XHHVYG7.js";
4
- export {
5
- loadBandage as default
6
- };
@@ -1,14 +0,0 @@
1
- import type { LayoutNode } from '../layout/referenceSeeds.js'
2
- import type { Graph, LayoutResult } from '../types.js'
3
-
4
- export interface BandageModule {
5
- computeLayout(
6
- graph: { nodes: LayoutNode[]; edges: Graph['edges'] },
7
- options: Record<string, unknown>,
8
- ): LayoutResult
9
- }
10
-
11
- // The vendored Emscripten bundle's default export is a factory that
12
- // instantiates the wasm module (layout inlined, -sSINGLE_FILE=1).
13
- declare const createBandageLayoutModule: () => Promise<BandageModule>
14
- export default createBandageLayoutModule
@@ -1,3 +0,0 @@
1
- export type { BandageModule } from './bandage/bandage-layout.js';
2
- import type { BandageModule } from './bandage/bandage-layout.js';
3
- export default function loadBandage(): Promise<BandageModule>;