@jbrowse/plugin-dotplot-view 2.6.1
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/LICENSE +201 -0
- package/dist/ComparativeRenderer/index.d.ts +27 -0
- package/dist/ComparativeRenderer/index.js +59 -0
- package/dist/ComparativeRenderer/index.js.map +1 -0
- package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +8 -0
- package/dist/DotplotDisplay/components/DotplotDisplay.js +24 -0
- package/dist/DotplotDisplay/components/DotplotDisplay.js.map +1 -0
- package/dist/DotplotDisplay/index.d.ts +12 -0
- package/dist/DotplotDisplay/index.js +48 -0
- package/dist/DotplotDisplay/index.js.map +1 -0
- package/dist/DotplotDisplay/renderDotplotBlock.d.ts +11 -0
- package/dist/DotplotDisplay/renderDotplotBlock.js +57 -0
- package/dist/DotplotDisplay/renderDotplotBlock.js.map +1 -0
- package/dist/DotplotDisplay/stateModelFactory.d.ts +138 -0
- package/dist/DotplotDisplay/stateModelFactory.js +165 -0
- package/dist/DotplotDisplay/stateModelFactory.js.map +1 -0
- package/dist/DotplotReadVsRef/DotplotReadVsRef.d.ts +3 -0
- package/dist/DotplotReadVsRef/DotplotReadVsRef.js +102 -0
- package/dist/DotplotReadVsRef/DotplotReadVsRef.js.map +1 -0
- package/dist/DotplotReadVsRef/index.d.ts +2 -0
- package/dist/DotplotReadVsRef/index.js +42 -0
- package/dist/DotplotReadVsRef/index.js.map +1 -0
- package/dist/DotplotRenderer/ComparativeRenderRpc.d.ts +27 -0
- package/dist/DotplotRenderer/ComparativeRenderRpc.js +59 -0
- package/dist/DotplotRenderer/ComparativeRenderRpc.js.map +1 -0
- package/dist/DotplotRenderer/DotplotRenderer.d.ts +69 -0
- package/dist/DotplotRenderer/DotplotRenderer.js +274 -0
- package/dist/DotplotRenderer/DotplotRenderer.js.map +1 -0
- package/dist/DotplotRenderer/components/DotplotRendering.d.ts +5 -0
- package/dist/DotplotRenderer/components/DotplotRendering.js +13 -0
- package/dist/DotplotRenderer/components/DotplotRendering.js.map +1 -0
- package/dist/DotplotRenderer/configSchema.d.ts +61 -0
- package/dist/DotplotRenderer/configSchema.js +83 -0
- package/dist/DotplotRenderer/configSchema.js.map +1 -0
- package/dist/DotplotRenderer/index.d.ts +3 -0
- package/dist/DotplotRenderer/index.js +17 -0
- package/dist/DotplotRenderer/index.js.map +1 -0
- package/dist/DotplotView/1dview.d.ts +307 -0
- package/dist/DotplotView/1dview.js +95 -0
- package/dist/DotplotView/1dview.js.map +1 -0
- package/dist/DotplotView/blockTypes.d.ts +61 -0
- package/dist/DotplotView/blockTypes.js +117 -0
- package/dist/DotplotView/blockTypes.js.map +1 -0
- package/dist/DotplotView/components/Axes.d.ts +14 -0
- package/dist/DotplotView/components/Axes.js +127 -0
- package/dist/DotplotView/components/Axes.js.map +1 -0
- package/dist/DotplotView/components/CursorIcon.d.ts +4 -0
- package/dist/DotplotView/components/CursorIcon.js +19 -0
- package/dist/DotplotView/components/CursorIcon.js.map +1 -0
- package/dist/DotplotView/components/DotplotTooltip.d.ts +19 -0
- package/dist/DotplotView/components/DotplotTooltip.js +128 -0
- package/dist/DotplotView/components/DotplotTooltip.js.map +1 -0
- package/dist/DotplotView/components/DotplotView.d.ts +6 -0
- package/dist/DotplotView/components/DotplotView.js +272 -0
- package/dist/DotplotView/components/DotplotView.js.map +1 -0
- package/dist/DotplotView/components/DotplotWarnings.d.ts +6 -0
- package/dist/DotplotView/components/DotplotWarnings.js +40 -0
- package/dist/DotplotView/components/DotplotWarnings.js.map +1 -0
- package/dist/DotplotView/components/ExportSvgDialog.d.ts +8 -0
- package/dist/DotplotView/components/ExportSvgDialog.js +76 -0
- package/dist/DotplotView/components/ExportSvgDialog.js.map +1 -0
- package/dist/DotplotView/components/Grid.d.ts +10 -0
- package/dist/DotplotView/components/Grid.js +60 -0
- package/dist/DotplotView/components/Grid.js.map +1 -0
- package/dist/DotplotView/components/Header.d.ts +10 -0
- package/dist/DotplotView/components/Header.js +168 -0
- package/dist/DotplotView/components/Header.js.map +1 -0
- package/dist/DotplotView/components/ImportCustomTrack.d.ts +11 -0
- package/dist/DotplotView/components/ImportCustomTrack.js +180 -0
- package/dist/DotplotView/components/ImportCustomTrack.js.map +1 -0
- package/dist/DotplotView/components/ImportForm.d.ts +6 -0
- package/dist/DotplotView/components/ImportForm.js +121 -0
- package/dist/DotplotView/components/ImportForm.js.map +1 -0
- package/dist/DotplotView/components/ImportSyntenyTrackSelector.d.ts +9 -0
- package/dist/DotplotView/components/ImportSyntenyTrackSelector.js +69 -0
- package/dist/DotplotView/components/ImportSyntenyTrackSelector.js.map +1 -0
- package/dist/DotplotView/components/PanButtons.d.ts +6 -0
- package/dist/DotplotView/components/PanButtons.js +60 -0
- package/dist/DotplotView/components/PanButtons.js.map +1 -0
- package/dist/DotplotView/components/WarningDialog.d.ts +16 -0
- package/dist/DotplotView/components/WarningDialog.js +41 -0
- package/dist/DotplotView/components/WarningDialog.js.map +1 -0
- package/dist/DotplotView/components/util.d.ts +19 -0
- package/dist/DotplotView/components/util.js +90 -0
- package/dist/DotplotView/components/util.js.map +1 -0
- package/dist/DotplotView/index.d.ts +2 -0
- package/dist/DotplotView/index.js +44 -0
- package/dist/DotplotView/index.js.map +1 -0
- package/dist/DotplotView/model.d.ts +616 -0
- package/dist/DotplotView/model.js +647 -0
- package/dist/DotplotView/model.js.map +1 -0
- package/dist/DotplotView/svgcomponents/SVGBackground.d.ts +5 -0
- package/dist/DotplotView/svgcomponents/SVGBackground.js +13 -0
- package/dist/DotplotView/svgcomponents/SVGBackground.js.map +1 -0
- package/dist/DotplotView/svgcomponents/SVGDotplotView.d.ts +2 -0
- package/dist/DotplotView/svgcomponents/SVGDotplotView.js +47 -0
- package/dist/DotplotView/svgcomponents/SVGDotplotView.js.map +1 -0
- package/dist/LaunchDotplotView.d.ts +2 -0
- package/dist/LaunchDotplotView.js +45 -0
- package/dist/LaunchDotplotView.js.map +1 -0
- package/dist/ServerSideRenderedBlockContent.d.ts +12 -0
- package/dist/ServerSideRenderedBlockContent.js +87 -0
- package/dist/ServerSideRenderedBlockContent.js.map +1 -0
- package/dist/ServerSideSyntenyRendering.d.ts +23 -0
- package/dist/ServerSideSyntenyRendering.js +54 -0
- package/dist/ServerSideSyntenyRendering.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/util.d.ts +9 -0
- package/dist/util.js +9 -0
- package/dist/util.js.map +1 -0
- package/esm/ComparativeRenderer/index.d.ts +27 -0
- package/esm/ComparativeRenderer/index.js +53 -0
- package/esm/ComparativeRenderer/index.js.map +1 -0
- package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +8 -0
- package/esm/DotplotDisplay/components/DotplotDisplay.js +19 -0
- package/esm/DotplotDisplay/components/DotplotDisplay.js.map +1 -0
- package/esm/DotplotDisplay/index.d.ts +12 -0
- package/esm/DotplotDisplay/index.js +41 -0
- package/esm/DotplotDisplay/index.js.map +1 -0
- package/esm/DotplotDisplay/renderDotplotBlock.d.ts +11 -0
- package/esm/DotplotDisplay/renderDotplotBlock.js +49 -0
- package/esm/DotplotDisplay/renderDotplotBlock.js.map +1 -0
- package/esm/DotplotDisplay/stateModelFactory.d.ts +138 -0
- package/esm/DotplotDisplay/stateModelFactory.js +158 -0
- package/esm/DotplotDisplay/stateModelFactory.js.map +1 -0
- package/esm/DotplotReadVsRef/DotplotReadVsRef.d.ts +3 -0
- package/esm/DotplotReadVsRef/DotplotReadVsRef.js +98 -0
- package/esm/DotplotReadVsRef/DotplotReadVsRef.js.map +1 -0
- package/esm/DotplotReadVsRef/index.d.ts +2 -0
- package/esm/DotplotReadVsRef/index.js +36 -0
- package/esm/DotplotReadVsRef/index.js.map +1 -0
- package/esm/DotplotRenderer/ComparativeRenderRpc.d.ts +27 -0
- package/esm/DotplotRenderer/ComparativeRenderRpc.js +53 -0
- package/esm/DotplotRenderer/ComparativeRenderRpc.js.map +1 -0
- package/esm/DotplotRenderer/DotplotRenderer.d.ts +69 -0
- package/esm/DotplotRenderer/DotplotRenderer.js +268 -0
- package/esm/DotplotRenderer/DotplotRenderer.js.map +1 -0
- package/esm/DotplotRenderer/components/DotplotRendering.d.ts +5 -0
- package/esm/DotplotRenderer/components/DotplotRendering.js +8 -0
- package/esm/DotplotRenderer/components/DotplotRendering.js.map +1 -0
- package/esm/DotplotRenderer/configSchema.d.ts +61 -0
- package/esm/DotplotRenderer/configSchema.js +81 -0
- package/esm/DotplotRenderer/configSchema.js.map +1 -0
- package/esm/DotplotRenderer/index.d.ts +3 -0
- package/esm/DotplotRenderer/index.js +12 -0
- package/esm/DotplotRenderer/index.js.map +1 -0
- package/esm/DotplotView/1dview.d.ts +307 -0
- package/esm/DotplotView/1dview.js +87 -0
- package/esm/DotplotView/1dview.js.map +1 -0
- package/esm/DotplotView/blockTypes.d.ts +61 -0
- package/esm/DotplotView/blockTypes.js +109 -0
- package/esm/DotplotView/blockTypes.js.map +1 -0
- package/esm/DotplotView/components/Axes.d.ts +14 -0
- package/esm/DotplotView/components/Axes.js +121 -0
- package/esm/DotplotView/components/Axes.js.map +1 -0
- package/esm/DotplotView/components/CursorIcon.d.ts +4 -0
- package/esm/DotplotView/components/CursorIcon.js +11 -0
- package/esm/DotplotView/components/CursorIcon.js.map +1 -0
- package/esm/DotplotView/components/DotplotTooltip.d.ts +19 -0
- package/esm/DotplotView/components/DotplotTooltip.js +101 -0
- package/esm/DotplotView/components/DotplotTooltip.js.map +1 -0
- package/esm/DotplotView/components/DotplotView.d.ts +6 -0
- package/esm/DotplotView/components/DotplotView.js +244 -0
- package/esm/DotplotView/components/DotplotView.js.map +1 -0
- package/esm/DotplotView/components/DotplotWarnings.d.ts +6 -0
- package/esm/DotplotView/components/DotplotWarnings.js +15 -0
- package/esm/DotplotView/components/DotplotWarnings.js.map +1 -0
- package/esm/DotplotView/components/ExportSvgDialog.d.ts +8 -0
- package/esm/DotplotView/components/ExportSvgDialog.js +50 -0
- package/esm/DotplotView/components/ExportSvgDialog.js.map +1 -0
- package/esm/DotplotView/components/Grid.d.ts +10 -0
- package/esm/DotplotView/components/Grid.js +53 -0
- package/esm/DotplotView/components/Grid.js.map +1 -0
- package/esm/DotplotView/components/Header.d.ts +10 -0
- package/esm/DotplotView/components/Header.js +140 -0
- package/esm/DotplotView/components/Header.js.map +1 -0
- package/esm/DotplotView/components/ImportCustomTrack.d.ts +11 -0
- package/esm/DotplotView/components/ImportCustomTrack.js +152 -0
- package/esm/DotplotView/components/ImportCustomTrack.js.map +1 -0
- package/esm/DotplotView/components/ImportForm.d.ts +6 -0
- package/esm/DotplotView/components/ImportForm.js +93 -0
- package/esm/DotplotView/components/ImportForm.js.map +1 -0
- package/esm/DotplotView/components/ImportSyntenyTrackSelector.d.ts +9 -0
- package/esm/DotplotView/components/ImportSyntenyTrackSelector.js +44 -0
- package/esm/DotplotView/components/ImportSyntenyTrackSelector.js.map +1 -0
- package/esm/DotplotView/components/PanButtons.d.ts +6 -0
- package/esm/DotplotView/components/PanButtons.js +55 -0
- package/esm/DotplotView/components/PanButtons.js.map +1 -0
- package/esm/DotplotView/components/WarningDialog.d.ts +16 -0
- package/esm/DotplotView/components/WarningDialog.js +36 -0
- package/esm/DotplotView/components/WarningDialog.js.map +1 -0
- package/esm/DotplotView/components/util.d.ts +19 -0
- package/esm/DotplotView/components/util.js +83 -0
- package/esm/DotplotView/components/util.js.map +1 -0
- package/esm/DotplotView/index.d.ts +2 -0
- package/esm/DotplotView/index.js +15 -0
- package/esm/DotplotView/index.js.map +1 -0
- package/esm/DotplotView/model.d.ts +616 -0
- package/esm/DotplotView/model.js +616 -0
- package/esm/DotplotView/model.js.map +1 -0
- package/esm/DotplotView/svgcomponents/SVGBackground.d.ts +5 -0
- package/esm/DotplotView/svgcomponents/SVGBackground.js +7 -0
- package/esm/DotplotView/svgcomponents/SVGBackground.js.map +1 -0
- package/esm/DotplotView/svgcomponents/SVGDotplotView.d.ts +2 -0
- package/esm/DotplotView/svgcomponents/SVGDotplotView.js +40 -0
- package/esm/DotplotView/svgcomponents/SVGDotplotView.js.map +1 -0
- package/esm/LaunchDotplotView.d.ts +2 -0
- package/esm/LaunchDotplotView.js +42 -0
- package/esm/LaunchDotplotView.js.map +1 -0
- package/esm/ServerSideRenderedBlockContent.d.ts +12 -0
- package/esm/ServerSideRenderedBlockContent.js +62 -0
- package/esm/ServerSideRenderedBlockContent.js.map +1 -0
- package/esm/ServerSideSyntenyRendering.d.ts +23 -0
- package/esm/ServerSideSyntenyRendering.js +29 -0
- package/esm/ServerSideSyntenyRendering.js.map +1 -0
- package/esm/index.d.ts +7 -0
- package/esm/index.js +38 -0
- package/esm/index.js.map +1 -0
- package/esm/util.d.ts +9 -0
- package/esm/util.js +5 -0
- package/esm/util.js.map +1 -0
- package/package.json +69 -0
- package/src/ComparativeRenderer/index.ts +87 -0
- package/src/DotplotDisplay/components/DotplotDisplay.tsx +34 -0
- package/src/DotplotDisplay/index.ts +48 -0
- package/src/DotplotDisplay/renderDotplotBlock.ts +60 -0
- package/src/DotplotDisplay/stateModelFactory.tsx +196 -0
- package/src/DotplotReadVsRef/DotplotReadVsRef.ts +115 -0
- package/src/DotplotReadVsRef/index.ts +50 -0
- package/src/DotplotRenderer/ComparativeRenderRpc.ts +87 -0
- package/src/DotplotRenderer/DotplotRenderer.ts +328 -0
- package/src/DotplotRenderer/__image_snapshots__/linear-synteny-renderer-test-ts-test-rendering-a-simple-synteny-from-fake-data-1-snap.png +0 -0
- package/src/DotplotRenderer/components/DotplotRendering.tsx +12 -0
- package/src/DotplotRenderer/configSchema.ts +92 -0
- package/src/DotplotRenderer/index.ts +16 -0
- package/src/DotplotView/1dview.ts +98 -0
- package/src/DotplotView/blockTypes.ts +140 -0
- package/src/DotplotView/components/Axes.tsx +246 -0
- package/src/DotplotView/components/CursorIcon.tsx +24 -0
- package/src/DotplotView/components/DotplotTooltip.tsx +163 -0
- package/src/DotplotView/components/DotplotView.tsx +348 -0
- package/src/DotplotView/components/DotplotWarnings.tsx +26 -0
- package/src/DotplotView/components/ExportSvgDialog.tsx +129 -0
- package/src/DotplotView/components/Grid.tsx +112 -0
- package/src/DotplotView/components/Header.tsx +182 -0
- package/src/DotplotView/components/ImportCustomTrack.tsx +262 -0
- package/src/DotplotView/components/ImportForm.tsx +209 -0
- package/src/DotplotView/components/ImportSyntenyTrackSelector.tsx +90 -0
- package/src/DotplotView/components/PanButtons.tsx +93 -0
- package/src/DotplotView/components/WarningDialog.tsx +74 -0
- package/src/DotplotView/components/util.ts +118 -0
- package/src/DotplotView/index.ts +16 -0
- package/src/DotplotView/model.test.ts +17 -0
- package/src/DotplotView/model.ts +719 -0
- package/src/DotplotView/svgcomponents/SVGBackground.tsx +21 -0
- package/src/DotplotView/svgcomponents/SVGDotplotView.tsx +68 -0
- package/src/LaunchDotplotView.ts +63 -0
- package/src/ServerSideRenderedBlockContent.tsx +86 -0
- package/src/ServerSideSyntenyRendering.tsx +54 -0
- package/src/index.ts +41 -0
- package/src/util.ts +14 -0
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { Instance } from 'mobx-state-tree';
|
|
2
|
+
declare const Dotplot1DView: import("mobx-state-tree").IModelType<{
|
|
3
|
+
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
4
|
+
displayedRegions: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
5
|
+
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
6
|
+
start: import("mobx-state-tree").ISimpleType<number>;
|
|
7
|
+
end: import("mobx-state-tree").ISimpleType<number>;
|
|
8
|
+
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
9
|
+
} & {
|
|
10
|
+
assemblyName: import("mobx-state-tree").ISimpleType<string>; /**
|
|
11
|
+
* #getter
|
|
12
|
+
*/
|
|
13
|
+
}, {
|
|
14
|
+
setRefName(newRefName: string): void;
|
|
15
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
16
|
+
bpPerPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
17
|
+
offsetPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
18
|
+
interRegionPaddingWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
19
|
+
minimumBlockWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
20
|
+
}, {
|
|
21
|
+
features: import("@jbrowse/core/util").Feature[] | undefined;
|
|
22
|
+
volatileWidth: number;
|
|
23
|
+
} & {
|
|
24
|
+
setDisplayedRegions(regions: import("@jbrowse/core/util").Region[]): void;
|
|
25
|
+
setBpPerPx(val: number): void;
|
|
26
|
+
setVolatileWidth(width: number): void;
|
|
27
|
+
} & {
|
|
28
|
+
readonly width: number;
|
|
29
|
+
readonly assemblyNames: string[];
|
|
30
|
+
readonly displayedRegionsTotalPx: number;
|
|
31
|
+
readonly maxOffset: number;
|
|
32
|
+
readonly minOffset: number;
|
|
33
|
+
readonly totalBp: number;
|
|
34
|
+
} & {
|
|
35
|
+
readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
36
|
+
readonly staticBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
37
|
+
readonly currBp: number;
|
|
38
|
+
} & {
|
|
39
|
+
pxToBp(px: number): {
|
|
40
|
+
coord: number;
|
|
41
|
+
index: number;
|
|
42
|
+
refName: string;
|
|
43
|
+
oob: boolean;
|
|
44
|
+
assemblyName: string;
|
|
45
|
+
offset: number;
|
|
46
|
+
start: number;
|
|
47
|
+
end: number;
|
|
48
|
+
reversed: boolean;
|
|
49
|
+
};
|
|
50
|
+
bpToPx({ refName, coord, regionNumber, }: {
|
|
51
|
+
refName: string;
|
|
52
|
+
coord: number;
|
|
53
|
+
regionNumber?: number | undefined;
|
|
54
|
+
}): number | undefined;
|
|
55
|
+
} & {
|
|
56
|
+
setFeatures(features: import("@jbrowse/core/util").Feature[]): void;
|
|
57
|
+
showAllRegions(): void;
|
|
58
|
+
zoomOut(): void;
|
|
59
|
+
zoomIn(): void;
|
|
60
|
+
zoomTo(bpPerPx: number, offset?: number | undefined): number;
|
|
61
|
+
scrollTo(offsetPx: number): number;
|
|
62
|
+
centerAt(coord: number, refName: string | undefined, regionNumber: number): void;
|
|
63
|
+
scroll(distance: number): number;
|
|
64
|
+
} & {
|
|
65
|
+
moveTo(start?: import("@jbrowse/core/util/Base1DUtils").BpOffset | undefined, end?: import("@jbrowse/core/util/Base1DUtils").BpOffset | undefined): void;
|
|
66
|
+
} & {
|
|
67
|
+
/**
|
|
68
|
+
* #action
|
|
69
|
+
*/
|
|
70
|
+
setScaleFactor(n: number): void;
|
|
71
|
+
/**
|
|
72
|
+
* #action
|
|
73
|
+
*/
|
|
74
|
+
center(): void;
|
|
75
|
+
} & {
|
|
76
|
+
/**
|
|
77
|
+
* #getter
|
|
78
|
+
* this uses padding=false and elision=false
|
|
79
|
+
*/
|
|
80
|
+
readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
81
|
+
/**
|
|
82
|
+
* #getter
|
|
83
|
+
*/
|
|
84
|
+
readonly scaleFactor: number;
|
|
85
|
+
/**
|
|
86
|
+
* #getter
|
|
87
|
+
*/
|
|
88
|
+
readonly maxBpPerPx: number;
|
|
89
|
+
/**
|
|
90
|
+
* #getter
|
|
91
|
+
*/
|
|
92
|
+
readonly minBpPerPx: number;
|
|
93
|
+
/**
|
|
94
|
+
* #getter
|
|
95
|
+
*/
|
|
96
|
+
readonly maxOffset: number;
|
|
97
|
+
/**
|
|
98
|
+
* #getter
|
|
99
|
+
*/
|
|
100
|
+
readonly minOffset: number;
|
|
101
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
102
|
+
declare const DotplotHView: import("mobx-state-tree").IModelType<{
|
|
103
|
+
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
104
|
+
displayedRegions: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
105
|
+
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
106
|
+
start: import("mobx-state-tree").ISimpleType<number>;
|
|
107
|
+
end: import("mobx-state-tree").ISimpleType<number>;
|
|
108
|
+
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
109
|
+
} & {
|
|
110
|
+
assemblyName: import("mobx-state-tree").ISimpleType<string>; /**
|
|
111
|
+
* #getter
|
|
112
|
+
*/
|
|
113
|
+
}, {
|
|
114
|
+
setRefName(newRefName: string): void;
|
|
115
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
116
|
+
bpPerPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
117
|
+
offsetPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
118
|
+
interRegionPaddingWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
119
|
+
minimumBlockWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
120
|
+
}, {
|
|
121
|
+
features: import("@jbrowse/core/util").Feature[] | undefined;
|
|
122
|
+
volatileWidth: number;
|
|
123
|
+
} & {
|
|
124
|
+
setDisplayedRegions(regions: import("@jbrowse/core/util").Region[]): void;
|
|
125
|
+
setBpPerPx(val: number): void;
|
|
126
|
+
setVolatileWidth(width: number): void;
|
|
127
|
+
} & {
|
|
128
|
+
readonly width: number;
|
|
129
|
+
readonly assemblyNames: string[];
|
|
130
|
+
readonly displayedRegionsTotalPx: number;
|
|
131
|
+
readonly maxOffset: number;
|
|
132
|
+
readonly minOffset: number;
|
|
133
|
+
readonly totalBp: number;
|
|
134
|
+
} & {
|
|
135
|
+
readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
136
|
+
readonly staticBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
137
|
+
readonly currBp: number;
|
|
138
|
+
} & {
|
|
139
|
+
pxToBp(px: number): {
|
|
140
|
+
coord: number;
|
|
141
|
+
index: number;
|
|
142
|
+
refName: string;
|
|
143
|
+
oob: boolean;
|
|
144
|
+
assemblyName: string;
|
|
145
|
+
offset: number;
|
|
146
|
+
start: number;
|
|
147
|
+
end: number;
|
|
148
|
+
reversed: boolean;
|
|
149
|
+
};
|
|
150
|
+
bpToPx({ refName, coord, regionNumber, }: {
|
|
151
|
+
refName: string;
|
|
152
|
+
coord: number;
|
|
153
|
+
regionNumber?: number | undefined;
|
|
154
|
+
}): number | undefined;
|
|
155
|
+
} & {
|
|
156
|
+
setFeatures(features: import("@jbrowse/core/util").Feature[]): void;
|
|
157
|
+
showAllRegions(): void;
|
|
158
|
+
zoomOut(): void;
|
|
159
|
+
zoomIn(): void;
|
|
160
|
+
zoomTo(bpPerPx: number, offset?: number | undefined): number;
|
|
161
|
+
scrollTo(offsetPx: number): number;
|
|
162
|
+
centerAt(coord: number, refName: string | undefined, regionNumber: number): void;
|
|
163
|
+
scroll(distance: number): number;
|
|
164
|
+
} & {
|
|
165
|
+
moveTo(start?: import("@jbrowse/core/util/Base1DUtils").BpOffset | undefined, end?: import("@jbrowse/core/util/Base1DUtils").BpOffset | undefined): void;
|
|
166
|
+
} & {
|
|
167
|
+
/**
|
|
168
|
+
* #action
|
|
169
|
+
*/
|
|
170
|
+
setScaleFactor(n: number): void;
|
|
171
|
+
/**
|
|
172
|
+
* #action
|
|
173
|
+
*/
|
|
174
|
+
center(): void;
|
|
175
|
+
} & {
|
|
176
|
+
/**
|
|
177
|
+
* #getter
|
|
178
|
+
* this uses padding=false and elision=false
|
|
179
|
+
*/
|
|
180
|
+
readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
181
|
+
/**
|
|
182
|
+
* #getter
|
|
183
|
+
*/
|
|
184
|
+
readonly scaleFactor: number;
|
|
185
|
+
/**
|
|
186
|
+
* #getter
|
|
187
|
+
*/
|
|
188
|
+
readonly maxBpPerPx: number;
|
|
189
|
+
/**
|
|
190
|
+
* #getter
|
|
191
|
+
*/
|
|
192
|
+
readonly minBpPerPx: number;
|
|
193
|
+
/**
|
|
194
|
+
* #getter
|
|
195
|
+
*/
|
|
196
|
+
readonly maxOffset: number;
|
|
197
|
+
/**
|
|
198
|
+
* #getter
|
|
199
|
+
*/
|
|
200
|
+
readonly minOffset: number;
|
|
201
|
+
} & {
|
|
202
|
+
readonly width: any;
|
|
203
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
204
|
+
declare const DotplotVView: import("mobx-state-tree").IModelType<{
|
|
205
|
+
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
206
|
+
displayedRegions: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
207
|
+
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
208
|
+
start: import("mobx-state-tree").ISimpleType<number>;
|
|
209
|
+
end: import("mobx-state-tree").ISimpleType<number>;
|
|
210
|
+
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
211
|
+
} & {
|
|
212
|
+
assemblyName: import("mobx-state-tree").ISimpleType<string>; /**
|
|
213
|
+
* #getter
|
|
214
|
+
*/
|
|
215
|
+
}, {
|
|
216
|
+
setRefName(newRefName: string): void;
|
|
217
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
218
|
+
bpPerPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
219
|
+
offsetPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
220
|
+
interRegionPaddingWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
221
|
+
minimumBlockWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
222
|
+
}, {
|
|
223
|
+
features: import("@jbrowse/core/util").Feature[] | undefined;
|
|
224
|
+
volatileWidth: number;
|
|
225
|
+
} & {
|
|
226
|
+
setDisplayedRegions(regions: import("@jbrowse/core/util").Region[]): void;
|
|
227
|
+
setBpPerPx(val: number): void;
|
|
228
|
+
setVolatileWidth(width: number): void;
|
|
229
|
+
} & {
|
|
230
|
+
readonly width: number;
|
|
231
|
+
readonly assemblyNames: string[];
|
|
232
|
+
readonly displayedRegionsTotalPx: number;
|
|
233
|
+
readonly maxOffset: number;
|
|
234
|
+
readonly minOffset: number;
|
|
235
|
+
readonly totalBp: number;
|
|
236
|
+
} & {
|
|
237
|
+
readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
238
|
+
readonly staticBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
239
|
+
readonly currBp: number;
|
|
240
|
+
} & {
|
|
241
|
+
pxToBp(px: number): {
|
|
242
|
+
coord: number;
|
|
243
|
+
index: number;
|
|
244
|
+
refName: string;
|
|
245
|
+
oob: boolean;
|
|
246
|
+
assemblyName: string;
|
|
247
|
+
offset: number;
|
|
248
|
+
start: number;
|
|
249
|
+
end: number;
|
|
250
|
+
reversed: boolean;
|
|
251
|
+
};
|
|
252
|
+
bpToPx({ refName, coord, regionNumber, }: {
|
|
253
|
+
refName: string;
|
|
254
|
+
coord: number;
|
|
255
|
+
regionNumber?: number | undefined;
|
|
256
|
+
}): number | undefined;
|
|
257
|
+
} & {
|
|
258
|
+
setFeatures(features: import("@jbrowse/core/util").Feature[]): void;
|
|
259
|
+
showAllRegions(): void;
|
|
260
|
+
zoomOut(): void;
|
|
261
|
+
zoomIn(): void;
|
|
262
|
+
zoomTo(bpPerPx: number, offset?: number | undefined): number;
|
|
263
|
+
scrollTo(offsetPx: number): number;
|
|
264
|
+
centerAt(coord: number, refName: string | undefined, regionNumber: number): void;
|
|
265
|
+
scroll(distance: number): number;
|
|
266
|
+
} & {
|
|
267
|
+
moveTo(start?: import("@jbrowse/core/util/Base1DUtils").BpOffset | undefined, end?: import("@jbrowse/core/util/Base1DUtils").BpOffset | undefined): void;
|
|
268
|
+
} & {
|
|
269
|
+
/**
|
|
270
|
+
* #action
|
|
271
|
+
*/
|
|
272
|
+
setScaleFactor(n: number): void;
|
|
273
|
+
/**
|
|
274
|
+
* #action
|
|
275
|
+
*/
|
|
276
|
+
center(): void;
|
|
277
|
+
} & {
|
|
278
|
+
/**
|
|
279
|
+
* #getter
|
|
280
|
+
* this uses padding=false and elision=false
|
|
281
|
+
*/
|
|
282
|
+
readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
283
|
+
/**
|
|
284
|
+
* #getter
|
|
285
|
+
*/
|
|
286
|
+
readonly scaleFactor: number;
|
|
287
|
+
/**
|
|
288
|
+
* #getter
|
|
289
|
+
*/
|
|
290
|
+
readonly maxBpPerPx: number;
|
|
291
|
+
/**
|
|
292
|
+
* #getter
|
|
293
|
+
*/
|
|
294
|
+
readonly minBpPerPx: number;
|
|
295
|
+
/**
|
|
296
|
+
* #getter
|
|
297
|
+
*/
|
|
298
|
+
readonly maxOffset: number;
|
|
299
|
+
/**
|
|
300
|
+
* #getter
|
|
301
|
+
*/
|
|
302
|
+
readonly minOffset: number;
|
|
303
|
+
} & {
|
|
304
|
+
readonly width: any;
|
|
305
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
306
|
+
export { DotplotVView, DotplotHView, Dotplot1DView };
|
|
307
|
+
export type Dotplot1DViewModel = Instance<typeof Dotplot1DView>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { getParent } from 'mobx-state-tree';
|
|
2
|
+
import { observable } from 'mobx';
|
|
3
|
+
import Base1DView from '@jbrowse/core/util/Base1DViewModel';
|
|
4
|
+
import calculateDynamicBlocks from '@jbrowse/core/util/calculateDynamicBlocks';
|
|
5
|
+
/**
|
|
6
|
+
* #stateModel Dotplot1DView
|
|
7
|
+
* ref https://mobx-state-tree.js.org/concepts/volatiles on volatile state used here
|
|
8
|
+
*/
|
|
9
|
+
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
10
|
+
const Dotplot1DView = Base1DView.extend(self => {
|
|
11
|
+
const scaleFactor = observable.box(1);
|
|
12
|
+
return {
|
|
13
|
+
views: {
|
|
14
|
+
/**
|
|
15
|
+
* #getter
|
|
16
|
+
* this uses padding=false and elision=false
|
|
17
|
+
*/
|
|
18
|
+
get dynamicBlocks() {
|
|
19
|
+
return calculateDynamicBlocks(self, false, false);
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* #getter
|
|
23
|
+
*/
|
|
24
|
+
get scaleFactor() {
|
|
25
|
+
return scaleFactor.get();
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* #getter
|
|
29
|
+
*/
|
|
30
|
+
get maxBpPerPx() {
|
|
31
|
+
return self.totalBp / (self.width - 50);
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* #getter
|
|
35
|
+
*/
|
|
36
|
+
get minBpPerPx() {
|
|
37
|
+
return 1 / 50;
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* #getter
|
|
41
|
+
*/
|
|
42
|
+
get maxOffset() {
|
|
43
|
+
return self.displayedRegionsTotalPx - self.width * 0.2;
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* #getter
|
|
47
|
+
*/
|
|
48
|
+
get minOffset() {
|
|
49
|
+
return -self.width * 0.8;
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
actions: {
|
|
53
|
+
/**
|
|
54
|
+
* #action
|
|
55
|
+
*/
|
|
56
|
+
setScaleFactor(n) {
|
|
57
|
+
scaleFactor.set(n);
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* #action
|
|
61
|
+
*/
|
|
62
|
+
center() {
|
|
63
|
+
const centerBp = self.totalBp / 2;
|
|
64
|
+
const centerPx = centerBp / self.bpPerPx;
|
|
65
|
+
self.scrollTo(centerPx - self.width / 2);
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
const DotplotHView = Dotplot1DView.extend(self => ({
|
|
71
|
+
views: {
|
|
72
|
+
get width() {
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74
|
+
return getParent(self).viewWidth;
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
}));
|
|
78
|
+
const DotplotVView = Dotplot1DView.extend(self => ({
|
|
79
|
+
views: {
|
|
80
|
+
get width() {
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
82
|
+
return getParent(self).viewHeight;
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
}));
|
|
86
|
+
export { DotplotVView, DotplotHView, Dotplot1DView };
|
|
87
|
+
//# sourceMappingURL=1dview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1dview.js","sourceRoot":"","sources":["../../src/DotplotView/1dview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAY,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AACjC,OAAO,UAAU,MAAM,oCAAoC,CAAA;AAC3D,OAAO,sBAAsB,MAAM,2CAA2C,CAAA;AAE9E;;;GAGG;AACH,SAAS,CAAC,KAAI,CAAC,CAAC,wDAAwD;AAExE,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;IAC7C,MAAM,WAAW,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IACrC,OAAO;QACL,KAAK,EAAE;YACL;;;eAGG;YACH,IAAI,aAAa;gBACf,OAAO,sBAAsB,CAAC,IAAI,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AAC,EAAE,CAAC,CAAC;IACjD,KAAK,EAAE;QACL,IAAI,KAAK;YACP,8DAA8D;YAC9D,OAAO,SAAS,CAAM,IAAI,CAAC,CAAC,UAAU,CAAA;QACxC,CAAC;KACF;CACF,CAAC,CAAC,CAAA;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
type Func<T> = (value: BaseBlock, index: number, array: BaseBlock[]) => T;
|
|
2
|
+
export declare class BlockSet {
|
|
3
|
+
blocks: BaseBlock[];
|
|
4
|
+
constructor(blocks?: BaseBlock[]);
|
|
5
|
+
push(block: BaseBlock): void;
|
|
6
|
+
getBlocks(): BaseBlock[];
|
|
7
|
+
map<T, U = this>(func: Func<T>, thisarg?: U): T[];
|
|
8
|
+
forEach<T, U = this>(func: Func<T>, thisarg?: U): void;
|
|
9
|
+
get length(): number;
|
|
10
|
+
get totalWidthPx(): number;
|
|
11
|
+
get offsetPx(): number;
|
|
12
|
+
get contentBlocks(): BaseBlock[];
|
|
13
|
+
}
|
|
14
|
+
export declare class BaseBlock {
|
|
15
|
+
reversed?: boolean;
|
|
16
|
+
refName: string;
|
|
17
|
+
start: number;
|
|
18
|
+
end: number;
|
|
19
|
+
assemblyName: string;
|
|
20
|
+
key: string;
|
|
21
|
+
widthPx: number;
|
|
22
|
+
offsetPx: number;
|
|
23
|
+
/**
|
|
24
|
+
* a block that should be shown as filled with data
|
|
25
|
+
*/
|
|
26
|
+
constructor(data: any);
|
|
27
|
+
/**
|
|
28
|
+
* rename the reference sequence of this block and return a new one
|
|
29
|
+
*
|
|
30
|
+
* @param refName -
|
|
31
|
+
* @returns either a new block with a renamed reference sequence,
|
|
32
|
+
* or the same block, if the ref name is not actually different
|
|
33
|
+
*/
|
|
34
|
+
renameReference(refName: string): any;
|
|
35
|
+
toRegion(): {
|
|
36
|
+
refName: string;
|
|
37
|
+
start: number;
|
|
38
|
+
end: number;
|
|
39
|
+
assemblyName: string;
|
|
40
|
+
reversed: boolean | undefined;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export declare class ContentBlock extends BaseBlock {
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* marker block representing one or more blocks that are
|
|
47
|
+
* too small to be shown at the current zoom level
|
|
48
|
+
*/
|
|
49
|
+
export declare class ElidedBlock extends BaseBlock {
|
|
50
|
+
widthPx: number;
|
|
51
|
+
elidedBlockCount: number;
|
|
52
|
+
constructor(data: Record<string, any>);
|
|
53
|
+
push(otherBlock: ElidedBlock): void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* marker block that sits between two different displayed regions
|
|
57
|
+
* and provides a thick border between them
|
|
58
|
+
*/
|
|
59
|
+
export declare class InterRegionPaddingBlock extends BaseBlock {
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export class BlockSet {
|
|
2
|
+
constructor(blocks = []) {
|
|
3
|
+
this.blocks = blocks;
|
|
4
|
+
}
|
|
5
|
+
push(block) {
|
|
6
|
+
if (block instanceof ElidedBlock && this.blocks.length > 0) {
|
|
7
|
+
const lastBlock = this.blocks.at(-1);
|
|
8
|
+
if (lastBlock instanceof ElidedBlock) {
|
|
9
|
+
lastBlock.push(block);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
this.blocks.push(block);
|
|
14
|
+
}
|
|
15
|
+
getBlocks() {
|
|
16
|
+
return this.blocks;
|
|
17
|
+
}
|
|
18
|
+
map(func, thisarg) {
|
|
19
|
+
// eslint-disable-next-line unicorn/no-array-method-this-argument
|
|
20
|
+
return this.blocks.map(func, thisarg);
|
|
21
|
+
}
|
|
22
|
+
forEach(func, thisarg) {
|
|
23
|
+
// eslint-disable-next-line unicorn/no-array-method-this-argument
|
|
24
|
+
return this.blocks.forEach(func, thisarg);
|
|
25
|
+
}
|
|
26
|
+
get length() {
|
|
27
|
+
return this.blocks.length;
|
|
28
|
+
}
|
|
29
|
+
get totalWidthPx() {
|
|
30
|
+
return this.blocks.length
|
|
31
|
+
? this.blocks.map(blocks => blocks.widthPx).reduce((a, b) => a + b)
|
|
32
|
+
: 0;
|
|
33
|
+
}
|
|
34
|
+
get offsetPx() {
|
|
35
|
+
return this.blocks.length ? this.blocks[0].offsetPx : 0;
|
|
36
|
+
}
|
|
37
|
+
get contentBlocks() {
|
|
38
|
+
return this.blocks.filter(block => block instanceof ContentBlock);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export class BaseBlock {
|
|
42
|
+
/**
|
|
43
|
+
* a block that should be shown as filled with data
|
|
44
|
+
*/
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
|
+
constructor(data) {
|
|
47
|
+
this.widthPx = 0;
|
|
48
|
+
this.offsetPx = 0;
|
|
49
|
+
Object.assign(this, data);
|
|
50
|
+
this.assemblyName = data.assemblyName;
|
|
51
|
+
this.refName = data.refName;
|
|
52
|
+
this.start = data.start;
|
|
53
|
+
this.end = data.end;
|
|
54
|
+
this.key = data.key;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* rename the reference sequence of this block and return a new one
|
|
58
|
+
*
|
|
59
|
+
* @param refName -
|
|
60
|
+
* @returns either a new block with a renamed reference sequence,
|
|
61
|
+
* or the same block, if the ref name is not actually different
|
|
62
|
+
*/
|
|
63
|
+
renameReference(refName) {
|
|
64
|
+
if (this.refName && refName !== this.refName) {
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
66
|
+
return new this.constructor({ ...this, refName });
|
|
67
|
+
}
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
toRegion() {
|
|
71
|
+
return {
|
|
72
|
+
refName: this.refName,
|
|
73
|
+
start: this.start,
|
|
74
|
+
end: this.end,
|
|
75
|
+
assemblyName: this.assemblyName,
|
|
76
|
+
reversed: this.reversed,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export class ContentBlock extends BaseBlock {
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* marker block representing one or more blocks that are
|
|
84
|
+
* too small to be shown at the current zoom level
|
|
85
|
+
*/
|
|
86
|
+
export class ElidedBlock extends BaseBlock {
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
88
|
+
constructor(data) {
|
|
89
|
+
super(data);
|
|
90
|
+
this.elidedBlockCount = 0;
|
|
91
|
+
this.widthPx = data.widthPx;
|
|
92
|
+
}
|
|
93
|
+
push(otherBlock) {
|
|
94
|
+
this.elidedBlockCount += 1;
|
|
95
|
+
if (otherBlock) {
|
|
96
|
+
this.refName = '';
|
|
97
|
+
this.start = 0;
|
|
98
|
+
this.end = 0;
|
|
99
|
+
this.widthPx += otherBlock.widthPx;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* marker block that sits between two different displayed regions
|
|
105
|
+
* and provides a thick border between them
|
|
106
|
+
*/
|
|
107
|
+
export class InterRegionPaddingBlock extends BaseBlock {
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=blockTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blockTypes.js","sourceRoot":"","sources":["../../src/DotplotView/blockTypes.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,QAAQ;IACnB,YAAmB,SAAsB,EAAE;QAAxB,WAAM,GAAN,MAAM,CAAkB;IAAG,CAAC;IAE/C,IAAI,CAAC,KAAgB;QACnB,IAAI,KAAK,YAAY,WAAW,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAC1D,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;YACpC,IAAI,SAAS,YAAY,WAAW,EAAE;gBACpC,SAAS,CAAC,IAAI,CAAC,KAA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AAO,GAAG,EAAE,CAAA;YACjB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;YACd,IAAI,CAAC,GAAG,GAAG,CAAC,CAAA;YACZ,IAAI,CAAC,OAAO,IAAI,UAAU,CAAC,OAAO,CAAA;SACnC;IACH,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,SAAS;CAAG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DotplotViewModel } from '../model';
|
|
3
|
+
export declare const HorizontalAxis: ({ model, }: {
|
|
4
|
+
model: DotplotViewModel;
|
|
5
|
+
}) => React.JSX.Element;
|
|
6
|
+
export declare const HorizontalAxisRaw: ({ model, }: {
|
|
7
|
+
model: DotplotViewModel;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
|
+
export declare const VerticalAxis: ({ model, }: {
|
|
10
|
+
model: DotplotViewModel;
|
|
11
|
+
}) => React.JSX.Element;
|
|
12
|
+
export declare const VerticalAxisRaw: ({ model, }: {
|
|
13
|
+
model: DotplotViewModel;
|
|
14
|
+
}) => React.JSX.Element;
|