@jbrowse/plugin-linear-genome-view 5.0.0-beta.2 → 5.0.0-beta.3

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.
@@ -33,6 +33,11 @@ export interface PerRegionTestControl {
33
33
  estimateCalls: number;
34
34
  /** the display's own density verdict, canvas's second too-large axis */
35
35
  densityTooLarge: boolean;
36
+ /**
37
+ * What the next fetch stores, so a test can tell the payload a refetch
38
+ * replaced from the one that replaced it.
39
+ */
40
+ payloadTag: string;
36
41
  }
37
42
  /**
38
43
  * The smallest possible display on `MultiRegionDisplayMixin`: it fetches, it
@@ -321,6 +326,7 @@ declare function makeStateModel(control: PerRegionTestControl, gate: GateOptIns,
321
326
  readonly canRender: boolean;
322
327
  readonly rendersCanvas: boolean;
323
328
  readonly paintInert: boolean;
329
+ readonly paintSuperseded: boolean;
324
330
  } & {
325
331
  readonly painted: boolean;
326
332
  } & {
@@ -354,6 +360,7 @@ declare function makeStateModel(control: PerRegionTestControl, gate: GateOptIns,
354
360
  readonly awaitingPrerequisite: boolean;
355
361
  readonly awaitingDependentData: boolean;
356
362
  readonly rpcPropsCacheKey: string;
363
+ readonly adapterConfigKey: string;
357
364
  } & {
358
365
  setError(error?: unknown): void;
359
366
  setStatusMessage(status?: import("@jbrowse/core/util").RpcStatus): void;
@@ -374,31 +381,45 @@ declare function makeStateModel(control: PerRegionTestControl, gate: GateOptIns,
374
381
  } & {
375
382
  readonly host: import("@jbrowse/display-kit/regionHost").RegionHost;
376
383
  readonly canvasWidthPx: number;
384
+ readonly settledSubPixelBinBp: number;
377
385
  readonly canRender: boolean;
378
386
  readonly rendersCanvas: boolean;
379
387
  readonly viewportWithinLoadedData: boolean;
380
388
  readonly viewportEmpty: boolean;
381
389
  readonly fetchSuspended: boolean;
382
390
  readonly layoutReady: boolean;
383
- readonly regionFetchKey: string;
384
- regionHasData(_displayedRegionIndex: number): boolean;
391
+ readonly zoomFetchKey: string;
392
+ regionHasData(displayedRegionIndex: number): boolean;
385
393
  readonly dataSuperseded: boolean;
386
394
  readonly renderBlocks: import("@jbrowse/render-core/renderBlock").RenderBlock[];
395
+ } & {
396
+ readonly fetchInputs: import("@jbrowse/display-kit/fetchInputs").FetchInputs;
397
+ readonly settingsFetchInputs: unknown;
398
+ } & {
399
+ readonly regionPayloads: ReadonlyMap<number, unknown>;
400
+ readonly hasRegionData: boolean;
387
401
  } & {
388
402
  isCacheValid(displayedRegionIndex: number): boolean;
389
403
  } & {
404
+ readonly staleSettingsDrawn: boolean;
390
405
  readonly dataCurrent: boolean;
391
406
  readonly loadedAssembly: import("@jbrowse/core/assemblyManager/assembly").Assembly | undefined;
407
+ } & {
408
+ readonly phaseViewportCurrent: boolean;
392
409
  } & {
393
410
  readonly svgReady: boolean;
394
411
  readonly paintInert: boolean;
412
+ readonly paintSuperseded: boolean;
395
413
  readonly displayPhase: import("@jbrowse/render-core/displayPhase").DisplayPhase;
396
414
  } & {
397
- setLoadedRegion(displayedRegionIndex: number, region: import("@jbrowse/core/util").Region, fetchKey?: string): void;
415
+ setLoadedRegion(displayedRegionIndex: number, region: import("@jbrowse/core/util").Region, payload: import("@jbrowse/display-kit/regionCommit").RegionPayload | undefined, fetchInputs?: import("@jbrowse/display-kit/fetchInputs").FetchInputs): void;
416
+ evictRegionStore(keep: ReadonlySet<number>): void;
398
417
  dropLoadedRegion(displayedRegionIndex: number): void;
399
418
  clearDisplaySpecificData(): void;
419
+ clearSettingsBakedData(): void;
400
420
  } & {
401
421
  clearAllRpcData(): void;
422
+ invalidateSettings(): void;
402
423
  reload(): void;
403
424
  } & {
404
425
  fetchNeeded(_needed: IndexedRegion[]): void;
@@ -409,23 +430,23 @@ declare function makeStateModel(control: PerRegionTestControl, gate: GateOptIns,
409
430
  } & {
410
431
  /** every `fetchNeeded` call, as the region list it was handed */
