@jbrowse/bandage-core 4.2.0 → 4.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.
@@ -16,8 +16,9 @@ import {
16
16
  loadGraph,
17
17
  openGbz,
18
18
  parseRegion,
19
- refNameBinding
20
- } from "../chunks/chunk-FPBV6GNR.js";
19
+ refNameBinding,
20
+ walkRows
21
+ } from "../chunks/chunk-YNLMROBC.js";
21
22
 
22
23
  // src/cli/figure.ts
23
24
  import { access, open, readFile, writeFile } from "node:fs/promises";
@@ -138,6 +139,8 @@ async function renderSpec(spec, base) {
138
139
  checkLayout(spec.layout);
139
140
  const resolve = (location) => isUrl(location) ? location : path.resolve(base, location);
140
141
  let source;
142
+ const mode = layoutModeByValue(spec.layout ?? "force");
143
+ const strip = !!spec.walkStrip && mode.drawsNodes;
141
144
  if (spec.gbz) {
142
145
  const { db, index } = spec.gbz.db === "hprc" ? HPRC_GBZ : spec.gbz;
143
146
  const indexLocation = index ? resolve(index) : await siblingIndex(resolve(db));
@@ -146,7 +149,8 @@ async function renderSpec(spec, base) {
146
149
  byteSource(resolve(db)),
147
150
  indexLocation ? byteSource(indexLocation) : void 0
148
151
  ),
149
- spec.gbz
152
+ // walk rows measure whole walks, which a cut only follows when asked
153
+ mode.wholeWalks || strip ? { snarls: "overlapping", ...spec.gbz } : spec.gbz
150
154
  );
151
155
  source = { ...cut, name: `${cut.sample} ${spec.gbz.region}` };
152
156
  } else if (spec.gfa) {
@@ -161,7 +165,7 @@ async function renderSpec(spec, base) {
161
165
  const graph = loadGraph(source.text, source.name, {
162
166
  referencePath: spec.referencePath
163
167
  });
164
- const layout = layoutModeByValue(spec.layout ?? "force").run(graph, source.region) ?? (await forceLayout(
168
+ const layout = mode.run(graph, source.region) ?? (await forceLayout(
165
169
  graph,
166
170
  {
167
171
  quality: spec.quality ?? 2,
@@ -170,8 +174,10 @@ async function renderSpec(spec, base) {
170
174
  },
171
175
  engine
172
176
  )).result;
177
+ const stripRows = strip ? walkRows(graph, source.region) : void 0;
173
178
  return figureSvg(graph, layout, {
174
179
  ...spec,
180
+ walkStrip: stripRows && { rows: stripRows },
175
181
  walks: spec.walks?.map((w) => typeof w === "string" ? { walk: w } : w),
176
182
  region: source.region,
177
183
  genes: spec.genes ? await readGenes(spec.genes, graph, resolve) : void 0,
package/dist/index.js CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  GENE_INK,
14
14
  HALO_FACTOR,
15
15
  HPRC_GBZ,
16
+ LABELLED_ROW_PX,
16
17
  LABEL_CHAR_PX,
17
18
  LABEL_PAD,
18
19
  LABEL_PX,
@@ -28,6 +29,7 @@ import {
28
29
  ROW_HEIGHT_PX,
29
30
  WALK_FIELDS,
30
31
  WALK_SCHEMES,
32
+ WALK_STRIP_CEILING_PX,
31
33
  WELL_KNOWN_SAMPLES,
32
34
  alongRow,
33
35
  assemblyWalk,
@@ -36,6 +38,7 @@ import {
36
38
  baseEdgeCurves,
37
39
  buildGeometry,
38
40
  clampZoom,
41
+ coalesceRuns,
39
42
  computeColorSchemeRange,
40
43
  computeReferenceRamp,
41
44
  contains,
@@ -105,7 +108,11 @@ import {
105
108
  runPaint,
106
109
  schemeCss,
107
110
  screenToLayout,
111
+ segmentAt,
108
112
  serializeEl,
113
+ stripGeneGaps,
114
+ stripMarks,
115
+ stripRowAt,
109
116
  svgCanvas,
110
117
  svgPath,
111
118
  translateCurves,
@@ -116,6 +123,7 @@ import {
116
123
  walkHighlight,
117
124
  walkKey,
118
125
  walkLift,
126
+ walkMarksTree,
119
127
  walkPosition,
120
128
  walkRowReadout,
121
129
  walkRows,
@@ -123,10 +131,12 @@ import {
123
131
  walkRowsKey,
124
132
  walkRowsKeyTree,
125
133
  walkRowsTree,
134
+ walkStripFrame,
135
+ walkStripLabelsTree,
126
136
  wellKnownSample,
127
137
  yToXOf,
128
138
  zoomAbout
129
- } from "./chunks/chunk-FPBV6GNR.js";
139
+ } from "./chunks/chunk-YNLMROBC.js";
130
140
 
131
141
  // src/index.ts
132
142
  import { getDpr } from "@jbrowse/render-core/canvas2dUtils";
@@ -243,14 +253,15 @@ var SpatialIndex = class {
243
253
  }
244
254
  };
245
255
  var EdgeSpatialIndex = class {
246
- constructor(nodePositions, graph, drawPaths, axis, cellSize, deletions, version2 = 0) {
256
+ constructor(nodePositions, graph, drawPaths, axis, cellSize, deletions, version2 = 0, routes2) {
247
257
  this.cells = /* @__PURE__ */ new Map();
248
258
  this.edgeCurves = baseEdgeCurves(
249
259
  nodePositions,
250
260
  graph,
251
261
  axis,
252
262
  deletions,
253
- version2
263
+ version2,
264
+ routes2
254
265
  );
255
266
  const boxes = [];
256
267
  let extentX = 0;
@@ -373,9 +384,9 @@ function getSpatialIndex(nodePositions, version2) {
373
384
  return index;
374
385
  }
375
386
  var edgeCache = /* @__PURE__ */ new WeakMap();
376
- function getEdgeSpatialIndex(nodePositions, graph, drawPaths, axis, version2, deletions) {
387
+ function getEdgeSpatialIndex(nodePositions, graph, drawPaths, axis, version2, deletions, routes2) {
377
388
  const cached = edgeCache.get(nodePositions);
378
- if (cached?.graph === graph && cached.drawPaths === drawPaths && cached.scaleX === axis.scaleX && cached.scaleY === axis.scaleY && cached.version === version2 && cached.deletions === deletions) {
389
+ if (cached?.graph === graph && cached.drawPaths === drawPaths && cached.scaleX === axis.scaleX && cached.scaleY === axis.scaleY && cached.version === version2 && cached.deletions === deletions && cached.routes === routes2) {
379
390
  return cached.index;
380
391
  }
381
392
  const index = new EdgeSpatialIndex(
@@ -385,7 +396,8 @@ function getEdgeSpatialIndex(nodePositions, graph, drawPaths, axis, version2, de
385
396
  axis,
386
397
  void 0,
387
398
  deletions,
388
- version2
399
+ version2,
400
+ routes2
389
401
  );
390
402
  edgeCache.set(nodePositions, {
391
403
  graph,
@@ -394,7 +406,8 @@ function getEdgeSpatialIndex(nodePositions, graph, drawPaths, axis, version2, de
394
406
  scaleY: axis.scaleY,
395
407
  version: version2,
396
408
  index,
397
- deletions
409
+ deletions,
410
+ routes: routes2
398
411
  });
399
412
  return index;
400
413
  }
@@ -424,7 +437,7 @@ function findHoveredNode(nodePositions, graphX, graphY, axis, version2 = 0, ink)
424
437
  }
425
438
  return hovered;
426
439
  }
427
- function findHoveredEdge(nodePositions, graph, graphX, graphY, axis, drawPaths, version2 = 0, deletions, hiddenEdges) {
440
+ function findHoveredEdge(nodePositions, graph, graphX, graphY, axis, drawPaths, version2 = 0, deletions, hiddenEdges, deletionRoutes) {
428
441
  const yToX = yToXOf(axis);
429
442
  const edgeThreshold = 10 / axis.scaleX;
430
443
  const edgeIndex = getEdgeSpatialIndex(
@@ -433,7 +446,8 @@ function findHoveredEdge(nodePositions, graph, graphX, graphY, axis, drawPaths,
433
446
  drawPaths,
434
447
  axis,
435
448
  version2,
436
- deletions
449
+ deletions,
450
+ deletionRoutes
437
451
  );
438
452
  const candidates = edgeIndex.query(
439
453
  graphX,
@@ -1783,6 +1797,7 @@ export {
1783
1797
  FORCE_LAYOUT_LABEL,
1784
1798
  HALO_FACTOR,
1785
1799
  HPRC_GBZ,
1800
+ LABELLED_ROW_PX,
1786
1801
  LABEL_CHAR_PX,
1787
1802
  LABEL_PAD,
1788
1803
  LABEL_PX,
@@ -1802,6 +1817,7 @@ export {
1802
1817
  ON_REFERENCE as WALK_ON_REFERENCE,
1803
1818
  OUTSIDE_CUT as WALK_OUTSIDE_CUT,
1804
1819
  WALK_SCHEMES,
1820
+ WALK_STRIP_CEILING_PX,
1805
1821
  WELL_KNOWN_SAMPLES,
1806
1822
  alongRow,
1807
1823
  assemblyWalk,
@@ -1814,6 +1830,7 @@ export {
1814
1830
  buildGeometry,
1815
1831
  clampZoom,
1816
1832
  classifyBubble,
1833
+ coalesceRuns,
1817
1834
  computeReferenceRamp,
1818
1835
  connectorAt,
1819
1836
  contains,
@@ -1891,8 +1908,12 @@ export {
1891
1908
  runPaint,
1892
1909
  schemeCss,
1893
1910
  screenToLayout,
1911
+ segmentAt,
1894
1912
  serializeEl,
1895
1913
  stripBlockAt,
1914
+ stripGeneGaps,
1915
+ stripMarks,
1916
+ stripRowAt,
1896
1917
  svgCanvas,
1897
1918
  tubeMapConnectors,
1898
1919
  tubeMapFrame,
@@ -1907,6 +1928,7 @@ export {
1907
1928
  walkHighlight,
1908
1929
  walkKey,
1909
1930
  walkLift,
1931
+ walkMarksTree,
1910
1932
  walkPosition,
1911
1933
  walkRowReadout,
1912
1934
  walkRows,
@@ -1914,6 +1936,8 @@ export {
1914
1936
  walkRowsKey,
1915
1937
  walkRowsKeyTree,
1916
1938
  walkRowsTree,
1939
+ walkStripFrame,
1940
+ walkStripLabelsTree,
1917
1941
  warpX,
1918
1942
  wellKnownSample,
1919
1943
  wheelZoomFactor,
@@ -3,7 +3,7 @@ import type { FigureOptions } from '../figure.js';
3
3
  import type { GbzSource } from '../gbzCut.js';
4
4
  import type { LayoutModeValue } from '../layoutModes.js';
5
5
  import type { WalkLayer } from '../walkEncoding.js';
6
- export interface FigureSpec extends Omit<FigureOptions, 'walks' | 'region' | 'genes' | 'spec'> {
6
+ export interface FigureSpec extends Omit<FigureOptions, 'walks' | 'region' | 'genes' | 'spec' | 'walkStrip'> {
7
7
  gfa?: string;
8
8
  gbz?: GbzSource;
9
9
  region?: string;
@@ -12,6 +12,7 @@ export interface FigureSpec extends Omit<FigureOptions, 'walks' | 'region' | 'ge
12
12
  quality?: number;
13
13
  bubbleSpread?: BubbleSpread;
14
14
  walks?: (string | WalkLayer)[];
15
+ walkStrip?: boolean;
15
16
  genes?: {
16
17
  file: string;
17
18
  index?: string;
@@ -1,4 +1,4 @@
1
- import type { Graph } from './types.js';
1
+ import type { Graph, NodeSegment } from './types.js';
2
2
  import type { AxisScale } from './util/geometry.js';
3
3
  export interface DeletionEdge {
4
4
  edgeIndex: number;
@@ -20,5 +20,5 @@ export declare function bypassedPoints(nodePositions: Record<string, {
20
20
  export declare function deletionArcCurves(nodePositions: Record<string, {
21
21
  x: number;
22
22
  y: number;
23
- }[]>, deletion: DeletionEdge, axis: AxisScale): import("./util/geometry.js").BezierCurve[] | undefined;
23
+ }[]>, deletion: DeletionEdge, axis: AxisScale, route?: NodeSegment[]): import("./util/geometry.js").BezierCurve[] | undefined;
24
24
  export declare function deletionEdges(graph: Graph): DeletionEdge[];
@@ -2,6 +2,7 @@ import type { ColorScheme } from './colorSchemes.js';
2
2
  import type { FacetInput } from './facetGrid.js';
3
3
  import type { GeneModel } from './genes/genePins.js';
4
4
  import type { GeneGaps, RowGene, WalkRowsWithCalls } from './layout/walkRowDraw.js';
5
+ import type { WalkRows } from './layout/walkRows.js';
5
6
  import type { NodeWidth } from './nodeWidths.js';
6
7
  import type { Graph, LayoutResult } from './types.js';
7
8
  import type { WalkLayer } from './walkEncoding.js';
@@ -30,5 +31,10 @@ export interface FigureOptions {
30
31
  walkRows?: WalkRowsWithCalls;
31
32
  rowGenes?: Map<string, RowGene[]>;
32
33
  rowGeneGaps?: GeneGaps;
34
+ walkStrip?: {
35
+ rows: WalkRows;
36
+ rowGenes?: Map<string, RowGene[]>;
37
+ rowGeneGaps?: GeneGaps;
38
+ };
33
39
  }
34
40
  export declare function figureSvg(graph: Graph, layout: LayoutResult, o?: FigureOptions): string;
@@ -1,4 +1,5 @@
1
1
  import type { DeletionEdge } from './deletionEdges.js';
2
+ import type { DeletionRoutes } from './layout/deletionRoutes.js';
2
3
  import type { Box, TakeBox } from './overlayLabels.js';
3
4
  import type { AlleleDeletion, NodeSegment } from './types.js';
4
5
  import type { AxisScale } from './util/geometry.js';
@@ -23,6 +24,7 @@ interface SizeLabelArgs {
23
24
  nodePositions: Record<string, NodeSegment[]>;
24
25
  nodeLengths: Map<string, number>;
25
26
  deletions: DeletionEdge[];
27
+ deletionRoutes?: DeletionRoutes;
26
28
  alleleDeletions?: AlleleDeletion[];
27
29
  axis: AxisScale;
28
30
  translateX: number;
@@ -35,7 +37,7 @@ export interface SizeLabelCandidate {
35
37
  label: GraphLabel;
36
38
  box: Box;
37
39
  }
38
- export declare function sizeLabelCandidates({ nodePositions, nodeLengths, deletions, alleleDeletions, axis, translateX, translateY, width, height, version, }: SizeLabelArgs): {
40
+ export declare function sizeLabelCandidates({ nodePositions, nodeLengths, deletions, deletionRoutes, alleleDeletions, axis, translateX, translateY, width, height, version, }: SizeLabelArgs): {
39
41
  deletions: SizeLabelCandidate[];
40
42
  nodes: SizeLabelCandidate[];
41
43
  };
@@ -56,8 +56,10 @@ export { bubbleSubgraph } from './bubbles/popBubble.js';
56
56
  export type { MinigraphBubble } from './bubbles/bubbleLine.js';
57
57
  export { walkRows } from './layout/walkRows.js';
58
58
  export type { WalkAxis, WalkRow, WalkRows, WalkRun } from './layout/walkRows.js';
59
- export { BAR_PX as WALK_BAR_PX, DISAGREES as WALK_DISAGREES, GAP_PX as WALK_GAP_PX, GENE_INK as WALK_GENE_INK, OFF_REFERENCE as WALK_OFF_REFERENCE, ON_REFERENCE as WALK_ON_REFERENCE, OUTSIDE_CUT as WALK_OUTSIDE_CUT, alongRow, placeRowGenes, readoutPlacement, rowGeneBoxes, rowSpan, runPaint, unitTicks, walkRowReadout, walkRowsKey, walkRowsKeyTree, walkRowsTree, } from './layout/walkRowDraw.js';
59
+ export { BAR_PX as WALK_BAR_PX, DISAGREES as WALK_DISAGREES, GAP_PX as WALK_GAP_PX, GENE_INK as WALK_GENE_INK, OFF_REFERENCE as WALK_OFF_REFERENCE, ON_REFERENCE as WALK_ON_REFERENCE, OUTSIDE_CUT as WALK_OUTSIDE_CUT, alongRow, coalesceRuns, placeRowGenes, readoutPlacement, rowGeneBoxes, rowSpan, runPaint, unitTicks, walkRowReadout, walkRowsKey, walkRowsKeyTree, walkRowsTree, } from './layout/walkRowDraw.js';
60
60
  export type { GeneBox, GeneGaps, KeyEntry, KeySwatch, ReadoutCall, RowGene, WalkRowsFrame, WalkRowsWithCalls, } from './layout/walkRowDraw.js';
61
+ export { LABELLED_ROW_PX, WALK_STRIP_CEILING_PX, segmentAt, stripGeneGaps, stripMarks, stripRowAt, walkMarksTree, walkStripFrame, walkStripLabelsTree, } from './layout/walkStrip.js';
62
+ export type { StripFrame, StripMark } from './layout/walkStrip.js';
61
63
  export { el, serializeEl } from './el.js';
62
64
  export type { El, ElAttrs } from './el.js';
63
65
  export { RAMP_GRADIENT_CSS, rampHue, rampHueCss, rampStops, } from './referenceRampCss.js';
@@ -2,6 +2,7 @@ import type { BubbleHalo, RouteLabel } from './bubbles/bubbleHalos.js';
2
2
  import type { DeletionEdge } from './deletionEdges.js';
3
3
  import type { GenePin } from './genes/genePins.js';
4
4
  import type { GraphLabel } from './graphLabels.js';
5
+ import type { DeletionRoutes } from './layout/deletionRoutes.js';
5
6
  import type { PlacedLabel } from './overlayLabels.js';
6
7
  import type { AlleleDeletion, NodeSegment } from './types.js';
7
8
  import type { AxisScale } from './util/geometry.js';
@@ -33,6 +34,7 @@ export interface LabelLayoutSource {
33
34
  nodeLengths: Map<string, number>;
34
35
  showDeletionEdges: boolean;
35
36
  deletions: DeletionEdge[];
37
+ deletionRoutes?: DeletionRoutes;
36
38
  alleleDeletions: AlleleDeletion[];
37
39
  positionsVersion: number;
38
40
  }
@@ -0,0 +1,31 @@
1
+ import type { BandageScaleOpts } from './drawnScale.js';
2
+ import type { DeletionEdge } from '../deletionEdges.js';
3
+ import type { Graph, GraphEdge, GraphNode, NodeSegment } from '../types.js';
4
+ export type DeletionRoutes = Record<number, NodeSegment[]>;
5
+ export declare function withDeletionRoutes(graph: Graph, deletions: DeletionEdge[]): {
6
+ graph: {
7
+ nodes: {
8
+ id: string;
9
+ name: string;
10
+ length: number;
11
+ depth: number;
12
+ }[];
13
+ edges: GraphEdge[];
14
+ name: string;
15
+ paths?: import("../types.js").GraphPath[];
16
+ anchorPaths?: import("../types.js").PathOrigin[];
17
+ pathVisits?: Map<string, import("../types.js").PathVisit[]>;
18
+ anchoredBy?: "tags" | "paths";
19
+ referencePath?: string;
20
+ reads?: import("../gaf/parseGaf.js").GafRecord[];
21
+ };
22
+ routes: Map<number, string>;
23
+ ids: Set<string>;
24
+ };
25
+ export declare function routeNodes(graph: Graph, deletions: DeletionEdge[], routes: Map<number, string>, drawnOf: (bp: number) => number, opts: BandageScaleOpts): GraphNode[];
26
+ export declare function takeRoutes(positions: Record<string, NodeSegment[]>, routes: Map<number, string>): {
27
+ nodePositions: {
28
+ [x: string]: NodeSegment[];
29
+ };
30
+ deletionRoutes: DeletionRoutes;
31
+ };
@@ -25,4 +25,5 @@ export interface LayoutScaling {
25
25
  opts: BandageScaleOpts;
26
26
  }
27
27
  export declare function layoutScaling(graph: Graph, spread?: NodeLengthSpread): LayoutScaling;
28
+ export declare function drawnLengthOf(graph: Graph, spread?: NodeLengthSpread): (bp: number) => number;
28
29
  export { MEAN_NODE_LENGTH };
@@ -3,7 +3,7 @@ export interface MergedRuns {
3
3
  graph: Graph;
4
4
  runs: Map<string, string[]>;
5
5
  }
6
- export declare function mergeRuns(graph: Graph): MergedRuns;
6
+ export declare function mergeRuns(graph: Graph, alone?: ReadonlySet<string>): MergedRuns;
7
7
  export declare function splitRuns(positions: Record<string, NodeSegment[]>, runs: Map<string, string[]>, weightOf: (id: string) => number): Record<string, NodeSegment[]>;
8
8
  export declare function polylineSlice(line: NodeSegment[], from: number, to: number): NodeSegment[];
9
9
  export declare function polylineMidpoint(line: NodeSegment[]): NodeSegment;
@@ -50,6 +50,7 @@ export interface RowGene {
50
50
  }[];
51
51
  }
52
52
  export declare function placeRowGenes(rows: WalkRow[], byRow: Map<string, GeneModel[]>): Map<string, RowGene[]>;
53
+ export declare function boxesGenes(rowPx: number, barPx: number): boolean;
53
54
  export interface GeneBox {
54
55
  name: string;
55
56
  x: number;
@@ -66,7 +67,10 @@ export interface GeneBox {
66
67
  size: number;
67
68
  };
68
69
  }
69
- export declare function rowGeneBoxes(genes: RowGene[], X: (offset: number) => number, y: number): GeneBox[];
70
+ export declare function rowGeneBoxes(genes: RowGene[], X: (offset: number) => number, y: number, { rowPx, barPx }?: {
71
+ rowPx?: number | undefined;
72
+ barPx?: number | undefined;
73
+ }): GeneBox[];
70
74
  export type KeySwatch = {
71
75
  kind: 'bar';
72
76
  fill: string;
@@ -82,6 +86,7 @@ export interface KeyEntry {
82
86
  note?: true;
83
87
  }
84
88
  export interface GeneGaps {
89
+ crowded?: boolean;
85
90
  untracked: number;
86
91
  unplaced?: number;
87
92
  unread: number;
@@ -114,7 +119,11 @@ export interface WalkRowsFrame {
114
119
  translateY: number;
115
120
  width: number;
116
121
  height: number;
122
+ rowPx?: number;
123
+ barPx?: number;
124
+ readouts?: boolean;
117
125
  }
126
+ export declare function coalesceRuns(runs: WalkRun[], pxPerBp: number): WalkRun[];
118
127
  export declare function walkRowsTree(bars: WalkRowsWithCalls, frame: WalkRowsFrame, o?: {
119
128
  ramp?: {
120
129
  start: number;
@@ -0,0 +1,32 @@
1
+ import type { GeneGaps, WalkRowsFrame } from './walkRowDraw.js';
2
+ import type { WalkRow, WalkRows } from './walkRows.js';
3
+ import type { Graph, GraphNode } from '../types.js';
4
+ export declare const WALK_STRIP_CEILING_PX = 260;
5
+ export declare const LABELLED_ROW_PX = 12;
6
+ export interface StripMark {
7
+ row: string;
8
+ start: number;
9
+ bp: number;
10
+ }
11
+ export declare function stripMarks(graph: Graph, rows: WalkRow[], node: GraphNode): StripMark[];
12
+ export declare function segmentAt(graph: Graph, row: WalkRow, offset: number, pxPerBp: number): string | undefined;
13
+ export interface StripFrame extends WalkRowsFrame {
14
+ rowPx: number;
15
+ barPx: number;
16
+ readouts: boolean;
17
+ labelled: boolean;
18
+ boxesGenes: boolean;
19
+ }
20
+ export declare function walkStripFrame(bars: WalkRows, o: {
21
+ width: number;
22
+ maxHeight?: number;
23
+ labelPx?: number;
24
+ }): StripFrame;
25
+ export declare function stripRowAt(bars: WalkRows, frame: StripFrame, x: number, y: number): {
26
+ index: number;
27
+ row: WalkRow;
28
+ offset: number;
29
+ } | undefined;
30
+ export declare function walkMarksTree(bars: WalkRows, frame: StripFrame, marks: StripMark[]): import("../index.js").El;
31
+ export declare function walkStripLabelsTree(bars: WalkRows, frame: StripFrame, bold?: ReadonlySet<string>): import("../index.js").El;
32
+ export declare function stripGeneGaps(frame: StripFrame, gaps: GeneGaps | undefined): GeneGaps | undefined;
@@ -32,23 +32,26 @@ export declare function engineRequest(graph: Graph, scaling: LayoutScaling, sett
32
32
  export declare function engineKey(graph: Graph, settings: EngineSettings): string;
33
33
  export declare function forceLayout(graph: Graph, settings: EngineSettings, engine: LayoutEngine): Promise<{
34
34
  result: {
35
- nodePositions: Record<string, NodeSegment[]>;
36
- rowLabels?: import("./types.js").RowLabel[];
37
- sampleRows?: string[];
38
- alleleDeletions?: import("./types.js").AlleleDeletion[];
39
- referenceAxis?: boolean;
40
- pixelRows?: boolean;
35
+ deletionRoutes?: import("./layout/deletionRoutes.js").DeletionRoutes | undefined;
41
36
  extent?: {
42
37
  minX?: number;
43
38
  minY?: number;
44
39
  maxX?: number;
45
40
  maxY?: number;
46
41
  };
42
+ nodePositions: {
43
+ [x: string]: NodeSegment[];
44
+ };
45
+ rowLabels?: import("./types.js").RowLabel[];
46
+ sampleRows?: string[];
47
+ alleleDeletions?: import("./types.js").AlleleDeletion[];
48
+ referenceAxis?: boolean;
49
+ pixelRows?: boolean;
47
50
  tubeMap?: import("./index.js").TubeMapDrawing;
48
51
  };
49
52
  duration: number;
50
53
  }>;
51
- export declare function layoutExtent(nodePositions: Record<string, NodeSegment[]>): Bounds;
54
+ export declare function layoutExtent(nodePositions: Record<string | number, NodeSegment[]>): Bounds;
52
55
  export declare const FIT_PADDING = 40;
53
56
  export declare function clampZoom(zoom: number): number;
54
57
  export declare function fittedTranslateY(bounds: {
@@ -1,4 +1,5 @@
1
1
  import type { ResolvedColorScheme } from '../colorSchemes.js';
2
+ import type { DeletionRoutes } from '../layout/deletionRoutes.js';
2
3
  import type { NodeWidth } from '../nodeWidths.js';
3
4
  import type { Graph, GraphNode, NodeSegment } from '../types.js';
4
5
  import type { WalkLift } from '../walkHighlight.js';
@@ -27,6 +28,7 @@ export interface BuildOptions {
27
28
  };
28
29
  referenceRamp?: ReferenceRamp;
29
30
  deletions?: Map<number, string[]>;
31
+ deletionRoutes?: DeletionRoutes;
30
32
  hiddenEdges?: ReadonlySet<number>;
31
33
  version?: number;
32
34
  }
@@ -73,4 +73,5 @@ export interface LayoutResult {
73
73
  maxY?: number;
74
74
  };
75
75
  tubeMap?: TubeMapDrawing;
76
+ deletionRoutes?: Record<number, NodeSegment[]>;
76
77
  }
@@ -1,3 +1,4 @@
1
+ import type { DeletionRoutes } from '../layout/deletionRoutes.js';
1
2
  import type { Graph, NodeSegment } from '../types.js';
2
3
  import type { AxisScale } from './geometry.js';
3
4
  interface CellEntry {
@@ -18,7 +19,7 @@ export declare class EdgeSpatialIndex {
18
19
  private cellSize;
19
20
  private cells;
20
21
  private edgeCurves;
21
- constructor(nodePositions: Record<string, NodeSegment[]>, graph: Graph, drawPaths: boolean, axis: AxisScale, cellSize?: number | CellSize, deletions?: Map<number, string[]>, version?: number);
22
+ constructor(nodePositions: Record<string, NodeSegment[]>, graph: Graph, drawPaths: boolean, axis: AxisScale, cellSize?: number | CellSize, deletions?: Map<number, string[]>, version?: number, routes?: DeletionRoutes);
22
23
  getCurves(ei: number): import("./geometry.js").BezierCurve[] | undefined;
23
24
  query(x: number, y: number, radiusX: number, radiusY?: number): number[];
24
25
  }
@@ -1,4 +1,5 @@
1
+ import type { DeletionRoutes } from '../layout/deletionRoutes.js';
1
2
  import type { Graph, NodeSegment } from '../types.js';
2
3
  import type { AxisScale, BezierCurve } from './geometry.js';
3
4
  export type EdgeCurves = Map<number, BezierCurve[]>;
4
- export declare function baseEdgeCurves(nodePositions: Record<string, NodeSegment[]>, graph: Graph, axis: AxisScale, deletions: Map<number, string[]> | undefined, version: number): EdgeCurves;
5
+ export declare function baseEdgeCurves(nodePositions: Record<string, NodeSegment[]>, graph: Graph, axis: AxisScale, deletions: Map<number, string[]> | undefined, version: number, routes?: DeletionRoutes): EdgeCurves;
@@ -43,4 +43,5 @@ export declare function pathRibbonOffsets(fromSegments: NodeSegment[], toSegment
43
43
  export type SelfLink = boolean | Side;
44
44
  export declare function selfLinkOf(edge: GraphEdge): SelfLink;
45
45
  export declare function computeEdgeCurves(fromSegments: NodeSegment[], toSegments: NodeSegment[], selfLink: SelfLink, offsetX: number, offsetY: number, axis: AxisScale, bypassed?: NodeSegment[], maxBowIn?: number): BezierCurve[];
46
+ export declare function routedEdgeCurves(fromSegments: NodeSegment[], toSegments: NodeSegment[], route: NodeSegment[]): BezierCurve[];
46
47
  export {};
@@ -1,3 +1,4 @@
1
+ import type { DeletionRoutes } from '../layout/deletionRoutes.js';
1
2
  import type { Graph, NodeSegment } from '../types.js';
2
3
  import type { AxisScale } from './geometry.js';
3
4
  export declare function distanceToSegment(px: number, py: number, x1: number, y1: number, x2: number, y2: number): number;
@@ -7,4 +8,4 @@ export interface NodeInk {
7
8
  maxHalfWidthPx: number;
8
9
  }
9
10
  export declare function findHoveredNode(nodePositions: Record<string, NodeSegment[]>, graphX: number, graphY: number, axis: AxisScale, version?: number, ink?: NodeInk): string | null;
10
- export declare function findHoveredEdge(nodePositions: Record<string, NodeSegment[]>, graph: Graph, graphX: number, graphY: number, axis: AxisScale, drawPaths: boolean, version?: number, deletions?: Map<number, string[]>, hiddenEdges?: ReadonlySet<number>): number | null;
11
+ export declare function findHoveredEdge(nodePositions: Record<string, NodeSegment[]>, graph: Graph, graphX: number, graphY: number, axis: AxisScale, drawPaths: boolean, version?: number, deletions?: Map<number, string[]>, hiddenEdges?: ReadonlySet<number>, deletionRoutes?: DeletionRoutes): number | null;
@@ -1 +1 @@
1
- export declare const version = "4.2.0";
1
+ export declare const version = "4.4.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/bandage-core",
3
- "version": "4.2.0",
3
+ "version": "4.4.0",
4
4
  "description": "Pangenome graph layout and drawing with no host: GFA in, the Bandage force-directed engine and reference-anchored layouts, a Canvas2D renderer, hit testing and labels out",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "repository": {