@jbrowse/plugin-linear-genome-view 5.0.0-beta.1 → 5.0.0-beta.2
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/LaunchLinearGenomeView/index.js +2 -13
- package/esm/LinearGenomeView/afterAttach.js +16 -18
- package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +1 -1
- package/esm/LinearGenomeView/components/PaddingBlocks.js +11 -1
- package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +1 -1
- package/esm/LinearGenomeView/components/ZoomButton.js +6 -1
- package/esm/LinearGenomeView/components/ZoomTransform.js +4 -0
- package/esm/LinearGenomeView/components/searchModes.d.ts +1 -1
- package/esm/LinearGenomeView/components/searchModes.js +1 -1
- package/esm/LinearGenomeView/index.d.ts +1 -0
- package/esm/LinearGenomeView/index.js +8 -1
- package/esm/LinearGenomeView/initKeys.d.ts +0 -1
- package/esm/LinearGenomeView/initKeys.js +9 -45
- package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
- package/esm/LinearGenomeView/launchKeys.js +23 -0
- package/esm/LinearGenomeView/lazyDialogs.d.ts +1 -1
- package/esm/LinearGenomeView/linkedViewSync.d.ts +1 -1
- package/esm/LinearGenomeView/linkedViewSync.js +6 -0
- package/esm/LinearGenomeView/model.d.ts +1734 -22
- package/esm/LinearGenomeView/model.js +121 -57
- package/esm/LinearGenomeView/svgcomponents/figureContract.js +14 -14
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +2 -2
- package/esm/LinearGenomeView/types.d.ts +1 -1
- package/esm/displayKitTests/perRegionTestEnv.d.ts +51 -28
- package/esm/displayKitTests/perRegionTestEnv.js +0 -3
- package/esm/index.d.ts +14 -2
- package/esm/index.js +1 -2
- package/esm/searchUtils.d.ts +6 -3
- package/esm/searchUtils.js +37 -11
- package/package.json +8 -8
- package/esm/LinearGenomeView/FloatingSvgOverlay.d.ts +0 -5
- package/esm/LinearGenomeView/FloatingSvgOverlay.js +0 -25
|
@@ -45,7 +45,6 @@ export interface PerRegionTestControl {
|
|
|
45
45
|
/** Which of the gate's opt-in hooks this display overrides. */
|
|
46
46
|
export interface GateOptIns {
|
|
47
47
|
gateEnabled?: boolean;
|
|
48
|
-
densityGateEnabled?: boolean;
|
|
49
48
|
}
|
|
50
49
|
declare function makeStateModel(control: PerRegionTestControl, gate: GateOptIns, configSchema: AnyConfigurationSchemaType): import("@jbrowse/mobx-state-tree").IModelType<Omit<Omit<Omit<{
|
|
51
50
|
id: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
@@ -246,6 +245,16 @@ declare function makeStateModel(control: PerRegionTestControl, gate: GateOptIns,
|
|
|
246
245
|
setError(error?: unknown): void;
|
|
247
246
|
clearHoveredFeature(): void;
|
|
248
247
|
reload(): void;
|
|
248
|
+
applyDisplaySettings(settings: Record<string, unknown>, options?: {
|
|
249
|
+
allowSetters?: boolean;
|
|
250
|
+
}): {
|
|
251
|
+
applied: string[];
|
|
252
|
+
unapplied: string[];
|
|
253
|
+
failed: {
|
|
254
|
+
key: string;
|
|
255
|
+
error: string;
|
|
256
|
+
}[];
|
|
257
|
+
};
|
|
249
258
|
} & {
|
|
250
259
|
scrollTop: number;
|
|
251
260
|
} & {
|
|
@@ -265,7 +274,6 @@ declare function makeStateModel(control: PerRegionTestControl, gate: GateOptIns,
|
|
|
265
274
|
gateMeasuredViewportKey: string | undefined;
|
|
266
275
|
} & {
|
|
267
276
|
readonly gateEnabled: boolean;
|
|
268
|
-
readonly densityGateEnabled: boolean;
|
|
269
277
|
readonly byteGateAdapterConfig: Record<string, unknown>;
|
|
270
278
|
readonly configuredFetchSizeLimit: number | undefined;
|
|
271
279
|
readonly densityTooLarge: boolean;
|
|
@@ -295,15 +303,10 @@ declare function makeStateModel(control: PerRegionTestControl, gate: GateOptIns,
|
|
|
295
303
|
} & {
|
|
296
304
|
readonly gateSkipsMeasuredViewport: boolean;
|
|
297
305
|
} & {
|
|
298
|
-
setByteEstimate(measurement: {
|
|
299
|
-
bytes: number;
|
|
300
|
-
viewport: import("@jbrowse/display-kit/regionTooLargeUtils").GateViewport;
|
|
301
|
-
}): void;
|
|
302
306
|
clearByteEstimate(): void;
|
|
303
307
|
setForceLoadTrack(flag: boolean): void;
|
|
304
|
-
reload(): void;
|
|
305
308
|
} & {
|
|
306
|
-
commitFetchBytes(perRegionBytes: (number | undefined)[], issued: import("@jbrowse/display-kit/regionTooLargeUtils").GateFetchState): void;
|
|
309
|
+
commitFetchBytes(perRegionBytes: (number | undefined)[], issued: import("@jbrowse/display-kit/regionTooLargeUtils").GateFetchState, partial?: boolean): void;
|
|
307
310
|
} & {
|
|
308
311
|
forceLoad(): void;
|
|
309
312
|
} & {
|
|
@@ -349,6 +352,7 @@ declare function makeStateModel(control: PerRegionTestControl, gate: GateOptIns,
|
|
|
349
352
|
readonly isLoadingOrCanceled: boolean;
|
|
350
353
|
readonly fetchInert: boolean;
|
|
351
354
|
readonly awaitingPrerequisite: boolean;
|
|
355
|
+
readonly awaitingDependentData: boolean;
|
|
352
356
|
readonly rpcPropsCacheKey: string;
|
|
353
357
|
} & {
|
|
354
358
|
setError(error?: unknown): void;
|
|
@@ -359,8 +363,10 @@ declare function makeStateModel(control: PerRegionTestControl, gate: GateOptIns,
|
|
|
359
363
|
} & {
|
|
360
364
|
cancelFetch(): void;
|
|
361
365
|
cancelFetchByUser(): void;
|
|
366
|
+
reload(): void;
|
|
362
367
|
beforeDestroy(): void;
|
|
363
|
-
|
|
368
|
+
beginFetch(stopToken: import("@jbrowse/core/util").StopToken): void;
|
|
369
|
+
endFetch(current: boolean): void;
|
|
364
370
|
} & {
|
|
365
371
|
runFetch: (work: (ctx: import("@jbrowse/display-kit/FetchMixin").FetchContext) => Promise<void>) => Promise<void>;
|
|
366
372
|
} & {
|
|
@@ -369,8 +375,10 @@ declare function makeStateModel(control: PerRegionTestControl, gate: GateOptIns,
|
|
|
369
375
|
readonly host: import("@jbrowse/display-kit/regionHost").RegionHost;
|
|
370
376
|
readonly canvasWidthPx: number;
|
|
371
377
|
readonly canRender: boolean;
|
|
378
|
+
readonly rendersCanvas: boolean;
|
|
372
379
|
readonly viewportWithinLoadedData: boolean;
|
|
373
380
|
readonly viewportEmpty: boolean;
|
|
381
|
+
readonly fetchSuspended: boolean;
|
|
374
382
|
readonly layoutReady: boolean;
|
|
375
383
|
readonly regionFetchKey: string;
|
|
376
384
|
regionHasData(_displayedRegionIndex: number): boolean;
|
|
@@ -411,7 +419,6 @@ declare function makeStateModel(control: PerRegionTestControl, gate: GateOptIns,
|
|
|
411
419
|
fetchKey: string;
|
|
412
420
|
} & {
|
|
413
421
|
readonly gateEnabled: boolean;
|
|
414
|
-
readonly densityGateEnabled: boolean;
|
|
415
422
|
readonly densityTooLarge: boolean;
|
|
416
423
|
readonly regionFetchKey: string;
|
|
417
424
|
regionHasData(_displayedRegionIndex: number): boolean;
|
|
@@ -703,6 +710,16 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
703
710
|
setError(error?: unknown): void;
|
|
704
711
|
clearHoveredFeature(): void;
|
|
705
712
|
reload(): void;
|
|
713
|
+
applyDisplaySettings(settings: Record<string, unknown>, options?: {
|
|
714
|
+
allowSetters?: boolean;
|
|
715
|
+
}): {
|
|
716
|
+
applied: string[];
|
|
717
|
+
unapplied: string[];
|
|
718
|
+
failed: {
|
|
719
|
+
key: string;
|
|
720
|
+
error: string;
|
|
721
|
+
}[];
|
|
722
|
+
};
|
|
706
723
|
} & {
|
|
707
724
|
scrollTop: number;
|
|
708
725
|
} & {
|
|
@@ -722,7 +739,6 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
722
739
|
gateMeasuredViewportKey: string | undefined;
|
|
723
740
|
} & {
|
|
724
741
|
readonly gateEnabled: boolean;
|
|
725
|
-
readonly densityGateEnabled: boolean;
|
|
726
742
|
readonly byteGateAdapterConfig: Record<string, unknown>;
|
|
727
743
|
readonly configuredFetchSizeLimit: number | undefined;
|
|
728
744
|
readonly densityTooLarge: boolean;
|
|
@@ -752,15 +768,10 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
752
768
|
} & {
|
|
753
769
|
readonly gateSkipsMeasuredViewport: boolean;
|
|
754
770
|
} & {
|
|
755
|
-
setByteEstimate(measurement: {
|
|
756
|
-
bytes: number;
|
|
757
|
-
viewport: import("@jbrowse/display-kit/regionTooLargeUtils").GateViewport;
|
|
758
|
-
}): void;
|
|
759
771
|
clearByteEstimate(): void;
|
|
760
772
|
setForceLoadTrack(flag: boolean): void;
|
|
761
|
-
reload(): void;
|
|
762
773
|
} & {
|
|
763
|
-
commitFetchBytes(perRegionBytes: (number | undefined)[], issued: import("@jbrowse/display-kit/regionTooLargeUtils").GateFetchState): void;
|
|
774
|
+
commitFetchBytes(perRegionBytes: (number | undefined)[], issued: import("@jbrowse/display-kit/regionTooLargeUtils").GateFetchState, partial?: boolean): void;
|
|
764
775
|
} & {
|
|
765
776
|
forceLoad(): void;
|
|
766
777
|
} & {
|
|
@@ -806,6 +817,7 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
806
817
|
readonly isLoadingOrCanceled: boolean;
|
|
807
818
|
readonly fetchInert: boolean;
|
|
808
819
|
readonly awaitingPrerequisite: boolean;
|
|
820
|
+
readonly awaitingDependentData: boolean;
|
|
809
821
|
readonly rpcPropsCacheKey: string;
|
|
810
822
|
} & {
|
|
811
823
|
setError(error?: unknown): void;
|
|
@@ -816,8 +828,10 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
816
828
|
} & {
|
|
817
829
|
cancelFetch(): void;
|
|
818
830
|
cancelFetchByUser(): void;
|
|
831
|
+
reload(): void;
|
|
819
832
|
beforeDestroy(): void;
|
|
820
|
-
|
|
833
|
+
beginFetch(stopToken: import("@jbrowse/core/util").StopToken): void;
|
|
834
|
+
endFetch(current: boolean): void;
|
|
821
835
|
} & {
|
|
822
836
|
runFetch: (work: (ctx: import("@jbrowse/display-kit/FetchMixin").FetchContext) => Promise<void>) => Promise<void>;
|
|
823
837
|
} & {
|
|
@@ -826,8 +840,10 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
826
840
|
readonly host: import("@jbrowse/display-kit/regionHost").RegionHost;
|
|
827
841
|
readonly canvasWidthPx: number;
|
|
828
842
|
readonly canRender: boolean;
|
|
843
|
+
readonly rendersCanvas: boolean;
|
|
829
844
|
readonly viewportWithinLoadedData: boolean;
|
|
830
845
|
readonly viewportEmpty: boolean;
|
|
846
|
+
readonly fetchSuspended: boolean;
|
|
831
847
|
readonly layoutReady: boolean;
|
|
832
848
|
readonly regionFetchKey: string;
|
|
833
849
|
regionHasData(_displayedRegionIndex: number): boolean;
|
|
@@ -868,7 +884,6 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
868
884
|
fetchKey: string;
|
|
869
885
|
} & {
|
|
870
886
|
readonly gateEnabled: boolean;
|
|
871
|
-
readonly densityGateEnabled: boolean;
|
|
872
887
|
readonly densityTooLarge: boolean;
|
|
873
888
|
readonly regionFetchKey: string;
|
|
874
889
|
regionHasData(_displayedRegionIndex: number): boolean;
|
|
@@ -1077,6 +1092,16 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
1077
1092
|
setError(error?: unknown): void;
|
|
1078
1093
|
clearHoveredFeature(): void;
|
|
1079
1094
|
reload(): void;
|
|
1095
|
+
applyDisplaySettings(settings: Record<string, unknown>, options?: {
|
|
1096
|
+
allowSetters?: boolean;
|
|
1097
|
+
}): {
|
|
1098
|
+
applied: string[];
|
|
1099
|
+
unapplied: string[];
|
|
1100
|
+
failed: {
|
|
1101
|
+
key: string;
|
|
1102
|
+
error: string;
|
|
1103
|
+
}[];
|
|
1104
|
+
};
|
|
1080
1105
|
} & {
|
|
1081
1106
|
scrollTop: number;
|
|
1082
1107
|
} & {
|
|
@@ -1096,7 +1121,6 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
1096
1121
|
gateMeasuredViewportKey: string | undefined;
|
|
1097
1122
|
} & {
|
|
1098
1123
|
readonly gateEnabled: boolean;
|
|
1099
|
-
readonly densityGateEnabled: boolean;
|
|
1100
1124
|
readonly byteGateAdapterConfig: Record<string, unknown>;
|
|
1101
1125
|
readonly configuredFetchSizeLimit: number | undefined;
|
|
1102
1126
|
readonly densityTooLarge: boolean;
|
|
@@ -1126,15 +1150,10 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
1126
1150
|
} & {
|
|
1127
1151
|
readonly gateSkipsMeasuredViewport: boolean;
|
|
1128
1152
|
} & {
|
|
1129
|
-
setByteEstimate(measurement: {
|
|
1130
|
-
bytes: number;
|
|
1131
|
-
viewport: import("@jbrowse/display-kit/regionTooLargeUtils").GateViewport;
|
|
1132
|
-
}): void;
|
|
1133
1153
|
clearByteEstimate(): void;
|
|
1134
1154
|
setForceLoadTrack(flag: boolean): void;
|
|
1135
|
-
reload(): void;
|
|
1136
1155
|
} & {
|
|
1137
|
-
commitFetchBytes(perRegionBytes: (number | undefined)[], issued: import("@jbrowse/display-kit/regionTooLargeUtils").GateFetchState): void;
|
|
1156
|
+
commitFetchBytes(perRegionBytes: (number | undefined)[], issued: import("@jbrowse/display-kit/regionTooLargeUtils").GateFetchState, partial?: boolean): void;
|
|
1138
1157
|
} & {
|
|
1139
1158
|
forceLoad(): void;
|
|
1140
1159
|
} & {
|
|
@@ -1180,6 +1199,7 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
1180
1199
|
readonly isLoadingOrCanceled: boolean;
|
|
1181
1200
|
readonly fetchInert: boolean;
|
|
1182
1201
|
readonly awaitingPrerequisite: boolean;
|
|
1202
|
+
readonly awaitingDependentData: boolean;
|
|
1183
1203
|
readonly rpcPropsCacheKey: string;
|
|
1184
1204
|
} & {
|
|
1185
1205
|
setError(error?: unknown): void;
|
|
@@ -1190,8 +1210,10 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
1190
1210
|
} & {
|
|
1191
1211
|
cancelFetch(): void;
|
|
1192
1212
|
cancelFetchByUser(): void;
|
|
1213
|
+
reload(): void;
|
|
1193
1214
|
beforeDestroy(): void;
|
|
1194
|
-
|
|
1215
|
+
beginFetch(stopToken: import("@jbrowse/core/util").StopToken): void;
|
|
1216
|
+
endFetch(current: boolean): void;
|
|
1195
1217
|
} & {
|
|
1196
1218
|
runFetch: (work: (ctx: import("@jbrowse/display-kit/FetchMixin").FetchContext) => Promise<void>) => Promise<void>;
|
|
1197
1219
|
} & {
|
|
@@ -1200,8 +1222,10 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
1200
1222
|
readonly host: import("@jbrowse/display-kit/regionHost").RegionHost;
|
|
1201
1223
|
readonly canvasWidthPx: number;
|
|
1202
1224
|
readonly canRender: boolean;
|
|
1225
|
+
readonly rendersCanvas: boolean;
|
|
1203
1226
|
readonly viewportWithinLoadedData: boolean;
|
|
1204
1227
|
readonly viewportEmpty: boolean;
|
|
1228
|
+
readonly fetchSuspended: boolean;
|
|
1205
1229
|
readonly layoutReady: boolean;
|
|
1206
1230
|
readonly regionFetchKey: string;
|
|
1207
1231
|
regionHasData(_displayedRegionIndex: number): boolean;
|
|
@@ -1242,7 +1266,6 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
|
|
|
1242
1266
|
fetchKey: string;
|
|
1243
1267
|
} & {
|
|
1244
1268
|
readonly gateEnabled: boolean;
|
|
1245
|
-
readonly densityGateEnabled: boolean;
|
|
1246
1269
|
readonly densityTooLarge: boolean;
|
|
1247
1270
|
readonly regionFetchKey: string;
|
|
1248
1271
|
regionHasData(_displayedRegionIndex: number): boolean;
|
|
@@ -41,9 +41,6 @@ function makeStateModel(control, gate, configSchema) {
|
|
|
41
41
|
get gateEnabled() {
|
|
42
42
|
return gate.gateEnabled ?? false;
|
|
43
43
|
},
|
|
44
|
-
get densityGateEnabled() {
|
|
45
|
-
return gate.densityGateEnabled ?? false;
|
|
46
|
-
},
|
|
47
44
|
get densityTooLarge() {
|
|
48
45
|
return control.densityTooLarge;
|
|
49
46
|
},
|
package/esm/index.d.ts
CHANGED
|
@@ -4,6 +4,19 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
4
4
|
name: string;
|
|
5
5
|
exports: {
|
|
6
6
|
baseLinearDisplayConfigSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
7
|
+
readonly densityTier: {
|
|
8
|
+
readonly type: 'stringEnum';
|
|
9
|
+
readonly model: import("@jbrowse/mobx-state-tree").ISimpleType<"auto" | "density" | "features">;
|
|
10
|
+
readonly defaultValue: 'auto';
|
|
11
|
+
readonly description: 'when to draw the features-per-bin density band in place of features: "auto" swaps to it where the region is too large to fetch, "features" never does and keeps the banner, "density" always does. Needs a density source on the adapter (its densityAdapter slot)';
|
|
12
|
+
readonly advanced: true;
|
|
13
|
+
};
|
|
14
|
+
readonly densityTierBpPerPx: {
|
|
15
|
+
readonly type: 'number';
|
|
16
|
+
readonly defaultValue: 0;
|
|
17
|
+
readonly description: 'in "auto" mode, also draw the density band from this many bp per pixel outward, before the region is too large to fetch; 0 leaves the swap to the fetch-size gate alone';
|
|
18
|
+
readonly advanced: true;
|
|
19
|
+
};
|
|
7
20
|
readonly fetchSizeLimit: {
|
|
8
21
|
readonly type: 'number';
|
|
9
22
|
readonly defaultValue: 1000000;
|
|
@@ -117,8 +130,7 @@ export { default as ExportSvgDialog } from './LinearGenomeView/components/Export
|
|
|
117
130
|
export { GetSequenceDialog } from './LinearGenomeView/lazyDialogs.ts';
|
|
118
131
|
export { default as ConnectedHoverHighlight } from './LinearGenomeView/components/ConnectedHoverHighlight.tsx';
|
|
119
132
|
export { default as HoverPositionHighlight } from './LinearGenomeView/components/HoverPositionHighlight.tsx';
|
|
120
|
-
export { TrackOverlayContext, TrackOverlayPortal, TrackOverlaySlot, } from '@jbrowse/display-ui';
|
|
121
|
-
export { FloatingSvgOverlay } from './LinearGenomeView/FloatingSvgOverlay.tsx';
|
|
133
|
+
export { FloatingSvgOverlay, TrackOverlayContext, TrackOverlayPortal, TrackOverlaySlot, } from '@jbrowse/display-ui';
|
|
122
134
|
export type { HoverHighlightPosition } from './LinearGenomeView/components/HoverPositionHighlight.tsx';
|
|
123
135
|
export { SvgChrome, SvgClipRect } from '@jbrowse/core/svg/SvgExport';
|
|
124
136
|
export { svgSafeId } from '@jbrowse/core/svg/svgId';
|
package/esm/index.js
CHANGED
|
@@ -125,8 +125,7 @@ export { default as HoverPositionHighlight } from './LinearGenomeView/components
|
|
|
125
125
|
// mounts it, and so does an embedder mounting `RenderingComponent` directly —
|
|
126
126
|
// who otherwise supplies no node at all and gets display chrome buried under
|
|
127
127
|
// their own region masks.
|
|
128
|
-
export { TrackOverlayContext, TrackOverlayPortal, TrackOverlaySlot, } from '@jbrowse/display-ui';
|
|
129
|
-
export { FloatingSvgOverlay } from './LinearGenomeView/FloatingSvgOverlay.js';
|
|
128
|
+
export { FloatingSvgOverlay, TrackOverlayContext, TrackOverlayPortal, TrackOverlaySlot, } from '@jbrowse/display-ui';
|
|
130
129
|
export { SvgChrome, SvgClipRect } from '@jbrowse/core/svg/SvgExport';
|
|
131
130
|
// for a display that hand-rolls a <clipPath> instead of using SvgClipRect (an
|
|
132
131
|
// inset or non-rect clip); ids built from a trackId/refName need it
|
package/esm/searchUtils.d.ts
CHANGED
|
@@ -32,28 +32,31 @@ export declare function unanimousResult({ results, model, session, assembly, }:
|
|
|
32
32
|
session: TrackCatalog;
|
|
33
33
|
assembly?: Assembly;
|
|
34
34
|
}): BaseResult | undefined;
|
|
35
|
-
export declare function showSearchResults({ results, query, model, assemblyName, grow, }: {
|
|
35
|
+
export declare function showSearchResults({ results, query, model, assemblyName, grow, showHitTrack, }: {
|
|
36
36
|
results: BaseResult[];
|
|
37
37
|
query: string;
|
|
38
38
|
model: LinearGenomeViewModel;
|
|
39
39
|
assemblyName: string;
|
|
40
40
|
grow?: number;
|
|
41
|
+
showHitTrack?: boolean;
|
|
41
42
|
}): Promise<boolean>;
|
|
42
|
-
export declare function navToOption({ option, model, assemblyName, grow, }: {
|
|
43
|
+
export declare function navToOption({ option, model, assemblyName, grow, showHitTrack, }: {
|
|
43
44
|
model: LinearGenomeViewModel;
|
|
44
45
|
option: BaseResult;
|
|
45
46
|
assemblyName: string;
|
|
46
47
|
grow?: number;
|
|
48
|
+
showHitTrack?: boolean;
|
|
47
49
|
}): Promise<void>;
|
|
48
50
|
export declare class SearchResultsNotFoundError extends Error {
|
|
49
51
|
name: string;
|
|
50
52
|
}
|
|
51
53
|
export declare function notifySearchFailure(session: NotificationSink, e: unknown): void;
|
|
52
|
-
export declare function handleSelectedRegion({ input, model, assemblyName, grow, }: {
|
|
54
|
+
export declare function handleSelectedRegion({ input, model, assemblyName, grow, showHitTrack, }: {
|
|
53
55
|
input: string;
|
|
54
56
|
model: LinearGenomeViewModel;
|
|
55
57
|
assemblyName: string;
|
|
56
58
|
grow?: number;
|
|
59
|
+
showHitTrack?: boolean;
|
|
57
60
|
}): Promise<boolean>;
|
|
58
61
|
export declare function checkRef(str: string, isRef: (name: string) => boolean): boolean;
|
|
59
62
|
export declare function fetchResults({ queryString, searchType, assemblyName, textSearchManager, assembly, stopToken, }: {
|
package/esm/searchUtils.js
CHANGED
|
@@ -86,6 +86,24 @@ function trackRank(result, model, session) {
|
|
|
86
86
|
return session.getTrackById(trackId) ? 1 : 3;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
+
// The pick is a stable minimum, so a linear scan rather than a sort: only the
|
|
90
|
+
// best rung is taken, and keeping the first strictly-lowest one is what leaves
|
|
91
|
+
// an agreeing group with nothing to choose between in the order the ranking
|
|
92
|
+
// handed it. Ranked once per hit for the reason `destinations` above it is:
|
|
93
|
+
// `trackRank` reaches `session.getTrackById`, and a comparator asks O(n log n)
|
|
94
|
+
// times for an answer that does not vary.
|
|
95
|
+
function bestRanked(results, model, session) {
|
|
96
|
+
let best = results[0];
|
|
97
|
+
let bestRank = trackRank(best, model, session);
|
|
98
|
+
for (let i = 1; i < results.length; i++) {
|
|
99
|
+
const rank = trackRank(results[i], model, session);
|
|
100
|
+
if (rank < bestRank) {
|
|
101
|
+
best = results[i];
|
|
102
|
+
bestRank = rank;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return best;
|
|
106
|
+
}
|
|
89
107
|
// The picker exists to disambiguate, and hits that name one feature at one
|
|
90
108
|
// place are not ambiguous — they are several indexes having found it. An
|
|
91
109
|
// instance carrying a handful of gene tracks turns every gene search into a
|
|
@@ -97,16 +115,12 @@ export function unanimousResult({ results, model, session, assembly, }) {
|
|
|
97
115
|
const destinations = results.map(r => destination(r, assembly));
|
|
98
116
|
const agree = destinations[0] !== undefined &&
|
|
99
117
|
destinations.every(d => d === destinations[0]);
|
|
100
|
-
|
|
101
|
-
// order the ranking handed it
|
|
102
|
-
return agree
|
|
103
|
-
? [...results].sort((a, b) => trackRank(a, model, session) - trackRank(b, model, session))[0]
|
|
104
|
-
: undefined;
|
|
118
|
+
return agree ? bestRanked(results, model, session) : undefined;
|
|
105
119
|
}
|
|
106
120
|
// Every multi-hit result set reaches the picker through here, so the two
|
|
107
121
|
// search surfaces cannot disagree about when one is worth raising. Returns
|
|
108
122
|
// whether the view moved.
|
|
109
|
-
export async function showSearchResults({ results, query, model, assemblyName, grow, }) {
|
|
123
|
+
export async function showSearchResults({ results, query, model, assemblyName, grow, showHitTrack, }) {
|
|
110
124
|
const session = getSession(model);
|
|
111
125
|
const unanimous = unanimousResult({
|
|
112
126
|
results,
|
|
@@ -115,7 +129,13 @@ export async function showSearchResults({ results, query, model, assemblyName, g
|
|
|
115
129
|
assembly: session.assemblyManager.get(assemblyName),
|
|
116
130
|
});
|
|
117
131
|
if (unanimous) {
|
|
118
|
-
await navToOption({
|
|
132
|
+
await navToOption({
|
|
133
|
+
option: unanimous,
|
|
134
|
+
model,
|
|
135
|
+
assemblyName,
|
|
136
|
+
grow,
|
|
137
|
+
showHitTrack,
|
|
138
|
+
});
|
|
119
139
|
return true;
|
|
120
140
|
}
|
|
121
141
|
else {
|
|
@@ -127,7 +147,11 @@ export async function showSearchResults({ results, query, model, assemblyName, g
|
|
|
127
147
|
// own edges, which is what this default is; a caller that asked for a specific
|
|
128
148
|
// padding gets that instead.
|
|
129
149
|
const SEARCH_HIT_GROW = 0.2;
|
|
130
|
-
|
|
150
|
+
// A hit lands with the track its index came from shown, which is what a name
|
|
151
|
+
// typed into the search box wants. A session spec that named its own tracks
|
|
152
|
+
// passes false: it asked for those tracks, and a hosted config's full RefSeq
|
|
153
|
+
// appearing beside the curated one it listed read as a bug.
|
|
154
|
+
export async function navToOption({ option, model, assemblyName, grow, showHitTrack = true, }) {
|
|
131
155
|
// getLocation() can be an empty string when a result reports hasLocation()
|
|
132
156
|
// but carries no coordinates; treat that as "no location" and fall back to
|
|
133
157
|
// the label rather than forwarding '' into an empty, view-blanking parse
|
|
@@ -136,8 +160,8 @@ export async function navToOption({ option, model, assemblyName, grow, }) {
|
|
|
136
160
|
const session = getSession(model);
|
|
137
161
|
const { assemblyManager } = session;
|
|
138
162
|
await model.navToLocations(parseLocStrings(location, assemblyName, (ref, asm) => assemblyManager.isValidRefName(ref, asm)), assemblyName, grow ?? SEARCH_HIT_GROW);
|
|
139
|
-
if (trackId && isAlive(model)) {
|
|
140
|
-
model.
|
|
163
|
+
if (showHitTrack && trackId && isAlive(model)) {
|
|
164
|
+
await model.launchTrack(trackId);
|
|
141
165
|
}
|
|
142
166
|
// same detach hazard as showTrack above: navToLocations awaits, and handlers
|
|
143
167
|
// read off the view (the canvas one calls getSession(model) and model.tracks),
|
|
@@ -174,7 +198,7 @@ export function notifySearchFailure(session, e) {
|
|
|
174
198
|
// about where to go and so raise the picker, and a view detached while the
|
|
175
199
|
// search RPC ran — and each of them resolves, so a caller awaiting this cannot
|
|
176
200
|
// otherwise tell "showing it" from "asked you which one".
|
|
177
|
-
export async function handleSelectedRegion({ input, model, assemblyName, grow, }) {
|
|
201
|
+
export async function handleSelectedRegion({ input, model, assemblyName, grow, showHitTrack, }) {
|
|
178
202
|
const { assemblyManager, textSearchManager } = getSession(model);
|
|
179
203
|
// resolves only once regions/aliases are loaded, which isValidRefName needs
|
|
180
204
|
// (it throws otherwise). A load failure is not this function's to report:
|
|
@@ -260,6 +284,7 @@ export async function handleSelectedRegion({ input, model, assemblyName, grow, }
|
|
|
260
284
|
model,
|
|
261
285
|
assemblyName,
|
|
262
286
|
grow,
|
|
287
|
+
showHitTrack,
|
|
263
288
|
});
|
|
264
289
|
}
|
|
265
290
|
else if (results.length === 1) {
|
|
@@ -272,6 +297,7 @@ export async function handleSelectedRegion({ input, model, assemblyName, grow, }
|
|
|
272
297
|
model,
|
|
273
298
|
assemblyName,
|
|
274
299
|
grow,
|
|
300
|
+
showHitTrack,
|
|
275
301
|
});
|
|
276
302
|
return true;
|
|
277
303
|
}
|
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.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "JBrowse 2 linear genome view",
|
|
6
6
|
"keywords": [
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@jbrowse/mobx-state-tree": "^6.5.1",
|
|
25
|
-
"@mui/icons-material": "^9.
|
|
26
|
-
"@mui/material": "^9.
|
|
25
|
+
"@mui/icons-material": "^9.4.0",
|
|
26
|
+
"@mui/material": "^9.4.0",
|
|
27
27
|
"mobx": "^7.0.3",
|
|
28
28
|
"mobx-react": "^10.0.2",
|
|
29
|
-
"@jbrowse/core": "^5.0.0-beta.
|
|
30
|
-
"@jbrowse/render-core": "^5.0.0-beta.
|
|
31
|
-
"@jbrowse/display-ui": "^5.0.0-beta.
|
|
32
|
-
"@jbrowse/display-kit": "^5.0.0-beta.
|
|
29
|
+
"@jbrowse/core": "^5.0.0-beta.2",
|
|
30
|
+
"@jbrowse/render-core": "^5.0.0-beta.2",
|
|
31
|
+
"@jbrowse/display-ui": "^5.0.0-beta.2",
|
|
32
|
+
"@jbrowse/display-kit": "^5.0.0-beta.2"
|
|
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.2"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"prebuild": "pnpm clean",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { TrackOverlayPortal } from '@jbrowse/display-ui';
|
|
3
|
-
import { observer } from 'mobx-react';
|
|
4
|
-
// Lifts an SVG legend / chrome above the inter-region padding masks: a
|
|
5
|
-
// full-track, pointer-events:none <svg> portaled into the TrackContainer overlay
|
|
6
|
-
// node (see TrackOverlayPortal). The SVG counterpart to the HTML overlays
|
|
7
|
-
// (FloatingLegend, HicOverlayPanel) — used where the same legend
|
|
8
|
-
// markup is also drawn by an SVG-export path, so it must stay <svg>.
|
|
9
|
-
//
|
|
10
|
-
// Children draw in <svg> user space; the wrapping <svg> stays pointer-events:none
|
|
11
|
-
// so it doesn't eat canvas events, so any interactive sub-content (a dismiss
|
|
12
|
-
// "×", clickable swatches) must set pointer-events:auto on its own element.
|
|
13
|
-
// fallbackInline={false}: outside a TrackContainer it renders nothing, matching
|
|
14
|
-
// callers whose export path draws its own inline legend.
|
|
15
|
-
export const FloatingSvgOverlay = observer(function FloatingSvgOverlay({ width, height, children, }) {
|
|
16
|
-
return (_jsx(TrackOverlayPortal, { fallbackInline: false, children: _jsx("svg", { style: {
|
|
17
|
-
position: 'absolute',
|
|
18
|
-
top: 0,
|
|
19
|
-
left: 0,
|
|
20
|
-
width,
|
|
21
|
-
height,
|
|
22
|
-
pointerEvents: 'none',
|
|
23
|
-
overflow: 'hidden',
|
|
24
|
-
}, children: children }) }));
|
|
25
|
-
});
|