@jbrowse/plugin-circular-view 2.16.1 → 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 (73) hide show
  1. package/dist/BaseChordDisplay/components/BaseChordDisplay.js +5 -4
  2. package/dist/BaseChordDisplay/components/Loading.js +1 -2
  3. package/dist/BaseChordDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -3
  4. package/dist/BaseChordDisplay/{models/configSchema.js → configSchema.js} +1 -10
  5. package/dist/BaseChordDisplay/index.d.ts +2 -2
  6. package/dist/BaseChordDisplay/index.js +2 -2
  7. package/{esm/BaseChordDisplay/models → dist/BaseChordDisplay}/model.d.ts +11 -52
  8. package/dist/BaseChordDisplay/{models/model.js → model.js} +29 -89
  9. package/dist/BaseChordDisplay/renderReaction.d.ts +27 -0
  10. package/dist/BaseChordDisplay/{models/renderReaction.js → renderReaction.js} +5 -13
  11. package/dist/CircularView/components/CircularView.d.ts +1 -1
  12. package/dist/CircularView/components/CircularView.js +2 -3
  13. package/dist/CircularView/components/Controls.d.ts +1 -1
  14. package/dist/CircularView/components/Controls.js +11 -12
  15. package/dist/CircularView/components/ExportSvgDialog.d.ts +1 -1
  16. package/dist/CircularView/components/ExportSvgDialog.js +2 -4
  17. package/dist/CircularView/components/ImportForm.d.ts +1 -1
  18. package/dist/CircularView/components/ImportForm.js +3 -3
  19. package/dist/CircularView/components/Ruler.d.ts +2 -2
  20. package/dist/CircularView/components/Ruler.js +1 -7
  21. package/dist/CircularView/index.d.ts +1 -1
  22. package/dist/CircularView/index.js +1 -1
  23. package/dist/CircularView/{models/model.d.ts → model.d.ts} +9 -158
  24. package/dist/CircularView/{models/model.js → model.js} +8 -217
  25. package/dist/CircularView/{models/slices.d.ts → slices.d.ts} +1 -1
  26. package/dist/CircularView/svgcomponents/SVGBackground.js +1 -1
  27. package/dist/CircularView/svgcomponents/SVGCircularView.d.ts +1 -1
  28. package/dist/CircularView/svgcomponents/SVGCircularView.js +4 -9
  29. package/dist/CircularView/{models/viewportVisibleRegion.js → viewportVisibleRegion.js} +0 -70
  30. package/dist/LaunchCircularView/index.d.ts +1 -1
  31. package/dist/LaunchCircularView/index.js +1 -3
  32. package/dist/index.d.ts +3 -3
  33. package/dist/index.js +5 -7
  34. package/esm/BaseChordDisplay/components/BaseChordDisplay.js +5 -4
  35. package/esm/BaseChordDisplay/components/Loading.js +2 -3
  36. package/esm/BaseChordDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -3
  37. package/esm/BaseChordDisplay/{models/configSchema.js → configSchema.js} +1 -10
  38. package/esm/BaseChordDisplay/index.d.ts +2 -2
  39. package/esm/BaseChordDisplay/index.js +2 -2
  40. package/{dist/BaseChordDisplay/models → esm/BaseChordDisplay}/model.d.ts +11 -52
  41. package/esm/BaseChordDisplay/{models/model.js → model.js} +30 -90
  42. package/esm/BaseChordDisplay/renderReaction.d.ts +27 -0
  43. package/esm/BaseChordDisplay/{models/renderReaction.js → renderReaction.js} +5 -10
  44. package/esm/CircularView/components/CircularView.d.ts +1 -1
  45. package/esm/CircularView/components/CircularView.js +2 -3
  46. package/esm/CircularView/components/Controls.d.ts +1 -1
  47. package/esm/CircularView/components/Controls.js +11 -12
  48. package/esm/CircularView/components/ExportSvgDialog.d.ts +1 -1
  49. package/esm/CircularView/components/ExportSvgDialog.js +2 -4
  50. package/esm/CircularView/components/ImportForm.d.ts +1 -1
  51. package/esm/CircularView/components/ImportForm.js +3 -3
  52. package/esm/CircularView/components/Ruler.d.ts +2 -2
  53. package/esm/CircularView/components/Ruler.js +2 -8
  54. package/esm/CircularView/index.d.ts +1 -1
  55. package/esm/CircularView/index.js +1 -1
  56. package/esm/CircularView/{models/model.d.ts → model.d.ts} +9 -158
  57. package/esm/CircularView/{models/model.js → model.js} +9 -218
  58. package/esm/CircularView/{models/slices.d.ts → slices.d.ts} +1 -1
  59. package/esm/CircularView/{models/slices.js → slices.js} +1 -1
  60. package/esm/CircularView/svgcomponents/SVGBackground.js +1 -1
  61. package/esm/CircularView/svgcomponents/SVGCircularView.d.ts +1 -1
  62. package/esm/CircularView/svgcomponents/SVGCircularView.js +4 -9
  63. package/esm/CircularView/{models/viewportVisibleRegion.js → viewportVisibleRegion.js} +0 -70
  64. package/esm/LaunchCircularView/index.d.ts +1 -1
  65. package/esm/LaunchCircularView/index.js +1 -3
  66. package/esm/index.d.ts +3 -3
  67. package/esm/index.js +3 -5
  68. package/package.json +2 -3
  69. package/dist/BaseChordDisplay/models/renderReaction.d.ts +0 -45
  70. package/esm/BaseChordDisplay/models/renderReaction.d.ts +0 -45
  71. /package/dist/CircularView/{models/slices.js → slices.js} +0 -0
  72. /package/dist/CircularView/{models/viewportVisibleRegion.d.ts → viewportVisibleRegion.d.ts} +0 -0
  73. /package/esm/CircularView/{models/viewportVisibleRegion.d.ts → viewportVisibleRegion.d.ts} +0 -0
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { observer } from 'mobx-react';
3
- import { getSession, polarToCartesian, radToDeg, assembleLocString, getStrokeProps, getFillProps, } from '@jbrowse/core/util';
2
+ import { assembleLocString, getFillProps, getSession, getStrokeProps, polarToCartesian, radToDeg, } from '@jbrowse/core/util';
4
3
  import { makeContrasting } from '@jbrowse/core/util/color';
