@jbrowse/bandage-core 4.4.0 → 4.5.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.
@@ -5583,8 +5583,11 @@ function walkStripLabelsTree(bars, frame, bold = /* @__PURE__ */ new Set()) {
5583
5583
  )
5584
5584
  );
5585
5585
  }
5586
- function stripGeneGaps(frame, gaps) {
5587
- return gaps && !frame.boxesGenes ? { ...gaps, crowded: true } : gaps;
5586
+ function stripGeneGaps(frame, rowGenes, gaps) {
5587
+ if (!rowGenes?.size) {
5588
+ return void 0;
5589
+ }
5590
+ return frame.boxesGenes ? gaps : { untracked: 0, unread: 0, ...gaps, crowded: true };
5588
5591
  }
5589
5592
 
5590
5593
  // src/renderer/svgCanvas.ts
@@ -5700,7 +5703,7 @@ function svgCanvas(width, height) {
5700
5703
  }
5701
5704
 
5702
5705
  // src/version.ts
5703
- var version = "4.4.0";
5706
+ var version = "4.5.0";
5704
5707
 
5705
5708
  // src/viewport.ts
5706
5709
  function axisScaleOf(scale, pixelRows) {
@@ -5806,6 +5809,10 @@ function figureSvg(graph, layout, o = {}) {
5806
5809
  const nodeById = new Map(graph.nodes.map((node) => [node.id, node]));
5807
5810
  const colorScheme = resolveColorScheme(o.colorScheme ?? "auto", graph);
5808
5811
  const referenceRamp = colorScheme === "reference-position" && !layout.tubeMap ? computeReferenceRamp(graph, rampDomain) : void 0;
5812
+ const rampInterval = referenceRamp && {
5813
+ start: referenceRamp.start,
5814
+ end: referenceRamp.start + referenceRamp.span
5815
+ };
5809
5816
  const deletions = layout.tubeMap ? [] : deletionEdges(graph);
5810
5817
  const layers = o.walks ?? [];
5811
5818
  const walkRamp = layers.some((l) => l.color?.field === "reference") ? referenceRamp ?? computeReferenceRamp(graph, rampDomain) : void 0;
@@ -5872,10 +5879,7 @@ function figureSvg(graph, layout, o = {}) {
5872
5879
  rows,
5873
5880
  { ...t, width: w, height: h },
5874
5881
  {
5875
- ramp: referenceRamp && {
5876
- start: referenceRamp.start,
5877
- end: referenceRamp.start + referenceRamp.span
5878
- },
5882
+ ramp: rampInterval,
5879
5883
  rowGenes: o.rowGenes
5880
5884
  }
5881
5885
  )
@@ -5998,10 +6002,7 @@ function figureSvg(graph, layout, o = {}) {
5998
6002
  if (rows) {
5999
6003
  const key = walkRowsKeyTree(
6000
6004
  walkRowsKey(rows, {
6001
- ramp: referenceRamp && {
6002
- start: referenceRamp.start,
6003
- end: referenceRamp.start + referenceRamp.span
6004
- },
6005
+ ramp: rampInterval,
6005
6006
  genes: o.rowGenes?.size ? o.rowGeneGaps : void 0
6006
6007
  }),
6007
6008
  x,
@@ -6042,11 +6043,8 @@ function figureSvg(graph, layout, o = {}) {
6042
6043
  const frame = walkStripFrame(strip.rows, { width });
6043
6044
  const key = walkRowsKeyTree(
6044
6045
  walkRowsKey(strip.rows, {
6045
- ramp: referenceRamp && {
6046
- start: referenceRamp.start,
6047
- end: referenceRamp.start + referenceRamp.span
6048
- },
6049
- genes: strip.rowGenes?.size ? stripGeneGaps(frame, strip.rowGeneGaps) : void 0
6046
+ ramp: rampInterval,
6047
+ genes: stripGeneGaps(frame, strip.rowGenes, strip.rowGeneGaps)
6050
6048
  }),
6051
6049
  6,
6052
6050
  height + frame.height
@@ -6055,10 +6053,7 @@ function figureSvg(graph, layout, o = {}) {
6055
6053
  `<line x1="0" x2="${width}" y1="${height + 0.5}" y2="${height + 0.5}" stroke="#ddd"/>`,
6056
6054
  `<svg y="${height}" width="${width}" height="${frame.height}">${serializeEl(
6057
6055
  walkRowsTree(strip.rows, frame, {
6058
- ramp: referenceRamp && {
6059
- start: referenceRamp.start,
6060
- end: referenceRamp.start + referenceRamp.span
6061
- },
6056
+ ramp: rampInterval,
6062
6057
  rowGenes: strip.rowGenes,
6063
6058
  idPrefix: "strip"
6064
6059
  })
@@ -18,7 +18,7 @@ import {
18
18
  parseRegion,
19
19
  refNameBinding,
20
20
  walkRows
21
- } from "../chunks/chunk-YNLMROBC.js";
21
+ } from "../chunks/chunk-7KQ2IWLP.js";
22
22
 
23
23
  // src/cli/figure.ts
24
24
  import { access, open, readFile, writeFile } from "node:fs/promises";
@@ -139,8 +139,6 @@ async function renderSpec(spec, base) {
139
139
  checkLayout(spec.layout);
140
140
  const resolve = (location) => isUrl(location) ? location : path.resolve(base, location);
141
141
  let source;
142
- const mode = layoutModeByValue(spec.layout ?? "force");
143
- const strip = !!spec.walkStrip && mode.drawsNodes;
144
142
  if (spec.gbz) {
145
143
  const { db, index } = spec.gbz.db === "hprc" ? HPRC_GBZ : spec.gbz;
146
144
  const indexLocation = index ? resolve(index) : await siblingIndex(resolve(db));
@@ -149,8 +147,8 @@ async function renderSpec(spec, base) {
149
147
  byteSource(resolve(db)),
150
148
  indexLocation ? byteSource(indexLocation) : void 0
151
149
  ),
152
- // walk rows measure whole walks, which a cut only follows when asked
153
- mode.wholeWalks || strip ? { snarls: "overlapping", ...spec.gbz } : spec.gbz
150
+ // the strip measures whole walks, which a cut only follows when asked
151
+ spec.walkStrip ? { snarls: "overlapping", ...spec.gbz } : spec.gbz
154
152
  );
155
153
  source = { ...cut, name: `${cut.sample} ${spec.gbz.region}` };
156
154
  } else if (spec.gfa) {
@@ -165,7 +163,7 @@ async function renderSpec(spec, base) {
165
163
  const graph = loadGraph(source.text, source.name, {
166
164
  referencePath: spec.referencePath
167
165
  });
168
- const layout = mode.run(graph, source.region) ?? (await forceLayout(
166
+ const layout = layoutModeByValue(spec.layout ?? "force").run(graph, source.region) ?? (await forceLayout(
169
167
  graph,
170
168
  {
171
169
  quality: spec.quality ?? 2,
@@ -174,7 +172,7 @@ async function renderSpec(spec, base) {
174
172
  },
175
173
  engine
176
174
  )).result;
177
- const stripRows = strip ? walkRows(graph, source.region) : void 0;
175
+ const stripRows = spec.walkStrip ? walkRows(graph, source.region) : void 0;
178
176
  return figureSvg(graph, layout, {
179
177
  ...spec,
180
178
  walkStrip: stripRows && { rows: stripRows },
package/dist/index.js CHANGED
@@ -136,7 +136,7 @@ import {
136
136
  wellKnownSample,
137
137
  yToXOf,
138
138
  zoomAbout
139
- } from "./chunks/chunk-YNLMROBC.js";
139
+ } from "./chunks/chunk-7KQ2IWLP.js";
140
140
 
141
141
  // src/index.ts
142
142
  import { getDpr } from "@jbrowse/render-core/canvas2dUtils";
@@ -1,4 +1,4 @@
1
- import type { GeneGaps, WalkRowsFrame } from './walkRowDraw.js';
1
+ import type { GeneGaps, RowGene, WalkRowsFrame } from './walkRowDraw.js';
2
2
  import type { WalkRow, WalkRows } from './walkRows.js';
3
3
  import type { Graph, GraphNode } from '../types.js';
4
4
  export declare const WALK_STRIP_CEILING_PX = 260;
@@ -29,4 +29,4 @@ export declare function stripRowAt(bars: WalkRows, frame: StripFrame, x: number,
29
29
  } | undefined;
30
30
  export declare function walkMarksTree(bars: WalkRows, frame: StripFrame, marks: StripMark[]): import("../index.js").El;
31
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
+ export declare function stripGeneGaps(frame: StripFrame, rowGenes: Map<string, RowGene[]> | undefined, gaps: GeneGaps | undefined): GeneGaps | undefined;
@@ -46,5 +46,6 @@ export interface Renderer {
46
46
  setEdgeHighlight(edgeIndex: number | null, factor: number): void;
47
47
  updateTransform(transform: TransformUniform): void;
48
48
  render(clearColor: [number, number, number, number]): void;
49
+ releaseOffscreenTargets(): void;
49
50
  dispose(): void;
50
51
  }
@@ -1 +1 @@
1
- export declare const version = "4.4.0";
1
+ export declare const version = "4.5.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/bandage-core",
3
- "version": "4.4.0",
3
+ "version": "4.5.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": {
@@ -32,10 +32,10 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "@gmod/gbz-base": "^6.0.1",
35
- "@gmod/tabix": "^3.9.0",
35
+ "@gmod/tabix": "^3.9.1",
36
36
  "@gmod/tubemap-core": "^0.1.0",
37
- "@jbrowse/core": "5.0.0-beta.9",
38
- "@jbrowse/render-core": "5.0.0-beta.9"
37
+ "@jbrowse/core": "5.0.0-beta.11",
38
+ "@jbrowse/render-core": "5.0.0-beta.11"
39
39
  },
40
40
  "devDependencies": {
41
41
  "esbuild": "^0.28.2",