@jbrowse/plugin-wiggle 2.18.0 → 3.0.1

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 (144) hide show
  1. package/dist/BigWigAdapter/index.js +17 -7
  2. package/dist/CreateMultiWiggleExtension/ConfirmDialog.d.ts +1 -2
  3. package/dist/CreateMultiWiggleExtension/ConfirmDialog.js +12 -47
  4. package/dist/CreateMultiWiggleExtension/index.js +17 -7
  5. package/dist/DensityRenderer/DensityRenderer.js +35 -2
  6. package/dist/GuessAdapter/index.d.ts +2 -0
  7. package/dist/GuessAdapter/index.js +25 -0
  8. package/dist/LinePlotRenderer/LinePlotRenderer.js +35 -2
  9. package/dist/LinearWiggleDisplay/components/SetColorDialog.d.ts +1 -2
  10. package/dist/LinearWiggleDisplay/components/SetColorDialog.js +21 -57
  11. package/dist/LinearWiggleDisplay/components/Tooltip.d.ts +1 -2
  12. package/dist/LinearWiggleDisplay/components/Tooltip.js +5 -17
  13. package/dist/LinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -2
  14. package/dist/LinearWiggleDisplay/components/WiggleDisplayComponent.js +9 -12
  15. package/dist/LinearWiggleDisplay/index.js +17 -7
  16. package/dist/LinearWiggleDisplay/model.d.ts +31 -8
  17. package/dist/LinearWiggleDisplay/model.js +37 -20
  18. package/dist/LinearWiggleDisplay/renderSvg.d.ts +1 -2
  19. package/dist/LinearWiggleDisplay/renderSvg.js +2 -5
  20. package/dist/MultiDensityRenderer/MultiDensityRenderer.js +38 -3
  21. package/dist/MultiLineRenderer/MultiLineRenderer.js +35 -2
  22. package/dist/MultiLinearWiggleDisplay/components/ColorLegend.d.ts +2 -4
  23. package/dist/MultiLinearWiggleDisplay/components/ColorLegend.js +5 -14
  24. package/dist/MultiLinearWiggleDisplay/components/FullHeightScaleBar.d.ts +7 -0
  25. package/dist/MultiLinearWiggleDisplay/components/FullHeightScaleBar.js +17 -0
  26. package/dist/MultiLinearWiggleDisplay/components/IndividualScaleBars.d.ts +7 -0
  27. package/dist/MultiLinearWiggleDisplay/components/IndividualScaleBars.js +15 -0
  28. package/dist/MultiLinearWiggleDisplay/components/LegendItem.d.ts +11 -0
  29. package/dist/MultiLinearWiggleDisplay/components/LegendItem.js +19 -0
  30. package/dist/MultiLinearWiggleDisplay/components/RectBg.d.ts +1 -2
  31. package/dist/MultiLinearWiggleDisplay/components/RectBg.js +2 -5
  32. package/dist/MultiLinearWiggleDisplay/components/ScoreLegend.d.ts +1 -2
  33. package/dist/MultiLinearWiggleDisplay/components/ScoreLegend.js +2 -4
  34. package/dist/MultiLinearWiggleDisplay/components/SetColorDialog.d.ts +1 -2
  35. package/dist/MultiLinearWiggleDisplay/components/SetColorDialog.js +18 -55
  36. package/dist/MultiLinearWiggleDisplay/components/SourcesGrid.d.ts +1 -2
  37. package/dist/MultiLinearWiggleDisplay/components/SourcesGrid.js +79 -85
  38. package/dist/MultiLinearWiggleDisplay/components/Tooltip.d.ts +1 -2
  39. package/dist/MultiLinearWiggleDisplay/components/Tooltip.js +7 -21
  40. package/dist/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -2
  41. package/dist/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js +2 -4
  42. package/dist/MultiLinearWiggleDisplay/components/YScaleBars.d.ts +1 -2
  43. package/dist/MultiLinearWiggleDisplay/components/YScaleBars.js +7 -27
  44. package/dist/MultiLinearWiggleDisplay/index.js +17 -7
  45. package/dist/MultiLinearWiggleDisplay/model.d.ts +10 -7
  46. package/dist/MultiLinearWiggleDisplay/model.js +30 -8
  47. package/dist/MultiLinearWiggleDisplay/renderSvg.d.ts +1 -2
  48. package/dist/MultiLinearWiggleDisplay/renderSvg.js +2 -5
  49. package/dist/MultiLinearWiggleDisplay/util.d.ts +1 -0
  50. package/dist/MultiLinearWiggleDisplay/util.js +10 -0
  51. package/dist/MultiRowLineRenderer/MultiRowLineRenderer.js +35 -2
  52. package/dist/MultiRowXYPlotRenderer/MultiRowXYPlotRenderer.js +35 -2
  53. package/dist/MultiWiggleAdapter/index.js +17 -7
  54. package/dist/MultiWiggleAddTrackWorkflow/AddTrackWorkflow.d.ts +3 -3
  55. package/dist/MultiWiggleAddTrackWorkflow/AddTrackWorkflow.js +61 -100
  56. package/dist/MultiWiggleAddTrackWorkflow/index.js +17 -7
  57. package/dist/MultiWiggleRendering.d.ts +1 -2
  58. package/dist/MultiWiggleRendering.js +4 -27
  59. package/dist/MultiXYPlotRenderer/MultiXYPlotRenderer.js +35 -2
  60. package/dist/Tooltip.d.ts +1 -2
  61. package/dist/Tooltip.js +6 -32
  62. package/dist/WiggleBaseRenderer.d.ts +3 -3
  63. package/dist/WiggleRendering.d.ts +1 -2
  64. package/dist/WiggleRendering.js +4 -27
  65. package/dist/XYPlotRenderer/XYPlotRenderer.js +35 -2
  66. package/dist/index.d.ts +3 -3
  67. package/dist/index.js +19 -34
  68. package/dist/shared/SetMinMaxDialog.d.ts +1 -2
  69. package/dist/shared/SetMinMaxDialog.js +11 -41
  70. package/dist/shared/SharedWiggleMixin.d.ts +6 -6
  71. package/dist/shared/SharedWiggleMixin.js +17 -7
  72. package/dist/shared/YScaleBar.d.ts +1 -2
  73. package/dist/shared/YScaleBar.js +2 -5
  74. package/esm/CreateMultiWiggleExtension/ConfirmDialog.d.ts +1 -2
  75. package/esm/CreateMultiWiggleExtension/ConfirmDialog.js +12 -24
  76. package/esm/DensityRenderer/DensityRenderer.js +1 -1
  77. package/esm/GuessAdapter/index.d.ts +2 -0
  78. package/esm/GuessAdapter/index.js +22 -0
  79. package/esm/LinePlotRenderer/LinePlotRenderer.js +1 -1
  80. package/esm/LinearWiggleDisplay/components/SetColorDialog.d.ts +1 -2
  81. package/esm/LinearWiggleDisplay/components/SetColorDialog.js +21 -34
  82. package/esm/LinearWiggleDisplay/components/Tooltip.d.ts +1 -2
  83. package/esm/LinearWiggleDisplay/components/Tooltip.js +5 -17
  84. package/esm/LinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -2
  85. package/esm/LinearWiggleDisplay/components/WiggleDisplayComponent.js +9 -12
  86. package/esm/LinearWiggleDisplay/model.d.ts +31 -8
  87. package/esm/LinearWiggleDisplay/model.js +20 -13
  88. package/esm/LinearWiggleDisplay/renderSvg.d.ts +1 -2
  89. package/esm/LinearWiggleDisplay/renderSvg.js +2 -5
  90. package/esm/MultiDensityRenderer/MultiDensityRenderer.js +4 -2
  91. package/esm/MultiLineRenderer/MultiLineRenderer.js +1 -1
  92. package/esm/MultiLinearWiggleDisplay/components/ColorLegend.d.ts +2 -4
  93. package/esm/MultiLinearWiggleDisplay/components/ColorLegend.js +5 -14
  94. package/esm/MultiLinearWiggleDisplay/components/FullHeightScaleBar.d.ts +7 -0
  95. package/esm/MultiLinearWiggleDisplay/components/FullHeightScaleBar.js +12 -0
  96. package/esm/MultiLinearWiggleDisplay/components/IndividualScaleBars.d.ts +7 -0
  97. package/esm/MultiLinearWiggleDisplay/components/IndividualScaleBars.js +10 -0
  98. package/esm/MultiLinearWiggleDisplay/components/LegendItem.d.ts +11 -0
  99. package/esm/MultiLinearWiggleDisplay/components/LegendItem.js +14 -0
  100. package/esm/MultiLinearWiggleDisplay/components/RectBg.d.ts +1 -2
  101. package/esm/MultiLinearWiggleDisplay/components/RectBg.js +2 -2
  102. package/esm/MultiLinearWiggleDisplay/components/ScoreLegend.d.ts +1 -2
  103. package/esm/MultiLinearWiggleDisplay/components/ScoreLegend.js +2 -4
  104. package/esm/MultiLinearWiggleDisplay/components/SetColorDialog.d.ts +1 -2
  105. package/esm/MultiLinearWiggleDisplay/components/SetColorDialog.js +18 -32
  106. package/esm/MultiLinearWiggleDisplay/components/SourcesGrid.d.ts +1 -2
  107. package/esm/MultiLinearWiggleDisplay/components/SourcesGrid.js +62 -78
  108. package/esm/MultiLinearWiggleDisplay/components/Tooltip.d.ts +1 -2
  109. package/esm/MultiLinearWiggleDisplay/components/Tooltip.js +7 -21
  110. package/esm/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -2
  111. package/esm/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js +2 -4
  112. package/esm/MultiLinearWiggleDisplay/components/YScaleBars.d.ts +1 -2
  113. package/esm/MultiLinearWiggleDisplay/components/YScaleBars.js +8 -28
  114. package/esm/MultiLinearWiggleDisplay/model.d.ts +10 -7
  115. package/esm/MultiLinearWiggleDisplay/model.js +14 -2
  116. package/esm/MultiLinearWiggleDisplay/renderSvg.d.ts +1 -2
  117. package/esm/MultiLinearWiggleDisplay/renderSvg.js +2 -5
  118. package/esm/MultiLinearWiggleDisplay/util.d.ts +1 -0
  119. package/esm/MultiLinearWiggleDisplay/util.js +7 -0
  120. package/esm/MultiRowLineRenderer/MultiRowLineRenderer.js +1 -1
  121. package/esm/MultiRowXYPlotRenderer/MultiRowXYPlotRenderer.js +1 -1
  122. package/esm/MultiWiggleAddTrackWorkflow/AddTrackWorkflow.d.ts +3 -3
  123. package/esm/MultiWiggleAddTrackWorkflow/AddTrackWorkflow.js +61 -76
  124. package/esm/MultiWiggleRendering.d.ts +1 -2
  125. package/esm/MultiWiggleRendering.js +4 -4
  126. package/esm/MultiXYPlotRenderer/MultiXYPlotRenderer.js +1 -1
  127. package/esm/Tooltip.d.ts +1 -2
  128. package/esm/Tooltip.js +6 -9
  129. package/esm/WiggleBaseRenderer.d.ts +3 -3
  130. package/esm/WiggleRendering.d.ts +1 -2
  131. package/esm/WiggleRendering.js +4 -4
  132. package/esm/XYPlotRenderer/XYPlotRenderer.js +1 -1
  133. package/esm/index.d.ts +3 -3
  134. package/esm/index.js +2 -27
  135. package/esm/shared/SetMinMaxDialog.d.ts +1 -2
  136. package/esm/shared/SetMinMaxDialog.js +11 -18
  137. package/esm/shared/SharedWiggleMixin.d.ts +6 -6
  138. package/esm/shared/YScaleBar.d.ts +1 -2
  139. package/esm/shared/YScaleBar.js +2 -2
  140. package/package.json +12 -13
  141. package/dist/MultiLinearWiggleDisplay/components/DraggableDialog.d.ts +0 -6
  142. package/dist/MultiLinearWiggleDisplay/components/DraggableDialog.js +0 -62
  143. package/esm/MultiLinearWiggleDisplay/components/DraggableDialog.d.ts +0 -6
  144. package/esm/MultiLinearWiggleDisplay/components/DraggableDialog.js +0 -34
