@jbrowse/bandage-core 0.1.19 → 4.0.24

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.
@@ -0,0 +1,20 @@
1
+ import type { BubbleSpread } from '../bubbleSpreads.js';
2
+ import type { FigureOptions } from '../figure.js';
3
+ import type { LayoutModeValue } from '../layoutModes.js';
4
+ import type { WalkLayer } from '../walkEncoding.js';
5
+ export interface FigureSpec extends Omit<FigureOptions, 'walks' | 'region'> {
6
+ gfa?: string;
7
+ gbz?: {
8
+ db: string;
9
+ index?: string;
10
+ region: string;
11
+ haplotypes?: string[];
12
+ referenceSample?: string;
13
+ };
14
+ region?: string;
15
+ referencePath?: string;
16
+ layout?: LayoutModeValue;
17
+ quality?: number;
18
+ bubbleSpread?: BubbleSpread;
19
+ walks?: (string | WalkLayer)[];
20
+ }
@@ -19,3 +19,13 @@ export declare function facetGrid({ count, bounds, pixelRows, width, room, colum
19
19
  room: number;
20
20
  columns?: number;
21
21
  }): FacetGrid;
22
+ export type FacetBy = 'walk' | 'sample';
23
+ export declare function facetCells(names: string[], by: FacetBy): {
24
+ columns: undefined;
25
+ count: number;
26
+ cells: number[];
27
+ } | {
28
+ columns: number;
29
+ count: number;
30
+ cells: number[];
31
+ };
@@ -0,0 +1,24 @@
1
+ import type { ColorScheme } from './colorSchemes.js';
2
+ import type { FacetBy } from './facetGrid.js';
3
+ import type { NodeWidth } from './nodeWidths.js';
4
+ import type { Graph, LayoutResult } from './types.js';
5
+ import type { WalkLayer } from './walkEncoding.js';
6
+ export interface FigureOptions {
7
+ width?: number;
8
+ height?: number;
9
+ walks?: WalkLayer[];
10
+ facet?: 'none' | FacetBy;
11
+ columns?: number;
12
+ colorScheme?: ColorScheme;
13
+ nodeWidth?: NodeWidth;
14
+ showDeletionEdges?: boolean;
15
+ contigThickness?: number;
16
+ connectorThickness?: number;
17
+ region?: {
18
+ refName: string;
19
+ start: number;
20
+ end: number;
21
+ };
22
+ metadata?: string;
23
+ }
24
+ export declare function figureSvg(graph: Graph, layout: LayoutResult, o?: FigureOptions): string;
@@ -13,6 +13,10 @@ export interface GeneModel {
13
13
  export interface GenePin {
14
14
  gene: GeneModel;
15
15
  exons: string;
16
+ exonsByNode: {
17
+ nodeId: string;
18
+ d: string;
19
+ }[];
16
20
  at: NodeSegment;
17
21
  covered: number;
18
22
  }
@@ -33,11 +33,14 @@ export type { TubeMapColumn, TubeMapDrawing } from './layout/tubeMapLayout.js';
33
33
  export { deletionEdges } from './deletionEdges.js';
34
34
  export type { DeletionEdge } from './deletionEdges.js';
35
35
  export { facetLifts, walkHighlight, walkLift } from './walkHighlight.js';
36
- export { walkKey } from './walkKey.js';
37
- export { FACET_GAP_PX, FACET_PAD_PX, FACET_TITLE_PX, facetGrid, } from './facetGrid.js';
38
- export type { FacetGrid } from './facetGrid.js';
36
+ export { rangeText, walkKey } from './walkKey.js';
37
+ export { figureSvg } from './figure.js';
38
+ export type { FigureOptions } from './figure.js';
39
+ export { svgCanvas } from './renderer/svgCanvas.js';
40
+ export { FACET_GAP_PX, FACET_PAD_PX, FACET_TITLE_PX, facetCells, facetGrid, } from './facetGrid.js';
41
+ export type { FacetBy, FacetGrid } from './facetGrid.js';
39
42
  export type { LiftedWalk, WalkLift } from './walkHighlight.js';
40
- export { WALK_FIELDS, WALK_SCHEMES, encodingSwatchCss, resolveEncoding, schemeCss, } from './walkEncoding.js';
43
+ export { WALK_FIELDS, WALK_SCHEMES, encodingStops, encodingSwatchCss, resolveEncoding, schemeCss, } from './walkEncoding.js';
41
44
  export type { WalkEncoding, WalkField, WalkLayer, WalkScheme, } from './walkEncoding.js';
42
45
  export { pathColorsLegible, pathLegend } from './pathColors.js';
43
46
  export { bubblesFromGraph } from './bubbles/bubblesFromGraph.js';
@@ -50,7 +53,7 @@ export { walkRows } from './layout/walkRows.js';
50
53
  export type { WalkRows } from './layout/walkRows.js';
51
54
  export { walkRowsExtent } from './layout/walkRowLayout.js';
52
55
  export { ROW_HEIGHT_PX } from './layout/rowSpacing.js';
53
- export { HALO_FACTOR, LEGEND_INSET_PX, layoutLabels } from './labelLayout.js';
56
+ export { HALO_FACTOR, LEGEND_INSET_PX, geneCoverageNote, layoutLabels, } from './labelLayout.js';
54
57
  export type { LabelLayout, LabelLayoutSource } from './labelLayout.js';
55
58
  export { formatBp } from './graphLabels.js';
56
59
  export { genePins } from './genes/genePins.js';
@@ -45,4 +45,5 @@ export interface LabelLayout {
45
45
  }>[];
46
46
  sizes: GraphLabel[];
47
47
  }
