react-msaview 4.4.1 → 4.4.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 (38) hide show
  1. package/bundle/index.js +9 -9
  2. package/bundle/index.js.LICENSE.txt +5 -5
  3. package/bundle/index.js.map +1 -1
  4. package/dist/components/dialogs/SettingsDialog.js +3 -2
  5. package/dist/components/dialogs/SettingsDialog.js.map +1 -1
  6. package/dist/components/header/Header.js +2 -6
  7. package/dist/components/header/Header.js.map +1 -1
  8. package/dist/components/header/{ColorMenu.d.ts → SettingsMenu.d.ts} +2 -2
  9. package/dist/components/header/SettingsMenu.js +125 -0
  10. package/dist/components/header/SettingsMenu.js.map +1 -0
  11. package/dist/components/header/ZoomMenu.js +14 -2
  12. package/dist/components/header/ZoomMenu.js.map +1 -1
  13. package/dist/components/msa/MSAMouseoverCanvas.js +4 -1
  14. package/dist/components/msa/MSAMouseoverCanvas.js.map +1 -1
  15. package/dist/model.d.ts +10 -4
  16. package/dist/model.js +16 -4
  17. package/dist/model.js.map +1 -1
  18. package/dist/version.d.ts +1 -1
  19. package/dist/version.js +1 -1
  20. package/package.json +1 -1
  21. package/src/components/dialogs/SettingsDialog.tsx +4 -2
  22. package/src/components/header/Header.tsx +2 -6
  23. package/src/components/header/SettingsMenu.tsx +152 -0
  24. package/src/components/header/ZoomMenu.tsx +15 -2
  25. package/src/components/msa/MSAMouseoverCanvas.tsx +4 -1
  26. package/src/model.ts +16 -6
  27. package/src/version.ts +1 -1
  28. package/dist/components/header/ColorMenu.js +0 -19
  29. package/dist/components/header/ColorMenu.js.map +0 -1
  30. package/dist/components/header/MSAMenu.d.ts +0 -6
  31. package/dist/components/header/MSAMenu.js +0 -44
  32. package/dist/components/header/MSAMenu.js.map +0 -1
  33. package/dist/components/header/TreeMenu.d.ts +0 -6
  34. package/dist/components/header/TreeMenu.js +0 -64
  35. package/dist/components/header/TreeMenu.js.map +0 -1
  36. package/src/components/header/ColorMenu.tsx +0 -33
  37. package/src/components/header/MSAMenu.tsx +0 -55
  38. package/src/components/header/TreeMenu.tsx +0 -82