5
4
  import { useTheme } from '@mui/material/styles';
5
+ import { observer } from 'mobx-react';
6
6
  import { makeStyles } from 'tss-react/mui';
7
7
  const useStyles = makeStyles()({
8
8
  rulerLabel: {
@@ -13,7 +13,6 @@ const useStyles = makeStyles()({
13
13
  },
14
14
  });
15
15
  function sliceArcPath(slice, radiusPx, startBase, endBase) {
16
- // A rx ry x-axis-rotation large-arc-flag sweep-flag x y
17
16
  if (slice.flipped) {
18
17
  ;
19
18
  [startBase, endBase] = [endBase, startBase];
@@ -43,7 +42,6 @@ const ElisionRulerArc = observer(function ({ model, slice, region, }) {
43
42
  const endXY = polarToCartesian(radiusPx, endRadians);
44
43
  const widthPx = (endRadians - startRadians) * radiusPx;
45
44
  const largeArc = endRadians - startRadians > Math.PI ? '1' : '0';
46
- // TODO: draw the elision
47
45
  const centerRadians = (endRadians + startRadians) / 2;
48
46
  const regionCount = `[${Number(region.regions.length).toLocaleString()}]`;
49
47
  return (React.createElement(React.Fragment, null,
@@ -67,13 +65,11 @@ const RulerLabel = observer(function ({ view, text, maxWidthPx, radians, radiusP
67
65
  return null;
68
66
  }
69
67
  if (text.length * 6.5 < maxWidthPx) {
70
- // text is rotated parallel to the ruler arc
71
68
  return (React.createElement("text", { x: 0, y: 0, className: classes.rulerLabel, textAnchor: "middle", dominantBaseline: "baseline", transform: `translate(${textXY}) rotate(${radToDeg(radians) + 90})`, ...getFillProps(color) },
72
69
  text,
73
70
  React.createElement("title", null, title || text)));
74
71
  }
75
72
  if (maxWidthPx > 4) {
76
- // text is rotated perpendicular to the ruler arc
77
73
  const overallRotation = radToDeg(radians + view.offsetRadians - Math.PI / 2);
78
74
  if (overallRotation >= 180) {
79
75
  return (React.createElement("text", { x: 0, y: 0, className: classes.rulerLabel, textAnchor: "start", dominantBaseline: "middle", transform: `translate(${textXY}) rotate(${radToDeg(radians)})`, fill: color },
@@ -84,7 +80,6 @@ const RulerLabel = observer(function ({ view, text, maxWidthPx, radians, radiusP
84
80
  text,
85
81
  React.createElement("title", null, title || text)));
86
82
  }
87
- // if you get here there is no room for the text at all
88
83
  return null;
89
84
  });
90
85
  const RegionRulerArc = observer(function ({ model, slice, region, }) {
@@ -107,7 +102,6 @@ const RegionRulerArc = observer(function ({ model, slice, region, }) {
107
102
  else {
108
103
  color = theme.palette.text.primary;
109
104
  }
110
- // TODO: slice flipping
111
105
  return (React.createElement(React.Fragment, null,
112
106
  React.createElement(RulerLabel, { text: region.refName, view: model, maxWidthPx: widthPx, radians: centerRadians, radiusPx: radiusPx, color: color }),
113
107
  React.createElement("path", { d: sliceArcPath(slice, radiusPx + 1, region.start, region.end), stroke: color, strokeWidth: 2, fill: "none" })));
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function CircularViewF(pluginManager: PluginManager): void;
@@ -1,6 +1,6 @@
1
1
  import { lazy } from 'react';
2
2
  import ViewType from '@jbrowse/core/pluggableElementTypes/ViewType';
3
- import stateModelFactory from './models/model';
3
+ import stateModelFactory from './model';
4
4
  export default function CircularViewF(pluginManager) {
5
5
  pluginManager.addViewType(() => new ViewType({
6
6
  ReactComponent: lazy(() => import('./components/CircularView')),
@@ -1,10 +1,11 @@
1
- import React from 'react';
2
- import PluginManager from '@jbrowse/core/PluginManager';
3
- import { SnapshotOrInstance, Instance } from 'mobx-state-tree';
4
- import { Region } from '@jbrowse/core/util/types/mst';
5
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
6
- import { MenuItem } from '@jbrowse/core/ui';
7
- import { SliceRegion } from './slices';
1
+ import type React from 'react';
2
+ import type { SliceRegion } from './slices';
3
+ import type PluginManager from '@jbrowse/core/PluginManager';
4
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
5
+ import type { MenuItem } from '@jbrowse/core/ui';
6
+ import type { Region as IRegion } from '@jbrowse/core/util/types';
7
+ import type { Region } from '@jbrowse/core/util/types/mst';
8
+ import type { Instance, SnapshotOrInstance } from 'mobx-state-tree';
8
9
  export interface ExportSvgOptions {
9
10
  rasterizeLayers?: boolean;
10
11
  filename?: string;
@@ -13,11 +14,6 @@ export interface ExportSvgOptions {
13
14
  }>;
14
15
  themeName?: string;
15
16
  }
16
- /**
17
- * #stateModel CircularView
18
- * extends
19
- * - [BaseViewModel](../baseviewmodel)
20
- */
21
17
  declare function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
22
18
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
23
19
  displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
@@ -32,16 +28,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
32
28
  lockedFitToWindow: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
33
29
  disableImportForm: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
34
30
  height: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
35
- displayedRegions: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
36
- refName: import("mobx-state-tree").ISimpleType<string>;
37
- start: import("mobx-state-tree").ISimpleType<number>;
38
- end: import("mobx-state-tree").ISimpleType<number>;
39
- reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
40
- } & {
41
- assemblyName: import("mobx-state-tree").ISimpleType<string>;
42
- }, {
43
- setRefName(newRefName: string): void;
44
- }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
31
+ displayedRegions: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<IRegion[], IRegion[], IRegion[]>, [undefined]>;
45
32
  scrollX: import("mobx-state-tree").IType<number | undefined, number, number>;
46
33
  scrollY: import("mobx-state-tree").IType<number | undefined, number, number>;
47
34
  minimumRadiusPx: import("mobx-state-tree").IType<number | undefined, number, number>;
@@ -63,192 +50,56 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
63
50
  volatileWidth: number | undefined;
64
51
  error: unknown;
65
52
  } & {
66
- /**
67
- * #getter
68
- */
69
53
  readonly width: number;
70
- /**
71
- * #getter
72
- */
73
54
  readonly visibleSection: {
74
55
  rho: [number, number];
75
56
  theta: [number, number];
76
57
  };
77
- /**
78
- * #getter
79
- */
80
58
  readonly circumferencePx: number;
81
- /**
82
- * #getter
83
- */
84
59
  readonly radiusPx: number;
85
- /**
86
- * #getter
87
- */
88
60
  readonly bpPerRadian: number;
89
- /**
90
- * #getter
91
- */
92
61
  readonly pxPerRadian: number;
93
- /**
94
- * #getter
95
- */
96
62
  readonly centerXY: [number, number];
97
- /**
98
- * #getter
99
- */
100
63
  readonly totalBp: number;
101
- /**
102
- * #getter
103
- */
104
64
  readonly maximumRadiusPx: number;
105
- /**
106
- * #getter
107
- */
108
65
  readonly maxBpPerPx: number;
109
- /**
110
- * #getter
111
- */
112
66
  readonly minBpPerPx: number;
113
- /**
114
- * #getter
115
- */
116
67
  readonly atMaxBpPerPx: boolean;
117
- /**
118
- * #getter
119
- */
120
68
  readonly atMinBpPerPx: boolean;
121
- /**
122
- * #getter
123
- */
124
69
  readonly tooSmallToLock: boolean;
125
- /**
126
- * #getter
127
- */
128
70
  readonly figureDimensions: [number, number];
129
- /**
130
- * #getter
131
- */
132
71
  readonly figureWidth: number;
133
- /**
134
- * #getter
135
- */
136
72
  readonly figureHeight: number;
137
- /**
138
- * #getter
139
- * this is displayedRegions, post-processed to elide regions that are too
140
- * small to see reasonably
141
- */
142
73
  readonly elidedRegions: SliceRegion[];
143
- /**
144
- * #getter
145
- */
146
74
  readonly assemblyNames: string[];
147
- /**
148
- * #getter
149
- */
150
75
  readonly initialized: boolean;
151
76
  } & {
152
- /**
153
- * #getter
154
- */
155
77
  readonly staticSlices: import("./slices").Slice[];
156
78
  } & {
157
- /**
158
- * #getter
159
- */
160
79
  readonly visibleStaticSlices: import("./slices").Slice[];
161
80
  } & {
162
- /**
163
- * #action
164
- */
165
81
  setWidth(newWidth: number): number;
166
- /**
167
- * #action
168
- */
169
82
  setHeight(newHeight: number): number;
170
- /**
171
- * #action
172
- */
173
83
  resizeHeight(distance: number): number;
174
- /**
175
- * #action
176
- */
177
84
  resizeWidth(distance: number): number;
178
- /**
179
- * #action
180
- */
181
85
  rotateClockwiseButton(): void;
182
- /**
183
- * #action
184
- */
185
86
  rotateCounterClockwiseButton(): void;
186
- /**
187
- * #action
188
- */
189
87
  rotateClockwise(distance?: number): void;
190
- /**
191
- * #action
192
- */
193
88
  rotateCounterClockwise(distance?: number): void;
194
- /**
195
- * #action
196
- */
197
89
  zoomInButton(): void;
198
- /**
199
- * #action
200
- */
201
90
  zoomOutButton(): void;
202
- /**
203
- * #action
204
- */
205
91
  setBpPerPx(newVal: number): void;
206
- /**
207
- * #action
208
- */
209
92
  setModelViewWhenAdjust(secondCondition: boolean): void;
210
- /**
211
- * #action
212
- */
213
93
  setDisplayedRegions(regions: SnapshotOrInstance<typeof Region>[]): void;
214
- /**
215
- * #action
216
- */
217
94
  activateTrackSelector(): import("@jbrowse/core/util").Widget;
218
- /**
219
- * #action
220
- */
221
95
  toggleTrack(trackId: string): boolean;
222
- /**
223
- * #action
224
- */
225
96
  setError(error: unknown): void;
226
- /**
227
- * #action
228
- */
229
97
  showTrack(trackId: string, initialSnapshot?: {}): void;
230
- /**
231
- * #action
232
- */
233
98
  addTrackConf(configuration: AnyConfigurationModel, initialSnapshot?: {}): void;
234
- /**
235
- * #action
236
- */
237
99
  hideTrack(trackId: string): number;
238
- /**
239
- * #action
240
- */
241
100
  toggleFitToWindowLock(): boolean;
242
- /**
243
- * #action
244
- * creates an svg export and save using FileSaver
245
- */
246
101
  exportSvg(opts?: ExportSvgOptions): Promise<void>;
247
102
  } & {
248
- /**
249
- * #method
250
- * return the view menu items
251
- */
252
103
  menuItems(): MenuItem[];
253
104
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
254
105
  export type CircularViewStateModel = ReturnType<typeof stateModelFactory>;