411
432
  fetchLog: IndexedRegion[][];
412
- loadedData: Map<number, string>;
413
433
  /**
414
- * What `regionFetchKey` answers. A volatile, not a `control` knob, and
434
+ * What `zoomFetchKey` answers. A volatile, not a `control` knob, and
415
435
  * that is the point: a real display's key reads view state, so the
416
436
  * autorun re-runs when it moves. A plain closure value would be memoized
417
437
  * by the computed and never invalidate.
418
438
  */
419
439
  fetchKey: string;
420
440
  } & {
441
+ regionHasData(displayedRegionIndex: number): boolean;
442
+ } & {
443
+ /** the fetched payloads, off the foundation's store */
444
+ readonly loadedData: ReadonlyMap<number, string>;
421
445
  readonly gateEnabled: boolean;
422
446
  readonly densityTooLarge: boolean;
423
- readonly regionFetchKey: string;
424
- regionHasData(_displayedRegionIndex: number): boolean;
447
+ readonly zoomFetchKey: string;
425
448
  } & {
426
449
  setFetchKey(key: string): void;
427
- setLoaded(displayedRegionIndex: number, value: string): void;
428
- clearDisplaySpecificData(): void;
429
450
  } & {
430
451
  fetchNeeded(needed: IndexedRegion[]): Promise<void>;
431
452
  }, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
@@ -471,6 +492,8 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
471
492
  level?: string;
472
493
  actions: import("@jbrowse/core/util").SnackAction[];
473
494
  }[];
495
+ widgets: Map<string, unknown>;
496
+ openedWidgets: Record<string, unknown>[];
474
497
  } & {
475
498
  getTrackById: (id: string) => unknown;
476
499
  getDisplayTypeDefault(displayType: string, slot: string): unknown;
@@ -480,6 +503,11 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
480
503
  notifyError(message: string): void;
481
504
  queueDialog(cb: (handleClose: () => void) => import("@jbrowse/display-test-utils").QueuedDialog): void;
482
505
  setSelection(thing: unknown): void;
506
+ addWidget(type: string, id: string, initialState?: Record<string, unknown>): {
507
+ type: string;
508
+ id: string;
509
+ };
510
+ showWidget(_widget: unknown): void;
483
511
  setDisplayTypeDefault(displayType: string, slot: string, value: unknown): void;
484
512
  } & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/mobx-state-tree").IModelType<{
485
513
  name: import("@jbrowse/mobx-state-tree").IType<string | undefined, string, string>;
@@ -498,6 +526,8 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
498
526
  level?: string;
499
527
  actions: import("@jbrowse/core/util").SnackAction[];
500
528
  }[];
529
+ widgets: Map<string, unknown>;
530
+ openedWidgets: Record<string, unknown>[];
501
531
  } & {
502
532
  getTrackById: (id: string) => unknown;
503
533
  getDisplayTypeDefault(displayType: string, slot: string): unknown;
@@ -507,6 +537,11 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
507
537
  notifyError(message: string): void;
508
538
  queueDialog(cb: (handleClose: () => void) => import("@jbrowse/display-test-utils").QueuedDialog): void;
509
539
  setSelection(thing: unknown): void;
540
+ addWidget(type: string, id: string, initialState?: Record<string, unknown>): {
541
+ type: string;
542
+ id: string;
543
+ };
544
+ showWidget(_widget: unknown): void;
510
545
  setDisplayTypeDefault(displayType: string, slot: string, value: unknown): void;
511
546
  }, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>>;