@@ -38,7 +38,7 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
38
38
  status?: string;
39
39
  reactElement?: React.ReactElement;
40
40
  };
41
- }) => import("react").JSX.Element | undefined;
41
+ }) => import("react/jsx-runtime").JSX.Element | undefined;
42
42
  renderProps: any;
43
43
  } & {
44
44
  doReload(): void;
@@ -190,13 +190,13 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
190
190
  } & {
191
191
  readonly statsReadyAndRegionNotTooLarge: boolean;
192
192
  regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
193
- regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react").JSX.Element | null;
193
+ regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
194
194
  } & {
195
195
  featureIdUnderMouse: undefined | string;
196
196
  contextMenuFeature: undefined | import("@jbrowse/core/util").Feature;
197
197
  } & {
198
- readonly DisplayMessageComponent: import("react").FC<any> | undefined;
199
- readonly blockType: "dynamicBlocks" | "staticBlocks";
198
+ readonly DisplayMessageComponent: undefined | React.FC<any>;
199
+ readonly blockType: "staticBlocks" | "dynamicBlocks";
200
200
  readonly blockDefinitions: import("@jbrowse/core/util/blockTypes").BlockSet;
201
201
  } & {
202
202
  readonly renderDelay: number;
@@ -223,7 +223,7 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
223
223
  contextMenuItems(): import("@jbrowse/core/ui").MenuItem[];
224
224
  renderProps(): any;
225
225
  } & {
226
- renderSvg(opts: ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
226
+ renderSvg(opts: ExportSvgDisplayOptions): Promise<import("react/jsx-runtime").JSX.Element>;
227
227
  afterAttach(): void;
228
228
  } & {
229
229
  message: undefined | string;
@@ -339,7 +339,17 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
339
339
  readonly quantitativeStatsReady: boolean;
340
340
  } & {
341
341
  trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
342
+ type: string;
343
+ label?: undefined;
344
+ icon?: undefined;
345
+ subMenu?: undefined;
346
+ onClick?: undefined;
347
+ checked?: undefined;
348
+ } | {
342
349
  label: string;
350
+ icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
351
+ muiName: string;
352
+ };
343
353
  subMenu: ({
344
354
  label: string;
345
355
  subMenu: {
@@ -362,8 +372,8 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
362
372
  subMenu?: undefined;
363
373
  })[];
364
374
  type?: undefined;
365
- checked?: undefined;
366
375
  onClick?: undefined;
376
+ checked?: undefined;
367
377
  } | {
368
378
  label: string;
369
379
  subMenu: {
@@ -373,10 +383,23 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
373
383
  onClick: () => void;
374
384
  }[];
375
385
  type?: undefined;
376
- checked?: undefined;
386
+ icon?: undefined;
377
387
  onClick?: undefined;
388
+ checked?: undefined;
389
+ } | {
390
+ label: string;
391
+ icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
392
+ muiName: string;
393
+ };
394
+ onClick: () => void;
395
+ type?: undefined;
396
+ subMenu?: undefined;
397
+ checked?: undefined;
378
398
  } | {
379
399
  type: string;
400
+ icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
401
+ muiName: string;
402
+ };
380
403
  label: string;