48
+ export declare function geneCoverageNote(pin: GenePin): string | undefined;
48
49
  export declare function layoutLabels(m: LabelLayoutSource): LabelLayout;
@@ -13,6 +13,7 @@ export interface LabelCandidate<T> {
13
13
  y: number;
14
14
  text: string;
15
15
  stack?: number;
16
+ fallback?: string;
16
17
  }
17
18
  export interface PlacedLabel<T> extends LabelCandidate<T> {
18
19
  w: number;
@@ -1,19 +1,21 @@
1
1
  import type { ResolvedColorScheme } from './colorSchemes.js';
2
2
  import type { ReferenceRamp } from './renderer/GeometryBuilder.js';
3
3
  import type { Graph, NodeSegment } from './types.js';
4
- export declare const REFERENCE_STRIP_PX = 10;
4
+ export declare const REFERENCE_STRIP_PX = 12;
5
5
  export declare const REFERENCE_STRIP_ZONE_PX: number;
6
6
  export interface StripBlock {
7
7
  node: string;
8
8
  bp0: number;
9
9
  bp1: number;
10
- color: string;
10
+ colors: string[];
11
+ faded: boolean;
11
12
  }
12
- export declare function referenceStripBlocks(graph: Graph, { colorScheme, referenceRamp, walkNodes, walkColors, }: {
13
+ export declare function referenceStripBlocks(graph: Graph, { colorScheme, referenceRamp, walks, }: {
13
14
  colorScheme: ResolvedColorScheme;
14
15
  referenceRamp?: ReferenceRamp;
15
- walkNodes?: ReadonlySet<string>;
16
- walkColors?: ReadonlyMap<string, number>;
16
+ walks?: readonly {
17
+ colors: ReadonlyMap<string, number>;
18
+ }[];
17
19
  }): StripBlock[];
18
20
  export interface BpFrame {
19
21
  scale: number;
@@ -39,8 +41,15 @@ export interface StripLit {
39
41
  y: number;
40
42
  };
41
43
  }
42
- export declare function drawReferenceStrip(ctx: CanvasRenderingContext2D, blocks: readonly StripBlock[], frame: BpFrame, { width, lit, darkMode, }: {
44
+ export declare function stripPixels(blocks: readonly StripBlock[], frame: BpFrame, width: number, dpr: number): {
45
+ colors: string[];
46
+ x0: number;
47
+ x1: number;
48
+ tier: number;
49
+ }[];
50
+ export declare function drawReferenceStrip(ctx: CanvasRenderingContext2D, blocks: readonly StripBlock[], frame: BpFrame, { width, lit, darkMode, dpr, }: {
43
51
  width: number;
44
52
  lit?: StripLit;
45
53
  darkMode?: boolean;
54
+ dpr?: number;
46
55
  }): void;
@@ -0,0 +1,4 @@
1
+ export declare function svgCanvas(width: number, height: number): {
2
+ canvas: HTMLCanvasElement;
3
+ markup: () => string;
4
+ };
@@ -48,4 +48,8 @@ export declare function schemeCss(scheme: WalkScheme, t: number): string;
48
48
  export declare function schemeColor(scheme: WalkScheme, t: number): number;
49
49
  export declare function encodedColor({ field, scheme }: WalkEncoding, t?: number): number;
50
50
  export declare const NO_VALUE_COLOR: number;
51
- export declare function encodingSwatchCss({ field, scheme }: WalkEncoding): string;
51
+ export declare function encodingStops({ field, scheme }: WalkEncoding): {
52
+ offset: number;
53
+ color: string;
54
+ }[];
55
+ export declare function encodingSwatchCss(encoding: WalkEncoding): string;
@@ -1,4 +1,5 @@
1
1
  import type { LiftedWalk } from './walkHighlight.js';
2
+ export declare function rangeText(contig: string | undefined, start: number, end: number): string;
2
3
  export declare function walkKey(walk: LiftedWalk, reference?: {
3
4
  name?: string;
4
5
  start: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/bandage-core",
3
- "version": "0.1.19",
3
+ "version": "4.0.24",
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": {
@@ -24,6 +24,9 @@
24
24
  "publishConfig": {
25
25
  "access": "public"
26
26
  },
27
+ "bin": {
28
+ "bandage-figure": "dist/cli/figure.js"
29
+ },
27
30
  "files": [
28
31
  "dist"
29
32
  ],