512
547
  view: any;
@@ -786,6 +821,7 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
786
821
  readonly canRender: boolean;
787
822
  readonly rendersCanvas: boolean;
788
823
  readonly paintInert: boolean;
824
+ readonly paintSuperseded: boolean;
789
825
  } & {
790
826
  readonly painted: boolean;
791
827
  } & {
@@ -819,6 +855,7 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
819
855
  readonly awaitingPrerequisite: boolean;
820
856
  readonly awaitingDependentData: boolean;
821
857
  readonly rpcPropsCacheKey: string;
858
+ readonly adapterConfigKey: string;
822
859
  } & {
823
860
  setError(error?: unknown): void;
824
861
  setStatusMessage(status?: import("@jbrowse/core/util").RpcStatus): void;
@@ -839,31 +876,45 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
839
876
  } & {
840
877
  readonly host: import("@jbrowse/display-kit/regionHost").RegionHost;
841
878
  readonly canvasWidthPx: number;
879
+ readonly settledSubPixelBinBp: number;
842
880
  readonly canRender: boolean;
843
881
  readonly rendersCanvas: boolean;
844
882
  readonly viewportWithinLoadedData: boolean;
845
883
  readonly viewportEmpty: boolean;
846
884
  readonly fetchSuspended: boolean;
847
885
  readonly layoutReady: boolean;
848
- readonly regionFetchKey: string;
849
- regionHasData(_displayedRegionIndex: number): boolean;
886
+ readonly zoomFetchKey: string;
887
+ regionHasData(displayedRegionIndex: number): boolean;
850
888
  readonly dataSuperseded: boolean;
851
889
  readonly renderBlocks: import("@jbrowse/render-core/renderBlock").RenderBlock[];
890
+ } & {
891
+ readonly fetchInputs: import("@jbrowse/display-kit/fetchInputs").FetchInputs;
892
+ readonly settingsFetchInputs: unknown;
893
+ } & {
894
+ readonly regionPayloads: ReadonlyMap<number, unknown>;
895
+ readonly hasRegionData: boolean;
852
896
  } & {
853
897
  isCacheValid(displayedRegionIndex: number): boolean;
854
898
  } & {
899
+ readonly staleSettingsDrawn: boolean;
855
900
  readonly dataCurrent: boolean;
856
901
  readonly loadedAssembly: import("@jbrowse/core/assemblyManager/assembly").Assembly | undefined;
902
+ } & {
903
+ readonly phaseViewportCurrent: boolean;
857
904
  } & {
858
905
  readonly svgReady: boolean;
859
906
  readonly paintInert: boolean;
907
+ readonly paintSuperseded: boolean;
860
908
  readonly displayPhase: import("@jbrowse/render-core/displayPhase").DisplayPhase;
861
909
  } & {
862
- setLoadedRegion(displayedRegionIndex: number, region: import("@jbrowse/core/util").Region, fetchKey?: string): void;
910
+ setLoadedRegion(displayedRegionIndex: number, region: import("@jbrowse/core/util").Region, payload: import("@jbrowse/display-kit/regionCommit").RegionPayload | undefined, fetchInputs?: import("@jbrowse/display-kit/fetchInputs").FetchInputs): void;
911
+ evictRegionStore(keep: ReadonlySet<number>): void;
863
912
  dropLoadedRegion(displayedRegionIndex: number): void;
864
913
  clearDisplaySpecificData(): void;
914
+ clearSettingsBakedData(): void;
865
915
  } & {
866
916
  clearAllRpcData(): void;
917
+ invalidateSettings(): void;
867
918
  reload(): void;
868
919
  } & {
869
920
  fetchNeeded(_needed: IndexedRegion[]): void;
@@ -874,23 +925,23 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
874
925
  } & {
875
926
  /** every `fetchNeeded` call, as the region list it was handed */
876
927
  fetchLog: IndexedRegion[][];
877
- loadedData: Map<number, string>;
878
928
  /**
879
- * What `regionFetchKey` answers. A volatile, not a `control` knob, and
929
+ * What `zoomFetchKey` answers. A volatile, not a `control` knob, and
880
930
  * that is the point: a real display's key reads view state, so the
881
931
  * autorun re-runs when it moves. A plain closure value would be memoized
882
932
  * by the computed and never invalidate.
883
933
  */
884
934
  fetchKey: string;
885
935
  } & {
936
+ regionHasData(displayedRegionIndex: number): boolean;
937
+ } & {
938
+ /** the fetched payloads, off the foundation's store */
939
+ readonly loadedData: ReadonlyMap<number, string>;
886
940
  readonly gateEnabled: boolean;
887
941
  readonly densityTooLarge: boolean;
888
- readonly regionFetchKey: string;
889
- regionHasData(_displayedRegionIndex: number): boolean;
942
+ readonly zoomFetchKey: string;
890
943
  } & {
891
944
  setFetchKey(key: string): void;
892
- setLoaded(displayedRegionIndex: number, value: string): void;
893
- clearDisplaySpecificData(): void;
894
945
  } & {
895
946
  fetchNeeded(needed: IndexedRegion[]): Promise<void>;
896
947
  } & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/mobx-state-tree").IModelType<Omit<Omit<Omit<{
