@jbrowse/plugin-wiggle 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/LinearWiggleDisplay/components/SetColorDialog.js +3 -19
  2. package/dist/LinearWiggleDisplay/components/SetColorDialog.js.map +1 -1
  3. package/dist/LinearWiggleDisplay/components/Tooltip.d.ts +1 -1
  4. package/dist/LinearWiggleDisplay/models/model.d.ts +27 -24
  5. package/dist/LinearWiggleDisplay/models/model.js +4 -4
  6. package/dist/LinearWiggleDisplay/models/model.js.map +1 -1
  7. package/dist/MultiLinearWiggleDisplay/components/DraggableDialog.d.ts +7 -0
  8. package/dist/MultiLinearWiggleDisplay/components/DraggableDialog.js +43 -0
  9. package/dist/MultiLinearWiggleDisplay/components/DraggableDialog.js.map +1 -0
  10. package/dist/MultiLinearWiggleDisplay/components/SetColorDialog.js +4 -22
  11. package/dist/MultiLinearWiggleDisplay/components/SetColorDialog.js.map +1 -1
  12. package/dist/MultiLinearWiggleDisplay/components/Tooltip.d.ts +1 -1
  13. package/dist/MultiLinearWiggleDisplay/models/model.d.ts +3 -3
  14. package/dist/MultiLinearWiggleDisplay/models/model.js +1 -1
  15. package/dist/MultiLinearWiggleDisplay/models/model.js.map +1 -1
  16. package/dist/Tooltip.d.ts +2 -2
  17. package/dist/WiggleRendering.js +1 -1
  18. package/dist/WiggleRendering.js.map +1 -1
  19. package/dist/index.d.ts +2 -2
  20. package/dist/{LinearWiggleDisplay/components → shared}/SetMinMaxDialog.d.ts +0 -0
  21. package/dist/shared/SetMinMaxDialog.js +53 -0
  22. package/dist/shared/SetMinMaxDialog.js.map +1 -0
  23. package/esm/LinearWiggleDisplay/components/SetColorDialog.js +4 -17
  24. package/esm/LinearWiggleDisplay/components/SetColorDialog.js.map +1 -1
  25. package/esm/LinearWiggleDisplay/components/Tooltip.d.ts +1 -1
  26. package/esm/LinearWiggleDisplay/models/model.d.ts +27 -24
  27. package/esm/LinearWiggleDisplay/models/model.js +4 -4
  28. package/esm/LinearWiggleDisplay/models/model.js.map +1 -1
  29. package/esm/MultiLinearWiggleDisplay/components/DraggableDialog.d.ts +7 -0
  30. package/esm/MultiLinearWiggleDisplay/components/DraggableDialog.js +38 -0
  31. package/esm/MultiLinearWiggleDisplay/components/DraggableDialog.js.map +1 -0
  32. package/esm/MultiLinearWiggleDisplay/components/SetColorDialog.js +5 -23
  33. package/esm/MultiLinearWiggleDisplay/components/SetColorDialog.js.map +1 -1
  34. package/esm/MultiLinearWiggleDisplay/components/Tooltip.d.ts +1 -1
  35. package/esm/MultiLinearWiggleDisplay/models/model.d.ts +3 -3
  36. package/esm/MultiLinearWiggleDisplay/models/model.js +1 -1
  37. package/esm/MultiLinearWiggleDisplay/models/model.js.map +1 -1
  38. package/esm/Tooltip.d.ts +2 -2
  39. package/esm/WiggleRendering.js +1 -1
  40. package/esm/WiggleRendering.js.map +1 -1
  41. package/esm/index.d.ts +2 -2
  42. package/{dist/MultiLinearWiggleDisplay/components → esm/shared}/SetMinMaxDialog.d.ts +0 -0
  43. package/esm/shared/SetMinMaxDialog.js +27 -0
  44. package/esm/shared/SetMinMaxDialog.js.map +1 -0
  45. package/package.json +3 -3
  46. package/src/BigWigAdapter/__snapshots__/BigWigAdapter.test.ts.snap +14 -14
  47. package/src/DensityRenderer/__snapshots__/DensityRenderer.test.js.snap +4 -4
  48. package/src/LinearWiggleDisplay/components/SetColorDialog.tsx +7 -27
  49. package/src/LinearWiggleDisplay/models/model.tsx +5 -5
  50. package/src/MultiLinearWiggleDisplay/components/DraggableDialog.tsx +71 -0
  51. package/src/MultiLinearWiggleDisplay/components/SetColorDialog.tsx +7 -41
  52. package/src/MultiLinearWiggleDisplay/models/model.tsx +1 -1
  53. package/src/WiggleRendering.tsx +1 -1
  54. package/src/XYPlotRenderer/__snapshots__/XYPlotRenderer.test.js.snap +4 -4
  55. package/src/__snapshots__/index.test.js.snap +1 -1
  56. package/src/shared/SetMinMaxDialog.tsx +88 -0
  57. package/dist/LinearWiggleDisplay/components/SetMinMaxDialog.js +0 -75
  58. package/dist/LinearWiggleDisplay/components/SetMinMaxDialog.js.map +0 -1
  59. package/dist/MultiLinearWiggleDisplay/components/SetMinMaxDialog.js +0 -75
  60. package/dist/MultiLinearWiggleDisplay/components/SetMinMaxDialog.js.map +0 -1
  61. package/esm/LinearWiggleDisplay/components/SetMinMaxDialog.d.ts +0 -11
  62. package/esm/LinearWiggleDisplay/components/SetMinMaxDialog.js +0 -46
  63. package/esm/LinearWiggleDisplay/components/SetMinMaxDialog.js.map +0 -1
  64. package/esm/MultiLinearWiggleDisplay/components/SetMinMaxDialog.d.ts +0 -11
  65. package/esm/MultiLinearWiggleDisplay/components/SetMinMaxDialog.js +0 -46
  66. package/esm/MultiLinearWiggleDisplay/components/SetMinMaxDialog.js.map +0 -1
  67. package/src/LinearWiggleDisplay/components/SetMinMaxDialog.tsx +0 -113
  68. package/src/MultiLinearWiggleDisplay/components/SetMinMaxDialog.tsx +0 -113