381
404
  checked: boolean;
382
405
  onClick: () => void;
@@ -384,7 +407,7 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
384
407
  })[];
385
408
  } & {
386
409
  afterAttach(): void;
387
- renderSvg(opts: ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
410
+ renderSvg(opts: ExportSvgDisplayOptions): Promise<import("react/jsx-runtime").JSX.Element>;
388
411
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
389
412
  export type WiggleDisplayStateModel = ReturnType<typeof stateModelFactory>;
390
413
  export type WiggleDisplayModel = Instance<WiggleDisplayStateModel>;
@@ -1,6 +1,9 @@
1
1
  import { lazy } from 'react';
2
2
  import { getConf } from '@jbrowse/core/configuration';
3
3
  import { getContainingView, getSession } from '@jbrowse/core/util';
4
+ import EqualizerIcon from '@mui/icons-material/Equalizer';
5
+ import PaletteIcon from '@mui/icons-material/Palette';
6
+ import VisibilityIcon from '@mui/icons-material/Visibility';
4
7
  import { types } from 'mobx-state-tree';
5
8
  import { axisPropsFromTickScale } from 'react-d3-axis-mod';
6
9
  import SharedWiggleMixin from '../shared/SharedWiggleMixin';
@@ -114,8 +117,10 @@ function stateModelFactory(pluginManager, configSchema) {
114
117
  trackMenuItems() {
115
118
  return [
116
119
  ...superTrackMenuItems(),
120
+ { type: 'divider' },
117
121
  {
118
122
  label: 'Score',
123
+ icon: EqualizerIcon,
119
124
  subMenu: self.scoreTrackMenuItems(),
120
125
  },
121
126
  ...(self.canHaveFill
@@ -133,18 +138,6 @@ function stateModelFactory(pluginManager, configSchema) {
133
138
  },
134
139
  ]
135
140
  : []),
136
- ...(self.needsScalebar
137
- ? [
138
- {
139
- type: 'checkbox',
140
- label: 'Draw cross hatches',
141
- checked: self.displayCrossHatchesSetting,
142
- onClick: () => {
143
- self.toggleCrossHatches();
144
- },
145
- },
146
- ]
147
- : []),
148
141
  ...(hasRenderings
149
142
  ? [
150
143
  {
@@ -161,7 +154,8 @@ function stateModelFactory(pluginManager, configSchema) {
161
154
  ]
162
155
  : []),
163
156
  {
164
- label: 'Set color',
157
+ label: 'Color',
158
+ icon: PaletteIcon,
165
159
  onClick: () => {
166
160
  getSession(self).queueDialog(handleClose => [
167
161
  SetColorDialog,
@@ -172,6 +166,19 @@ function stateModelFactory(pluginManager, configSchema) {
172
166
  ]);
173
167
  },
174
168
  },
169
+ ...(self.needsScalebar
170
+ ? [
171
+ {
172
+ type: 'checkbox',
173
+ icon: VisibilityIcon,
174
+ label: 'Show cross hatches',
175
+ checked: self.displayCrossHatchesSetting,
176
+ onClick: () => {
177
+ self.toggleCrossHatches();
178
+ },
179
+ },
180
+ ]
181
+ : []),
175
182
  ];
176
183
  },
177
184
  };
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import type { WiggleDisplayModel } from './model';
3
2
  import type { ExportSvgDisplayOptions } from '@jbrowse/plugin-linear-genome-view';
4
- export declare function renderSvg(self: WiggleDisplayModel, opts: ExportSvgDisplayOptions, superRenderSvg: (opts: ExportSvgDisplayOptions) => Promise<React.ReactNode>): Promise<React.JSX.Element>;
3
+ export declare function renderSvg(self: WiggleDisplayModel, opts: ExportSvgDisplayOptions, superRenderSvg: (opts: ExportSvgDisplayOptions) => Promise<React.ReactNode>): Promise<import("react/jsx-runtime").JSX.Element>;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { getContainingView } from '@jbrowse/core/util';
3
3
  import { when } from 'mobx';
4
4
  import YScaleBar from '../shared/YScaleBar';
@@ -6,8 +6,5 @@ export async function renderSvg(self, opts, superRenderSvg) {
6
6
  await when(() => !!self.stats && !!self.regionCannotBeRenderedText);
7
7
  const { needsScalebar, stats } = self;
8
8
  const { offsetPx } = getContainingView(self);
9
- return (React.createElement(React.Fragment, null,
10
- React.createElement("g", null, await superRenderSvg(opts)),
11
- needsScalebar && stats ? (React.createElement("g", { transform: `translate(${Math.max(-offsetPx, 0)})` },
12
- React.createElement(YScaleBar, { model: self, orientation: "left" }))) : null));
9
+ return (_jsxs(_Fragment, { children: [_jsx("g", { children: await superRenderSvg(opts) }), needsScalebar && stats ? (_jsx("g", { transform: `translate(${Math.max(-offsetPx, 0)})`, children: _jsx(YScaleBar, { model: self, orientation: "left" }) })) : null] }));
13
10
  }
@@ -1,12 +1,12 @@
1
1
  import { groupBy } from '@jbrowse/core/util';
2
2
  import WiggleBaseRenderer from '../WiggleBaseRenderer';
3
- import { drawDensity } from '../drawDensity';
4
3
  export default class MultiDensityPlotRenderer extends WiggleBaseRenderer {
5
4
  async draw(ctx, props) {
6
5
  const { sources, features } = props;
7
6
  const groups = groupBy(features.values(), f => f.get('source'));
8
7
  const height = props.height / sources.length;
9
8
  let feats = [];
9
+ const { drawDensity } = await import('../drawDensity');
10
10
  ctx.save();
11
11
  sources.forEach(source => {
12
12
  const features = groups[source.name] || [];
@@ -19,6 +19,8 @@ export default class MultiDensityPlotRenderer extends WiggleBaseRenderer {
19
19
  feats = feats.concat(reducedFeatures);
20
20
  });
21
21
  ctx.restore();
22
- return { reducedFeatures: feats };
22
+ return {
23
+ reducedFeatures: feats,
24
+ };
23
25
  }
24
26
  }
@@ -1,10 +1,10 @@
1
1
  import { groupBy } from '@jbrowse/core/util';
2
2
  import WiggleBaseRenderer from '../WiggleBaseRenderer';
3
- import { drawLine } from '../drawLine';
4
3
  export default class MultiLineRenderer extends WiggleBaseRenderer {
5
4
  async draw(ctx, props) {
6
5
  const { sources, features } = props;
7
6
  const groups = groupBy(features.values(), f => f.get('source'));
7
+ const { drawLine } = await import('../drawLine');
8
8
  let feats = [];
9
9
  sources.forEach(source => {
10
10
  const { reducedFeatures } = drawLine(ctx, {
@@ -1,9 +1,7 @@
1
- import React from 'react';
2
1
  import type { WiggleDisplayModel } from '../model';
3
- declare const ColorLegend: ({ model, rowHeight, labelWidth, exportSVG, }: {
2
+ declare const ColorLegend: ({ model, rowHeight, exportSVG, }: {
4
3
  model: WiggleDisplayModel;
5
4
  rowHeight: number;
6
- labelWidth: number;
7
5
  exportSVG?: boolean;
8
- }) => React.JSX.Element | null;
6
+ }) => import("react/jsx-runtime").JSX.Element | null;
9
7
  export default ColorLegend;
@@ -1,22 +1,13 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { observer } from 'mobx-react';
3
+ import LegendItem from './LegendItem';
3
4
  import RectBg from './RectBg';
4
- const ColorLegend = observer(function ({ model, rowHeight, labelWidth, exportSVG, }) {
5
- const { needsCustomLegend, needsScalebar, needsFullHeightScalebar, rowHeightTooSmallForScalebar, renderColorBoxes, sources, } = model;
6
- const svgFontSize = Math.min(rowHeight, 12);
7
- const canDisplayLabel = rowHeight > 11;
5
+ const ColorLegend = observer(function ({ model, rowHeight, exportSVG, }) {
6
+ const { needsScalebar, needsFullHeightScalebar, rowHeightTooSmallForScalebar, renderColorBoxes, sources, labelWidth, } = model;
8
7
  const colorBoxWidth = renderColorBoxes ? 15 : 0;
9
8
  const legendWidth = labelWidth + colorBoxWidth + 5;
10
9
  const svgOffset = exportSVG ? 10 : 0;
11
10
  const extraOffset = svgOffset || (needsScalebar && !rowHeightTooSmallForScalebar ? 50 : 0);
12
- return sources ? (React.createElement(React.Fragment, null,
13
- needsFullHeightScalebar ? (React.createElement(RectBg, { y: 0, x: extraOffset, width: legendWidth, height: (sources.length + 0.25) * rowHeight })) : null,
14
- sources.map((source, idx) => {
15
- const boxHeight = Math.min(20, rowHeight);
16
- return (React.createElement(React.Fragment, { key: `${source.name}-${idx}` },
17
- needsFullHeightScalebar ? null : (React.createElement(RectBg, { y: idx * rowHeight + 1, x: extraOffset, width: legendWidth, height: boxHeight })),
18
- source.color ? (React.createElement(RectBg, { y: idx * rowHeight + 1, x: extraOffset, width: colorBoxWidth, height: needsCustomLegend ? rowHeight : boxHeight, color: source.color })) : null,
19
- canDisplayLabel ? (React.createElement("text", { y: idx * rowHeight + 13, x: extraOffset + colorBoxWidth + 2, fontSize: svgFontSize }, source.name)) : null));
20
- }))) : null;
11
+ return sources ? (_jsxs(_Fragment, { children: [needsFullHeightScalebar ? (_jsx(RectBg, { y: 0, x: extraOffset, width: legendWidth, height: (sources.length + 0.25) * rowHeight })) : null, sources.map((source, idx) => (_jsx(LegendItem, { source: source, idx: idx, model: model, rowHeight: rowHeight, exportSVG: exportSVG, labelWidth: labelWidth }, `${source.name}-${idx}`)))] })) : null;
21
12
  });
22
13
  export default ColorLegend;
@@ -0,0 +1,7 @@
1
+ import type { WiggleDisplayModel } from '../model';
2
+ declare const FullHeightScaleBar: ({ model, orientation, exportSVG, }: {
3
+ model: WiggleDisplayModel;
4
+ orientation?: string;
5
+ exportSVG?: boolean;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ export default FullHeightScaleBar;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { getContainingView } from '@jbrowse/core/util';
3
+ import { observer } from 'mobx-react';
4
+ import ColorLegend from './ColorLegend';
5
+ import { getOffset } from './util';
6
+ import YScaleBar from '../../shared/YScaleBar';
7
+ const FullHeightScaleBar = observer(function ({ model, orientation, exportSVG, }) {
8
+ const { labelWidth } = model;
9
+ const { width: viewWidth } = getContainingView(model);
10
+ return (_jsxs(_Fragment, { children: [_jsx("g", { transform: `translate(${!exportSVG ? getOffset(model) : 0},0)`, children: _jsx(YScaleBar, { model: model, orientation: orientation }) }), _jsx("g", { transform: `translate(${viewWidth - labelWidth - 100},0)`, children: _jsx(ColorLegend, { exportSVG: exportSVG, model: model, rowHeight: 12 }) })] }));
11
+ });
12
+ export default FullHeightScaleBar;
@@ -0,0 +1,7 @@
1
+ import type { WiggleDisplayModel } from '../model';
2
+ declare const IndividualScaleBars: ({ model, orientation, exportSVG, }: {
3
+ model: WiggleDisplayModel;
4
+ orientation?: string;
5
+ exportSVG?: boolean;
6
+ }) => import("react/jsx-runtime").JSX.Element | null;
7
+ export default IndividualScaleBars;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { observer } from 'mobx-react';
3
+ import ColorLegend from './ColorLegend';
4
+ import ScoreLegend from './ScoreLegend';
5
+ import YScaleBar from '../../shared/YScaleBar';
6
+ const IndividualScaleBars = observer(function ({ model, orientation, exportSVG, }) {
7
+ const { sources, rowHeight, rowHeightTooSmallForScalebar, needsCustomLegend, ticks, } = model;
8
+ return (sources === null || sources === void 0 ? void 0 : sources.length) ? (_jsxs(_Fragment, { children: [_jsx(ColorLegend, { exportSVG: exportSVG, model: model, rowHeight: model.rowHeight }), rowHeightTooSmallForScalebar || needsCustomLegend ? (_jsx(ScoreLegend, { model: model })) : (sources.map((_source, idx) => (_jsx("g", { transform: `translate(0 ${rowHeight * idx})`, children: _jsx(YScaleBar, { model: model, orientation: orientation }) }, `${JSON.stringify(ticks)}-${idx}`))))] })) : null;
9
+ });
10
+ export default IndividualScaleBars;
@@ -0,0 +1,11 @@
1
+ import type { Source } from '../../util';
2
+ import type { WiggleDisplayModel } from '../model';
3
+ declare const LegendItem: ({ source, idx, rowHeight, labelWidth, model, exportSVG, }: {
4
+ source: Source;
5
+ idx: number;
6
+ rowHeight: number;
7
+ labelWidth: number;
8
+ model: WiggleDisplayModel;
9
+ exportSVG?: boolean;
10
+ }) => import("react/jsx-runtime").JSX.Element;
11
+ export default LegendItem;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import RectBg from './RectBg';
3
+ const LegendItem = function ({ source, idx, rowHeight, labelWidth, model, exportSVG, }) {
4
+ const boxHeight = Math.min(20, rowHeight);
5
+ const { needsCustomLegend, needsScalebar, needsFullHeightScalebar, rowHeightTooSmallForScalebar, renderColorBoxes, } = model;
6
+ const svgFontSize = Math.min(rowHeight, 12);
7
+ const canDisplayLabel = rowHeight > 11;
8
+ const colorBoxWidth = renderColorBoxes ? 15 : 0;
9
+ const legendWidth = labelWidth + colorBoxWidth + 5;
10
+ const svgOffset = exportSVG ? 10 : 0;
11
+ const extraOffset = svgOffset || (needsScalebar && !rowHeightTooSmallForScalebar ? 50 : 0);
12
+ return (_jsxs(_Fragment, { children: [needsFullHeightScalebar ? null : (_jsx(RectBg, { y: idx * rowHeight + 1, x: extraOffset, width: legendWidth, height: boxHeight })), source.color ? (_jsx(RectBg, { y: idx * rowHeight + 1, x: extraOffset, width: colorBoxWidth, height: needsCustomLegend ? rowHeight : boxHeight, color: source.color })) : null, canDisplayLabel ? (_jsx("text", { y: idx * rowHeight + 13, x: extraOffset + colorBoxWidth + 2, fontSize: svgFontSize, children: source.name })) : null] }));
13
+ };
14
+ export default LegendItem;
@@ -1,9 +1,8 @@
1
- import React from 'react';
2
1
  declare const RectBg: (props: {
3
2
  x: number;
4
3
  y: number;
5
4
  width: number;
6
5
  height: number;
7
6
  color?: string;
8
- }) => React.JSX.Element;
7
+ }) => import("react/jsx-runtime").JSX.Element;
9
8
  export default RectBg;
@@ -1,7 +1,7 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { getFillProps } from '@jbrowse/core/util';
3
3
  const RectBg = (props) => {
4
4
  const { color = 'rgb(255,255,255,0.8)' } = props;
5
- return React.createElement("rect", { ...props, ...getFillProps(color) });
5
+ return _jsx("rect", { ...props, ...getFillProps(color) });
6
6
  };
7
7
  export default RectBg;
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
1
  import type { WiggleDisplayModel } from '../model';
3
2
  declare const ScoreLegend: ({ model }: {
4
3
  model: WiggleDisplayModel;
5
- }) => React.JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
6
5
  export default ScoreLegend;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { getContainingView, measureText } from '@jbrowse/core/util';
3
3
  import { observer } from 'mobx-react';
4
4
  import RectBg from './RectBg';
@@ -9,8 +9,6 @@ const ScoreLegend = observer(({ model }) => {
9
9
  const len = measureText(legend, 14);
10
10
  const padding = 25;
11
11
  const xpos = width - len - padding;
12
- return (React.createElement(React.Fragment, null,
13
- React.createElement(RectBg, { y: 0, x: xpos, width: len + 6, height: 16 }),
14
- React.createElement("text", { y: 13, x: xpos }, legend)));
12
+ return (_jsxs(_Fragment, { children: [_jsx(RectBg, { y: 0, x: xpos, width: len + 6, height: 16 }), _jsx("text", { y: 13, x: xpos, children: legend })] }));
15
13
  });
16
14
  export default ScoreLegend;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import type { Source } from '../../util';
3
2
  export default function SetColorDialog({ model, handleClose, }: {
4
3
  model: {
@@ -7,4 +6,4 @@ export default function SetColorDialog({ model, handleClose, }: {
7
6
  clearLayout: () => void;
8
7
  };
9
8
  handleClose: () => void;
10
- }): React.JSX.Element;
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,47 +1,33 @@
1
- import React, { useState } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import DraggableDialog from '@jbrowse/core/ui/DraggableDialog';
2
4
  import { useLocalStorage } from '@jbrowse/core/util';
3
5
  import { Button, DialogActions, DialogContent } from '@mui/material';
4
6
  import { makeStyles } from 'tss-react/mui';
5
- import DraggableDialog from './DraggableDialog';
6
7
  import SourcesGrid from './SourcesGrid';
7
8
  const useStyles = makeStyles()({
8
9
  content: {
9
10
  minWidth: 800,
10
11
  },
12
+ float: {
13
+ float: 'right',
14
+ },
11
15
  });
12
16
  export default function SetColorDialog({ model, handleClose, }) {
13
17
  const { classes } = useStyles();
14
18
  const { sources } = model;
15
19
  const [currLayout, setCurrLayout] = useState(structuredClone(sources || []));
16
20
  const [showTips, setShowTips] = useLocalStorage('multiwiggle-showTips', false);
17
- return (React.createElement(DraggableDialog, { open: true, onClose: handleClose, maxWidth: "xl", title: 'Multi-wiggle color/arrangement editor' },
18
- React.createElement(DialogContent, { className: classes.content },
19
- React.createElement(Button, { variant: "contained", style: { float: 'right' }, onClick: () => {
20
- setShowTips(!showTips);
21
- } }, showTips ? 'Hide tips' : 'Show tips'),
22
- React.createElement("br", null),
23
- showTips ? (React.createElement(React.Fragment, null,
24
- "Helpful tips",
25
- React.createElement("ul", null,
26
- React.createElement("li", null, "You can select rows in the table with the checkboxes"),
27
- React.createElement("li", null, "Multi-select is enabled with shift-click and control-click"),
28
- React.createElement("li", null, "The \"Move selected items up/down\" can re-arrange subtracks"),
29
- React.createElement("li", null, "Sorting the data grid itself can also re-arrange subtracks"),
30
- React.createElement("li", null, "Changes are applied when you hit Submit"),
31
- React.createElement("li", null, "You can click and drag the dialog box to move it on the screen"),
32
- React.createElement("li", null, "Columns in the table can be hidden using a vertical '...' menu on the right side of each column")))) : null,
33
- React.createElement(SourcesGrid, { rows: currLayout, onChange: setCurrLayout, showTips: showTips })),
34
- React.createElement(DialogActions, null,
35
- React.createElement(Button, { variant: "contained", type: "submit", color: "inherit", onClick: () => {
36
- model.clearLayout();
37
- setCurrLayout(model.sources || []);
38
- } }, "Clear custom settings"),
39
- React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => {
40
- handleClose();
41
- setCurrLayout([...(model.sources || [])]);
42
- } }, "Cancel"),
43
- React.createElement(Button, { variant: "contained", color: "primary", type: "submit", onClick: () => {
44
- model.setLayout(currLayout);
45
- handleClose();
46
- } }, "Submit"))));
21
+ return (_jsxs(DraggableDialog, { open: true, onClose: handleClose, maxWidth: "xl", title: "Multi-wiggle color/arrangement editor", children: [_jsxs(DialogContent, { className: classes.content, children: [_jsx(Button, { variant: "contained", className: classes.float, onClick: () => {
22
+ setShowTips(!showTips);
23
+ }, children: showTips ? 'Hide tips' : 'Show tips' }), _jsx("br", {}), showTips ? (_jsxs(_Fragment, { children: ["Helpful tips", _jsxs("ul", { children: [_jsx("li", { children: "You can select rows in the table with the checkboxes" }), _jsx("li", { children: "Multi-select is enabled with shift-click and control-click" }), _jsx("li", { children: "The \"Move selected items up/down\" can re-arrange subtracks" }), _jsx("li", { children: "Sorting the data grid itself can also re-arrange subtracks" }), _jsx("li", { children: "Changes are applied when you hit Submit" }), _jsx("li", { children: "You can click and drag the dialog box to move it on the screen" }), _jsx("li", { children: "Columns in the table can be hidden using a vertical '...' menu on the right side of each column" })] })] })) : null, _jsx(SourcesGrid, { rows: currLayout, onChange: setCurrLayout, showTips: showTips })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", type: "submit", color: "inherit", onClick: () => {
24
+ model.clearLayout();
25
+ setCurrLayout(model.sources || []);
26
+ }, children: "Clear custom settings" }), _jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
27
+ handleClose();
28
+ setCurrLayout([...(model.sources || [])]);
29
+ }, children: "Cancel" }), _jsx(Button, { variant: "contained", color: "primary", type: "submit", onClick: () => {
30
+ model.setLayout(currLayout);
31
+ handleClose();
32
+ }, children: "Submit" })] })] }));
47
33
  }
@@ -1,8 +1,7 @@
1
- import React from 'react';
2
1
  import type { Source } from '../../util';
3
2
  declare function SourcesGrid({ rows, onChange, showTips, }: {
4
3
  rows: Source[];
5
4
  onChange: (arg: Source[]) => void;
6
5
  showTips: boolean;
7
- }): React.JSX.Element;
6
+ }): import("react/jsx-runtime").JSX.Element;
8
7
  export default SourcesGrid;