@@ -1168,6 +1219,7 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
1168
1219
  readonly canRender: boolean;
1169
1220
  readonly rendersCanvas: boolean;
1170
1221
  readonly paintInert: boolean;
1222
+ readonly paintSuperseded: boolean;
1171
1223
  } & {
1172
1224
  readonly painted: boolean;
1173
1225
  } & {
@@ -1201,6 +1253,7 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
1201
1253
  readonly awaitingPrerequisite: boolean;
1202
1254
  readonly awaitingDependentData: boolean;
1203
1255
  readonly rpcPropsCacheKey: string;
1256
+ readonly adapterConfigKey: string;
1204
1257
  } & {
1205
1258
  setError(error?: unknown): void;
1206
1259
  setStatusMessage(status?: import("@jbrowse/core/util").RpcStatus): void;
@@ -1221,31 +1274,45 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
1221
1274
  } & {
1222
1275
  readonly host: import("@jbrowse/display-kit/regionHost").RegionHost;
1223
1276
  readonly canvasWidthPx: number;
1277
+ readonly settledSubPixelBinBp: number;
1224
1278
  readonly canRender: boolean;
1225
1279
  readonly rendersCanvas: boolean;
1226
1280
  readonly viewportWithinLoadedData: boolean;
1227
1281
  readonly viewportEmpty: boolean;
1228
1282
  readonly fetchSuspended: boolean;
1229
1283
  readonly layoutReady: boolean;
1230
- readonly regionFetchKey: string;
1231
- regionHasData(_displayedRegionIndex: number): boolean;
1284
+ readonly zoomFetchKey: string;
1285
+ regionHasData(displayedRegionIndex: number): boolean;
1232
1286
  readonly dataSuperseded: boolean;
1233
1287
  readonly renderBlocks: import("@jbrowse/render-core/renderBlock").RenderBlock[];
1288
+ } & {
1289
+ readonly fetchInputs: import("@jbrowse/display-kit/fetchInputs").FetchInputs;
1290
+ readonly settingsFetchInputs: unknown;
1291
+ } & {
1292
+ readonly regionPayloads: ReadonlyMap<number, unknown>;
1293
+ readonly hasRegionData: boolean;
1234
1294
  } & {
1235
1295
  isCacheValid(displayedRegionIndex: number): boolean;
1236
1296
  } & {
1297
+ readonly staleSettingsDrawn: boolean;
1237
1298
  readonly dataCurrent: boolean;
1238
1299
  readonly loadedAssembly: import("@jbrowse/core/assemblyManager/assembly").Assembly | undefined;
1300
+ } & {
1301
+ readonly phaseViewportCurrent: boolean;
1239
1302
  } & {
1240
1303
  readonly svgReady: boolean;
1241
1304
  readonly paintInert: boolean;
1305
+ readonly paintSuperseded: boolean;
1242
1306
  readonly displayPhase: import("@jbrowse/render-core/displayPhase").DisplayPhase;
1243
1307
  } & {
1244
- setLoadedRegion(displayedRegionIndex: number, region: import("@jbrowse/core/util").Region, fetchKey?: string): void;
1308
+ setLoadedRegion(displayedRegionIndex: number, region: import("@jbrowse/core/util").Region, payload: import("@jbrowse/display-kit/regionCommit").RegionPayload | undefined, fetchInputs?: import("@jbrowse/display-kit/fetchInputs").FetchInputs): void;
1309
+ evictRegionStore(keep: ReadonlySet<number>): void;
1245
1310
  dropLoadedRegion(displayedRegionIndex: number): void;
1246
1311
  clearDisplaySpecificData(): void;
1312
+ clearSettingsBakedData(): void;
1247
1313
  } & {
1248
1314
  clearAllRpcData(): void;
1315
+ invalidateSettings(): void;
1249
1316
  reload(): void;
1250
1317
  } & {
1251
1318
  fetchNeeded(_needed: IndexedRegion[]): void;
@@ -1256,23 +1323,23 @@ export declare function createPerRegionTestEnvironment({ measuresBytes, gate, es
1256
1323
  } & {
1257
1324
  /** every `fetchNeeded` call, as the region list it was handed */
1258
1325
  fetchLog: IndexedRegion[][];
1259
- loadedData: Map<number, string>;
1260
1326
  /**
1261
- * What `regionFetchKey` answers. A volatile, not a `control` knob, and
1327
+ * What `zoomFetchKey` answers. A volatile, not a `control` knob, and
1262
1328
  * that is the point: a real display's key reads view state, so the
1263
1329
  * autorun re-runs when it moves. A plain closure value would be memoized
1264
1330
  * by the computed and never invalidate.
1265
1331
  */
1266
1332
  fetchKey: string;
1267
1333
  } & {
1334
+ regionHasData(displayedRegionIndex: number): boolean;
1335
+ } & {
1336
+ /** the fetched payloads, off the foundation's store */
1337
+ readonly loadedData: ReadonlyMap<number, string>;
1268
1338
  readonly gateEnabled: boolean;
1269
1339
  readonly densityTooLarge: boolean;
1270
- readonly regionFetchKey: string;
1271
- regionHasData(_displayedRegionIndex: number): boolean;
1340
+ readonly zoomFetchKey: string;
1272
1341
  } & {
1273
1342
  setFetchKey(key: string): void;
1274
- setLoaded(displayedRegionIndex: number, value: string): void;
1275
- clearDisplaySpecificData(): void;
1276
1343
  } & {
1277
1344
  fetchNeeded(needed: IndexedRegion[]): Promise<void>;
1278
1345
  }, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>>;
@@ -28,44 +28,49 @@ function makeStateModel(control, gate, configSchema) {
28
28
  .volatile(() => ({
29
29
  /** every `fetchNeeded` call, as the region list it was handed */
30
30
  fetchLog: [],
31
- loadedData: new Map(),
32
31
  /**
33
- * What `regionFetchKey` answers. A volatile, not a `control` knob, and
32
+ * What `zoomFetchKey` answers. A volatile, not a `control` knob, and
34
33
  * that is the point: a real display's key reads view state, so the
35
34
  * autorun re-runs when it moves. A plain closure value would be memoized
36
35
  * by the computed and never invalidate.
37
36
  */
38
37
  fetchKey: '',
39
38
  }))
39
+ .views(self => {
40
+ // chained, not replaced: `staleAnswers` forces a false answer for a
41
+ // bounded number of calls, and everything else is the foundation's own
42
+ // store-derived default
43
+ const superRegionHasData = self.regionHasData;
44
+ return {
45
+ regionHasData(displayedRegionIndex) {
46
+ control.cacheValidCalls += 1;
47
+ if (control.staleAnswers > 0) {
48
+ control.staleAnswers -= 1;
49
+ return false;
50
+ }
51
+ return superRegionHasData.call(self, displayedRegionIndex);
52
+ },
53
+ };
54
+ })
40
55
  .views(self => ({
56
+ /** the fetched payloads, off the foundation's store */
57
+ get loadedData() {
58
+ return self.regionPayloads;
59
+ },
41
60
  get gateEnabled() {
42
61
  return gate.gateEnabled ?? false;
43
62
  },
44
63
  get densityTooLarge() {
45
64
  return control.densityTooLarge;
46
65
  },
47
- get regionFetchKey() {
66
+ get zoomFetchKey() {
48
67
  return self.fetchKey;
49
68
  },
50
- regionHasData(_displayedRegionIndex) {
51
- control.cacheValidCalls += 1;
52
- if (control.staleAnswers > 0) {
53
- control.staleAnswers -= 1;
54
- return false;
55
- }
56
- return true;
57
- },
58
69
  }))
59
70
  .actions(self => ({
60
71
  setFetchKey(key) {
61
72
  self.fetchKey = key;
62
73
  },
63
- setLoaded(displayedRegionIndex, value) {
64
- self.loadedData.set(displayedRegionIndex, value);
65
- },
66
- clearDisplaySpecificData() {
67
- self.loadedData.clear();
68
- },
69
74
  }))
70
75
  .actions(self => ({
71
76
  fetchNeeded(needed) {
@@ -90,17 +95,15 @@ function makeStateModel(control, gate, configSchema) {
90
95
  // budget means no measurement at all, which is why `estimateCalls`
91
96
  // stays at zero for an ungated display.
92
97
  if (byteLimit === undefined) {
93
- return { value: 'data' };
98
+ return { value: control.payloadTag };
94
99
  }
95
100
  control.estimateCalls += 1;
96
101
  const bytes = control.estimateBytes;
97
102
  return bytes > byteLimit
98
103
  ? { regionTooLarge: true, bytes }
99
- : { value: 'data', bytes };
100
- },
101
- onResult: (idx, result) => {
102
- self.setLoaded(idx, result.value);
104
+ : { value: control.payloadTag, bytes };
103
105
  },
106
+ onResult: (_idx, result) => result.value,
104
107
  });
105
108
  },
106
109
  }));
@@ -118,6 +121,7 @@ export function createPerRegionTestEnvironment({ measuresBytes = false, gate, es
118
121
  estimateBytes,
119
122
  estimateCalls: 0,
120
123
  densityTooLarge: false,
124
+ payloadTag: 'data',
121
125
  };
122
126
  const optIns = gate ?? { gateEnabled: measuresBytes };
123
127
  const env = createDisplayTestEnvironment({
package/esm/index.d.ts CHANGED
@@ -4,19 +4,6 @@ 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
- };
20
7
  readonly fetchSizeLimit: {
21
8
  readonly type: 'number';
22
9
  readonly defaultValue: 1000000;
@@ -29,12 +16,6 @@ export default class LinearGenomeViewPlugin extends Plugin {
29
16
  readonly description: 'Declarative equivalent of the "Force load" button on the "too much data" banner: when true the display always renders, however large the region or dense the features. Off by default (the gate guards against huge downloads). Set it on a view no one can interact with — an embedded / notebook view, or a screenshot — where the region is known and you want it drawn without a click.';
30
17
  readonly advanced: true;
31
18
  };
32
- readonly maxFeatureScreenDensity: {
33
- readonly type: "number";
34
- readonly description: "maximum features per pixel before showing a \"too many features\" message";
35
- readonly defaultValue: 1;
36
- readonly advanced: true;
37
- };
38
19
  readonly height: {
39
20
  readonly type: "number";
40
21
  readonly defaultValue: 100;
@@ -105,7 +86,6 @@ export { default as HeaderSearchBoxRow } from './LinearGenomeView/components/Hea
105
86
  export { searchBoxMenuItems, useSearchBoxPrefs, } from './LinearGenomeView/components/useSearchBoxPrefs.ts';
106
87
  export type { SearchBoxPrefs } from './LinearGenomeView/components/useSearchBoxPrefs.ts';
107
88
  export { normalizeTrackInit } from '@jbrowse/core/util/tracks';
108
- export { linearGenomeViewPropKeys, partitionLaunchKeys, } from './LinearGenomeView/initKeys.ts';
109
89
  export { applyInitHighlights } from './LinearGenomeView/afterAttach.ts';
110
90
  export { MultiLevelRubberband } from './MultiLevelRubberband/index.ts';
111
91
  export { fetchResults, SearchResultsNotFoundError } from './searchUtils.ts';
@@ -115,6 +95,7 @@ export type { ScalebarRefNameLabel } from './LinearGenomeView/util.ts';
115
95
  export type { RegionsOrientation } from './LinearGenomeView/util.ts';
116
96
  export { makeTicks } from './LinearGenomeView/util.ts';
117
97
  export type { Tick } from './LinearGenomeView/util.ts';
98
+ export { containingLgv } from './LinearGenomeView/containingLgv.ts';
118
99
  export { showRegionsWithUndo } from './LinearGenomeView/showRegionsWithUndo.ts';
119
100
  export type { SharedFit } from './LinearGenomeView/sharedScaleContainer.ts';
120
101
  export { fitAllRegionsWindow } from './LinearGenomeView/util.ts';
package/esm/index.js CHANGED
@@ -85,7 +85,6 @@ export { default as HeaderSearchBoxes } from './LinearGenomeView/components/Head
85
85
  export { default as HeaderSearchBoxRow } from './LinearGenomeView/components/HeaderSearchBoxRow.js';
86
86
  export { searchBoxMenuItems, useSearchBoxPrefs, } from './LinearGenomeView/components/useSearchBoxPrefs.js';
87
87
  export { normalizeTrackInit } from '@jbrowse/core/util/tracks';
88
- export { linearGenomeViewPropKeys, partitionLaunchKeys, } from './LinearGenomeView/initKeys.js';
89
88
  export { applyInitHighlights } from './LinearGenomeView/afterAttach.js';
90
89
  export { MultiLevelRubberband } from './MultiLevelRubberband/index.js';
91
90
  export { fetchResults, SearchResultsNotFoundError } from './searchUtils.js';
@@ -99,6 +98,7 @@ export { makeTicks } from './LinearGenomeView/util.js';
99
98
  // The two halves of "show these regions instead": navigate the view you are
100
99
  // looking at, or seed a snapshot for a new one. A caller deriving either itself
101
100
  // lands on a viewport property the model no longer reads — see each for how.
101
+ export { containingLgv } from './LinearGenomeView/containingLgv.js';
102
102
  export { showRegionsWithUndo } from './LinearGenomeView/showRegionsWithUndo.js';
103
103
  export { fitAllRegionsWindow } from './LinearGenomeView/util.js';
104
104
  export { renderToSvg } from './LinearGenomeView/svgcomponents/SVGLinearGenomeView.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-genome-view",
3
- "version": "5.0.0-beta.2",
3
+ "version": "5.0.0-beta.3",
4
4
  "type": "module",
5
5
  "description": "JBrowse 2 linear genome view",
6
6
  "keywords": [
@@ -26,10 +26,10 @@
26
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.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"
29
+ "@jbrowse/core": "^5.0.0-beta.3",
30
+ "@jbrowse/display-kit": "^5.0.0-beta.3",
31
+ "@jbrowse/display-ui": "^5.0.0-beta.3",
32
+ "@jbrowse/render-core": "^5.0.0-beta.3"
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.2"
43
+ "@jbrowse/display-test-utils": "^5.0.0-beta.3"
44
44
  },
45
45
  "scripts": {
46
46
  "prebuild": "pnpm clean",
@@ -1,12 +0,0 @@
1
- export declare function partitionLaunchKeys(spec: object, viewPropKeys: ReadonlySet<string>): {
2
- init: Record<string, unknown>;
3
- viewProps: Record<string, unknown>;
4
- unknown: Record<string, unknown>;
5
- };
6
- export declare function linearGenomeViewPropKeys(pluginManager: {
7
- getViewType: (name: string) => {
8
- stateModel: {
9
- properties: object;
10
- };
11
- };
12
- }): ReadonlySet<string>;
@@ -1,68 +0,0 @@
1
- import { lgvLaunchKeys } from './launchKeys.js';
2
- // The remaining v4 partition, still used by the synteny view to build its LGV
3
- // rows. `lgvLaunchKeys` is the one declaration of what a launch key is, so the
4
- // two cannot disagree while both exist.
5
- const knownInitKeys = new Set(Object.keys(lgvLaunchKeys.keys));
6
- // Never settable from a spec, whatever the model declares: `type` picks the
7
- // view, `id` is passed top-level so MST's optional identifier honors it, and
8
- // `launch` is the blob the partition fills rather than something anyone writes.
9
- const RESERVED = new Set(['id', 'type', 'launch']);
10
- const LEGACY_VIEWPORT_PROPS = new Set(lgvLaunchKeys.passThrough);
11
- // Partition launch keys three ways, once, for every caller that needs to know
12
- // which is which:
13
- //
14
- // - `init`: resolution keys (loc, tracks, highlight, …) with no direct MST
15
- // representation, which afterAttach applies on attach and then discards
16
- // - `viewProps`: plain persisted props MST restores natively, so they belong on
17
- // the view snapshot rather than in the blob
18
- // - `unknown`: neither, i.e. a typo. MST silently drops unknown snapshot keys and
19
- // `init` is a frozen blob, so nothing else would notice
20
- //
21
- // The two callers differ only in what they do with each bucket: the launcher
22
- // spreads a flat spec across the new view's snapshot and warns about the typos,
23
- // while afterAttach — which only ever sees an already-built blob — warns about
24
- // both a typo and a view prop that ended up inside it.
25
- export function partitionLaunchKeys(spec,
26
- // The view's declared property names. Callers with a live node read it off
27
- // `getPropertyMembers(self).properties`; callers building a snapshot read it
28
- // off the registered view type's `stateModel.properties` — see
29
- // `linearGenomeViewPropKeys`.
30
- viewPropKeys) {
31
- const init = {};
32
- const viewProps = {};
33
- const unknown = {};
34
- for (const [key, value] of Object.entries(spec)) {
35
- const bucket = knownInitKeys.has(key)
36
- ? init
37
- : (viewPropKeys.has(key) || LEGACY_VIEWPORT_PROPS.has(key)) &&
38
- !RESERVED.has(key)
39
- ? viewProps
40
- : unknown;
41
- bucket[key] = value;
42
- }
43
- return { init, viewProps, unknown };
44
- }
45
- // The registered LinearGenomeView's declared property names, for a caller that
46
- // has a PluginManager but no view yet (a launcher, or a synteny row being built).
47
- // A caller holding a live node reads the same thing off
48
- // `getPropertyMembers(self).properties` instead.
49
- //
50
- // `getViewType` THROWS on an unregistered name, and that is left alone: this is
51
- // only ever called from code that is about to add a LinearGenomeView, so an
52
- // absent view type is a broken plugin manager rather than a case to degrade
53
- // through — and degrading would mean silently dropping every property the
54
- // caller asked for, which is the failure this whole mechanism exists to end.
55
- //
56
- // Cached: the set is fixed for the life of the manager, and a launch that opens
57
- // a stack of rows would otherwise rebuild it per row.
58
- const propKeyCache = new WeakMap();
59
- export function linearGenomeViewPropKeys(pluginManager) {
60
- const cached = propKeyCache.get(pluginManager);
61
- if (cached) {
62
- return cached;
63
- }
64
- const { stateModel } = pluginManager.getViewType('LinearGenomeView');
65
- const keys = new Set(Object.keys(stateModel.properties));
66
- propKeyCache.set(pluginManager, keys);
67
- return keys;
68
- }