@jbrowse/plugin-lollipop 2.17.0 → 2.18.0

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.
Files changed (31) hide show
  1. package/dist/LinearLollipopDisplay/configSchema.d.ts +1 -7
  2. package/dist/LinearLollipopDisplay/configSchema.js +0 -9
  3. package/dist/LinearLollipopDisplay/index.d.ts +1 -1
  4. package/dist/LinearLollipopDisplay/index.js +1 -1
  5. package/dist/LinearLollipopDisplay/model.d.ts +13 -69
  6. package/dist/LinearLollipopDisplay/model.js +1 -24
  7. package/dist/LollipopRenderer/Layout.d.ts +1 -4
  8. package/dist/LollipopRenderer/Layout.js +1 -12
  9. package/dist/LollipopRenderer/LollipopRenderer.js +2 -2
  10. package/dist/LollipopRenderer/components/LollipopRendering.js +0 -1
  11. package/dist/LollipopRenderer/components/ScoreText.d.ts +2 -2
  12. package/dist/LollipopRenderer/components/Stick.d.ts +2 -2
  13. package/dist/LollipopRenderer/index.d.ts +1 -1
  14. package/dist/index.d.ts +1 -1
  15. package/esm/LinearLollipopDisplay/configSchema.d.ts +1 -7
  16. package/esm/LinearLollipopDisplay/configSchema.js +0 -9
  17. package/esm/LinearLollipopDisplay/index.d.ts +1 -1
  18. package/esm/LinearLollipopDisplay/index.js +1 -1
  19. package/esm/LinearLollipopDisplay/model.d.ts +13 -69
  20. package/esm/LinearLollipopDisplay/model.js +2 -25
  21. package/esm/LollipopRenderer/Layout.d.ts +1 -4
  22. package/esm/LollipopRenderer/Layout.js +1 -12
  23. package/esm/LollipopRenderer/LollipopRenderer.js +2 -2
  24. package/esm/LollipopRenderer/components/LollipopRendering.js +1 -2
  25. package/esm/LollipopRenderer/components/ScoreText.d.ts +2 -2
  26. package/esm/LollipopRenderer/components/ScoreText.js +1 -1
  27. package/esm/LollipopRenderer/components/Stick.d.ts +2 -2
  28. package/esm/LollipopRenderer/components/Stick.js +1 -1
  29. package/esm/LollipopRenderer/index.d.ts +1 -1
  30. package/esm/index.d.ts +1 -1
  31. package/package.json +2 -2
@@ -1,11 +1,5 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
2
- /**
3
- * #config LinearLollipopDisplay
4
- */
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
5
2
  export declare function configSchemaFactory(pluginManager: PluginManager): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
6
- /**
7
- * #slot
8
- */
9
3
  renderer: import("mobx-state-tree").IAnyModelType;