package/esm/Tooltip.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Feature } from '@jbrowse/core/util';
3
- declare type Coord = [number, number];
4
- export declare type TooltipContentsComponent = React.ForwardRefExoticComponent<{
3
+ type Coord = [number, number];
4
+ export type TooltipContentsComponent = React.ForwardRefExoticComponent<{
5
5
  feature: Feature;
6
6
  model: any;
7
7
  } & React.RefAttributes<HTMLDivElement>>;
@@ -16,7 +16,7 @@ function WiggleRendering(props) {
16
16
  const clientBp = region.start + bpPerPx * px;
17
17
  let featureUnderMouse;
18
18
  for (const feature of features.values()) {
19
- // bpPerPx added to the end to accomodate "reduced features" (one feature per px)
19
+ // bpPerPx added to the end to accommodate "reduced features" (one feature per px)
20
20
  if (clientBp <= feature.get('end') + bpPerPx &&
21
21
  clientBp >= feature.get('start')) {
22
22
  featureUnderMouse = feature;
@@ -1 +1 @@
1
- {"version":3,"file":"WiggleRendering.js","sourceRoot":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CAAC,YAAY,CAAC,KAAK,CAAC,EAC1C,KAAK,EAAE;YACL,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE,UAAU;YACpB,MAAM;SACP;QAED,oBAAC,iBAAiB,OAAK,KAAK,GAAI,CAC5B,CACP,CAAA;AACH,CAAC;AAED,eAAe,QAAQ,CAAC,eAAe,CAAC,CAAA"}
package/esm/index.d.ts CHANGED
@@ -328,7 +328,7 @@ export default class WigglePlugin extends Plugin {
328
328
  renderProps(): any;
329
329
  readonly hasResolution: boolean;
330
330
  readonly hasGlobalStats: boolean;
331
- readonly fillSetting: 2 | 1 | 0;
331
+ readonly fillSetting: 1 | 2 | 0;
332
332
  } & {
333
333
  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 | {
334
334
  label: string;
@@ -625,7 +625,7 @@ export default class WigglePlugin extends Plugin {
625
625
  renderProps(): any;
626
626
  readonly hasResolution: boolean;
627
627
  readonly hasGlobalStats: boolean;
628
- readonly fillSetting: 2 | 1 | 0;
628
+ readonly fillSetting: 1 | 2 | 0;
629
629
  } & {
630
630
  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 | {
631
631
  label: string;
@@ -0,0 +1,27 @@
1
+ import React, { useState } from 'react';
2
+ import { Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
3
+ import { Dialog } from '@jbrowse/core/ui';
4
+ export default function SetMinMaxDlg(props) {
5
+ const { model, handleClose } = props;
6
+ const { minScore, maxScore, scaleType } = model;
7
+ const [min, setMin] = useState(`${minScore !== Number.MIN_VALUE ? minScore : ''}`);
8
+ const [max, setMax] = useState(`${maxScore !== Number.MAX_VALUE ? maxScore : ''}`);
9
+ const ok = min !== '' && max !== '' && !Number.isNaN(+min) && !Number.isNaN(+max)
10
+ ? +max > +min
11
+ : true;
12
+ const logOk = scaleType === 'log' && min !== '' && !Number.isNaN(+min) ? +min > 0 : true;
13
+ return (React.createElement(Dialog, { open: true, onClose: handleClose, title: "Set min/max score for track" },
14
+ React.createElement(DialogContent, null,
15
+ React.createElement(Typography, null, "Enter min/max score: "),
16
+ !ok ? (React.createElement(Typography, { color: "error" }, "Max is greater than or equal to min")) : null,
17
+ !logOk ? (React.createElement(Typography, { color: "error" }, "Min score should be greater than 0 for log scale")) : null,
18
+ React.createElement(TextField, { value: min, onChange: event => setMin(event.target.value), placeholder: "Enter min score" }),
19
+ React.createElement(TextField, { value: max, onChange: event => setMax(event.target.value), placeholder: "Enter max score" })),
20
+ React.createElement(DialogActions, null,
21
+ React.createElement(Button, { variant: "contained", color: "primary", type: "submit", style: { marginLeft: 20 }, disabled: !ok, onClick: () => {
22
+ model.setMinScore(min !== '' && !Number.isNaN(+min) ? +min : undefined);
23
+ model.setMaxScore(max !== '' && !Number.isNaN(+max) ? +max : undefined);
24
+ handleClose();
25
+ } }, "Submit"))));
26
+ }
27
+ //# sourceMappingURL=SetMinMaxDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetMinMaxDialog.js","sourceRoot":"","sources":["../../src/shared/SetMinMaxDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EACL,MAAM,EACN,aAAa,EACb,aAAa,EACb,SAAS,EACT,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KASpC;IACC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,KA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YAER,oBAAC,SAAS,IACR,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAC7C,WAAW,EAAC,iBAAiB,GAC7B;YACF,oBAAC,SAAS,IACR,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAC7C,WAAW,EAAC,iBAAiB,GAC7B,CACY;QAChB,oBAAC,aAAa;YACZ,oBAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,SAAS,EACf,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,EACzB,QAAQ,EAAE,CAAC,EAAE,EACb,OAAO,EAAE,GAAG,EAAE;oBACZ,KAAK,CAAC,WAAW,CACf,GAAG,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CACrD,CAAA;oBACD,KAAK,CAAC,WAAW,CACf,GAAG,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CACrD,CAAA;oBACD,WAAW,EAAE,CAAA;gBACf,CAAC,aAGM,CACK,CACT,CACV,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-wiggle",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "JBrowse 2 wiggle adapters, tracks, etc.",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -27,7 +27,7 @@
27
27
  "build": "npm-run-all build:*",
28
28
  "test": "cd ../..; jest plugins/wiggle",
29
29
  "prepublishOnly": "yarn test",
30
- "prepack": "yarn build; yarn useDist",
30
+ "prepack": "yarn build && yarn useDist",
31
31
  "postpack": "yarn useSrc",
32
32
  "useDist": "node ../../scripts/useDist.js",
33
33
  "useSrc": "node ../../scripts/useSrc.js",
@@ -70,5 +70,5 @@
70
70
  "distModule": "esm/index.js",
71
71
  "srcModule": "src/index.ts",
72
72
  "module": "esm/index.js",
73
- "gitHead": "cf31db8d833117f8822510340664fb3f045975cb"
73
+ "gitHead": "abbc00e8feedbc58de84a7a3e735ec0224909b29"
74
74
  }
@@ -1,7 +1,7 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`adapter can fetch features from volvox.bw adapter can fetch stats from volvox.bw 1`] = `
4
- Object {
4
+ {
5
5
  "basesCovered": 49984,
6
6
  "featureDensity": 0.00002000640204865557,
7
7
  "scoreMax": 38,
@@ -14,7 +14,7 @@ Object {
14
14
  `;
15
15
 
16
16
  exports[`adapter can fetch features from volvox.bw get local stats 1`] = `
17
- Object {
17
+ {
18
18
  "basesCovered": 30100,
19
19
  "featureCount": 30000,
20
20
  "featureDensity": 0.9966777408637874,
@@ -28,7 +28,7 @@ Object {
28
28
  `;
29
29
 
30
30
  exports[`adapter can fetch features from volvox.bw get region stats 1`] = `
31
- Object {
31
+ {
32
32
  "basesCovered": 30001,
33
33
  "featureCount": 30001,
34
34
  "featureDensity": 1,
@@ -42,71 +42,71 @@ Object {
42
42
  `;
43
43
 
44
44
  exports[`adapter can fetch features from volvox.bw test basic aspects of getfeatures 1`] = `
45
- Array [
46
- Object {
45
+ [
46
+ {
47
47
  "end": 1003,
48
48
  "refName": "ctgA",
49
49
  "score": 18,
50
50
  "start": 1002,
51
51
  "uniqueId": ":ctgA:1002-1003",
52
52
  },
53
- Object {
53
+ {
54
54
  "end": 1004,
55
55
  "refName": "ctgA",
56
56
  "score": 18,
57
57
  "start": 1003,
58
58
  "uniqueId": ":ctgA:1003-1004",
59
59
  },
60
- Object {
60
+ {
61
61
  "end": 1005,
62
62
  "refName": "ctgA",
63
63
  "score": 18,
64
64
  "start": 1004,
65
65
  "uniqueId": ":ctgA:1004-1005",
66
66
  },
67
- Object {
67
+ {
68
68
  "end": 1006,
69
69
  "refName": "ctgA",
70
70
  "score": 19,
71
71
  "start": 1005,
72
72
  "uniqueId": ":ctgA:1005-1006",
73
73
  },
74
- Object {
74
+ {
75
75
  "end": 1007,
76
76
  "refName": "ctgA",
77
77
  "score": 20,
78
78
  "start": 1006,
79
79
  "uniqueId": ":ctgA:1006-1007",
80
80
  },
81
- Object {
81
+ {
82
82
  "end": 1008,
83
83
  "refName": "ctgA",
84
84
  "score": 20,
85
85
  "start": 1007,
86
86
  "uniqueId": ":ctgA:1007-1008",
87
87
  },
88
- Object {
88
+ {
89
89
  "end": 1009,
90
90
  "refName": "ctgA",
91
91
  "score": 20,
92
92
  "start": 1008,
93
93
  "uniqueId": ":ctgA:1008-1009",
94
94
  },
95
- Object {
95
+ {
96
96
  "end": 1010,
97
97
  "refName": "ctgA",
98
98
  "score": 20,
99
99
  "start": 1009,
100
100
  "uniqueId": ":ctgA:1009-1010",
101
101
  },
102
- Object {
102
+ {
103
103
  "end": 1011,
104
104
  "refName": "ctgA",
105
105
  "score": 20,
106
106
  "start": 1010,
107
107
  "uniqueId": ":ctgA:1010-1011",
108
108
  },
109
- Object {
109
+ {
110
110
  "end": 1012,
111
111
  "refName": "ctgA",
112
112
  "score": 19,
@@ -1,16 +1,16 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`inverted mode and reversed 1`] = `
4
- Object {
4
+ {
5
5
  "imageData": Any<Object>,
6
- "reducedFeatures": Array [
7
- Object {
6
+ "reducedFeatures": [
7
+ {
8
8
  "end": 100,
9
9
  "score": 1,
10
10
  "start": 1,
11
11
  "uniqueId": "t1",
12
12
  },
13
- Object {
13
+ {
14
14
  "end": 200,
15
15
  "score": 2,
16
16
  "start": 101,
@@ -2,28 +2,15 @@ import React, { useState } from 'react'
2
2
  import { observer } from 'mobx-react'
3
3
  import {
4
4
  Button,
5
- Dialog,
6
5
  DialogContent,
7
6
  DialogActions,
8
- DialogTitle,
9
7
  FormControlLabel,
10
- IconButton,
11
8
  Radio,
12
9
  Typography,
13
10
  } from '@mui/material'
14
- import { makeStyles } from 'tss-react/mui'
15
- import CloseIcon from '@mui/icons-material/Close'
11
+ import { Dialog } from '@jbrowse/core/ui'
16
12
  import { ColorPicker } from '@jbrowse/core/ui/ColorPicker'
17
13
 
18
- const useStyles = makeStyles()(theme => ({
19
- closeButton: {
20
- position: 'absolute',
21
- right: theme.spacing(1),
22
- top: theme.spacing(1),
23
- color: theme.palette.grey[500],
24
- },
25
- }))
26
-
27
14
  function SetColorDialog({
28
15
  model,
29
16
  handleClose,
@@ -38,23 +25,16 @@ function SetColorDialog({
38
25
  }
39
26
  handleClose: () => void
40
27
  }) {
41
- const { classes } = useStyles()
42
28
  const [posneg, setPosNeg] = useState(false)
43
29
 
44
30
  return (
45
- <Dialog open onClose={handleClose}>
46
- <DialogTitle>
47
- Select either an overall color, or the positive/negative colors. Note
48
- that density renderers only work properly with positive/negative colors
49
- <IconButton
50
- aria-label="close"
51
- className={classes.closeButton}
52
- onClick={handleClose}
53
- >
54
- <CloseIcon />
55
- </IconButton>
56
- </DialogTitle>
31
+ <Dialog open onClose={handleClose} title="Set color">
57
32
  <DialogContent>
33
+ <Typography>
34
+ Select either an overall color, or the positive/negative colors. Note
35
+ that density renderers only work properly with positive/negative
36
+ colors
37
+ </Typography>
58
38
  <FormControlLabel
59
39
  checked={!posneg}
60
40
  onClick={() => setPosNeg(false)}
@@ -10,6 +10,7 @@ import {
10
10
  getSession,
11
11
  getContainingView,
12
12
  isSelectionContainer,
13
+ Feature,
13
14
  } from '@jbrowse/core/util'
14
15
  import {
15
16
  BaseLinearDisplay,
@@ -19,7 +20,6 @@ import { when } from 'mobx'
19
20
  import { isAlive, types, Instance } from 'mobx-state-tree'
20
21
  import PluginManager from '@jbrowse/core/PluginManager'
21
22
 
22
- import { Feature } from '@jbrowse/core/util/simpleFeature'
23
23
  import { axisPropsFromTickScale } from 'react-d3-axis-mod'
24
24
  import {
25
25
  getNiceDomain,
@@ -32,7 +32,7 @@ import {
32
32
  import Tooltip from '../components/Tooltip'
33
33
  import { YScaleBar } from '../components/WiggleDisplayComponent'
34
34
 
35
- const SetMinMaxDlg = lazy(() => import('../components/SetMinMaxDialog'))
35
+ const SetMinMaxDlg = lazy(() => import('../../shared/SetMinMaxDialog'))
36
36
  const SetColorDlg = lazy(() => import('../components/SetColorDialog'))
37
37
 
38
38
  // using a map because it preserves order
@@ -143,8 +143,8 @@ function stateModelFactory(
143
143
  Math.abs(self.stats.scoreMin - scoreMin) > EPSILON
144
144
  ) {
145
145
  self.stats = { scoreMin, scoreMax }
146
- self.statsReady = true
147
146
  }
147
+ self.statsReady = true
148
148
  },
149
149
  /**
150
150
  * #action
@@ -491,8 +491,8 @@ function stateModelFactory(
491
491
  * #getter
492
492
  */
493
493
  get adapterCapabilities() {
494
- return pluginManager.getAdapterType(self.adapterTypeName)
495
- .adapterCapabilities
494
+ const type = self.adapterTypeName
495
+ return pluginManager.getAdapterType(type).adapterCapabilities
496
496
  },
497
497
  }))
498
498
  .views(self => {
@@ -0,0 +1,71 @@
1
+ import React from 'react'
2
+ import {
3
+ Dialog,
4
+ DialogTitle,
5
+ IconButton,
6
+ Divider,
7
+ DialogProps,
8
+ Paper,
9
+ PaperProps,
10
+ ScopedCssBaseline,
11
+ } from '@mui/material'
12
+ import { observer } from 'mobx-react'
13
+ import { makeStyles } from 'tss-react/mui'
14
+ import Draggable from 'react-draggable'
15
+
16
+ // icons
17
+ import CloseIcon from '@mui/icons-material/Close'
18
+
19
+ const useStyles = makeStyles()(theme => ({
20
+ closeButton: {
21
+ position: 'absolute',
22
+ right: theme.spacing(1),
23
+ top: theme.spacing(1),
24
+ color: theme.palette.grey[500],
25
+ },
26
+ }))
27
+
28
+ // draggable dialog demo https://mui.com/material-ui/react-dialog/#draggable-dialog
29
+ function PaperComponent(props: PaperProps) {
30
+ return (
31
+ <Draggable
32
+ handle="#draggable-dialog-title"
33
+ cancel={'[class*="MuiDialogContent-root"]'}
34
+ >
35
+ <Paper {...props} />
36
+ </Draggable>
37
+ )
38
+ }
39
+
40
+ function DraggableDialog(props: DialogProps & { title: string }) {
41
+ const { classes } = useStyles()
42
+ const { title, children, onClose } = props
43
+
44
+ return (
45
+ <Dialog
46
+ {...props}
47
+ PaperComponent={PaperComponent}
48
+ aria-labelledby="draggable-dialog-title" // this area is important for the draggable functionality
49
+ >
50
+ <ScopedCssBaseline>
51
+ <DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title">
52
+ {title}
53
+ {onClose ? (
54
+ <IconButton
55
+ className={classes.closeButton}
56
+ onClick={() => {
57
+ // @ts-ignore
58
+ onClose()
59
+ }}
60
+ >
61
+ <CloseIcon />
62
+ </IconButton>
63
+ ) : null}
64
+ </DialogTitle>
65
+ <Divider />
66
+ {children}
67
+ </ScopedCssBaseline>
68
+ </Dialog>
69
+ )
70
+ }
71
+ export default observer(DraggableDialog)
@@ -1,14 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import {
3
- Button,
4
- Dialog,
5
- DialogContent,
6
- DialogActions,
7
- DialogTitle,
8
- IconButton,
9
- Paper,
10
- PaperProps,
11
- } from '@mui/material'
2
+ import { Button, DialogContent, DialogActions } from '@mui/material'
12
3
  import { makeStyles } from 'tss-react/mui'
13
4
  import {
14
5
  getStr,
@@ -17,45 +8,27 @@ import {
17
8
  useLocalStorage,
18
9
  } from '@jbrowse/core/util'
19
10
  import { DataGrid, GridCellParams } from '@mui/x-data-grid'
20
- import Draggable from 'react-draggable'
21
11
  import clone from 'clone'
22
12
 
23
13
  // locals
14
+ import DraggableDialog from './DraggableDialog'
24
15
  import ColorPicker, { ColorPopover } from '@jbrowse/core/ui/ColorPicker'
25
16
  import { UriLink } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'
26
17
  import { moveUp, moveDown } from './util'
27
18
  import { Source } from '../../util'
28
19
 
29
20
  // icons
30
- import CloseIcon from '@mui/icons-material/Close'
31
21
  import KeyboardDoubleArrowUpIcon from '@mui/icons-material/KeyboardDoubleArrowUp'
32
22
  import KeyboardDoubleArrowDownIcon from '@mui/icons-material/KeyboardDoubleArrowDown'
33
23
  import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'
34
24
  import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp'
35
25
 
36
- const useStyles = makeStyles()(theme => ({
37
- closeButton: {
38
- position: 'absolute',
39
- right: theme.spacing(1),
40
- top: theme.spacing(1),
41
- color: theme.palette.grey[500],
42
- },
26
+ const useStyles = makeStyles()({
43
27
  content: {
44
28
  minWidth: 800,
45
29
  },
46
- }))
30
+ })
47
31
 
48
- // draggable dialog demo https://mui.com/material-ui/react-dialog/#draggable-dialog
49
- function PaperComponent(props: PaperProps) {
50
- return (
51
- <Draggable
52
- handle="#draggable-dialog-title"
53
- cancel={'[class*="MuiDialogContent-root"]'}
54
- >
55
- <Paper {...props} />
56
- </Draggable>
57
- )
58
- }
59
32
  export default function SetColorDialog({
60
33
  model,
61
34
  handleClose,
@@ -72,19 +45,12 @@ export default function SetColorDialog({
72
45
  const [currLayout, setCurrLayout] = useState(clone(sources || []))
73
46
  const [showTips, setShowTips] = useLocalStorage('multiwiggle-showTips', true)
74
47
  return (
75
- <Dialog
76
- PaperComponent={PaperComponent}
48
+ <DraggableDialog
77
49
  open
78
50
  onClose={handleClose}
79
51
  maxWidth="xl"
80
- aria-labelledby="draggable-dialog-title" // this area is important for the draggable functionality
52
+ title={'Multi-wiggle color/arrangement editor'}
81
53
  >
82
- <DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title">
83
- Multi-wiggle color/arrangement editor{' '}
84
- <IconButton className={classes.closeButton} onClick={handleClose}>
85
- <CloseIcon />
86
- </IconButton>
87
- </DialogTitle>
88
54
  <DialogContent className={classes.content}>
89
55
  <Button
90
56
  variant="contained"
@@ -159,7 +125,7 @@ export default function SetColorDialog({
159
125
  Submit
160
126
  </Button>
161
127
  </DialogActions>
162
- </Dialog>
128
+ </DraggableDialog>
163
129
  )
164
130
  }
165
131
 
@@ -42,7 +42,7 @@ const randomColor = () =>
42
42
  '#000000'.replace(/0/g, () => (~~(Math.random() * 16)).toString(16))
43
43
 
44
44
  // lazt components
45
- const SetMinMaxDlg = lazy(() => import('../components/SetMinMaxDialog'))
45
+ const SetMinMaxDlg = lazy(() => import('../../shared/SetMinMaxDialog'))
46
46
  const SetColorDlg = lazy(() => import('../components/SetColorDialog'))
47
47
 
48
48
  // using a map because it preserves order
@@ -40,7 +40,7 @@ function WiggleRendering(props: {
40
40
  const clientBp = region.start + bpPerPx * px
41
41
  let featureUnderMouse
42
42
  for (const feature of features.values()) {
43
- // bpPerPx added to the end to accomodate "reduced features" (one feature per px)
43
+ // bpPerPx added to the end to accommodate "reduced features" (one feature per px)
44
44
  if (
45
45
  clientBp <= feature.get('end') + bpPerPx &&
46
46
  clientBp >= feature.get('start')
@@ -1,16 +1,16 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`several features 1`] = `
4
- Object {
4
+ {
5
5
  "imageData": Any<Object>,
6
- "reducedFeatures": Array [
7
- Object {
6
+ "reducedFeatures": [
7
+ {
8
8
  "end": 100,
9
9
  "score": 1,
10
10
  "start": 1,
11
11
  "uniqueId": "t1",
12
12
  },
13
- Object {
13
+ {
14
14
  "end": 200,
15
15
  "score": 2,
16
16
  "start": 101,
@@ -1,3 +1,3 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`plugin in a stock JBrowse 1`] = `Object {}`;
3
+ exports[`plugin in a stock JBrowse 1`] = `{}`;
@@ -0,0 +1,88 @@
1
+ import React, { useState } from 'react'
2
+ import {
3
+ Button,
4
+ DialogActions,
5
+ DialogContent,
6
+ TextField,
7
+ Typography,
8
+ } from '@mui/material'
9
+ import { Dialog } from '@jbrowse/core/ui'
10
+
11
+ export default function SetMinMaxDlg(props: {
12
+ model: {
13
+ minScore: number
14
+ maxScore: number
15
+ scaleType: string
16
+ setMinScore: Function
17
+ setMaxScore: Function
18
+ }
19
+ handleClose: () => void
20
+ }) {
21
+ const { model, handleClose } = props
22
+ const { minScore, maxScore, scaleType } = model
23
+
24
+ const [min, setMin] = useState(
25
+ `${minScore !== Number.MIN_VALUE ? minScore : ''}`,
26
+ )
27
+ const [max, setMax] = useState(
28
+ `${maxScore !== Number.MAX_VALUE ? maxScore : ''}`,
29
+ )
30
+
31
+ const ok =
32
+ min !== '' && max !== '' && !Number.isNaN(+min) && !Number.isNaN(+max)
33
+ ? +max > +min
34
+ : true
35
+
36
+ const logOk =
37
+ scaleType === 'log' && min !== '' && !Number.isNaN(+min) ? +min > 0 : true
38
+
39
+ return (
40
+ <Dialog open onClose={handleClose} title="Set min/max score for track">
41
+ <DialogContent>
42
+ <Typography>Enter min/max score: </Typography>
43
+ {!ok ? (
44
+ <Typography color="error">
45
+ Max is greater than or equal to min
46
+ </Typography>
47
+ ) : null}
48
+
49
+ {!logOk ? (
50
+ <Typography color="error">
51
+ Min score should be greater than 0 for log scale
52
+ </Typography>
53
+ ) : null}
54
+
55
+ <TextField
56
+ value={min}
57
+ onChange={event => setMin(event.target.value)}
58
+ placeholder="Enter min score"
59
+ />
60
+ <TextField
61
+ value={max}
62
+ onChange={event => setMax(event.target.value)}
63
+ placeholder="Enter max score"
64
+ />
65
+ </DialogContent>
66
+ <DialogActions>
67
+ <Button
68
+ variant="contained"
69
+ color="primary"
70
+ type="submit"
71
+ style={{ marginLeft: 20 }}
72
+ disabled={!ok}
73
+ onClick={() => {
74
+ model.setMinScore(
75
+ min !== '' && !Number.isNaN(+min) ? +min : undefined,
76
+ )
77
+ model.setMaxScore(
78
+ max !== '' && !Number.isNaN(+max) ? +max : undefined,
79
+ )
80
+ handleClose()
81
+ }}
82
+ >
83
+ Submit
84
+ </Button>
85
+ </DialogActions>
86
+ </Dialog>
87
+ )
88
+ }