@@ -0,0 +1,152 @@
1
+ import React from 'react'
2
+
3
+ import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'
4
+ import Palette from '@mui/icons-material/Palette'
5
+ import AccountTree from '@mui/icons-material/AccountTree'
6
+ import Settings from '@mui/icons-material/Settings'
7
+ import { observer } from 'mobx-react'
8
+
9
+ import colorSchemes from '../../colorSchemes'
10
+
11
+ import type { MsaViewModel } from '../../model'
12
+
13
+ const SettingsMenu = observer(function ({ model }: { model: MsaViewModel }) {
14
+ const {
15
+ colorSchemeName,
16
+ drawMsaLetters,
17
+ contrastLettering,
18
+ hideGaps,
19
+ bgColor,
20
+ drawTree,
21
+ showBranchLen,
22
+ labelsAlignRight,
23
+ drawNodeBubbles,
24
+ drawLabels,
25
+ treeWidthMatchesArea,
26
+ noTree,
27
+ } = model
28
+ return (
29
+ <CascadingMenuButton
30
+ closeAfterItemClick={false}
31
+ menuItems={[
32
+ {
33
+ label: 'Color scheme',
34
+ icon: Palette,
35
+ type: 'subMenu',
36
+ subMenu: Object.keys(colorSchemes).map(
37
+ option =>
38
+ ({
39
+ label: option,
40
+ type: 'radio',
41
+ checked: colorSchemeName === option,
42
+ onClick: () => {
43
+ model.setColorSchemeName(option)
44
+ },
45
+ }) as const,
46
+ ),
47
+ },
48
+ {
49
+ label: 'MSA settings',
50
+ type: 'subMenu',
51
+ subMenu: [
52
+ {
53
+ label: 'Draw letters',
54
+ type: 'checkbox',
55
+ checked: drawMsaLetters,
56
+ onClick: () => {
57
+ model.setDrawMsaLetters(!drawMsaLetters)
58
+ },
59
+ },
60
+ {
61
+ label: 'Color letters instead of background of tiles',
62
+ type: 'checkbox',
63
+ checked: !bgColor,
64
+ onClick: () => {
65
+ model.setBgColor(!bgColor)
66
+ },
67
+ },
68
+ {
69
+ label: 'Use contrast lettering',
70
+ type: 'checkbox',
71
+ checked: contrastLettering,
72
+ onClick: () => {
73
+ model.setContrastLettering(!contrastLettering)
74
+ },
75
+ },
76
+ {
77
+ label: 'Enable hiding gappy columns?',
78
+ type: 'checkbox',
79
+ checked: hideGaps,
80
+ onClick: () => {
81
+ model.setHideGaps(!hideGaps)
82
+ },
83
+ },
84
+ ],
85
+ },
86
+ {
87
+ label: 'Tree settings',
88
+ type: 'subMenu',
89
+ icon: AccountTree,
90
+ subMenu: [
91
+ {
92
+ label: 'Show branch length',
93
+ type: 'checkbox',
94
+ checked: showBranchLen,
95
+ onClick: () => {
96
+ model.setShowBranchLen(!showBranchLen)
97
+ },
98
+ },
99
+ {
100
+ label: 'Show tree',
101
+ type: 'checkbox',
102
+ checked: drawTree,
103
+ onClick: () => {
104
+ model.setDrawTree(!drawTree)
105
+ },
106
+ },
107
+ {
108
+ label: 'Draw clickable bubbles on tree branches',
109
+ type: 'checkbox',
110
+ checked: drawNodeBubbles,
111
+ onClick: () => {
112
+ model.setDrawNodeBubbles(!drawNodeBubbles)
113
+ },
114
+ },
115
+ {
116
+ label: 'Tree labels align right',
117
+ type: 'checkbox',
118
+ checked: labelsAlignRight,
119
+ onClick: () => {
120
+ model.setLabelsAlignRight(!labelsAlignRight)
121
+ },
122
+ },
123
+ {
124
+ label: 'Draw labels',
125
+ type: 'checkbox',
126
+ checked: drawLabels,
127
+ onClick: () => {
128
+ model.setDrawLabels(!drawLabels)
129
+ },
130
+ },
131
+ ...(noTree
132
+ ? []
133
+ : [
134
+ {
135
+ label: 'Make tree width fit to tree area',
136
+ type: 'checkbox' as const,
137
+ checked: treeWidthMatchesArea,
138
+ onClick: () => {
139
+ model.setTreeWidthMatchesArea(!treeWidthMatchesArea)
140
+ },
141
+ },
142
+ ]),
143
+ ],
144
+ },
145
+ ]}
146
+ >
147
+ <Settings />
148
+ </CascadingMenuButton>
149
+ )
150
+ })
151
+
152
+ export default SettingsMenu
@@ -12,11 +12,24 @@ const ZoomMenu = observer(function ({ model }: { model: MsaViewModel }) {
12
12
  <CascadingMenuButton
13
13
  menuItems={[
14
14
  {
15
- label: 'Fit to view',
15
+ label: 'Fit both vertically/horizontally',
16
16
  onClick: () => {
17
- model.showEntire()
17
+ model.fit()
18
18
  },
19
19
  },
20
+ {
21
+ label: 'Fit vertically',
22
+ onClick: () => {
23
+ model.fitVertically()
24
+ },
25
+ },
26
+ {
27
+ label: 'Fit horizontally',
28
+ onClick: () => {
29
+ model.fitHorizontally()
30
+ },
31
+ },
32
+
20
33
  {
21
34
  label: 'Reset zoom to default',
22
35
  icon: RestartAlt,
@@ -2,6 +2,7 @@ import React, { useEffect, useRef } from 'react'
2
2
 
3
3
  import { autorun } from 'mobx'
4
4
  import { observer } from 'mobx-react'
5
+ import { isAlive } from 'mobx-state-tree'
5
6
 
6
7
  import { renderMouseover } from './renderMSAMouseover'
7
8
 
@@ -18,7 +19,9 @@ const MSAMouseoverCanvas = observer(function ({
18
19
  const ctx = ref.current?.getContext('2d')
19
20
  return ctx
20
21
  ? autorun(() => {
21
- renderMouseover({ ctx, model })
22
+ if (isAlive(model)) {
23
+ renderMouseover({ ctx, model })
24
+ }
22
25
  })
23
26
  : undefined
24
27
  }, [model])
package/src/model.ts CHANGED
@@ -811,11 +811,7 @@ function stateModelFactory() {
811
811
  * #getter
812
812
  */
813
813
  get colStatsSums() {
814
- return Object.fromEntries(
815
- Object.entries(this.colStats).map(([key, val]) => {
816
- return [key, sum(Object.values(val))]
817
- }),
818
- )
814
+ return this.colStats.map(val => sum(Object.values(val)))
819
815
  },
820
816
  /**
821
817
  * #getter
@@ -1377,12 +1373,26 @@ function stateModelFactory() {
1377
1373
  /**
1378
1374
  * #action
1379
1375
  */
1380
- showEntire() {
1376
+ fit() {
1381
1377
  self.rowHeight = self.msaAreaHeight / self.numRows
1382
1378
  self.colWidth = self.msaAreaWidth / self.numColumns
1383
1379
  self.scrollX = 0
1384
1380
  self.scrollY = 0
1385
1381
  },
1382
+ /**
1383
+ * #action
1384
+ */
1385
+ fitVertically() {
1386
+ self.rowHeight = self.msaAreaHeight / self.numRows
1387
+ self.scrollY = 0
1388
+ },
1389
+ /**
1390
+ * #action
1391
+ */
1392
+ fitHorizontally() {
1393
+ self.colWidth = self.msaAreaWidth / self.numColumns
1394
+ self.scrollX = 0
1395
+ },
1386
1396
 
1387
1397
  afterCreate() {
1388
1398
  addDisposer(
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '4.4.1'
1
+ export const version = '4.4.2'
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
3
- import Palette from '@mui/icons-material/Palette';
4
- import { observer } from 'mobx-react';
5
- import colorSchemes from '../../colorSchemes';
6
- const ColorMenu = observer(({ model }) => {
7
- const { colorSchemeName } = model;
8
- return (React.createElement(CascadingMenuButton, { closeAfterItemClick: false, menuItems: Object.keys(colorSchemes).map(option => ({
9
- label: option,
10
- type: 'radio',
11
- checked: colorSchemeName === option,
12
- onClick: () => {
13
- model.setColorSchemeName(option);
14
- },
15
- })) },
16
- React.createElement(Palette, null)));
17
- });
18
- export default ColorMenu;
19
- //# sourceMappingURL=ColorMenu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ColorMenu.js","sourceRoot":"","sources":["../../../src/components/header/ColorMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,mBAAmB,MAAM,sCAAsC,CAAA;AACtE,OAAO,OAAO,MAAM,6BAA6B,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,YAAY,MAAM,oBAAoB,CAAA;AAI7C,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,EAAE,KAAK,EAA2B,EAAE,EAAE;IAChE,MAAM,EAAE,eAAe,EAAE,GAAG,KAAK,CAAA;IACjC,OAAO,CACL,oBAAC,mBAAmB,IAClB,mBAAmB,EAAE,KAAK,EAC1B,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CACtC,MAAM,CAAC,EAAE,CACP,CAAC;YACC,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,eAAe,KAAK,MAAM;YACnC,OAAO,EAAE,GAAG,EAAE;gBACZ,KAAK,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;YAClC,CAAC;SACF,CAAU,CACd;QAED,oBAAC,OAAO,OAAG,CACS,CACvB,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,SAAS,CAAA"}
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import type { MsaViewModel } from '../../model';
3
- declare const MSAMenu: ({ model }: {
4
- model: MsaViewModel;
5
- }) => React.JSX.Element;
6
- export default MSAMenu;
@@ -1,44 +0,0 @@
1
- import React from 'react';
2
- import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
3
- import { observer } from 'mobx-react';
4
- import { GridOn } from '@mui/icons-material';
5
- const MSAMenu = observer(function ({ model }) {
6
- const { drawMsaLetters, contrastLettering, hideGaps, bgColor } = model;
7
- return (React.createElement(CascadingMenuButton, { closeAfterItemClick: false, menuItems: [
8
- {
9
- label: 'Draw letters',
10
- type: 'checkbox',
11
- checked: drawMsaLetters,
12
- onClick: () => {
13
- model.setDrawMsaLetters(!drawMsaLetters);
14
- },
15
- },
16
- {
17
- label: 'Color letters instead of background of tiles',
18
- type: 'checkbox',
19
- checked: !bgColor,
20
- onClick: () => {
21
- model.setBgColor(!bgColor);
22
- },
23
- },
24
- {
25
- label: 'Use contrast lettering',
26
- type: 'checkbox',
27
- checked: contrastLettering,
28
- onClick: () => {
29
- model.setContrastLettering(!contrastLettering);
30
- },
31
- },
32
- {
33
- label: 'Enable hiding gappy columns?',
34
- type: 'checkbox',
35
- checked: hideGaps,
36
- onClick: () => {
37
- model.setHideGaps(!hideGaps);
38
- },
39
- },
40
- ] },
41
- React.createElement(GridOn, null)));
42
- });
43
- export default MSAMenu;
44
- //# sourceMappingURL=MSAMenu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MSAMenu.js","sourceRoot":"","sources":["../../../src/components/header/MSAMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,mBAAmB,MAAM,sCAAsC,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAI5C,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,EAAE,KAAK,EAA2B;IACnE,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAA;IACtE,OAAO,CACL,oBAAC,mBAAmB,IAClB,mBAAmB,EAAE,KAAK,EAC1B,SAAS,EAAE;YACT;gBACE,KAAK,EAAE,cAAc;gBACrB,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,cAAc;gBACvB,OAAO,EAAE,GAAG,EAAE;oBACZ,KAAK,CAAC,iBAAiB,CAAC,CAAC,cAAc,CAAC,CAAA;gBAC1C,CAAC;aACF;YACD;gBACE,KAAK,EAAE,8CAA8C;gBACrD,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,CAAC,OAAO;gBACjB,OAAO,EAAE,GAAG,EAAE;oBACZ,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAA;gBAC5B,CAAC;aACF;YACD;gBACE,KAAK,EAAE,wBAAwB;gBAC/B,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,iBAAiB;gBAC1B,OAAO,EAAE,GAAG,EAAE;oBACZ,KAAK,CAAC,oBAAoB,CAAC,CAAC,iBAAiB,CAAC,CAAA;gBAChD,CAAC;aACF;YACD;gBACE,KAAK,EAAE,8BAA8B;gBACrC,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,QAAQ;gBACjB,OAAO,EAAE,GAAG,EAAE;oBACZ,KAAK,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAC9B,CAAC;aACF;SACF;QAED,oBAAC,MAAM,OAAG,CACU,CACvB,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,OAAO,CAAA"}
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import type { MsaViewModel } from '../../model';
3
- declare const TreeMenu: ({ model }: {
4
- model: MsaViewModel;
5
- }) => React.JSX.Element;
6
- export default TreeMenu;
@@ -1,64 +0,0 @@
1
- import React from 'react';
2
- import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
3
- import AccountTree from '@mui/icons-material/AccountTree';
4
- import { observer } from 'mobx-react';
5
- const TreeMenu = observer(({ model }) => {
6
- const { drawTree, showBranchLen, labelsAlignRight, drawNodeBubbles, drawLabels, treeWidthMatchesArea, noTree, } = model;
7
- return (React.createElement(CascadingMenuButton, { closeAfterItemClick: false, menuItems: [
8
- {
9
- label: 'Show branch length',
10
- type: 'checkbox',
11
- checked: showBranchLen,
12
- onClick: () => {
13
- model.setShowBranchLen(!showBranchLen);
14
- },
15
- },
16
- {
17
- label: 'Show tree',
18
- type: 'checkbox',
19
- checked: drawTree,
20
- onClick: () => {
21
- model.setDrawTree(!drawTree);
22
- },
23
- },
24
- {
25
- label: 'Draw clickable bubbles on tree branches',
26
- type: 'checkbox',
27
- checked: drawNodeBubbles,
28
- onClick: () => {
29
- model.setDrawNodeBubbles(!drawNodeBubbles);
30
- },
31
- },
32
- {
33
- label: 'Tree labels align right',
34
- type: 'checkbox',
35
- checked: labelsAlignRight,
36
- onClick: () => {
37
- model.setLabelsAlignRight(!labelsAlignRight);
38
- },
39
- },
40
- {
41
- label: 'Draw labels',
42
- type: 'checkbox',
43
- checked: drawLabels,
44
- onClick: () => {
45
- model.setDrawLabels(!drawLabels);
46
- },
47
- },
48
- ...(noTree
49
- ? []
50
- : [
51
- {
52
- label: 'Make tree width fit to tree area',
53
- type: 'checkbox',
54
- checked: treeWidthMatchesArea,
55
- onClick: () => {
56
- model.setTreeWidthMatchesArea(!treeWidthMatchesArea);
57
- },
58
- },
59
- ]),
60
- ] },
61
- React.createElement(AccountTree, null)));
62
- });
63
- export default TreeMenu;
64
- //# sourceMappingURL=TreeMenu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TreeMenu.js","sourceRoot":"","sources":["../../../src/components/header/TreeMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,mBAAmB,MAAM,sCAAsC,CAAA;AACtE,OAAO,WAAW,MAAM,iCAAiC,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIrC,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,EAAE,KAAK,EAA2B,EAAE,EAAE;IAC/D,MAAM,EACJ,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,MAAM,GACP,GAAG,KAAK,CAAA;IACT,OAAO,CACL,oBAAC,mBAAmB,IAClB,mBAAmB,EAAE,KAAK,EAC1B,SAAS,EAAE;YACT;gBACE,KAAK,EAAE,oBAAoB;gBAC3B,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,aAAa;gBACtB,OAAO,EAAE,GAAG,EAAE;oBACZ,KAAK,CAAC,gBAAgB,CAAC,CAAC,aAAa,CAAC,CAAA;gBACxC,CAAC;aACF;YACD;gBACE,KAAK,EAAE,WAAW;gBAClB,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,QAAQ;gBACjB,OAAO,EAAE,GAAG,EAAE;oBACZ,KAAK,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAC9B,CAAC;aACF;YACD;gBACE,KAAK,EAAE,yCAAyC;gBAChD,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,eAAe;gBACxB,OAAO,EAAE,GAAG,EAAE;oBACZ,KAAK,CAAC,kBAAkB,CAAC,CAAC,eAAe,CAAC,CAAA;gBAC5C,CAAC;aACF;YACD;gBACE,KAAK,EAAE,yBAAyB;gBAChC,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,gBAAgB;gBACzB,OAAO,EAAE,GAAG,EAAE;oBACZ,KAAK,CAAC,mBAAmB,CAAC,CAAC,gBAAgB,CAAC,CAAA;gBAC9C,CAAC;aACF;YACD;gBACE,KAAK,EAAE,aAAa;gBACpB,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,UAAU;gBACnB,OAAO,EAAE,GAAG,EAAE;oBACZ,KAAK,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,CAAA;gBAClC,CAAC;aACF;YACD,GAAG,CAAC,MAAM;gBACR,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC;oBACE;wBACE,KAAK,EAAE,kCAAkC;wBACzC,IAAI,EAAE,UAAmB;wBACzB,OAAO,EAAE,oBAAoB;wBAC7B,OAAO,EAAE,GAAG,EAAE;4BACZ,KAAK,CAAC,uBAAuB,CAAC,CAAC,oBAAoB,CAAC,CAAA;wBACtD,CAAC;qBACF;iBACF,CAAC;SACP;QAED,oBAAC,WAAW,OAAG,CACK,CACvB,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,QAAQ,CAAA"}
@@ -1,33 +0,0 @@
1
- import React from 'react'
2
-
3
- import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'
4
- import Palette from '@mui/icons-material/Palette'
5
- import { observer } from 'mobx-react'
6
-
7
- import colorSchemes from '../../colorSchemes'
8
-
9
- import type { MsaViewModel } from '../../model'
10
-
11
- const ColorMenu = observer(({ model }: { model: MsaViewModel }) => {
12
- const { colorSchemeName } = model
13
- return (
14
- <CascadingMenuButton
15
- closeAfterItemClick={false}
16
- menuItems={Object.keys(colorSchemes).map(
17
- option =>
18
- ({
19
- label: option,
20
- type: 'radio',
21
- checked: colorSchemeName === option,
22
- onClick: () => {
23
- model.setColorSchemeName(option)
24
- },
25
- }) as const,
26
- )}
27
- >
28
- <Palette />
29
- </CascadingMenuButton>
30
- )
31
- })
32
-
33
- export default ColorMenu
@@ -1,55 +0,0 @@
1
- import React from 'react'
2
-
3
- import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'
4
- import { observer } from 'mobx-react'
5
-
6
- import { GridOn } from '@mui/icons-material'
7
-
8
- import type { MsaViewModel } from '../../model'
9
-
10
- const MSAMenu = observer(function ({ model }: { model: MsaViewModel }) {
11
- const { drawMsaLetters, contrastLettering, hideGaps, bgColor } = model
12
- return (
13
- <CascadingMenuButton
14
- closeAfterItemClick={false}
15
- menuItems={[
16
- {
17
- label: 'Draw letters',
18
- type: 'checkbox',
19
- checked: drawMsaLetters,
20
- onClick: () => {
21
- model.setDrawMsaLetters(!drawMsaLetters)
22
- },
23
- },
24
- {
25
- label: 'Color letters instead of background of tiles',
26
- type: 'checkbox',
27
- checked: !bgColor,
28
- onClick: () => {
29
- model.setBgColor(!bgColor)
30
- },
31
- },
32
- {
33
- label: 'Use contrast lettering',
34
- type: 'checkbox',
35
- checked: contrastLettering,
36
- onClick: () => {
37
- model.setContrastLettering(!contrastLettering)
38
- },
39
- },
40
- {
41
- label: 'Enable hiding gappy columns?',
42
- type: 'checkbox',
43
- checked: hideGaps,
44
- onClick: () => {
45
- model.setHideGaps(!hideGaps)
46
- },
47
- },
48
- ]}
49
- >
50
- <GridOn />
51
- </CascadingMenuButton>
52
- )
53
- })
54
-
55
- export default MSAMenu
@@ -1,82 +0,0 @@
1
- import React from 'react'
2
-
3
- import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'
4
- import AccountTree from '@mui/icons-material/AccountTree'
5
- import { observer } from 'mobx-react'
6
-
7
- import type { MsaViewModel } from '../../model'
8
-
9
- const TreeMenu = observer(({ model }: { model: MsaViewModel }) => {
10
- const {
11
- drawTree,
12
- showBranchLen,
13
- labelsAlignRight,
14
- drawNodeBubbles,
15
- drawLabels,
16
- treeWidthMatchesArea,
17
- noTree,
18
- } = model
19
- return (
20
- <CascadingMenuButton
21
- closeAfterItemClick={false}
22
- menuItems={[
23
- {
24
- label: 'Show branch length',
25
- type: 'checkbox',
26
- checked: showBranchLen,
27
- onClick: () => {
28
- model.setShowBranchLen(!showBranchLen)
29
- },
30
- },
31
- {
32
- label: 'Show tree',
33
- type: 'checkbox',
34
- checked: drawTree,
35
- onClick: () => {
36
- model.setDrawTree(!drawTree)
37
- },
38
- },
39
- {
40
- label: 'Draw clickable bubbles on tree branches',
41
- type: 'checkbox',
42
- checked: drawNodeBubbles,
43
- onClick: () => {
44
- model.setDrawNodeBubbles(!drawNodeBubbles)
45
- },
46
- },
47
- {
48
- label: 'Tree labels align right',
49
- type: 'checkbox',
50
- checked: labelsAlignRight,
51
- onClick: () => {
52
- model.setLabelsAlignRight(!labelsAlignRight)
53
- },
54
- },
55
- {
56
- label: 'Draw labels',
57
- type: 'checkbox',
58
- checked: drawLabels,
59
- onClick: () => {
60
- model.setDrawLabels(!drawLabels)
61
- },
62
- },
63
- ...(noTree
64
- ? []
65
- : [
66
- {
67
- label: 'Make tree width fit to tree area',
68
- type: 'checkbox' as const,
69
- checked: treeWidthMatchesArea,
70
- onClick: () => {
71
- model.setTreeWidthMatchesArea(!treeWidthMatchesArea)
72
- },
73
- },
74
- ]),
75
- ]}
76
- >
77
- <AccountTree />
78
- </CascadingMenuButton>
79
- )
80
- })
81
-
82
- export default TreeMenu