@jbrowse/plugin-dotplot-view 3.7.0 → 4.0.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/esm/ComparativeRenderer/index.d.ts +10 -10
- package/esm/ComparativeRenderer/index.js +4 -17
- package/esm/DiagonalizeDotplotRpc.js +9 -12
- package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +1 -1
- package/esm/DotplotDisplay/index.d.ts +3 -3
- package/esm/DotplotDisplay/index.js +4 -4
- package/esm/DotplotDisplay/renderDotplotBlock.d.ts +2 -1
- package/esm/DotplotDisplay/renderDotplotBlock.js +6 -4
- package/esm/DotplotDisplay/stateModelFactory.d.ts +143 -30
- package/esm/DotplotDisplay/stateModelFactory.js +5 -14
- package/esm/DotplotReadVsRef/DotplotReadVsRef.js +5 -6
- package/esm/DotplotReadVsRef/index.js +1 -1
- package/esm/DotplotRenderer/DotplotRenderer.d.ts +30 -39
- package/esm/DotplotRenderer/DotplotRenderer.js +55 -22
- package/esm/DotplotRenderer/components/DotplotRendering.d.ts +1 -1
- package/esm/DotplotRenderer/components/DotplotRendering.js +1 -1
- package/esm/DotplotRenderer/configSchema.d.ts +3 -3
- package/esm/DotplotRenderer/configSchema.js +1 -1
- package/esm/DotplotRenderer/drawDotplot.d.ts +3 -3
- package/esm/DotplotRenderer/drawDotplot.js +5 -6
- package/esm/DotplotRenderer/index.js +4 -4
- package/esm/DotplotView/1dview.d.ts +25 -25
- package/esm/DotplotView/1dview.js +13 -3
- package/esm/DotplotView/components/Axes.d.ts +1 -1
- package/esm/DotplotView/components/Axes.js +31 -41
- package/esm/DotplotView/components/ColorBySelector.d.ts +1 -1
- package/esm/DotplotView/components/ColorBySelector.js +3 -4
- package/esm/DotplotView/components/DiagonalizationProgressDialog.d.ts +1 -1
- package/esm/DotplotView/components/DiagonalizationProgressDialog.js +1 -1
- package/esm/DotplotView/components/DotplotControls.d.ts +1 -1
- package/esm/DotplotView/components/DotplotControls.js +7 -8
- package/esm/DotplotView/components/DotplotGrid.d.ts +6 -0
- package/esm/DotplotView/components/{Grid.js → DotplotGrid.js} +19 -20
- package/esm/DotplotView/components/DotplotGridWrapper.d.ts +6 -0
- package/esm/DotplotView/components/DotplotGridWrapper.js +8 -0
- package/esm/DotplotView/components/DotplotTooltipClick.d.ts +2 -2
- package/esm/DotplotView/components/DotplotTooltipClick.js +4 -4
- package/esm/DotplotView/components/DotplotTooltipMouseover.d.ts +1 -1
- package/esm/DotplotView/components/DotplotTooltipMouseover.js +2 -2
- package/esm/DotplotView/components/DotplotTooltips.d.ts +1 -1
- package/esm/DotplotView/components/DotplotTooltips.js +2 -2
- package/esm/DotplotView/components/DotplotView.d.ts +2 -2
- package/esm/DotplotView/components/DotplotView.js +23 -21
- package/esm/DotplotView/components/DotplotWarnings.d.ts +1 -1
- package/esm/DotplotView/components/DotplotWarnings.js +3 -3
- package/esm/DotplotView/components/ExportSvgDialog.d.ts +1 -1
- package/esm/DotplotView/components/Header.d.ts +1 -1
- package/esm/DotplotView/components/Header.js +5 -5
- package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +1 -1
- package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +6 -5
- package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +1 -1
- package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +2 -3
- package/esm/DotplotView/components/ImportForm/TrackSelector.d.ts +10 -1
- package/esm/DotplotView/components/ImportForm/TrackSelector.js +8 -4
- package/esm/DotplotView/components/ImportForm/index.d.ts +1 -1
- package/esm/DotplotView/components/ImportForm/index.js +4 -9
- package/esm/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.d.ts +1 -1
- package/esm/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.js +2 -2
- package/esm/DotplotView/components/ImportForm/selectors/PifGzSelector.d.ts +1 -1
- package/esm/DotplotView/components/ImportForm/selectors/PifGzSelector.js +2 -2
- package/esm/DotplotView/components/ImportForm/selectors/SwapAssemblies.js +3 -3
- package/esm/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.d.ts +1 -1
- package/esm/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.js +3 -3
- package/esm/DotplotView/components/ImportForm/selectors/index.d.ts +3 -3
- package/esm/DotplotView/components/ImportForm/selectors/index.js +3 -3
- package/esm/DotplotView/components/MinLengthSlider.d.ts +1 -1
- package/esm/DotplotView/components/MinLengthSlider.js +7 -7
- package/esm/DotplotView/components/MouseInteractionLayer.d.ts +3 -3
- package/esm/DotplotView/components/MouseInteractionLayer.js +6 -4
- package/esm/DotplotView/components/OpacitySlider.d.ts +1 -1
- package/esm/DotplotView/components/OpacitySlider.js +5 -6
- package/esm/DotplotView/components/PanButtons.d.ts +1 -1
- package/esm/DotplotView/components/PanButtons.js +1 -1
- package/esm/DotplotView/components/SelectionContextMenu.d.ts +1 -1
- package/esm/DotplotView/components/WarningDialog.js +1 -1
- package/esm/DotplotView/components/util.d.ts +1 -1
- package/esm/DotplotView/components/util.js +17 -5
- package/esm/DotplotView/index.js +2 -2
- package/esm/DotplotView/model.d.ts +208 -90
- package/esm/DotplotView/model.js +118 -79
- package/esm/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
- package/esm/DotplotView/svgcomponents/SVGDotplotView.js +5 -6
- package/esm/DotplotView/types.d.ts +7 -1
- package/esm/LaunchDotplotView.js +6 -36
- package/esm/ServerSideRenderedBlockContent.js +2 -6
- package/esm/ServerSideSyntenyRendering.d.ts +1 -1
- package/esm/ServerSideSyntenyRendering.js +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +8 -11
- package/esm/util.d.ts +1 -1
- package/package.json +28 -35
- package/dist/ComparativeRenderer/index.d.ts +0 -22
- package/dist/ComparativeRenderer/index.js +0 -53
- package/dist/DiagonalizeDotplotRpc.d.ts +0 -30
- package/dist/DiagonalizeDotplotRpc.js +0 -156
- package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +0 -6
- package/dist/DotplotDisplay/components/DotplotDisplay.js +0 -18
- package/dist/DotplotDisplay/index.d.ts +0 -5
- package/dist/DotplotDisplay/index.js +0 -36
- package/dist/DotplotDisplay/renderDotplotBlock.d.ts +0 -11
- package/dist/DotplotDisplay/renderDotplotBlock.js +0 -52
- package/dist/DotplotDisplay/stateModelFactory.d.ts +0 -108
- package/dist/DotplotDisplay/stateModelFactory.js +0 -134
- package/dist/DotplotReadVsRef/DotplotReadVsRef.d.ts +0 -3
- package/dist/DotplotReadVsRef/DotplotReadVsRef.js +0 -100
- package/dist/DotplotReadVsRef/index.d.ts +0 -2
- package/dist/DotplotReadVsRef/index.js +0 -41
- package/dist/DotplotRenderer/ComparativeRenderRpc.d.ts +0 -22
- package/dist/DotplotRenderer/ComparativeRenderRpc.js +0 -53
- package/dist/DotplotRenderer/DotplotRenderer.d.ts +0 -65
- package/dist/DotplotRenderer/DotplotRenderer.js +0 -102
- package/dist/DotplotRenderer/clamp.d.ts +0 -7
- package/dist/DotplotRenderer/clamp.js +0 -62
- package/dist/DotplotRenderer/components/DotplotRendering.d.ts +0 -3
- package/dist/DotplotRenderer/components/DotplotRendering.js +0 -9
- package/dist/DotplotRenderer/configSchema.d.ts +0 -40
- package/dist/DotplotRenderer/configSchema.js +0 -57
- package/dist/DotplotRenderer/drawDotplot.d.ts +0 -22
- package/dist/DotplotRenderer/drawDotplot.js +0 -209
- package/dist/DotplotRenderer/index.d.ts +0 -2
- package/dist/DotplotRenderer/index.js +0 -17
- package/dist/DotplotView/1dview.d.ts +0 -199
- package/dist/DotplotView/1dview.js +0 -65
- package/dist/DotplotView/components/Axes.d.ts +0 -13
- package/dist/DotplotView/components/Axes.js +0 -107
- package/dist/DotplotView/components/ColorBySelector.d.ts +0 -5
- package/dist/DotplotView/components/ColorBySelector.js +0 -79
- package/dist/DotplotView/components/CursorIcon.d.ts +0 -3
- package/dist/DotplotView/components/CursorIcon.js +0 -15
- package/dist/DotplotView/components/DiagonalizationProgressDialog.d.ts +0 -6
- package/dist/DotplotView/components/DiagonalizationProgressDialog.js +0 -125
- package/dist/DotplotView/components/DotplotControls.d.ts +0 -5
- package/dist/DotplotView/components/DotplotControls.js +0 -187
- package/dist/DotplotView/components/DotplotTooltipClick.d.ts +0 -10
- package/dist/DotplotView/components/DotplotTooltipClick.js +0 -17
- package/dist/DotplotView/components/DotplotTooltipMouseover.d.ts +0 -9
- package/dist/DotplotView/components/DotplotTooltipMouseover.js +0 -16
- package/dist/DotplotView/components/DotplotTooltips.d.ts +0 -15
- package/dist/DotplotView/components/DotplotTooltips.js +0 -43
- package/dist/DotplotView/components/DotplotView.d.ts +0 -5
- package/dist/DotplotView/components/DotplotView.js +0 -100
- package/dist/DotplotView/components/DotplotWarnings.d.ts +0 -5
- package/dist/DotplotView/components/DotplotWarnings.js +0 -53
- package/dist/DotplotView/components/ExportSvgDialog.d.ts +0 -7
- package/dist/DotplotView/components/ExportSvgDialog.js +0 -53
- package/dist/DotplotView/components/Grid.d.ts +0 -9
- package/dist/DotplotView/components/Grid.js +0 -47
- package/dist/DotplotView/components/Header.d.ts +0 -9
- package/dist/DotplotView/components/Header.js +0 -33
- package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +0 -7
- package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +0 -78
- package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +0 -7
- package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +0 -42
- package/dist/DotplotView/components/ImportForm/TrackSelector.d.ts +0 -7
- package/dist/DotplotView/components/ImportForm/TrackSelector.js +0 -23
- package/dist/DotplotView/components/ImportForm/getAdapter.d.ts +0 -117
- package/dist/DotplotView/components/ImportForm/getAdapter.js +0 -68
- package/dist/DotplotView/components/ImportForm/index.d.ts +0 -5
- package/dist/DotplotView/components/ImportForm/index.js +0 -75
- package/dist/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.d.ts +0 -3
- package/dist/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.js +0 -23
- package/dist/DotplotView/components/ImportForm/selectors/PifGzSelector.d.ts +0 -3
- package/dist/DotplotView/components/ImportForm/selectors/PifGzSelector.js +0 -13
- package/dist/DotplotView/components/ImportForm/selectors/SelectorTypes.d.ts +0 -23
- package/dist/DotplotView/components/ImportForm/selectors/SelectorTypes.js +0 -10
- package/dist/DotplotView/components/ImportForm/selectors/SwapAssemblies.d.ts +0 -13
- package/dist/DotplotView/components/ImportForm/selectors/SwapAssemblies.js +0 -32
- package/dist/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.d.ts +0 -3
- package/dist/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.js +0 -24
- package/dist/DotplotView/components/ImportForm/selectors/index.d.ts +0 -3
- package/dist/DotplotView/components/ImportForm/selectors/index.js +0 -12
- package/dist/DotplotView/components/ImportForm/util.d.ts +0 -10
- package/dist/DotplotView/components/ImportForm/util.js +0 -24
- package/dist/DotplotView/components/MinLengthSlider.d.ts +0 -5
- package/dist/DotplotView/components/MinLengthSlider.js +0 -44
- package/dist/DotplotView/components/MouseInteractionLayer.d.ts +0 -17
- package/dist/DotplotView/components/MouseInteractionLayer.js +0 -18
- package/dist/DotplotView/components/OpacitySlider.d.ts +0 -5
- package/dist/DotplotView/components/OpacitySlider.js +0 -43
- package/dist/DotplotView/components/PanButtons.d.ts +0 -5
- package/dist/DotplotView/components/PanButtons.js +0 -47
- package/dist/DotplotView/components/SelectionContextMenu.d.ts +0 -13
- package/dist/DotplotView/components/SelectionContextMenu.js +0 -42
- package/dist/DotplotView/components/SliderTooltip.d.ts +0 -2
- package/dist/DotplotView/components/SliderTooltip.js +0 -9
- package/dist/DotplotView/components/WarningDialog.d.ts +0 -16
- package/dist/DotplotView/components/WarningDialog.js +0 -39
- package/dist/DotplotView/components/hooks/useCtrlKeyTracking.d.ts +0 -1
- package/dist/DotplotView/components/hooks/useCtrlKeyTracking.js +0 -24
- package/dist/DotplotView/components/hooks/useCursorMode.d.ts +0 -7
- package/dist/DotplotView/components/hooks/useCursorMode.js +0 -19
- package/dist/DotplotView/components/hooks/useMouseCoordinates.d.ts +0 -29
- package/dist/DotplotView/components/hooks/useMouseCoordinates.js +0 -52
- package/dist/DotplotView/components/hooks/useMouseMoveHandler.d.ts +0 -6
- package/dist/DotplotView/components/hooks/useMouseMoveHandler.js +0 -27
- package/dist/DotplotView/components/hooks/useMouseUpHandler.d.ts +0 -3
- package/dist/DotplotView/components/hooks/useMouseUpHandler.js +0 -31
- package/dist/DotplotView/components/hooks/useWheelHandler.d.ts +0 -8
- package/dist/DotplotView/components/hooks/useWheelHandler.js +0 -47
- package/dist/DotplotView/components/util.d.ts +0 -14
- package/dist/DotplotView/components/util.js +0 -80
- package/dist/DotplotView/index.d.ts +0 -2
- package/dist/DotplotView/index.js +0 -52
- package/dist/DotplotView/model.d.ts +0 -440
- package/dist/DotplotView/model.js +0 -502
- package/dist/DotplotView/svgcomponents/SVGBackground.d.ts +0 -4
- package/dist/DotplotView/svgcomponents/SVGBackground.js +0 -10
- package/dist/DotplotView/svgcomponents/SVGDotplotView.d.ts +0 -2
- package/dist/DotplotView/svgcomponents/SVGDotplotView.js +0 -30
- package/dist/DotplotView/types.d.ts +0 -12
- package/dist/DotplotView/types.js +0 -2
- package/dist/LaunchDotplotView.d.ts +0 -2
- package/dist/LaunchDotplotView.js +0 -43
- package/dist/ServerSideRenderedBlockContent.d.ts +0 -12
- package/dist/ServerSideRenderedBlockContent.js +0 -48
- package/dist/ServerSideSyntenyRendering.d.ts +0 -13
- package/dist/ServerSideSyntenyRendering.js +0 -23
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -42
- package/dist/util.d.ts +0 -9
- package/dist/util.js +0 -7
- package/esm/DotplotRenderer/ComparativeRenderRpc.d.ts +0 -22
- package/esm/DotplotRenderer/ComparativeRenderRpc.js +0 -47
- package/esm/DotplotView/components/Grid.d.ts +0 -9
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { Dotplot1DViewModel } from '../DotplotView/model';
|
|
1
|
+
import ServerSideRenderer from '@jbrowse/core/pluggableElementTypes/renderers/ServerSideRendererType';
|
|
2
|
+
import type { Dotplot1DViewModel } from '../DotplotView/model.ts';
|
|
3
3
|
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
|
-
import type { RenderArgs, RenderArgsDeserialized } from '@jbrowse/core/pluggableElementTypes/renderers/
|
|
4
|
+
import type { RenderArgs as ServerSideRenderArgs, RenderArgsDeserialized as ServerSideRenderArgsDeserialized, RenderArgsSerialized as ServerSideRenderArgsSerialized, ResultsDeserialized as ServerSideResultsDeserialized, ResultsSerialized as ServerSideResultsSerialized } from '@jbrowse/core/pluggableElementTypes/renderers/ServerSideRendererType';
|
|
5
|
+
import type SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
|
|
6
|
+
import type RpcManager from '@jbrowse/core/rpc/RpcManager';
|
|
5
7
|
import type { Region } from '@jbrowse/core/util';
|
|
8
|
+
export interface RenderArgs extends ServerSideRenderArgs {
|
|
9
|
+
blockKey: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RenderArgsSerialized extends ServerSideRenderArgsSerialized {
|
|
12
|
+
blockKey: string;
|
|
13
|
+
}
|
|
14
|
+
export interface RenderArgsDeserialized extends ServerSideRenderArgsDeserialized {
|
|
15
|
+
blockKey: string;
|
|
16
|
+
}
|
|
17
|
+
export type ResultsSerialized = ServerSideResultsSerialized;
|
|
18
|
+
export interface ResultsDeserialized extends ServerSideResultsDeserialized {
|
|
19
|
+
blockKey: string;
|
|
20
|
+
}
|
|
6
21
|
export interface DotplotRenderArgsDeserialized extends RenderArgsDeserialized {
|
|
7
22
|
adapterConfig: AnyConfigurationModel;
|
|
8
23
|
height: number;
|
|
@@ -13,7 +28,7 @@ export interface DotplotRenderArgsDeserialized extends RenderArgsDeserialized {
|
|
|
13
28
|
vview: Dotplot1DViewModel;
|
|
14
29
|
};
|
|
15
30
|
}
|
|
16
|
-
interface DotplotRenderArgs extends RenderArgs {
|
|
31
|
+
export interface DotplotRenderArgs extends RenderArgs {
|
|
17
32
|
adapterConfig: AnyConfigurationModel;
|
|
18
33
|
sessionId: string;
|
|
19
34
|
view: {
|
|
@@ -25,41 +40,17 @@ interface DotplotRenderArgs extends RenderArgs {
|
|
|
25
40
|
};
|
|
26
41
|
};
|
|
27
42
|
}
|
|
28
|
-
export default class DotplotRenderer extends
|
|
43
|
+
export default class DotplotRenderer extends ServerSideRenderer {
|
|
29
44
|
supportsSVG: boolean;
|
|
30
45
|
renameRegionsIfNeeded(args: DotplotRenderArgs): Promise<DotplotRenderArgs>;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
html?: string;
|
|
42
|
-
} | {
|
|
43
|
-
height: number;
|
|
44
|
-
width: number;
|
|
45
|
-
offsetX: number;
|
|
46
|
-
offsetY: number;
|
|
47
|
-
bpPerPxX: number;
|
|
48
|
-
bpPerPxY: number;
|
|
49
|
-
warnings: import("./clamp").Warning[];
|
|
50
|
-
imageData: any;
|
|
51
|
-
reactElement?: React.ReactElement;
|
|
52
|
-
html?: string;
|
|
53
|
-
} | {
|
|
54
|
-
height: number;
|
|
55
|
-
width: number;
|
|
56
|
-
offsetX: number;
|
|
57
|
-
offsetY: number;
|
|
58
|
-
bpPerPxX: number;
|
|
59
|
-
bpPerPxY: number;
|
|
60
|
-
warnings: import("./clamp").Warning[];
|
|
61
|
-
reactElement: React.ReactElement;
|
|
62
|
-
html?: string;
|
|
63
|
-
}>;
|
|
46
|
+
serializeArgsInClient(args: RenderArgs): ServerSideRenderArgsSerialized;
|
|
47
|
+
deserializeResultsInClient(result: ResultsSerialized, args: RenderArgs): ResultsDeserialized;
|
|
48
|
+
renderInClient(rpcManager: RpcManager, args: RenderArgs): Promise<ServerSideResultsSerialized>;
|
|
49
|
+
getFeatures(renderArgs: {
|
|
50
|
+
regions: Region[];
|
|
51
|
+
sessionId: string;
|
|
52
|
+
adapterConfig: AnyConfigurationModel;
|
|
53
|
+
filters?: SerializableFilterChain;
|
|
54
|
+
}): Promise<import("@jbrowse/core/util").Feature[]>;
|
|
55
|
+
render(renderProps: DotplotRenderArgsDeserialized): Promise<import("librpc-web-mod").RpcResult>;
|
|
64
56
|
}
|
|
65
|
-
export {};
|
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { getAdapter } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
2
|
+
import ServerSideRenderer from '@jbrowse/core/pluggableElementTypes/renderers/ServerSideRendererType';
|
|
3
|
+
import { dedupe, getSerializedSvg, renameRegionsIfNeeded, renderToAbstractCanvas, } from '@jbrowse/core/util';
|
|
4
|
+
import { rpcResult } from '@jbrowse/core/util/librpc';
|
|
5
|
+
import { collectTransferables } from '@jbrowse/core/util/offscreenCanvasPonyfill';
|
|
6
|
+
import { firstValueFrom } from 'rxjs';
|
|
7
|
+
import { filter, toArray } from 'rxjs/operators';
|
|
8
|
+
import { Dotplot1DView } from "../DotplotView/model.js";
|
|
9
|
+
function isCanvasRecordedSvgExport(e) {
|
|
10
|
+
return 'canvasRecordedData' in e;
|
|
11
|
+
}
|
|
12
|
+
function normalizeRegion(r) {
|
|
13
|
+
return {
|
|
14
|
+
...r,
|
|
15
|
+
start: Math.floor(r.start),
|
|
16
|
+
end: Math.ceil(r.end),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export default class DotplotRenderer extends ServerSideRenderer {
|
|
20
|
+
supportsSVG = true;
|
|
9
21
|
async renameRegionsIfNeeded(args) {
|
|
10
|
-
var _a, _b;
|
|
11
22
|
const pm = this.pluginManager;
|
|
12
|
-
const assemblyManager =
|
|
23
|
+
const assemblyManager = pm.rootModel?.session?.assemblyManager;
|
|
13
24
|
const { view, sessionId, adapterConfig } = args;
|
|
14
25
|
async function process(regions) {
|
|
15
26
|
if (!assemblyManager) {
|
|
@@ -26,8 +37,36 @@ export default class DotplotRenderer extends ComparativeRenderer {
|
|
|
26
37
|
view.vview.displayedRegions = await process(view.vview.displayedRegions);
|
|
27
38
|
return args;
|
|
28
39
|
}
|
|
40
|
+
serializeArgsInClient(args) {
|
|
41
|
+
const { displayModel, ...serializable } = args;
|
|
42
|
+
return super.serializeArgsInClient(serializable);
|
|
43
|
+
}
|
|
44
|
+
deserializeResultsInClient(result, args) {
|
|
45
|
+
return {
|
|
46
|
+
...super.deserializeResultsInClient(result, args),
|
|
47
|
+
blockKey: args.blockKey,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
async renderInClient(rpcManager, args) {
|
|
51
|
+
const results = (await rpcManager.call(args.sessionId, 'ComparativeRender', args));
|
|
52
|
+
if (isCanvasRecordedSvgExport(results)) {
|
|
53
|
+
const { reactElement: _, ...rest } = results;
|
|
54
|
+
return {
|
|
55
|
+
...rest,
|
|
56
|
+
html: await getSerializedSvg(results),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return results;
|
|
60
|
+
}
|
|
61
|
+
async getFeatures(renderArgs) {
|
|
62
|
+
const { regions, sessionId, adapterConfig, filters } = renderArgs;
|
|
63
|
+
const { dataAdapter } = await getAdapter(this.pluginManager, sessionId, adapterConfig);
|
|
64
|
+
const res = await firstValueFrom(dataAdapter
|
|
65
|
+
.getFeaturesInMultipleRegions(regions.map(r => normalizeRegion(r)), renderArgs)
|
|
66
|
+
.pipe(filter(f => (filters ? filters.passes(f, renderArgs) : true)), toArray()));
|
|
67
|
+
return dedupe(res, f => f.id());
|
|
68
|
+
}
|
|
29
69
|
async render(renderProps) {
|
|
30
|
-
var _a, _b;
|
|
31
70
|
const { width, height, view: { hview, vview }, } = renderProps;
|
|
32
71
|
const dimensions = [width, height];
|
|
33
72
|
const views = [hview, vview].map((snap, idx) => {
|
|
@@ -41,23 +80,17 @@ export default class DotplotRenderer extends ComparativeRenderer {
|
|
|
41
80
|
regions: target.dynamicBlocks.contentBlocks,
|
|
42
81
|
});
|
|
43
82
|
target.setFeatures(feats);
|
|
44
|
-
const { drawDotplot } = await import(
|
|
83
|
+
const { drawDotplot } = await import("./drawDotplot.js");
|
|
45
84
|
const ret = await renderToAbstractCanvas(width, height, renderProps, ctx => drawDotplot(ctx, { ...renderProps, views }));
|
|
46
|
-
const
|
|
47
|
-
...renderProps,
|
|
48
|
-
...ret,
|
|
49
|
-
height,
|
|
50
|
-
width,
|
|
51
|
-
});
|
|
52
|
-
return {
|
|
53
|
-
...results,
|
|
85
|
+
const serialized = {
|
|
54
86
|
...ret,
|
|
55
87
|
height,
|
|
56
88
|
width,
|
|
57
|
-
offsetX:
|
|
58
|
-
offsetY:
|
|
89
|
+
offsetX: views[0].dynamicBlocks.blocks[0]?.offsetPx || 0,
|
|
90
|
+
offsetY: views[1].dynamicBlocks.blocks[0]?.offsetPx || 0,
|
|
59
91
|
bpPerPxX: views[0].bpPerPx,
|
|
60
92
|
bpPerPxY: views[1].bpPerPx,
|
|
61
93
|
};
|
|
94
|
+
return rpcResult(serialized, collectTransferables(ret));
|
|
62
95
|
}
|
|
63
96
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { DotplotRenderArgsDeserialized } from '../DotplotRenderer';
|
|
1
|
+
import type { DotplotRenderArgsDeserialized } from '../DotplotRenderer.ts';
|
|
2
2
|
declare const DotplotRendering: (props: DotplotRenderArgsDeserialized) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DotplotRendering;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { PrerenderedCanvas } from '@jbrowse/core/ui';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
|
-
const DotplotRendering = observer(function (props) {
|
|
4
|
+
const DotplotRendering = observer(function DotplotRendering(props) {
|
|
5
5
|
return _jsx(PrerenderedCanvas, { ...props });
|
|
6
6
|
});
|
|
7
7
|
export default DotplotRendering;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
2
|
color: {
|
|
3
3
|
type: string;
|
|
4
4
|
description: string;
|
|
@@ -22,7 +22,7 @@ declare const _default: import("@jbrowse/core/configuration/configurationSchema"
|
|
|
22
22
|
};
|
|
23
23
|
colorBy: {
|
|
24
24
|
type: string;
|
|
25
|
-
model: import("mobx-state-tree").ISimpleType<string>;
|
|
25
|
+
model: import("@jbrowse/mobx-state-tree").ISimpleType<string>;
|
|
26
26
|
description: string;
|
|
27
27
|
defaultValue: string;
|
|
28
28
|
};
|
|
@@ -36,5 +36,5 @@ declare const _default: import("@jbrowse/core/configuration/configurationSchema"
|
|
|
36
36
|
defaultValue: string[];
|
|
37
37
|
description: string;
|
|
38
38
|
};
|
|
39
|
-
}, import("
|
|
39
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
40
40
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type Warning } from './clamp';
|
|
2
|
-
import type {
|
|
1
|
+
import { type Warning } from './clamp.ts';
|
|
2
|
+
import type { RenderArgsDeserialized } from './DotplotRenderer.ts';
|
|
3
|
+
import type { Dotplot1DViewModel } from '../DotplotView/model.ts';
|
|
3
4
|
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
|
-
import type { RenderArgsDeserialized } from '@jbrowse/core/pluggableElementTypes/renderers/ComparativeServerSideRendererType';
|
|
5
5
|
export interface DotplotRenderArgsDeserialized extends RenderArgsDeserialized {
|
|
6
6
|
adapterConfig: AnyConfigurationModel;
|
|
7
7
|
height: number;
|
|
@@ -3,9 +3,9 @@ import { createJBrowseTheme } from '@jbrowse/core/ui';
|
|
|
3
3
|
import { category10 } from '@jbrowse/core/ui/colors';
|
|
4
4
|
import { bpToPx } from '@jbrowse/core/util/Base1DUtils';
|
|
5
5
|
import { colord } from '@jbrowse/core/util/colord';
|
|
6
|
+
import { getSnapshot } from '@jbrowse/mobx-state-tree';
|
|
6
7
|
import { MismatchParser } from '@jbrowse/plugin-alignments';
|
|
7
|
-
import {
|
|
8
|
-
import { clampWithWarnX, clampWithWarnY } from './clamp';
|
|
8
|
+
import { clampWithWarnX, clampWithWarnY } from "./clamp.js";
|
|
9
9
|
const { parseCigar } = MismatchParser;
|
|
10
10
|
function hashString(str) {
|
|
11
11
|
let hash = 0;
|
|
@@ -27,20 +27,19 @@ function applyAlpha(color, alpha) {
|
|
|
27
27
|
return colord(color).alpha(alpha).toRgbString();
|
|
28
28
|
}
|
|
29
29
|
export async function drawDotplot(ctx, props) {
|
|
30
|
-
var _a, _b;
|
|
31
30
|
const { config, views, height, drawCigar, theme, alpha = 1, minAlignmentLength = 0, colorBy: colorByOverride, } = props;
|
|
32
31
|
const color = readConfObject(config, 'color');
|
|
33
32
|
const posColor = readConfObject(config, 'posColor');
|
|
34
33
|
const negColor = readConfObject(config, 'negColor');
|
|
35
|
-
const colorBy = colorByOverride
|
|
34
|
+
const colorBy = colorByOverride ?? readConfObject(config, 'colorBy');
|
|
36
35
|
const lineWidth = readConfObject(config, 'lineWidth');
|
|
37
36
|
const thresholds = readConfObject(config, 'thresholds');
|
|
38
37
|
const palette = readConfObject(config, 'thresholdsPalette');
|
|
39
38
|
const isCallback = config.color.isCallback;
|
|
40
39
|
const hview = views[0];
|
|
41
40
|
const vview = views[1];
|
|
42
|
-
const db1 =
|
|
43
|
-
const db2 =
|
|
41
|
+
const db1 = hview.dynamicBlocks.contentBlocks[0]?.offsetPx;
|
|
42
|
+
const db2 = vview.dynamicBlocks.contentBlocks[0]?.offsetPx;
|
|
44
43
|
const warnings = [];
|
|
45
44
|
ctx.lineWidth = lineWidth;
|
|
46
45
|
const { bpPerPx: hBpPerPx } = hview;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import configSchema from
|
|
1
|
+
import { lazy } from 'react';
|
|
2
|
+
import DotplotRenderer from "./DotplotRenderer.js";
|
|
3
|
+
import configSchema from "./configSchema.js";
|
|
4
4
|
export default function DotplotRendererF(pluginManager) {
|
|
5
5
|
pluginManager.addRendererType(() => new DotplotRenderer({
|
|
6
6
|
name: 'DotplotRenderer',
|
|
7
7
|
configSchema: configSchema,
|
|
8
|
-
ReactComponent,
|
|
8
|
+
ReactComponent: lazy(() => import("./components/DotplotRendering.js")),
|
|
9
9
|
pluginManager,
|
|
10
10
|
}));
|
|
11
11
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { 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").IOptionalIType<import("mobx-state-tree").IType<import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[]>, [undefined]>;
|
|
5
|
-
bpPerPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
6
|
-
offsetPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
7
|
-
interRegionPaddingWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
8
|
-
minimumBlockWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
1
|
+
import type { Instance } from '@jbrowse/mobx-state-tree';
|
|
2
|
+
declare const Dotplot1DView: import("@jbrowse/mobx-state-tree").IModelType<{
|
|
3
|
+
id: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
4
|
+
displayedRegions: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IType<import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[]>, [undefined]>;
|
|
5
|
+
bpPerPx: import("@jbrowse/mobx-state-tree").IType<number | undefined, number, number>;
|
|
6
|
+
offsetPx: import("@jbrowse/mobx-state-tree").IType<number | undefined, number, number>;
|
|
7
|
+
interRegionPaddingWidth: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
8
|
+
minimumBlockWidth: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
9
9
|
}, {
|
|
10
10
|
features: undefined | import("@jbrowse/core/util").Feature[];
|
|
11
11
|
volatileWidth: number;
|
|
@@ -62,14 +62,14 @@ declare const Dotplot1DView: import("mobx-state-tree").IModelType<{
|
|
|
62
62
|
readonly minBpPerPx: number;
|
|
63
63
|
readonly maxOffset: number;
|
|
64
64
|
readonly minOffset: number;
|
|
65
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
66
|
-
declare const DotplotHView: import("mobx-state-tree").IModelType<{
|
|
67
|
-
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
68
|
-
displayedRegions: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[]>, [undefined]>;
|
|
69
|
-
bpPerPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
70
|
-
offsetPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
71
|
-
interRegionPaddingWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
72
|
-
minimumBlockWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
65
|
+
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
|
|
66
|
+
declare const DotplotHView: import("@jbrowse/mobx-state-tree").IModelType<{
|
|
67
|
+
id: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
68
|
+
displayedRegions: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IType<import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[]>, [undefined]>;
|
|
69
|
+
bpPerPx: import("@jbrowse/mobx-state-tree").IType<number | undefined, number, number>;
|
|
70
|
+
offsetPx: import("@jbrowse/mobx-state-tree").IType<number | undefined, number, number>;
|
|
71
|
+
interRegionPaddingWidth: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
72
|
+
minimumBlockWidth: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
73
73
|
}, {
|
|
74
74
|
features: undefined | import("@jbrowse/core/util").Feature[];
|
|
75
75
|
volatileWidth: number;
|
|
@@ -128,14 +128,14 @@ declare const DotplotHView: import("mobx-state-tree").IModelType<{
|
|
|
128
128
|
readonly minOffset: number;
|
|
129
129
|
} & {
|
|
130
130
|
readonly width: any;
|
|
131
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
132
|
-
declare const DotplotVView: import("mobx-state-tree").IModelType<{
|
|
133
|
-
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
134
|
-
displayedRegions: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[]>, [undefined]>;
|
|
135
|
-
bpPerPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
136
|
-
offsetPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
137
|
-
interRegionPaddingWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
138
|
-
minimumBlockWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
131
|
+
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
|
|
132
|
+
declare const DotplotVView: import("@jbrowse/mobx-state-tree").IModelType<{
|
|
133
|
+
id: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
134
|
+
displayedRegions: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IType<import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[]>, [undefined]>;
|
|
135
|
+
bpPerPx: import("@jbrowse/mobx-state-tree").IType<number | undefined, number, number>;
|
|
136
|
+
offsetPx: import("@jbrowse/mobx-state-tree").IType<number | undefined, number, number>;
|
|
137
|
+
interRegionPaddingWidth: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
138
|
+
minimumBlockWidth: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
139
139
|
}, {
|
|
140
140
|
features: undefined | import("@jbrowse/core/util").Feature[];
|
|
141
141
|
volatileWidth: number;
|
|
@@ -194,6 +194,6 @@ declare const DotplotVView: import("mobx-state-tree").IModelType<{
|
|
|
194
194
|
readonly minOffset: number;
|
|
195
195
|
} & {
|
|
196
196
|
readonly width: any;
|
|
197
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
197
|
+
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
|
|
198
198
|
export { Dotplot1DView, DotplotHView, DotplotVView };
|
|
199
199
|
export type Dotplot1DViewModel = Instance<typeof Dotplot1DView>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Base1DView from '@jbrowse/core/util/Base1DViewModel';
|
|
2
2
|
import calculateDynamicBlocks from '@jbrowse/core/util/calculateDynamicBlocks';
|
|
3
|
+
import { getParent } from '@jbrowse/mobx-state-tree';
|
|
3
4
|
import { observable } from 'mobx';
|
|
4
|
-
import { getParent } from 'mobx-state-tree';
|
|
5
5
|
function x() { }
|
|
6
6
|
const Dotplot1DView = Base1DView.extend(self => {
|
|
7
7
|
const scaleFactor = observable.box(1);
|
|
@@ -20,12 +20,22 @@ const Dotplot1DView = Base1DView.extend(self => {
|
|
|
20
20
|
return 1 / 50;
|
|
21
21
|
},
|
|
22
22
|
get maxOffset() {
|
|
23
|
+
const contentPx = self.displayedRegionsTotalPx;
|
|
24
|
+
const viewWidth = self.width;
|
|
25
|
+
if (contentPx <= viewWidth) {
|
|
26
|
+
return (contentPx - viewWidth) / 2;
|
|
27
|
+
}
|
|
23
28
|
const leftPadding = 10;
|
|
24
|
-
return
|
|
29
|
+
return contentPx - leftPadding;
|
|
25
30
|
},
|
|
26
31
|
get minOffset() {
|
|
32
|
+
const contentPx = self.displayedRegionsTotalPx;
|
|
33
|
+
const viewWidth = self.width;
|
|
34
|
+
if (contentPx <= viewWidth) {
|
|
35
|
+
return (contentPx - viewWidth) / 2;
|
|
36
|
+
}
|
|
27
37
|
const rightPadding = 30;
|
|
28
|
-
return -
|
|
38
|
+
return -viewWidth + rightPadding;
|
|
29
39
|
},
|
|
30
40
|
},
|
|
31
41
|
actions: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { getFillProps, getStrokeProps, getTickDisplayStr, } from '@jbrowse/core/util';
|
|
3
3
|
import { bpToPx } from '@jbrowse/core/util/Base1DUtils';
|
|
4
|
+
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
5
|
+
import { getSnapshot } from '@jbrowse/mobx-state-tree';
|
|
4
6
|
import { useTheme } from '@mui/material';
|
|
5
7
|
import { observer } from 'mobx-react';
|
|
6
|
-
import {
|
|
7
|
-
import { makeStyles } from 'tss-react/mui';
|
|
8
|
-
import { getBlockLabelKeysToHide } from './util';
|
|
8
|
+
import { getBlockLabelKeysToHide } from "./util.js";
|
|
9
9
|
const useStyles = makeStyles()(() => ({
|
|
10
10
|
vtext: {
|
|
11
11
|
gridColumn: '1/2',
|
|
@@ -20,12 +20,12 @@ const useStyles = makeStyles()(() => ({
|
|
|
20
20
|
userSelect: 'none',
|
|
21
21
|
},
|
|
22
22
|
}));
|
|
23
|
-
export const HorizontalAxis = observer(function ({ model, }) {
|
|
23
|
+
export const HorizontalAxis = observer(function HorizontalAxis({ model, }) {
|
|
24
24
|
const { viewWidth, borderY } = model;
|
|
25
25
|
const { classes } = useStyles();
|
|
26
26
|
return (_jsx("svg", { width: viewWidth, height: borderY, className: classes.htext, children: _jsx(HorizontalAxisRaw, { model: model }) }));
|
|
27
27
|
});
|
|
28
|
-
export const HorizontalAxisRaw = observer(function ({ model, }) {
|
|
28
|
+
export const HorizontalAxisRaw = observer(function HorizontalAxisRaw({ model, }) {
|
|
29
29
|
const { viewWidth, borderX, borderY, hview, htextRotation, hticks } = model;
|
|
30
30
|
const { offsetPx, width, dynamicBlocks, bpPerPx } = hview;
|
|
31
31
|
const dblocks = dynamicBlocks.contentBlocks;
|
|
@@ -37,36 +37,31 @@ export const HorizontalAxisRaw = observer(function ({ model, }) {
|
|
|
37
37
|
staticBlocks: hview.staticBlocks,
|
|
38
38
|
};
|
|
39
39
|
const ticks = hticks
|
|
40
|
-
.map(tick =>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
tick,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
})) === null || _a === void 0 ? void 0 : _a.offsetPx,
|
|
49
|
-
];
|
|
50
|
-
})
|
|
40
|
+
.map(tick => [
|
|
41
|
+
tick,
|
|
42
|
+
bpToPx({
|
|
43
|
+
refName: tick.refName,
|
|
44
|
+
coord: tick.base,
|
|
45
|
+
self: hviewSnap,
|
|
46
|
+
})?.offsetPx,
|
|
47
|
+
])
|
|
51
48
|
.filter(f => f[1] !== undefined)
|
|
52
49
|
.map(f => [f[0], f[1] - offsetPx]);
|
|
53
50
|
return (_jsxs(_Fragment, { children: [dblocks
|
|
54
51
|
.filter(region => !hide.has(region.key))
|
|
55
52
|
.map(region => {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return (_jsx("text", { transform: `rotate(${htextRotation},${xoff},${y})`, x: xoff, y: y + 1, fontSize: 11, dominantBaseline: "hanging", textAnchor: "end", ...getFillProps(theme.palette.text.primary), children: region.refName }, JSON.stringify(region)));
|
|
60
|
-
}), ticks.map(([tick, x]) => x > 0 && x < width ? (_jsx("line", { x1: x, x2: x, y1: 0, y2: tick.type === 'major' ? 6 : 4, strokeWidth: 1, ...getFillProps(theme.palette.text.primary) }, `line-${JSON.stringify(tick)}`)) : null), ticks
|
|
53
|
+
const xoff = Math.floor(region.offsetPx - hview.offsetPx);
|
|
54
|
+
return (_jsx("text", { transform: `rotate(${htextRotation},${xoff},0)`, x: xoff, y: 1, fontSize: 11, dominantBaseline: "hanging", textAnchor: "end", ...getFillProps(theme.palette.text.primary), children: region.refName }, region.key));
|
|
55
|
+
}), ticks.map(([tick, x], idx) => x > 0 && x < width ? (_jsx("line", { x1: x, x2: x, y1: 0, y2: tick.type === 'major' ? 6 : 4, strokeWidth: 1, ...getStrokeProps(theme.palette.text.primary) }, `line-${tick.refName}-${tick.base}-${idx}`)) : null), ticks
|
|
61
56
|
.filter(t => t[0].type === 'major')
|
|
62
|
-
.map(([tick, x]) => x > 10 && x < width ? (_jsx("text", { x: x - 7, y: 0, transform: `rotate(${htextRotation},${x},0)`, fontSize: 11, dominantBaseline: "middle", textAnchor: "end", ...getFillProps(theme.palette.text.primary), children: getTickDisplayStr(tick.base + 1, bpPerPx) }, `text-${
|
|
57
|
+
.map(([tick, x], idx) => x > 10 && x < width ? (_jsx("text", { x: x - 7, y: 0, transform: `rotate(${htextRotation},${x},0)`, fontSize: 11, dominantBaseline: "middle", textAnchor: "end", ...getFillProps(theme.palette.text.primary), children: getTickDisplayStr(tick.base + 1, bpPerPx) }, `text-${tick.refName}-${tick.base}-${idx}`)) : null), _jsx("text", { y: borderY - 12, x: (viewWidth - borderX) / 2, textAnchor: "middle", fontSize: 11, dominantBaseline: "hanging", ...getFillProps(theme.palette.text.primary), children: hview.assemblyNames.join(',') })] }));
|
|
63
58
|
});
|
|
64
|
-
export const VerticalAxis = observer(function ({ model, }) {
|
|
59
|
+
export const VerticalAxis = observer(function VerticalAxis({ model, }) {
|
|
65
60
|
const { borderX, viewHeight } = model;
|
|
66
61
|
const { classes } = useStyles();
|
|
67
62
|
return (_jsx("svg", { className: classes.vtext, width: borderX, height: viewHeight, children: _jsx(VerticalAxisRaw, { model: model }) }));
|
|
68
63
|
});
|
|
69
|
-
export const VerticalAxisRaw = observer(function ({ model, }) {
|
|
64
|
+
export const VerticalAxisRaw = observer(function VerticalAxisRaw({ model, }) {
|
|
70
65
|
const { viewHeight, borderX, borderY, vview, vtextRotation, vticks } = model;
|
|
71
66
|
const { offsetPx, width, dynamicBlocks, bpPerPx } = vview;
|
|
72
67
|
const dblocks = dynamicBlocks.contentBlocks;
|
|
@@ -78,27 +73,22 @@ export const VerticalAxisRaw = observer(function ({ model, }) {
|
|
|
78
73
|
staticBlocks: vview.staticBlocks,
|
|
79
74
|
};
|
|
80
75
|
const ticks = vticks
|
|
81
|
-
.map(tick =>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
tick,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
})) === null || _a === void 0 ? void 0 : _a.offsetPx,
|
|
90
|
-
];
|
|
91
|
-
})
|
|
76
|
+
.map(tick => [
|
|
77
|
+
tick,
|
|
78
|
+
bpToPx({
|
|
79
|
+
refName: tick.refName,
|
|
80
|
+
coord: tick.base,
|
|
81
|
+
self: vviewSnap,
|
|
82
|
+
})?.offsetPx,
|
|
83
|
+
])
|
|
92
84
|
.filter(f => f[1] !== undefined)
|
|
93
85
|
.map(f => [f[0], f[1] - offsetPx]);
|
|
94
86
|
return (_jsxs(_Fragment, { children: [dblocks
|
|
95
87
|
.filter(region => !hide.has(region.key))
|
|
96
88
|
.map(region => {
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return (_jsx("text", { transform: `rotate(${vtextRotation},${x},${y})`, x: x, y: yoff, fontSize: 11, textAnchor: "end", ...getFillProps(theme.palette.text.primary), children: region.refName }, JSON.stringify(region)));
|
|
101
|
-
}), ticks.map(([tick, y]) => y > 0 ? (_jsx("line", { y1: viewHeight - y, y2: viewHeight - y, x1: borderX, x2: borderX - (tick.type === 'major' ? 6 : 4), strokeWidth: 1, ...getStrokeProps(theme.palette.grey[400]) }, `line-${JSON.stringify(tick)}`)) : null), ticks
|
|
89
|
+
const yoff = Math.floor(viewHeight - region.offsetPx + offsetPx);
|
|
90
|
+
return (_jsx("text", { transform: `rotate(${vtextRotation},${borderX},${region.offsetPx})`, x: borderX, y: yoff, fontSize: 11, textAnchor: "end", ...getFillProps(theme.palette.text.primary), children: region.refName }, region.key));
|
|
91
|
+
}), ticks.map(([tick, y], idx) => y > 0 && y < viewHeight ? (_jsx("line", { y1: viewHeight - y, y2: viewHeight - y, x1: borderX, x2: borderX - (tick.type === 'major' ? 6 : 4), strokeWidth: 1, ...getStrokeProps(theme.palette.text.primary) }, `line-${tick.refName}-${tick.base}-${idx}`)) : null), ticks
|
|
102
92
|
.filter(t => t[0].type === 'major')
|
|
103
|
-
.map(([tick, y]) => y > 10 && y < viewHeight ? (_jsx("text", { y: viewHeight - y - 3, x: borderX - 7, textAnchor: "end", dominantBaseline: "hanging", fontSize: 11, ...getFillProps(theme.palette.text.primary), children: getTickDisplayStr(tick.base + 1, bpPerPx) }, `text-${
|
|
93
|
+
.map(([tick, y], idx) => y > 10 && y < viewHeight ? (_jsx("text", { y: viewHeight - y - 3, x: borderX - 7, textAnchor: "end", dominantBaseline: "hanging", fontSize: 11, ...getFillProps(theme.palette.text.primary), children: getTickDisplayStr(tick.base + 1, bpPerPx) }, `text-${tick.refName}-${tick.base}-${idx}`)) : null), _jsx("text", { y: (viewHeight - borderY) / 2, x: 12, transform: `rotate(-90,12,${(viewHeight - borderY) / 2})`, textAnchor: "middle", fontSize: 11, ...getFillProps(theme.palette.text.primary), children: vview.assemblyNames.join(',') })] }));
|
|
104
94
|
});
|
|
@@ -2,10 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
|
|
3
3
|
import PaletteIcon from '@mui/icons-material/Palette';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
5
|
-
const ColorBySelector = observer(function ({ model, }) {
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const colorBy = (_b = firstDisplay === null || firstDisplay === void 0 ? void 0 : firstDisplay.colorBy) !== null && _b !== void 0 ? _b : 'default';
|
|
5
|
+
const ColorBySelector = observer(function ColorBySelector({ model, }) {
|
|
6
|
+
const firstDisplay = model.tracks[0]?.displays[0];
|
|
7
|
+
const colorBy = firstDisplay?.colorBy ?? 'default';
|
|
9
8
|
const setColorBy = (value) => {
|
|
10
9
|
for (const track of model.tracks) {
|
|
11
10
|
for (const display of track.displays) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DotplotViewModel } from '../model';
|
|
1
|
+
import type { DotplotViewModel } from '../model.ts';
|
|
2
2
|
declare const DiagonalizationProgressDialog: ({ handleClose, model, }: {
|
|
3
3
|
handleClose: () => void;
|
|
4
4
|
model: Pick<DotplotViewModel, "tracks" | "hview" | "vview" | "id" | "type" | "displayName">;
|
|
@@ -73,7 +73,7 @@ async function runDiagonalization({ model, session, stopToken, setProgress, setM
|
|
|
73
73
|
throw new Error('No regions to reorder');
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
const DiagonalizationProgressDialog = observer(function ({ handleClose, model, }) {
|
|
76
|
+
const DiagonalizationProgressDialog = observer(function DiagonalizationProgressDialog({ handleClose, model, }) {
|
|
77
77
|
const [progress, setProgress] = useState(0);
|
|
78
78
|
const [message, setMessage] = useState('Ready to start diagonalization');
|
|
79
79
|
const [error, setError] = useState();
|
|
@@ -9,15 +9,14 @@ import ZoomIn from '@mui/icons-material/ZoomIn';
|
|
|
9
9
|
import ZoomOut from '@mui/icons-material/ZoomOut';
|
|
10
10
|
import { IconButton } from '@mui/material';
|
|
11
11
|
import { observer } from 'mobx-react';
|
|
12
|
-
import ColorBySelector from
|
|
13
|
-
import { CursorMouse, CursorMove } from
|
|
14
|
-
import MinLengthSlider from
|
|
15
|
-
import OpacitySlider from
|
|
16
|
-
const DiagonalizationProgressDialog = lazy(() => import(
|
|
17
|
-
const DotplotControls = observer(function ({ model, }) {
|
|
18
|
-
var _a;
|
|
12
|
+
import ColorBySelector from "./ColorBySelector.js";
|
|
13
|
+
import { CursorMouse, CursorMove } from "./CursorIcon.js";
|
|
14
|
+
import MinLengthSlider from "./MinLengthSlider.js";
|
|
15
|
+
import OpacitySlider from "./OpacitySlider.js";
|
|
16
|
+
const DiagonalizationProgressDialog = lazy(() => import("./DiagonalizationProgressDialog.js"));
|
|
17
|
+
const DotplotControls = observer(function DotplotControls({ model, }) {
|
|
19
18
|
const [showDynamicControls, setShowDynamicControls] = useState(true);
|
|
20
|
-
const hasDisplays =
|
|
19
|
+
const hasDisplays = model.tracks[0]?.displays[0];
|
|
21
20
|
return (_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '4px' }, children: [_jsx(IconButton, { onClick: () => {
|
|
22
21
|
model.zoomOut();
|
|
23
22
|
}, children: _jsx(ZoomOut, {}) }), _jsx(IconButton, { onClick: () => {
|