10
4
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
11
5
  maxFeatureScreenDensity: {
@@ -3,19 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.configSchemaFactory = configSchemaFactory;
4
4
  const configuration_1 = require("@jbrowse/core/configuration");
5
5
  const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
6
- /**
7
- * #config LinearLollipopDisplay
8
- */
9
6
  function configSchemaFactory(pluginManager) {
10
7
  return (0, configuration_1.ConfigurationSchema)('LinearLollipopDisplay', {
11
- /**
12
- * #slot
13
- */
14
8
  renderer: pluginManager.pluggableConfigSchemaType('renderer'),
15
9
  }, {
16
- /**
17
- * #baseConfiguration
18
- */
19
10
  baseConfiguration: plugin_linear_genome_view_1.baseLinearDisplayConfigSchema,
20
11
  explicitlyTyped: true,
21
12
  });
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function LinearLollipopDisplayF(pluginManager: PluginManager): void;
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = LinearLollipopDisplayF;
4
4
  const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
5
5
  const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
6
- const model_1 = require("./model");
7
6
  const configSchema_1 = require("./configSchema");
7
+ const model_1 = require("./model");
8
8
  function LinearLollipopDisplayF(pluginManager) {
9
9
  pluginManager.addDisplayType(() => {
10
10
  const configSchema = (0, configSchema_1.configSchemaFactory)(pluginManager);
@@ -1,16 +1,7 @@
1
- import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
2
- /**
3
- * #stateModel LinearLollipopDisplay
4
- * extends
5
- * - [BaseLinearDisplay](../baselineardisplay)
6
- */
1
+ import type { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
7
2
  export declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
8
- id: import("mobx-state-tree" /**
9
- * #getter
10
- */).IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
11
- type: import("mobx-state-tree" /**
12
- * #getter
13
- */).ISimpleType<string>;
3
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
4
+ type: import("mobx-state-tree").ISimpleType<string>;
14
5
  rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
15
6
  } & {
16
7
  heightPreConfig: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
@@ -20,21 +11,12 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
20
11
  } & {
21
12
  blockState: import("mobx-state-tree").IMapType<import("mobx-state-tree").IModelType<{
22
13
  key: import("mobx-state-tree").ISimpleType<string>;
23
- region: import("mobx-state-tree").IModelType<{
24
- refName: import("mobx-state-tree").ISimpleType<string>;
25
- start: import("mobx-state-tree").ISimpleType<number>;
26
- end: import("mobx-state-tree").ISimpleType<number>;
27
- reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
28
- } & {
29
- assemblyName: import("mobx-state-tree").ISimpleType<string>;
30
- }, {
31
- setRefName(newRefName: string): void;
32
- }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
14
+ region: import("mobx-state-tree").IType<import("@jbrowse/core/util").Region, import("@jbrowse/core/util").Region, import("@jbrowse/core/util").Region>;
33
15
  reloadFlag: import("mobx-state-tree").IType<number | undefined, number, number>;
34
16
  isLeftEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
35
17
  isRightEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
36
18
  }, {
37
- renderInProgress: AbortController | undefined;
19
+ stopToken: string | undefined;
38
20
  filled: boolean;
39
21
  reactElement: React.ReactElement | undefined;
40
22
  features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
@@ -58,15 +40,9 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
58
40
  doReload(): void;
59
41
  afterAttach(): void;
60
42
  setStatus(message: string): void;
61
- setLoading(abortController: AbortController): void;
43
+ setLoading(newStopToken: string): void;
62
44
  setMessage(messageText: string): void;
63
- setRendered(props: {
64
- reactElement: React.ReactElement;
65
- features: Map<string, import("@jbrowse/core/util").Feature>;
66
- layout: any;
67
- maxHeightReached: boolean;
68
- renderProps: any;
69
- } | undefined): void;
45
+ setRendered(props: import("@jbrowse/plugin-linear-genome-view/dist/BaseLinearDisplay/models/serverSideRenderedBlock").RenderedProps | undefined): void;
70
46
  setError(error: unknown): void;
71
47
  reload(): void;
72
48
  beforeDestroy(): void;
@@ -100,13 +76,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
100
76
  };
101
77
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
102
78
  } & {
103
- /**
104
- * #property
105
- */
106
79
  type: import("mobx-state-tree").ISimpleType<"LinearLollipopDisplay">;
107
- /**
108
- * #property
109
- */
110
80
  configuration: AnyConfigurationSchemaType;
111
81
  }, {
112
82
  rendererTypeName: string;
@@ -197,6 +167,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
197
167
  readonly regionTooLarge: boolean;
198
168
  readonly regionTooLargeReason: string;
199
169
  } & {
170
+ readonly statsReadyAndRegionNotTooLarge: boolean;
200
171
  regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
201
172
  regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): React.JSX.Element | null;
202
173
  } & {
@@ -234,21 +205,9 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
234
205
  renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<React.JSX.Element>;
235
206
  afterAttach(): void;
236
207
  } & {
237
- /**
238
- * #getter
239
- */
240
208
  readonly blockType: string;
241
- /**
242
- * #getter
243
- */
244
209
  readonly renderDelay: number;
245
- /**
246
- * #method
247
- */
248
210
  renderProps(): any;
249
- /**
250
- * #getter
251
- */
252
211
  readonly rendererTypeName: any;
253
212
  }, {
254
213
  type: string;
@@ -264,21 +223,12 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
264
223
  } & {
265
224
  blockState: import("mobx-state-tree").IMapType<import("mobx-state-tree").IModelType<{
266
225
  key: import("mobx-state-tree").ISimpleType<string>;
267
- region: import("mobx-state-tree").IModelType<{
268
- refName: import("mobx-state-tree").ISimpleType<string>;
269
- start: import("mobx-state-tree").ISimpleType<number>;
270
- end: import("mobx-state-tree").ISimpleType<number>;
271
- reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
272
- } & {
273
- assemblyName: import("mobx-state-tree").ISimpleType<string>;
274
- }, {
275
- setRefName(newRefName: string): void;
276
- }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
226
+ region: import("mobx-state-tree").IType<import("@jbrowse/core/util").Region, import("@jbrowse/core/util").Region, import("@jbrowse/core/util").Region>;
277
227
  reloadFlag: import("mobx-state-tree").IType<number | undefined, number, number>;
278
228
  isLeftEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
279
229
  isRightEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
280
230
  }, {
281
- renderInProgress: AbortController | undefined;
231
+ stopToken: string | undefined;
282
232
  filled: boolean;
283
233
  reactElement: React.ReactElement | undefined;
284
234
  features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
@@ -302,15 +252,9 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
302
252
  doReload(): void;
303
253
  afterAttach(): void;
304
254
  setStatus(message: string): void;
305
- setLoading(abortController: AbortController): void;
255
+ setLoading(newStopToken: string): void;
306
256
  setMessage(messageText: string): void;
307
- setRendered(props: {
308
- reactElement: React.ReactElement;
309
- features: Map<string, import("@jbrowse/core/util").Feature>;
310
- layout: any;
311
- maxHeightReached: boolean;
312
- renderProps: any;
313
- } | undefined): void;
257
+ setRendered(props: import("@jbrowse/plugin-linear-genome-view/dist/BaseLinearDisplay/models/serverSideRenderedBlock").RenderedProps | undefined): void;
314
258
  setError(error: unknown): void;
315
259
  reload(): void;
316
260
  beforeDestroy(): void;
@@ -347,8 +291,8 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
347
291
  type: string;
348
292
  id: string;
349
293
  configuration: import("mobx-state-tree").ModelSnapshotType<Record<string, any>>;
350
- heightPreConfig: number | undefined;
351
294
  rpcDriverName: string | undefined;
295
+ heightPreConfig: number | undefined;
352
296
  userBpPerPxLimit: number | undefined;
353
297
  userByteSizeLimit: number | undefined;
354
298
  } & import("mobx-state-tree")._NotCustomized>;
@@ -2,43 +2,23 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.stateModelFactory = stateModelFactory;
4
4
  const configuration_1 = require("@jbrowse/core/configuration");
5
- const mobx_state_tree_1 = require("mobx-state-tree");
6
5
  const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
7
- /**
8
- * #stateModel LinearLollipopDisplay
9
- * extends
10
- * - [BaseLinearDisplay](../baselineardisplay)
11
- */
6
+ const mobx_state_tree_1 = require("mobx-state-tree");
12
7
  function stateModelFactory(configSchema) {
13
8
  return mobx_state_tree_1.types
14
9
  .compose('LinearLollipopDisplay', plugin_linear_genome_view_1.BaseLinearDisplay, mobx_state_tree_1.types.model({
15
- /**
16
- * #property
17
- */
18
10
  type: mobx_state_tree_1.types.literal('LinearLollipopDisplay'),
19
- /**
20
- * #property
21
- */
22
11
  configuration: (0, configuration_1.ConfigurationReference)(configSchema),
23
12
  }))
24
13
  .views(self => {
25
14
  const { renderProps: superRenderProps } = self;
26
15
  return {
27
- /**
28
- * #getter
29
- */
30
16
  get blockType() {
31
17
  return 'dynamicBlocks';
32
18
  },
33
- /**
34
- * #getter
35
- */
36
19
  get renderDelay() {
37
20
  return 500;
38
21
  },
39
- /**
40
- * #method
41
- */
42
22
  renderProps() {
43
23
  return {
44
24
  ...superRenderProps(),
@@ -46,9 +26,6 @@ function stateModelFactory(configSchema) {
46
26
  config: self.configuration.renderer,
47
27
  };
48
28
  },
49
- /**
50
- * #getter
51
- */
52
29
  get rendererTypeName() {
53
30
  return self.configuration.renderer.type;
54
31
  },
@@ -1,4 +1,4 @@
1
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
1
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
2
2
  interface LayoutItem {
3
3
  uniqueId: string;
4
4
  anchorLocation: number;
@@ -25,9 +25,6 @@ export declare class FloatingLayout {
25
25
  add(uniqueId: string, anchorLocation: number, width: number, height: number, data: {
26
26
  score: number;
27
27
  }): void;
28
- /**
29
- * @returns Map of `uniqueId => {x,y,anchorLocation,width,height,data}`
30
- */
31
28
  getLayout(configuration?: AnyConfigurationModel): LayoutMap;
32
29
  getTotalHeight(): number;
33
30
  serializeRegion(): {
@@ -18,9 +18,6 @@ class FloatingLayout {
18
18
  this.items.push({ uniqueId, anchorLocation, width, height, data });
19
19
  this.layoutDirty = true;
20
20
  }
21
- /**
22
- * @returns Map of `uniqueId => {x,y,anchorLocation,width,height,data}`
23
- */
24
21
  getLayout(configuration) {
25
22
  if (!this.layoutDirty) {
26
23
  return this.layout;
@@ -29,10 +26,7 @@ class FloatingLayout {
29
26
  throw new Error('configuration object required');
30
27
  }
31
28
  const minY = (0, configuration_1.readConfObject)(configuration, 'minStickLength');
32
- // sort them by score ascending, so higher scores will always end up
33
- // stacked last (toward the bottom)
34
29
  const sorted = this.items.sort((a, b) => a.data.score - b.data.score);
35
- // bump them
36
30
  let maxBottom = 0;
37
31
  const layoutEntries = new Array(sorted.length);
38
32
  for (let i = 0; i < sorted.length; i += 1) {
@@ -42,7 +36,6 @@ class FloatingLayout {
42
36
  const end = start + width;
43
37
  let top = minY;
44
38
  let bottom = top + height;
45
- // figure out how far down to put it
46
39
  for (let j = 0; j < i; j += 1) {
47
40
  const [, previouslyLaidOutItem] = layoutEntries[j];
48
41
  const { x: prevStart, y: prevTop, width: prevWidth, height: prevHeight, } = previouslyLaidOutItem;
@@ -50,13 +43,11 @@ class FloatingLayout {
50
43
  const prevBottom = prevTop + prevHeight;
51
44
  if ((0, range_1.doesIntersect2)(prevStart, prevEnd, start, end) &&
52
45
  (0, range_1.doesIntersect2)(prevTop, prevBottom, top, bottom)) {
53
- // bump this one to the bottom of the previous one
54
46
  top = prevBottom;
55
47
  bottom = top + height;
56
- j = -1; // we need to check all of them again after bumping
48
+ j = -1;
57
49
  }
58
50
  }
59
- // record the entry and update the maxBottom
60
51
  layoutEntries[i] = [
61
52
  currentItem.uniqueId,
62
53
  { ...currentItem, x: start, y: top },
@@ -65,8 +56,6 @@ class FloatingLayout {
65
56
  maxBottom = bottom;
66
57
  }
67
58
  }
68
- // try to tile them left to right all at the same level
69
- // if they don't fit, try to alternate them on 2 levels, then 3
70
59
  this.totalHeight = maxBottom;
71
60
  this.layout = new Map(layoutEntries);
72
61
  this.layoutDirty = false;
@@ -36,8 +36,8 @@ class FloatingLayoutSession extends BoxRendererType_1.LayoutSession {
36
36
  const widthPx = (end - start) / this.bpPerPx;
37
37
  return new MultiLayout_1.default(Layout_1.FloatingLayout, { width: widthPx });
38
38
  }
39
- layoutIsValid( /* layout */) {
40
- return false; // layout.left layout.width === this.width
39
+ layoutIsValid() {
40
+ return false;
41
41
  }
42
42
  }
43
43
  class LollipopRenderer extends BoxRendererType_1.default {
@@ -7,7 +7,6 @@ const react_1 = __importDefault(require("react"));
7
7
  const configuration_1 = require("@jbrowse/core/configuration");
8
8
  const util_1 = require("@jbrowse/core/util");
9
9
  const mobx_react_1 = require("mobx-react");
10
- // locals
11
10
  const Lollipop_1 = __importDefault(require("./Lollipop"));
12
11
  const Stick_1 = __importDefault(require("./Stick"));
13
12
  function layoutFeat(args) {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
- import { Feature } from '@jbrowse/core/util';
2
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
+ import type { Feature } from '@jbrowse/core/util';
4
4
  export default function ScoreText({ feature, config, layoutRecord: { y, data: { anchorX, radiusPx, score }, }, }: {
5
5
  feature: Feature;
6
6
  config: AnyConfigurationModel;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
- import { Feature } from '@jbrowse/core/util';
2
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
+ import type { Feature } from '@jbrowse/core/util';
4
4
  declare const Stick: ({ feature, config, layoutRecord: { anchorLocation, y, data: { radiusPx }, }, }: {
5
5
  feature: Feature;
6
6
  config: AnyConfigurationModel;
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function LollipopRendererF(pluginManager: PluginManager): void;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Plugin from '@jbrowse/core/Plugin';
2
- import PluginManager from '@jbrowse/core/PluginManager';
2
+ import type PluginManager from '@jbrowse/core/PluginManager';
3
3
  export default class LollipopPlugin extends Plugin {
4
4
  name: string;
5
5
  install(pluginManager: PluginManager): void;
@@ -1,11 +1,5 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
2
- /**
3
- * #config LinearLollipopDisplay
4
- */
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
5
2
  export declare function configSchemaFactory(pluginManager: PluginManager): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
6
- /**
7
- * #slot
8
- */
9
3
  renderer: import("mobx-state-tree").IAnyModelType;
10
4
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
11
5
  maxFeatureScreenDensity: {
@@ -1,18 +1,9 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
2
  import { baseLinearDisplayConfigSchema } from '@jbrowse/plugin-linear-genome-view';
3
- /**
4
- * #config LinearLollipopDisplay
5
- */
6
3
  export function configSchemaFactory(pluginManager) {
7
4
  return ConfigurationSchema('LinearLollipopDisplay', {
8
- /**
9
- * #slot
10
- */
11
5
  renderer: pluginManager.pluggableConfigSchemaType('renderer'),
12
6
  }, {
13
- /**
14
- * #baseConfiguration
15
- */
16
7
  baseConfiguration: baseLinearDisplayConfigSchema,
17
8
  explicitlyTyped: true,
18
9
  });
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function LinearLollipopDisplayF(pluginManager: PluginManager): void;
@@ -1,7 +1,7 @@
1
1
  import { DisplayType } from '@jbrowse/core/pluggableElementTypes';
2
2
  import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view';
3
- import { stateModelFactory } from './model';
4
3
  import { configSchemaFactory } from './configSchema';
4
+ import { stateModelFactory } from './model';
5
5
  export default function LinearLollipopDisplayF(pluginManager) {
6
6
  pluginManager.addDisplayType(() => {
7
7
  const configSchema = configSchemaFactory(pluginManager);
@@ -1,16 +1,7 @@
1
- import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
2
- /**
3
- * #stateModel LinearLollipopDisplay
4
- * extends
5
- * - [BaseLinearDisplay](../baselineardisplay)
6
- */
1
+ import type { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
7
2
  export declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
8
- id: import("mobx-state-tree" /**
9
- * #getter
10
- */).IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
11
- type: import("mobx-state-tree" /**
12
- * #getter
13
- */).ISimpleType<string>;
3
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
4
+ type: import("mobx-state-tree").ISimpleType<string>;
14
5
  rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
15
6
  } & {
16
7
  heightPreConfig: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
@@ -20,21 +11,12 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
20
11
  } & {
21
12
  blockState: import("mobx-state-tree").IMapType<import("mobx-state-tree").IModelType<{
22
13
  key: import("mobx-state-tree").ISimpleType<string>;
23
- region: import("mobx-state-tree").IModelType<{
24
- refName: import("mobx-state-tree").ISimpleType<string>;
25
- start: import("mobx-state-tree").ISimpleType<number>;
26
- end: import("mobx-state-tree").ISimpleType<number>;
27
- reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
28
- } & {
29
- assemblyName: import("mobx-state-tree").ISimpleType<string>;
30
- }, {
31
- setRefName(newRefName: string): void;
32
- }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
14
+ region: import("mobx-state-tree").IType<import("@jbrowse/core/util").Region, import("@jbrowse/core/util").Region, import("@jbrowse/core/util").Region>;
33
15
  reloadFlag: import("mobx-state-tree").IType<number | undefined, number, number>;
34
16
  isLeftEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
35
17
  isRightEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
36
18
  }, {
37
- renderInProgress: AbortController | undefined;
19
+ stopToken: string | undefined;
38
20
  filled: boolean;
39
21
  reactElement: React.ReactElement | undefined;
40
22
  features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
@@ -58,15 +40,9 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
58
40
  doReload(): void;
59
41
  afterAttach(): void;
60
42
  setStatus(message: string): void;
61
- setLoading(abortController: AbortController): void;
43
+ setLoading(newStopToken: string): void;
62
44
  setMessage(messageText: string): void;
63
- setRendered(props: {
64
- reactElement: React.ReactElement;
65
- features: Map<string, import("@jbrowse/core/util").Feature>;
66
- layout: any;
67
- maxHeightReached: boolean;
68
- renderProps: any;
69
- } | undefined): void;
45
+ setRendered(props: import("@jbrowse/plugin-linear-genome-view/dist/BaseLinearDisplay/models/serverSideRenderedBlock").RenderedProps | undefined): void;
70
46
  setError(error: unknown): void;
71
47
  reload(): void;
72
48
  beforeDestroy(): void;
@@ -100,13 +76,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
100
76
  };
101
77
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
102
78
  } & {
103
- /**
104
- * #property
105
- */
106
79
  type: import("mobx-state-tree").ISimpleType<"LinearLollipopDisplay">;
107
- /**
108
- * #property
109
- */
110
80
  configuration: AnyConfigurationSchemaType;
111
81
  }, {
112
82
  rendererTypeName: string;
@@ -197,6 +167,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
197
167
  readonly regionTooLarge: boolean;
198
168
  readonly regionTooLargeReason: string;
199
169
  } & {
170
+ readonly statsReadyAndRegionNotTooLarge: boolean;
200
171
  regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
201
172
  regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): React.JSX.Element | null;
202
173
  } & {
@@ -234,21 +205,9 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
234
205
  renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<React.JSX.Element>;
235
206
  afterAttach(): void;
236
207
  } & {
237
- /**
238
- * #getter
239
- */
240
208
  readonly blockType: string;
241
- /**
242
- * #getter
243
- */
244
209
  readonly renderDelay: number;
245
- /**
246
- * #method
247
- */
248
210
  renderProps(): any;
249
- /**
250
- * #getter
251
- */
252
211
  readonly rendererTypeName: any;
253
212
  }, {
254
213
  type: string;
@@ -264,21 +223,12 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
264
223
  } & {
265
224
  blockState: import("mobx-state-tree").IMapType<import("mobx-state-tree").IModelType<{
266
225
  key: import("mobx-state-tree").ISimpleType<string>;
267
- region: import("mobx-state-tree").IModelType<{
268
- refName: import("mobx-state-tree").ISimpleType<string>;
269
- start: import("mobx-state-tree").ISimpleType<number>;
270
- end: import("mobx-state-tree").ISimpleType<number>;
271
- reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
272
- } & {
273
- assemblyName: import("mobx-state-tree").ISimpleType<string>;
274
- }, {
275
- setRefName(newRefName: string): void;
276
- }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
226
+ region: import("mobx-state-tree").IType<import("@jbrowse/core/util").Region, import("@jbrowse/core/util").Region, import("@jbrowse/core/util").Region>;
277
227
  reloadFlag: import("mobx-state-tree").IType<number | undefined, number, number>;
278
228
  isLeftEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
279
229
  isRightEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
280
230
  }, {
281
- renderInProgress: AbortController | undefined;
231
+ stopToken: string | undefined;
282
232
  filled: boolean;
283
233
  reactElement: React.ReactElement | undefined;
284
234
  features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
@@ -302,15 +252,9 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
302
252
  doReload(): void;
303
253
  afterAttach(): void;
304
254
  setStatus(message: string): void;
305
- setLoading(abortController: AbortController): void;
255
+ setLoading(newStopToken: string): void;
306
256
  setMessage(messageText: string): void;
307
- setRendered(props: {
308
- reactElement: React.ReactElement;
309
- features: Map<string, import("@jbrowse/core/util").Feature>;
310
- layout: any;
311
- maxHeightReached: boolean;
312
- renderProps: any;
313
- } | undefined): void;
257
+ setRendered(props: import("@jbrowse/plugin-linear-genome-view/dist/BaseLinearDisplay/models/serverSideRenderedBlock").RenderedProps | undefined): void;
314
258
  setError(error: unknown): void;
315
259
  reload(): void;
316
260
  beforeDestroy(): void;
@@ -347,8 +291,8 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
347
291
  type: string;
348
292
  id: string;
349
293
  configuration: import("mobx-state-tree").ModelSnapshotType<Record<string, any>>;
350
- heightPreConfig: number | undefined;
351
294
  rpcDriverName: string | undefined;
295
+ heightPreConfig: number | undefined;
352
296
  userBpPerPxLimit: number | undefined;
353
297
  userByteSizeLimit: number | undefined;
354
298
  } & import("mobx-state-tree")._NotCustomized>;
@@ -1,41 +1,21 @@
1
- import { ConfigurationReference, } from '@jbrowse/core/configuration';
2
- import { types } from 'mobx-state-tree';
1
+ import { ConfigurationReference } from '@jbrowse/core/configuration';
3
2
  import { BaseLinearDisplay } from '@jbrowse/plugin-linear-genome-view';
4
- /**
5
- * #stateModel LinearLollipopDisplay
6
- * extends
7
- * - [BaseLinearDisplay](../baselineardisplay)
8
- */
3
+ import { types } from 'mobx-state-tree';
9
4
  export function stateModelFactory(configSchema) {
10
5
  return types
11
6
  .compose('LinearLollipopDisplay', BaseLinearDisplay, types.model({
12
- /**
13
- * #property
14
- */
15
7
  type: types.literal('LinearLollipopDisplay'),
16
- /**
17
- * #property
18
- */
19
8
  configuration: ConfigurationReference(configSchema),
20
9
  }))
21
10
  .views(self => {
22
11
  const { renderProps: superRenderProps } = self;
23
12
  return {
24
- /**
25
- * #getter
26
- */
27
13
  get blockType() {
28
14
  return 'dynamicBlocks';
29
15
  },
30
- /**
31
- * #getter
32
- */
33
16
  get renderDelay() {
34
17
  return 500;
35
18
  },
36
- /**
37
- * #method
38
- */
39
19
  renderProps() {
40
20
  return {
41
21
  ...superRenderProps(),
@@ -43,9 +23,6 @@ export function stateModelFactory(configSchema) {
43
23
  config: self.configuration.renderer,
44
24
  };
45
25
  },
46
- /**
47
- * #getter
48
- */
49
26
  get rendererTypeName() {
50
27
  return self.configuration.renderer.type;
51
28
  },
@@ -1,4 +1,4 @@
1
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
1
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
2
2
  interface LayoutItem {
3
3
  uniqueId: string;
4
4
  anchorLocation: number;
@@ -25,9 +25,6 @@ export declare class FloatingLayout {
25
25
  add(uniqueId: string, anchorLocation: number, width: number, height: number, data: {
26
26
  score: number;
27
27
  }): void;
28
- /**
29
- * @returns Map of `uniqueId => {x,y,anchorLocation,width,height,data}`
30
- */
31
28
  getLayout(configuration?: AnyConfigurationModel): LayoutMap;
32
29
  getTotalHeight(): number;
33
30
  serializeRegion(): {
@@ -15,9 +15,6 @@ export class FloatingLayout {
15
15
  this.items.push({ uniqueId, anchorLocation, width, height, data });
16
16
  this.layoutDirty = true;
17
17
  }
18
- /**
19
- * @returns Map of `uniqueId => {x,y,anchorLocation,width,height,data}`
20
- */
21
18
  getLayout(configuration) {
22
19
  if (!this.layoutDirty) {
23
20
  return this.layout;
@@ -26,10 +23,7 @@ export class FloatingLayout {
26
23
  throw new Error('configuration object required');
27
24
  }
28
25
  const minY = readConfObject(configuration, 'minStickLength');
29
- // sort them by score ascending, so higher scores will always end up
30
- // stacked last (toward the bottom)
31
26
  const sorted = this.items.sort((a, b) => a.data.score - b.data.score);
32
- // bump them
33
27
  let maxBottom = 0;
34
28
  const layoutEntries = new Array(sorted.length);
35
29
  for (let i = 0; i < sorted.length; i += 1) {
@@ -39,7 +33,6 @@ export class FloatingLayout {
39
33
  const end = start + width;
40
34
  let top = minY;
41
35
  let bottom = top + height;
42
- // figure out how far down to put it
43
36
  for (let j = 0; j < i; j += 1) {
44
37
  const [, previouslyLaidOutItem] = layoutEntries[j];
45
38
  const { x: prevStart, y: prevTop, width: prevWidth, height: prevHeight, } = previouslyLaidOutItem;
@@ -47,13 +40,11 @@ export class FloatingLayout {
47
40
  const prevBottom = prevTop + prevHeight;
48
41
  if (doesIntersect2(prevStart, prevEnd, start, end) &&
49
42
  doesIntersect2(prevTop, prevBottom, top, bottom)) {
50
- // bump this one to the bottom of the previous one
51
43
  top = prevBottom;
52
44
  bottom = top + height;
53
- j = -1; // we need to check all of them again after bumping
45
+ j = -1;
54
46
  }
55
47
  }
56
- // record the entry and update the maxBottom
57
48
  layoutEntries[i] = [
58
49
  currentItem.uniqueId,
59
50
  { ...currentItem, x: start, y: top },
@@ -62,8 +53,6 @@ export class FloatingLayout {
62
53
  maxBottom = bottom;
63
54
  }
64
55
  }
65
- // try to tile them left to right all at the same level
66
- // if they don't fit, try to alternate them on 2 levels, then 3
67
56
  this.totalHeight = maxBottom;
68
57
  this.layout = new Map(layoutEntries);
69
58
  this.layoutDirty = false;
@@ -8,8 +8,8 @@ class FloatingLayoutSession extends LayoutSession {
8
8
  const widthPx = (end - start) / this.bpPerPx;
9
9
  return new MultiLayout(FloatingLayout, { width: widthPx });
10
10
  }
11
- layoutIsValid( /* layout */) {
12
- return false; // layout.left layout.width === this.width
11
+ layoutIsValid() {
12
+ return false;
13
13
  }
14
14
  }
15
15
  export default class LollipopRenderer extends BoxRendererType {
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import { readConfObject, } from '@jbrowse/core/configuration';
2
+ import { readConfObject } from '@jbrowse/core/configuration';
3
3
  import { bpToPx } from '@jbrowse/core/util';
4
4
  import { observer } from 'mobx-react';
5
- // locals
6
5
  import Lollipop from './Lollipop';
7
6
  import Stick from './Stick';
8
7
  function layoutFeat(args) {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
- import { Feature } from '@jbrowse/core/util';
2
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
+ import type { Feature } from '@jbrowse/core/util';
4
4
  export default function ScoreText({ feature, config, layoutRecord: { y, data: { anchorX, radiusPx, score }, }, }: {
5
5
  feature: Feature;
6
6
  config: AnyConfigurationModel;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { readConfObject, } from '@jbrowse/core/configuration';
2
+ import { readConfObject } from '@jbrowse/core/configuration';
3
3
  import { contrastingTextColor } from '@jbrowse/core/util/color';
4
4
  export default function ScoreText({ feature, config, layoutRecord: { y, data: { anchorX, radiusPx, score }, }, }) {
5
5
  const innerColor = readConfObject(config, 'innerColor', { feature });
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
- import { Feature } from '@jbrowse/core/util';
2
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
+ import type { Feature } from '@jbrowse/core/util';
4
4
  declare const Stick: ({ feature, config, layoutRecord: { anchorLocation, y, data: { radiusPx }, }, }: {
5
5
  feature: Feature;
6
6
  config: AnyConfigurationModel;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { readConfObject, } from '@jbrowse/core/configuration';
2
+ import { readConfObject } from '@jbrowse/core/configuration';
3
3
  import { observer } from 'mobx-react';
4
4
  const Stick = observer(function Stick({ feature, config, layoutRecord: { anchorLocation, y, data: { radiusPx }, }, }) {
5
5
  return (React.createElement("line", { x1: anchorLocation, y1: 0, x2: anchorLocation, y2: y + 2 * radiusPx, stroke: readConfObject(config, 'stickColor', { feature }), strokeWidth: readConfObject(config, 'stickWidth', { feature }) }));
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function LollipopRendererF(pluginManager: PluginManager): void;
package/esm/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Plugin from '@jbrowse/core/Plugin';
2
- import PluginManager from '@jbrowse/core/PluginManager';
2
+ import type PluginManager from '@jbrowse/core/PluginManager';
3
3
  export default class LollipopPlugin extends Plugin {
4
4
  name: string;
5
5
  install(pluginManager: PluginManager): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-lollipop",
3
- "version": "2.17.0",
3
+ "version": "2.18.0",
4
4
  "description": "JBrowse 2 plugin for lollipops",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -50,5 +50,5 @@
50
50
  "publishConfig": {
51
51
  "access": "public"
52
52
  },
53
- "gitHead": "eed30b5e671f8f7823652d7cecc51aa89226de46"
53
+ "gitHead": "c344ea60099cb7e460b77f15808946b24a7eee74"
54
54
  }