@jbrowse/plugin-linear-genome-view 5.0.0-beta.11 → 5.0.0-beta.15
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/FeatureTrack/configSchema.d.ts +2 -1
- package/esm/FeatureTrack/configSchema.js +2 -1
- package/esm/LinearGenomeView/afterAttach.js +1 -23
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +6 -2
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +31 -7
- package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -3
- package/esm/LinearGenomeView/components/HeaderPanControls.js +4 -2
- package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +4 -1
- package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
- package/esm/LinearGenomeView/components/HighlightBand.js +4 -2
- package/esm/LinearGenomeView/components/HighlightChip.d.ts +3 -2
- package/esm/LinearGenomeView/components/HighlightChip.js +4 -2
- package/esm/LinearGenomeView/components/LinearGenomeView.js +5 -12
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +7 -9
- package/esm/LinearGenomeView/components/MiniControls.js +8 -3
- package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +3 -2
- package/esm/LinearGenomeView/components/OverviewHighlightBand.js +4 -2
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +3 -2
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +4 -4
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +4 -4
- package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +3 -2
- package/esm/LinearGenomeView/components/SearchPanelForm.js +4 -2
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +4 -9
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +7 -4
- package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +3 -8
- package/esm/LinearGenomeView/components/SearchResultsTable.js +4 -33
- package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +3 -2
- package/esm/LinearGenomeView/components/StrandCheckboxes.js +4 -2
- package/esm/LinearGenomeView/components/TrackContainer.js +1 -1
- package/esm/LinearGenomeView/components/TrackLabel.js +4 -1
- package/esm/LinearGenomeView/components/TrackLabelMenu.js +8 -12
- package/esm/LinearGenomeView/components/useRangeSelect.js +3 -2
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +3 -1
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +4 -2
- package/esm/LinearGenomeView/components/useSideScroll.js +11 -12
- package/esm/LinearGenomeView/lazyDialogs.d.ts +17 -2
- package/esm/LinearGenomeView/menuItems.js +32 -24
- package/esm/LinearGenomeView/model.d.ts +121 -65
- package/esm/LinearGenomeView/model.js +143 -135
- package/esm/LinearGenomeView/rExport/exportLinearView.d.ts +13 -0
- package/esm/LinearGenomeView/rExport/exportLinearView.js +98 -0
- package/esm/LinearGenomeView/rExport/rScript.d.ts +75 -0
- package/esm/LinearGenomeView/rExport/rScript.js +464 -0
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +4 -7
- package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.d.ts +1 -2
- package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.js +2 -2
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +1 -2
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +5 -10
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +1 -2
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +5 -5
- package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +1 -2
- package/esm/LinearGenomeView/svgcomponents/SVGView.js +3 -3
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +24 -21
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +42 -29
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +32 -17
- package/esm/LinearGenomeView/svgcomponents/util.d.ts +16 -13
- package/esm/LinearGenomeView/svgcomponents/util.js +10 -19
- package/esm/LinearGenomeView/util.d.ts +42 -0
- package/esm/LinearGenomeView/util.js +81 -0
- package/esm/MultiLevelRubberband/MultiLevelRubberband.js +2 -2
- package/esm/displayKitTests/perRegionTestEnv.d.ts +45 -12
- package/esm/index.d.ts +4 -2
- package/esm/index.js +3 -1
- package/esm/searchUtils.js +1 -0
- package/esm/shared/RubberbandSpan.d.ts +3 -2
- package/esm/shared/RubberbandSpan.js +4 -2
- package/esm/shared/coordLabels.d.ts +6 -6
- package/esm/shared/coordLabels.js +7 -6
- package/package.json +10 -10
|
@@ -245,6 +245,8 @@ declare function makeStateModel(control: PerRegionTestControl, gate: GateOptIns,
|
|
|
245
245
|
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>>;
|
|
246
246
|
};
|
|
247
247
|
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
248
|
+
configProblemsOf(conf: import("@jbrowse/core/configuration").AnyConfigurationModel): string[];
|
|
249
|
+
readonly liveNotices: string[];
|
|
248
250
|
} & {
|
|
249
251
|
setStatusMessage(status?: import("@jbrowse/core/util").RpcStatus): void;
|
|
250
252
|
setError(error?: unknown): void;
|
|
@@ -263,15 +265,23 @@ declare function makeStateModel(control: PerRegionTestControl, gate: GateOptIns,
|
|
|
263
265
|
} & {
|
|
264
266
|
readonly plotKeys: string[];
|
|
265
267
|
readonly plot: import("@jbrowse/core/configuration").Plot;
|
|
268
|
+
readonly configNotices: string[];
|
|
269
|
+
readonly notices: string[];
|
|
270
|
+
readonly cornerNotices: string[];
|
|
266
271
|
readonly plotExamples: readonly import("@jbrowse/core/configuration").PlotExample[];
|
|
267
272
|
readonly configDocsUrl: string;
|
|
268
|
-
liftPlot(draft: import("@jbrowse/core/configuration").Plot): import("@jbrowse/core/configuration").AnyConfigurationModel;
|
|
269
|
-
plotProblems(draft: import("@jbrowse/core/configuration").Plot): string[];
|
|
270
|
-
plotWrites(draft: import("@jbrowse/core/configuration").Plot): Record<string, unknown>;
|
|
273
|
+
liftPlot(draft: import("@jbrowse/core/configuration").Plot, options?: import("@jbrowse/core/configuration").PlotWriteOptions): import("@jbrowse/core/configuration").AnyConfigurationModel;
|
|
274
|
+
plotProblems(draft: import("@jbrowse/core/configuration").Plot, options?: import("@jbrowse/core/configuration").PlotWriteOptions): string[];
|
|
275
|
+
plotWrites(draft: import("@jbrowse/core/configuration").Plot, options?: import("@jbrowse/core/configuration").PlotWriteOptions): Record<string, unknown>;
|
|
271
276
|
} & {
|
|
272
|
-
applyPlot(draft: import("@jbrowse/core/configuration").Plot): void;
|
|
277
|
+
applyPlot(draft: import("@jbrowse/core/configuration").Plot, options?: import("@jbrowse/core/configuration").PlotWriteOptions): void;
|
|
273
278
|
} & {
|
|
274
279
|
scrollTop: number;
|
|
280
|
+
hostHeight: number | undefined;
|
|
281
|
+
} & {
|
|
282
|
+
readonly configuredHeight: number;
|
|
283
|
+
} & {
|
|
284
|
+
readonly allottedHeight: number;
|
|
275
285
|
} & {
|
|
276
286
|
readonly height: number;
|
|
277
287
|
readonly resizing: boolean;
|
|
@@ -281,6 +291,7 @@ declare function makeStateModel(control: PerRegionTestControl, gate: GateOptIns,
|
|
|
281
291
|
readonly scrollableHeight: number;
|
|
282
292
|
} & {
|
|
283
293
|
setScrollTop(scrollTop: number): void;
|
|
294
|
+
setHostHeight(height: number | undefined): void;
|
|
284
295
|
setHeight(displayHeight: number): number;
|
|
285
296
|
resizeHeight(distance: number): number;
|
|
286
297
|
} & {
|
|
@@ -772,6 +783,8 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
772
783
|
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>>;
|
|
773
784
|
};
|
|
774
785
|
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
786
|
+
configProblemsOf(conf: import("@jbrowse/core/configuration").AnyConfigurationModel): string[];
|
|
787
|
+
readonly liveNotices: string[];
|
|
775
788
|
} & {
|
|
776
789
|
setStatusMessage(status?: import("@jbrowse/core/util").RpcStatus): void;
|
|
777
790
|
setError(error?: unknown): void;
|
|
@@ -790,15 +803,23 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
790
803
|
} & {
|
|
791
804
|
readonly plotKeys: string[];
|
|
792
805
|
readonly plot: import("@jbrowse/core/configuration").Plot;
|
|
806
|
+
readonly configNotices: string[];
|
|
807
|
+
readonly notices: string[];
|
|
808
|
+
readonly cornerNotices: string[];
|
|
793
809
|
readonly plotExamples: readonly import("@jbrowse/core/configuration").PlotExample[];
|
|
794
810
|
readonly configDocsUrl: string;
|
|
795
|
-
liftPlot(draft: import("@jbrowse/core/configuration").Plot): import("@jbrowse/core/configuration").AnyConfigurationModel;
|
|
796
|
-
plotProblems(draft: import("@jbrowse/core/configuration").Plot): string[];
|
|
797
|
-
plotWrites(draft: import("@jbrowse/core/configuration").Plot): Record<string, unknown>;
|
|
811
|
+
liftPlot(draft: import("@jbrowse/core/configuration").Plot, options?: import("@jbrowse/core/configuration").PlotWriteOptions): import("@jbrowse/core/configuration").AnyConfigurationModel;
|
|
812
|
+
plotProblems(draft: import("@jbrowse/core/configuration").Plot, options?: import("@jbrowse/core/configuration").PlotWriteOptions): string[];
|
|
813
|
+
plotWrites(draft: import("@jbrowse/core/configuration").Plot, options?: import("@jbrowse/core/configuration").PlotWriteOptions): Record<string, unknown>;
|
|
798
814
|
} & {
|
|
799
|
-
applyPlot(draft: import("@jbrowse/core/configuration").Plot): void;
|
|
815
|
+
applyPlot(draft: import("@jbrowse/core/configuration").Plot, options?: import("@jbrowse/core/configuration").PlotWriteOptions): void;
|
|
800
816
|
} & {
|
|
801
817
|
scrollTop: number;
|
|
818
|
+
hostHeight: number | undefined;
|
|
819
|
+
} & {
|
|
820
|
+
readonly configuredHeight: number;
|
|
821
|
+
} & {
|
|
822
|
+
readonly allottedHeight: number;
|
|
802
823
|
} & {
|
|
803
824
|
readonly height: number;
|
|
804
825
|
readonly resizing: boolean;
|
|
@@ -808,6 +829,7 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
808
829
|
readonly scrollableHeight: number;
|
|
809
830
|
} & {
|
|
810
831
|
setScrollTop(scrollTop: number): void;
|
|
832
|
+
setHostHeight(height: number | undefined): void;
|
|
811
833
|
setHeight(displayHeight: number): number;
|
|
812
834
|
resizeHeight(distance: number): number;
|
|
813
835
|
} & {
|
|
@@ -1188,6 +1210,8 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
1188
1210
|
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>>;
|
|
1189
1211
|
};
|
|
1190
1212
|
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
1213
|
+
configProblemsOf(conf: import("@jbrowse/core/configuration").AnyConfigurationModel): string[];
|
|
1214
|
+
readonly liveNotices: string[];
|
|
1191
1215
|
} & {
|
|
1192
1216
|
setStatusMessage(status?: import("@jbrowse/core/util").RpcStatus): void;
|
|
1193
1217
|
setError(error?: unknown): void;
|
|
@@ -1206,15 +1230,23 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
1206
1230
|
} & {
|
|
1207
1231
|
readonly plotKeys: string[];
|
|
1208
1232
|
readonly plot: import("@jbrowse/core/configuration").Plot;
|
|
1233
|
+
readonly configNotices: string[];
|
|
1234
|
+
readonly notices: string[];
|
|
1235
|
+
readonly cornerNotices: string[];
|
|
1209
1236
|
readonly plotExamples: readonly import("@jbrowse/core/configuration").PlotExample[];
|
|
1210
1237
|
readonly configDocsUrl: string;
|
|
1211
|
-
liftPlot(draft: import("@jbrowse/core/configuration").Plot): import("@jbrowse/core/configuration").AnyConfigurationModel;
|
|
1212
|
-
plotProblems(draft: import("@jbrowse/core/configuration").Plot): string[];
|
|
1213
|
-
plotWrites(draft: import("@jbrowse/core/configuration").Plot): Record<string, unknown>;
|
|
1238
|
+
liftPlot(draft: import("@jbrowse/core/configuration").Plot, options?: import("@jbrowse/core/configuration").PlotWriteOptions): import("@jbrowse/core/configuration").AnyConfigurationModel;
|
|
1239
|
+
plotProblems(draft: import("@jbrowse/core/configuration").Plot, options?: import("@jbrowse/core/configuration").PlotWriteOptions): string[];
|
|
1240
|
+
plotWrites(draft: import("@jbrowse/core/configuration").Plot, options?: import("@jbrowse/core/configuration").PlotWriteOptions): Record<string, unknown>;
|
|
1214
1241
|
} & {
|
|
1215
|
-
applyPlot(draft: import("@jbrowse/core/configuration").Plot): void;
|
|
1242
|
+
applyPlot(draft: import("@jbrowse/core/configuration").Plot, options?: import("@jbrowse/core/configuration").PlotWriteOptions): void;
|
|
1216
1243
|
} & {
|
|
1217
1244
|
scrollTop: number;
|
|
1245
|
+
hostHeight: number | undefined;
|
|
1246
|
+
} & {
|
|
1247
|
+
readonly configuredHeight: number;
|
|
1248
|
+
} & {
|
|
1249
|
+
readonly allottedHeight: number;
|
|
1218
1250
|
} & {
|
|
1219
1251
|
readonly height: number;
|
|
1220
1252
|
readonly resizing: boolean;
|
|
@@ -1224,6 +1256,7 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
1224
1256
|
readonly scrollableHeight: number;
|
|
1225
1257
|
} & {
|
|
1226
1258
|
setScrollTop(scrollTop: number): void;
|
|
1259
|
+
setHostHeight(height: number | undefined): void;
|
|
1227
1260
|
setHeight(displayHeight: number): number;
|
|
1228
1261
|
resizeHeight(distance: number): number;
|
|
1229
1262
|
} & {
|
package/esm/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
5
5
|
/**
|
|
6
6
|
* #config LinearGenomeViewConfigSchema
|
|
7
7
|
* #category root
|
|
8
|
+
* Sets defaults for every linear genome view, on the root config under
|
|
9
|
+
* `configuration.LinearGenomeViewPlugin`.
|
|
8
10
|
*/
|
|
9
11
|
configurationSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
10
12
|
readonly trackLabels: {
|
|
@@ -19,7 +21,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
19
21
|
configure(pluginManager: PluginManager): void;
|
|
20
22
|
}
|
|
21
23
|
export { DisplayChromeOverlayProvider, DisplayUIProvider, FloatingLegend, TrackControlProvider, plainChromeOverlays, plainTrackControl, useTrackControlMenu, } from '@jbrowse/display-ui';
|
|
22
|
-
export type {
|
|
24
|
+
export type { BackgroundProgressProps, DisplayChromeOverlays, ErrorBarProps, LegendItem, LegendSection, LoadingProps, RenderErrorProps, TooLargeProps, TrackControlComponent, TrackControlIcon, TrackControlMenu, TrackControlOption, TrackControlProps, } from '@jbrowse/display-ui';
|
|
23
25
|
export { HighlightChip, type LinearGenomeViewModel, type LinearGenomeViewStateModel, installLinkedViewSync, stateModelFactory as linearGenomeViewStateModelFactory, } from './LinearGenomeView/index.ts';
|
|
24
26
|
export { default as SearchBox } from './LinearGenomeView/components/SearchBox.tsx';
|
|
25
27
|
export { default as HeaderSearchBoxRow } from './LinearGenomeView/components/HeaderSearchBoxRow.tsx';
|
|
@@ -32,7 +34,7 @@ export { fetchResults, SearchResultsNotFoundError } from './searchUtils.ts';
|
|
|
32
34
|
export type { LaunchLinearGenomeViewArgs } from './LaunchLinearGenomeView/index.ts';
|
|
33
35
|
export type { BpOffset, ExportSvgOptions, HighlightInput, HighlightType, InitState, LinearGenomeViewLaunchProps, NavLocation, TrackLabelMode, ViewTrackLabelMode, VolatileGuide, } from './LinearGenomeView/types.ts';
|
|
34
36
|
export type { ScalebarRefNameLabel } from './LinearGenomeView/util.ts';
|
|
35
|
-
export type { HighlightRegion } from './LinearGenomeView/model.ts';
|
|
37
|
+
export type { HighlightRegion, SearchPickerRow, SearchPickerState, } from './LinearGenomeView/model.ts';
|
|
36
38
|
export type { RegionsOrientation } from './LinearGenomeView/util.ts';
|
|
37
39
|
export type { RegionEdit } from './LinearGenomeView/util.ts';
|
|
38
40
|
export { makeTicks } from './LinearGenomeView/util.ts';
|
package/esm/index.js
CHANGED
|
@@ -13,11 +13,13 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
13
13
|
/**
|
|
14
14
|
* #config LinearGenomeViewConfigSchema
|
|
15
15
|
* #category root
|
|
16
|
+
* Sets defaults for every linear genome view, on the root config under
|
|
17
|
+
* `configuration.LinearGenomeViewPlugin`.
|
|
16
18
|
*/
|
|
17
19
|
configurationSchema = ConfigurationSchema('LinearGenomeViewConfigSchema', {
|
|
18
20
|
/**
|
|
19
21
|
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
20
|
-
*
|
|
22
|
+
* The placement of a track's name: `offset` gives it its own line above the
|
|
21
23
|
* data, `overlapping` floats it over the top of the data to save vertical
|
|
22
24
|
* space, `hidden` omits it. The view menu's "Track labels" submenu sets the
|
|
23
25
|
* same thing per session
|
package/esm/searchUtils.js
CHANGED
|
@@ -170,6 +170,7 @@ export function notifySearchFailure(session, e) {
|
|
|
170
170
|
// otherwise tell "showing it" from "asked you which one".
|
|
171
171
|
export async function handleSelectedRegion({ input, model, assemblyName, grow, showHitTrack, }) {
|
|
172
172
|
const { assemblyManager, textSearchManager } = getSession(model);
|
|
173
|
+
model.closeSearchPicker();
|
|
173
174
|
// resolves only once regions/aliases are loaded, which isValidRefName needs
|
|
174
175
|
// (it throws otherwise). A load failure is not this function's to report:
|
|
175
176
|
// swallow it and let the input fall through to the text-search path below
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* single view reads one coordinate per edge and the multi-level rubberband reads
|
|
5
5
|
* one per level.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
declare const RubberbandSpan: ({ left, width, viewWidth, stickyTop, leftLabel, rightLabel, size, }: {
|
|
8
8
|
left: number;
|
|
9
9
|
width: number;
|
|
10
10
|
viewWidth: number;
|
|
@@ -12,4 +12,5 @@ export default function RubberbandSpan({ left, width, viewWidth, stickyTop, left
|
|
|
12
12
|
leftLabel: React.ReactNode;
|
|
13
13
|
rightLabel: React.ReactNode;
|
|
14
14
|
size?: React.ReactNode;
|
|
15
|
-
})
|
|
15
|
+
}) => import("react").JSX.Element;
|
|
16
|
+
export default RubberbandSpan;
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { alpha } from '@jbrowse/core/ui/palette';
|
|
3
3
|
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
4
4
|
import { Typography } from '@mui/material';
|
|
5
|
+
import { observer } from 'mobx-react';
|
|
5
6
|
import { LABEL_WIDTH, SpanEdgeLabels } from './coordLabels.js';
|
|
6
7
|
const useStyles = makeStyles()(theme => ({
|
|
7
8
|
rubberband: {
|
|
@@ -23,7 +24,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
23
24
|
* single view reads one coordinate per edge and the multi-level rubberband reads
|
|
24
25
|
* one per level.
|
|
25
26
|
*/
|
|
26
|
-
|
|
27
|
+
const RubberbandSpan = observer(function RubberbandSpan({ left, width, viewWidth, stickyTop, leftLabel, rightLabel, size, }) {
|
|
27
28
|
const { classes } = useStyles();
|
|
28
29
|
// a label only moves inside its edge when the span can hold it, so a sliver of
|
|
29
30
|
// a selection at a view border keeps both labels outside and takes the clip
|
|
@@ -31,4 +32,5 @@ export default function RubberbandSpan({ left, width, viewWidth, stickyTop, left
|
|
|
31
32
|
return (_jsxs("div", { className: classes.rubberband, style: { transform: `translateX(${left}px)`, width }, children: [_jsx(SpanEdgeLabels, { stickyTop: stickyTop, left: leftLabel, right: rightLabel, insideLeft: fitsInside && left < LABEL_WIDTH, insideRight: fitsInside && left + width > viewWidth - LABEL_WIDTH }), size ? (_jsx(Typography, { variant: "h6", className: classes.rubberbandText, style: stickyTop === undefined
|
|
32
33
|
? undefined
|
|
33
34
|
: { position: 'sticky', top: stickyTop }, children: size })) : null] }));
|
|
34
|
-
}
|
|
35
|
+
});
|
|
36
|
+
export default RubberbandSpan;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export declare const LABEL_WIDTH = 100;
|
|
2
2
|
/** A red vertical line at `coordX` with `children` labelled above it. */
|
|
3
|
-
export declare
|
|
3
|
+
export declare const VerticalGuideLine: ({ coordX, viewWidth, stickyTop, children, }: {
|
|
4
4
|
coordX: number;
|
|
5
5
|
viewWidth: number;
|
|
6
6
|
stickyTop: string | undefined;
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
-
})
|
|
8
|
+
}) => import("react").JSX.Element;
|
|
9
9
|
/**
|
|
10
10
|
* The bp coordinate under a vertical guide, drawn just above the top of the
|
|
11
11
|
* guide line so it covers neither the line nor the cursor hovering the scalebar
|
|
@@ -26,22 +26,22 @@ export declare function VerticalGuideLine({ coordX, viewWidth, stickyTop, childr
|
|
|
26
26
|
* measured once per hover, not per mousemove — only `coordX` changes as the
|
|
27
27
|
* mouse moves, and that needs no measurement.
|
|
28
28
|
*/
|
|
29
|
-
export declare
|
|
29
|
+
export declare const GuideLabel: ({ coordX, viewWidth, stickyTop, children, }: {
|
|
30
30
|
coordX: number;
|
|
31
31
|
viewWidth: number;
|
|
32
32
|
stickyTop: string | undefined;
|
|
33
33
|
children: React.ReactNode;
|
|
34
|
-
})
|
|
34
|
+
}) => import("react").JSX.Element;
|
|
35
35
|
/**
|
|
36
36
|
* The bp coordinates of a rubberband selection, one label just outside each edge
|
|
37
37
|
* of the span. Renders inside the span, so the edges are its own box. A label
|
|
38
38
|
* with no room outside its edge flips inside instead, which is why the span it
|
|
39
39
|
* has to fit in is a prop.
|
|
40
40
|
*/
|
|
41
|
-
export declare
|
|
41
|
+
export declare const SpanEdgeLabels: ({ stickyTop, left, right, insideLeft, insideRight, }: {
|
|
42
42
|
stickyTop: string | undefined;
|
|
43
43
|
left: React.ReactNode;
|
|
44
44
|
right: React.ReactNode;
|
|
45
45
|
insideLeft: boolean;
|
|
46
46
|
insideRight: boolean;
|
|
47
|
-
})
|
|
47
|
+
}) => import("react").JSX.Element;
|
|
@@ -3,6 +3,7 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
3
3
|
import { alpha } from '@jbrowse/core/ui/palette';
|
|
4
4
|
import { MUI_TOOLTIP_Z_INDEX } from '@jbrowse/core/ui/zIndexes';
|
|
5
5
|
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
6
|
+
import { observer } from 'mobx-react';
|
|
6
7
|
import { createPortal } from 'react-dom';
|
|
7
8
|
// roughly how wide a coordinate label is. the guide clamps itself half of this
|
|
8
9
|
// from either border, and a rubberband label that would hang off a border goes
|
|
@@ -62,10 +63,10 @@ const useStyles = makeStyles()(theme => ({
|
|
|
62
63
|
},
|
|
63
64
|
}));
|
|
64
65
|
/** A red vertical line at `coordX` with `children` labelled above it. */
|
|
65
|
-
export function VerticalGuideLine({ coordX, viewWidth, stickyTop, children, }) {
|
|
66
|
+
export const VerticalGuideLine = observer(function VerticalGuideLine({ coordX, viewWidth, stickyTop, children, }) {
|
|
66
67
|
const { classes } = useStyles();
|
|
67
68
|
return (_jsxs(_Fragment, { children: [_jsx(GuideLabel, { coordX: coordX, viewWidth: viewWidth, stickyTop: stickyTop, children: children }), _jsx("div", { className: classes.guideLine, style: { transform: `translateX(${coordX}px)` } })] }));
|
|
68
|
-
}
|
|
69
|
+
});
|
|
69
70
|
function anchorStyle(stickyTop) {
|
|
70
71
|
return stickyTop === undefined
|
|
71
72
|
? { position: 'relative' }
|
|
@@ -91,7 +92,7 @@ function anchorStyle(stickyTop) {
|
|
|
91
92
|
* measured once per hover, not per mousemove — only `coordX` changes as the
|
|
92
93
|
* mouse moves, and that needs no measurement.
|
|
93
94
|
*/
|
|
94
|
-
export function GuideLabel({ coordX, viewWidth, stickyTop, children, }) {
|
|
95
|
+
export const GuideLabel = observer(function GuideLabel({ coordX, viewWidth, stickyTop, children, }) {
|
|
95
96
|
const { classes, cx } = useStyles();
|
|
96
97
|
const anchorRef = useRef(null);
|
|
97
98
|
const [anchorPos, setAnchorPos] = useState();
|
|
@@ -120,14 +121,14 @@ export function GuideLabel({ coordX, viewWidth, stickyTop, children, }) {
|
|
|
120
121
|
bottom: anchorPos.viewportHeight - anchorPos.top + LABEL_GAP,
|
|
121
122
|
}, children: children }), document.body)
|
|
122
123
|
: null] }));
|
|
123
|
-
}
|
|
124
|
+
});
|
|
124
125
|
/**
|
|
125
126
|
* The bp coordinates of a rubberband selection, one label just outside each edge
|
|
126
127
|
* of the span. Renders inside the span, so the edges are its own box. A label
|
|
127
128
|
* with no room outside its edge flips inside instead, which is why the span it
|
|
128
129
|
* has to fit in is a prop.
|
|
129
130
|
*/
|
|
130
|
-
export function SpanEdgeLabels({ stickyTop, left, right, insideLeft, insideRight, }) {
|
|
131
|
+
export const SpanEdgeLabels = observer(function SpanEdgeLabels({ stickyTop, left, right, insideLeft, insideRight, }) {
|
|
131
132
|
const { classes, cx } = useStyles();
|
|
132
133
|
return (_jsxs("div", { className: classes.anchor, style: anchorStyle(stickyTop), children: [_jsx("div", { className: cx(classes.label, classes.spanLabel, insideLeft ? classes.insideLeftEdge : classes.leftOfEdge), children: left }), _jsx("div", { className: cx(classes.label, classes.spanLabel, insideRight ? classes.insideRightEdge : classes.rightOfEdge), children: right })] }));
|
|
133
|
-
}
|
|
134
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-linear-genome-view",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "JBrowse 2 linear genome view",
|
|
6
6
|
"keywords": [
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
"esm"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@jbrowse/mobx-state-tree": "^6.
|
|
25
|
-
"@mui/icons-material": "^9.
|
|
26
|
-
"@mui/material": "^9.
|
|
27
|
-
"mobx": "^7.0.
|
|
24
|
+
"@jbrowse/mobx-state-tree": "^6.9.0",
|
|
25
|
+
"@mui/icons-material": "^9.5.0",
|
|
26
|
+
"@mui/material": "^9.5.0",
|
|
27
|
+
"mobx": "^7.0.6",
|
|
28
28
|
"mobx-react": "^10.0.2",
|
|
29
|
-
"@jbrowse/display-kit": "^5.0.0-beta.
|
|
30
|
-
"@jbrowse/
|
|
31
|
-
"@jbrowse/
|
|
32
|
-
"@jbrowse/
|
|
29
|
+
"@jbrowse/display-kit": "^5.0.0-beta.15",
|
|
30
|
+
"@jbrowse/display-ui": "^5.0.0-beta.15",
|
|
31
|
+
"@jbrowse/core": "^5.0.0-beta.15",
|
|
32
|
+
"@jbrowse/render-core": "^5.0.0-beta.15"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": ">=19.0.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"sideEffects": false,
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@jbrowse/display-test-utils": "^5.0.0-beta.
|
|
43
|
+
"@jbrowse/display-test-utils": "^5.0.0-beta.15"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"prebuild": "pnpm clean",
|