react-msaview 5.4.1 → 5.6.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 (180) hide show
  1. package/LICENSE +21 -0
  2. package/bundle/index.js +487 -149
  3. package/bundle/index.js.map +7 -1
  4. package/dist/colorSchemes.js +11 -7
  5. package/dist/colorSchemes.js.map +1 -1
  6. package/dist/components/ConservationTrack.js +20 -26
  7. package/dist/components/ConservationTrack.js.map +1 -1
  8. package/dist/components/MSAViewer.d.ts +13 -1
  9. package/dist/components/MSAViewer.js +13 -7
  10. package/dist/components/MSAViewer.js.map +1 -1
  11. package/dist/components/SequenceTextArea.js +1 -1
  12. package/dist/components/SequenceTextArea.js.map +1 -1
  13. package/dist/components/TextTrack.js +20 -27
  14. package/dist/components/TextTrack.js.map +1 -1
  15. package/dist/components/Track.js +9 -6
  16. package/dist/components/Track.js.map +1 -1
  17. package/dist/components/dialogs/FeatureDialog.js +27 -23
  18. package/dist/components/dialogs/FeatureDialog.js.map +1 -1
  19. package/dist/components/dialogs/TrackInfoDialog.js +1 -1
  20. package/dist/components/dialogs/TrackInfoDialog.js.map +1 -1
  21. package/dist/components/header/ColorSchemeMenu.js +1 -1
  22. package/dist/components/header/ColorSchemeMenu.js.map +1 -1
  23. package/dist/components/header/FileMenu.js +1 -16
  24. package/dist/components/header/FileMenu.js.map +1 -1
  25. package/dist/components/header/Header.js +6 -5
  26. package/dist/components/header/Header.js.map +1 -1
  27. package/dist/components/header/HeaderInfoArea.js +1 -1
  28. package/dist/components/header/HeaderInfoArea.js.map +1 -1
  29. package/dist/components/header/HeaderStatusArea.js +1 -1
  30. package/dist/components/header/HeaderStatusArea.js.map +1 -1
  31. package/dist/components/header/MSASettingsMenu.js +1 -1
  32. package/dist/components/header/MSASettingsMenu.js.map +1 -1
  33. package/dist/components/header/MultiAlignmentSelector.js +0 -0
  34. package/dist/components/header/MultiAlignmentSelector.js.map +1 -1
  35. package/dist/components/header/TreeSettingsMenu.js +1 -1
  36. package/dist/components/header/TreeSettingsMenu.js.map +1 -1
  37. package/dist/components/header/ZoomControls.js +14 -12
  38. package/dist/components/header/ZoomControls.js.map +1 -1
  39. package/dist/components/header/ZoomMenu.js +1 -10
  40. package/dist/components/header/ZoomMenu.js.map +1 -1
  41. package/dist/components/header/settingsMenuItems.js +9 -1
  42. package/dist/components/header/settingsMenuItems.js.map +1 -1
  43. package/dist/components/{header/HeaderMenu.d.ts → msa/ColumnStats.d.ts} +3 -3
  44. package/dist/components/msa/ColumnStats.js +42 -0
  45. package/dist/components/msa/ColumnStats.js.map +1 -0
  46. package/dist/components/msa/DomainLegend.d.ts +6 -0
  47. package/dist/components/msa/DomainLegend.js +41 -0
  48. package/dist/components/msa/DomainLegend.js.map +1 -0
  49. package/dist/components/msa/MSACanvasBlock.js +41 -29
  50. package/dist/components/msa/MSACanvasBlock.js.map +1 -1
  51. package/dist/components/msa/MSAMouseoverCanvas.js +6 -12
  52. package/dist/components/msa/MSAMouseoverCanvas.js.map +1 -1
  53. package/dist/components/msa/MSAPanel.js +3 -1
  54. package/dist/components/msa/MSAPanel.js.map +1 -1
  55. package/dist/components/msa/renderBoxFeatureCanvasBlock.js +60 -14
  56. package/dist/components/msa/renderBoxFeatureCanvasBlock.js.map +1 -1
  57. package/dist/components/msa/renderMSABlock.js +3 -3
  58. package/dist/components/msa/renderMSABlock.js.map +1 -1
  59. package/dist/components/msa/renderMSAMouseover.js +33 -6
  60. package/dist/components/msa/renderMSAMouseover.js.map +1 -1
  61. package/dist/components/overlayColors.d.ts +3 -0
  62. package/dist/components/overlayColors.js +11 -0
  63. package/dist/components/overlayColors.js.map +1 -0
  64. package/dist/components/renderCtx.d.ts +1 -1
  65. package/dist/components/tracks/renderTracksSvg.d.ts +6 -3
  66. package/dist/components/tracks/renderTracksSvg.js +20 -11
  67. package/dist/components/tracks/renderTracksSvg.js.map +1 -1
  68. package/dist/components/tree/TreeCanvas.js +31 -38
  69. package/dist/components/tree/TreeCanvas.js.map +1 -1
  70. package/dist/components/tree/TreeCanvasBlock.js +12 -47
  71. package/dist/components/tree/TreeCanvasBlock.js.map +1 -1
  72. package/dist/components/tree/clickMap.d.ts +24 -0
  73. package/dist/components/tree/clickMap.js +33 -0
  74. package/dist/components/tree/clickMap.js.map +1 -0
  75. package/dist/components/tree/renderTreeCanvas.d.ts +1 -21
  76. package/dist/components/tree/renderTreeCanvas.js +8 -7
  77. package/dist/components/tree/renderTreeCanvas.js.map +1 -1
  78. package/dist/constants.d.ts +4 -0
  79. package/dist/constants.js +17 -0
  80. package/dist/constants.js.map +1 -1
  81. package/dist/createPaletteMap.d.ts +5 -2
  82. package/dist/createPaletteMap.js +15 -5
  83. package/dist/createPaletteMap.js.map +1 -1
  84. package/dist/fetchUtils.d.ts +2 -1
  85. package/dist/fetchUtils.js +3 -2
  86. package/dist/fetchUtils.js.map +1 -1
  87. package/dist/index.d.ts +1 -1
  88. package/dist/launchInterProScan.d.ts +2 -0
  89. package/dist/launchInterProScan.js.map +1 -1
  90. package/dist/model/msaModel.d.ts +25 -2
  91. package/dist/model/msaModel.js +15 -3
  92. package/dist/model/msaModel.js.map +1 -1
  93. package/dist/model/treeModel.d.ts +46 -5
  94. package/dist/model/treeModel.js +20 -7
  95. package/dist/model/treeModel.js.map +1 -1
  96. package/dist/model.d.ts +641 -133
  97. package/dist/model.js +191 -77
  98. package/dist/model.js.map +1 -1
  99. package/dist/propertyConservation.d.ts +7 -0
  100. package/dist/propertyConservation.js +66 -0
  101. package/dist/propertyConservation.js.map +1 -0
  102. package/dist/renderToSvg.js +104 -74
  103. package/dist/renderToSvg.js.map +1 -1
  104. package/dist/types.d.ts +4 -1
  105. package/dist/{webpack.js → umd.js} +1 -1
  106. package/dist/umd.js.map +1 -0
  107. package/dist/useCanvasAutorun.d.ts +2 -0
  108. package/dist/useCanvasAutorun.js +23 -0
  109. package/dist/useCanvasAutorun.js.map +1 -0
  110. package/dist/version.d.ts +1 -1
  111. package/dist/version.js +1 -1
  112. package/package.json +7 -8
  113. package/src/colorSchemes.docs.test.ts +55 -0
  114. package/src/colorSchemes.ts +12 -7
  115. package/src/columnStats.test.ts +94 -0
  116. package/src/components/ConservationTrack.tsx +17 -15
  117. package/src/components/MSAViewer.tsx +42 -18
  118. package/src/components/SequenceTextArea.tsx +1 -1
  119. package/src/components/TextTrack.tsx +7 -11
  120. package/src/components/Track.tsx +9 -6
  121. package/src/components/dialogs/FeatureDialog.tsx +62 -48
  122. package/src/components/dialogs/TrackInfoDialog.tsx +1 -1
  123. package/src/components/header/ColorSchemeMenu.tsx +1 -0
  124. package/src/components/header/FileMenu.tsx +1 -15
  125. package/src/components/header/Header.tsx +11 -8
  126. package/src/components/header/HeaderInfoArea.tsx +1 -1
  127. package/src/components/header/HeaderStatusArea.tsx +1 -1
  128. package/src/components/header/MSASettingsMenu.tsx +1 -0
  129. package/src/components/header/MultiAlignmentSelector.tsx +0 -0
  130. package/src/components/header/TreeSettingsMenu.tsx +1 -0
  131. package/src/components/header/ZoomControls.tsx +24 -17
  132. package/src/components/header/ZoomMenu.tsx +1 -10
  133. package/src/components/header/settingsMenuItems.ts +9 -1
  134. package/src/components/msa/ColumnStats.tsx +54 -0
  135. package/src/components/msa/DomainLegend.tsx +78 -0
  136. package/src/components/msa/MSACanvasBlock.tsx +46 -25
  137. package/src/components/msa/MSAMouseoverCanvas.tsx +10 -13
  138. package/src/components/msa/MSAPanel.tsx +2 -0
  139. package/src/components/msa/renderBoxFeatureCanvasBlock.ts +75 -17
  140. package/src/components/msa/renderMSABlock.ts +3 -3
  141. package/src/components/msa/renderMSAMouseover.ts +34 -6
  142. package/src/components/overlayColors.ts +12 -0
  143. package/src/components/renderCtx.ts +1 -0
  144. package/src/components/tracks/renderTracksSvg.ts +25 -11
  145. package/src/components/tree/TreeCanvas.tsx +47 -54
  146. package/src/components/tree/TreeCanvasBlock.tsx +10 -68
  147. package/src/components/tree/clickMap.ts +55 -0
  148. package/src/components/tree/renderTreeCanvas.ts +10 -34
  149. package/src/constants.ts +19 -0
  150. package/src/createPaletteMap.ts +18 -5
  151. package/src/fetchUtils.ts +6 -3
  152. package/src/index.ts +1 -1
  153. package/src/launchInterProScan.ts +3 -1
  154. package/src/model/msaModel.ts +21 -3
  155. package/src/model/treeModel.ts +21 -7
  156. package/src/model.ts +221 -119
  157. package/src/propertyConservation.test.ts +47 -0
  158. package/src/propertyConservation.ts +73 -0
  159. package/src/renderDomainLegendSvg.test.tsx +134 -0
  160. package/src/renderToSvg.tsx +210 -147
  161. package/src/segmentOverlay.test.ts +70 -0
  162. package/src/stripDefaultSnapshot.test.ts +54 -0
  163. package/src/types.ts +7 -1
  164. package/src/useCanvasAutorun.ts +28 -0
  165. package/src/version.ts +1 -1
  166. package/bundle/index.js.LICENSE.txt +0 -100
  167. package/dist/components/dialogs/SettingsDialog.d.ts +0 -7
  168. package/dist/components/dialogs/SettingsDialog.js +0 -100
  169. package/dist/components/dialogs/SettingsDialog.js.map +0 -1
  170. package/dist/components/header/HeaderMenu.js +0 -27
  171. package/dist/components/header/HeaderMenu.js.map +0 -1
  172. package/dist/components/util.d.ts +0 -1
  173. package/dist/components/util.js +0 -7
  174. package/dist/components/util.js.map +0 -1
  175. package/dist/webpack.js.map +0 -1
  176. package/src/components/dialogs/SettingsDialog.tsx +0 -234
  177. package/src/components/header/HeaderMenu.tsx +0 -38
  178. package/src/components/util.ts +0 -9
  179. /package/dist/{webpack.d.ts → umd.d.ts} +0 -0
  180. /package/src/{webpack.ts → umd.ts} +0 -0
@@ -0,0 +1,70 @@
1
+ // Verifies that ordinal segment features (exons) from a GFF overlay are treated
2
+ // as a numbered gene model — alternating two shades, labeled by number, and
3
+ // kept out of the categorical color-key legend — while real domains keep a
4
+ // distinct color + legend entry.
5
+ import { expect, test } from 'vitest'
6
+
7
+ import { segmentShades } from './constants.ts'
8
+ import MSAModelF from './model.ts'
9
+
10
+ const msa = `>human
11
+ ACDEFGHIKLMNPQRSTVWYACDEFGHIKLMNPQRSTVWYACDEFGHIKLMNPQRSTVWY
12
+ >mouse
13
+ ACDEFGHIKLMNPQRSTVWYACDEFGHIKLMNPQRSTVWYACDEFGHIKLMNPQRSTVWY`
14
+
15
+ // three exons in CDS coordinates plus one real domain, deliberately out of
16
+ // start order in the file to prove ordering is by position not file/length
17
+ const gff = `##gff-version 3
18
+ human src exon 41 60 . . . ID=human.exon3;Name=exon-3
19
+ human src exon 1 20 . . . ID=human.exon1;Name=exon-1
20
+ human src exon 21 40 . . . ID=human.exon2;Name=exon-2
21
+ human Pfam protein_match 5 35 . . . Name=PF00069;signature_desc=Kinase`
22
+
23
+ function makeModel() {
24
+ const model = MSAModelF().create({
25
+ id: 'segment-overlay-test',
26
+ type: 'MsaView',
27
+ height: 400,
28
+ msaFormat: 'fasta',
29
+ data: { msa },
30
+ })
31
+ model.setWidth(800)
32
+ model.applyGFFText(gff)
33
+ return model
34
+ }
35
+
36
+ test('exons are ordered by sequence position, domains kept separate', () => {
37
+ const model = makeModel()
38
+ expect(model.segmentDomainTypes.map(d => d.accession)).toEqual([
39
+ 'exon-1',
40
+ 'exon-2',
41
+ 'exon-3',
42
+ ])
43
+ expect(model.categoricalDomainTypes.map(d => d.accession)).toEqual([
44
+ 'PF00069',
45
+ ])
46
+ })
47
+
48
+ test('exons alternate two shades; domain gets its own color', () => {
49
+ const { fillPalette } = makeModel()
50
+ expect(fillPalette['exon-1']).toBe(segmentShades[0])
51
+ expect(fillPalette['exon-2']).toBe(segmentShades[1])
52
+ expect(fillPalette['exon-3']).toBe(segmentShades[0])
53
+ expect(fillPalette.PF00069).not.toBe(segmentShades[0])
54
+ expect(fillPalette.PF00069).not.toBe(segmentShades[1])
55
+ })
56
+
57
+ test('exons are labeled by their number', () => {
58
+ const { segmentLabels } = makeModel()
59
+ expect(segmentLabels.get('exon-1')).toBe('1')
60
+ expect(segmentLabels.get('exon-2')).toBe('2')
61
+ expect(segmentLabels.get('exon-3')).toBe('3')
62
+ })
63
+
64
+ test('legend lists only categorical domains, not exons', () => {
65
+ const model = makeModel()
66
+ for (const acc of ['exon-1', 'exon-2', 'exon-3', 'PF00069']) {
67
+ model.setFilter(acc, true)
68
+ }
69
+ expect(model.visibleDomainTypes.map(d => d.accession)).toEqual(['PF00069'])
70
+ })
@@ -0,0 +1,54 @@
1
+ import { getSnapshot } from '@jbrowse/mobx-state-tree'
2
+ import { expect, test } from 'vitest'
3
+
4
+ import stateModelFactory from './model.ts'
5
+
6
+ const MsaView = stateModelFactory()
7
+
8
+ test('default view produces a minimal snapshot (defaults stripped)', () => {
9
+ const model = MsaView.create({ type: 'MsaView' })
10
+ const snap = getSnapshot(model)
11
+ // only the always-present keys remain; every defaulted scalar/collection is gone
12
+ expect(snap.colWidth).toBeUndefined()
13
+ expect(snap.rowHeight).toBeUndefined()
14
+ expect(snap.showDomains).toBeUndefined()
15
+ expect(snap.colorSchemeName).toBeUndefined()
16
+ expect(snap.drawTree).toBeUndefined()
17
+ expect(snap.treeAreaWidth).toBeUndefined()
18
+ expect(snap.collapsed).toBeUndefined()
19
+ expect(snap.turnedOffTracks).toBeUndefined()
20
+ expect(snap.type).toBe('MsaView')
21
+ })
22
+
23
+ test('non-default values are retained in the snapshot', () => {
24
+ const model = MsaView.create({ type: 'MsaView' })
25
+ model.setColWidth(30)
26
+ model.setColorSchemeName('clustalx')
27
+ model.setDrawTree(false)
28
+ model.toggleCollapsed('nodeA')
29
+ const snap = getSnapshot(model)
30
+ expect(snap.colWidth).toBe(30)
31
+ expect(snap.colorSchemeName).toBe('clustalx')
32
+ expect(snap.drawTree).toBe(false)
33
+ expect(snap.collapsed).toEqual(['nodeA'])
34
+ })
35
+
36
+ test('setting a value back to its default strips it again', () => {
37
+ const model = MsaView.create({ type: 'MsaView' })
38
+ model.setColWidth(30)
39
+ expect(getSnapshot(model).colWidth).toBe(30)
40
+ model.setColWidth(12) // defaultColWidth
41
+ expect(getSnapshot(model).colWidth).toBeUndefined()
42
+ })
43
+
44
+ test('inline data is stripped when a filehandle can refetch it', () => {
45
+ const model = MsaView.create({
46
+ type: 'MsaView',
47
+ data: { msa: '>s1\nACGT', tree: '(a,b);' },
48
+ msaFilehandle: { uri: 'http://example.com/x.fa', locationType: 'UriLocation' },
49
+ })
50
+ const snap = getSnapshot(model)
51
+ // msa dropped (msaFilehandle present), tree kept (no treeFilehandle)
52
+ expect(snap.data.msa).toBeUndefined()
53
+ expect(snap.data.tree).toBe('(a,b);')
54
+ })
package/src/types.ts CHANGED
@@ -15,9 +15,15 @@ export interface TextTrackModel extends BasicTrackModel {
15
15
  data?: string
16
16
  }
17
17
 
18
+ // a track that draws a per-column bar chart (conservation, property
19
+ // conservation). `barColor` doubles as the marker that a track is a bar track.
20
+ export interface BarTrackModel extends BasicTrackModel {
21
+ barColor?: string
22
+ }
23
+
18
24
  export interface BasicTrack {
19
25
  ReactComponent: React.FC<any>
20
- model: TextTrackModel
26
+ model: TextTrackModel & BarTrackModel
21
27
  }
22
28
 
23
29
  export interface Node {
@@ -0,0 +1,28 @@
1
+ import { useEffect, useRef } from 'react'
2
+ import type React from 'react'
3
+
4
+ import { autorun } from 'mobx'
5
+
6
+ // Wires a canvas ref to a mobx autorun: grabs the 2d context once the canvas
7
+ // mounts and re-runs `draw` whenever any observable it reads changes. Collapses
8
+ // the getContext/null-guard/autorun-dispose boilerplate repeated by every
9
+ // canvas block host. `deps` controls when the effect (and thus the context
10
+ // lookup) is torn down and re-created, matching a normal useEffect dep array.
11
+ export function useCanvasAutorun(
12
+ draw: (ctx: CanvasRenderingContext2D) => void,
13
+ deps: React.DependencyList,
14
+ ) {
15
+ const ref = useRef<HTMLCanvasElement>(null)
16
+ // the autorun tracks its own observable reads, so `draw` is intentionally not
17
+ // a dependency; `deps` alone controls when the effect re-subscribes
18
+ useEffect(() => {
19
+ const ctx = ref.current?.getContext('2d')
20
+ return ctx
21
+ ? autorun(() => {
22
+ draw(ctx)
23
+ })
24
+ : undefined
25
+ // eslint-disable-next-line @eslint-react/exhaustive-deps
26
+ }, deps)
27
+ return ref
28
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '5.4.1'
1
+ export const version = '5.6.0'
@@ -1,100 +0,0 @@
1
- /*!
2
- * escape-html
3
- * Copyright(c) 2012-2013 TJ Holowaychuk
4
- * Copyright(c) 2015 Andreas Lubbe
5
- * Copyright(c) 2015 Tiancheng "Timothy" Gu
6
- * MIT Licensed
7
- */
8
-
9
- /*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */
10
-
11
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
12
-
13
- /**
14
- * @license React
15
- * react-dom-client.production.js
16
- *
17
- * Copyright (c) Meta Platforms, Inc. and affiliates.
18
- *
19
- * This source code is licensed under the MIT license found in the
20
- * LICENSE file in the root directory of this source tree.
21
- */
22
-
23
- /**
24
- * @license React
25
- * react-dom.production.js
26
- *
27
- * Copyright (c) Meta Platforms, Inc. and affiliates.
28
- *
29
- * This source code is licensed under the MIT license found in the
30
- * LICENSE file in the root directory of this source tree.
31
- */
32
-
33
- /**
34
- * @license React
35
- * react-is.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */
42
-
43
- /**
44
- * @license React
45
- * react-jsx-runtime.production.js
46
- *
47
- * Copyright (c) Meta Platforms, Inc. and affiliates.
48
- *
49
- * This source code is licensed under the MIT license found in the
50
- * LICENSE file in the root directory of this source tree.
51
- */
52
-
53
- /**
54
- * @license React
55
- * react.production.js
56
- *
57
- * Copyright (c) Meta Platforms, Inc. and affiliates.
58
- *
59
- * This source code is licensed under the MIT license found in the
60
- * LICENSE file in the root directory of this source tree.
61
- */
62
-
63
- /**
64
- * @license React
65
- * scheduler.production.js
66
- *
67
- * Copyright (c) Meta Platforms, Inc. and affiliates.
68
- *
69
- * This source code is licensed under the MIT license found in the
70
- * LICENSE file in the root directory of this source tree.
71
- */
72
-
73
- /**
74
- * @license React
75
- * use-sync-external-store-shim.production.js
76
- *
77
- * Copyright (c) Meta Platforms, Inc. and affiliates.
78
- *
79
- * This source code is licensed under the MIT license found in the
80
- * LICENSE file in the root directory of this source tree.
81
- */
82
-
83
- /**
84
- * @license React
85
- * use-sync-external-store-shim/with-selector.production.js
86
- *
87
- * Copyright (c) Meta Platforms, Inc. and affiliates.
88
- *
89
- * This source code is licensed under the MIT license found in the
90
- * LICENSE file in the root directory of this source tree.
91
- */
92
-
93
- /** @license React v16.13.1
94
- * react-is.production.min.js
95
- *
96
- * Copyright (c) Facebook, Inc. and its affiliates.
97
- *
98
- * This source code is licensed under the MIT license found in the
99
- * LICENSE file in the root directory of this source tree.
100
- */
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import type { MsaViewModel } from '../../model.ts';
3
- declare const SettingsDialog: ({ model, onClose, }: {
4
- model: MsaViewModel;
5
- onClose: () => void;
6
- }) => React.JSX.Element;
7
- export default SettingsDialog;
@@ -1,100 +0,0 @@
1
- import React from 'react';
2
- import { Dialog } from '@jbrowse/core/ui';
3
- import { Button, DialogActions, DialogContent, MenuItem, Slider, TextField, Typography, } from '@mui/material';
4
- import { observer } from 'mobx-react';
5
- import { makeStyles } from 'tss-react/mui';
6
- import colorSchemes from "../../colorSchemes.js";
7
- import Checkbox2 from "../Checkbox2.js";
8
- const useStyles = makeStyles()(theme => ({
9
- field: {
10
- margin: theme.spacing(4),
11
- },
12
- flex: {
13
- display: 'flex',
14
- },
15
- minw: {
16
- width: '80em',
17
- },
18
- }));
19
- const toP = (s = 0) => +s.toFixed(1);
20
- const SettingsContent = observer(function ({ model }) {
21
- return (React.createElement(React.Fragment, null,
22
- React.createElement(TreeSettings, { model: model }),
23
- React.createElement(MSASettings, { model: model })));
24
- });
25
- const TreeSettings = observer(function TreeSettings({ model, }) {
26
- const { drawTree, drawLabels, drawNodeBubbles, labelsAlignRight, showBranchLen, } = model;
27
- return (React.createElement("div", null,
28
- React.createElement("h1", null, "Tree options"),
29
- React.createElement(Checkbox2, { checked: showBranchLen, label: "Show branch length?", onChange: () => {
30
- model.setShowBranchLen(!showBranchLen);
31
- } }),
32
- React.createElement(Checkbox2, { checked: drawNodeBubbles, label: "Draw clickable bubbles on tree branches?", onChange: () => {
33
- model.setDrawNodeBubbles(!drawNodeBubbles);
34
- } }),
35
- React.createElement(Checkbox2, { checked: drawTree, label: "Show tree?", onChange: () => {
36
- model.setDrawTree(!drawTree);
37
- } }),
38
- React.createElement(Checkbox2, { checked: labelsAlignRight, label: "Tree labels align right?", onChange: () => {
39
- model.setLabelsAlignRight(!labelsAlignRight);
40
- } }),
41
- React.createElement(Checkbox2, { checked: drawLabels, label: "Draw labels", onChange: () => {
42
- model.setDrawLabels(!drawLabels);
43
- } })));
44
- });
45
- const MSASettings = observer(function MSASettings({ model, }) {
46
- const { classes } = useStyles();
47
- const { bgColor, colWidth, allowedGappyness, drawMsaLetters, colorSchemeName, hideGaps, rowHeight, } = model;
48
- return (React.createElement("div", null,
49
- React.createElement("h1", null, "MSA options"),
50
- React.createElement(Checkbox2, { checked: drawMsaLetters, label: "Draw letters", onChange: () => {
51
- model.setDrawMsaLetters(!drawMsaLetters);
52
- } }),
53
- React.createElement(Checkbox2, { checked: bgColor, label: "Color letters instead of background of tiles", onChange: () => {
54
- model.setBgColor(!bgColor);
55
- } }),
56
- React.createElement(Checkbox2, { checked: hideGaps, label: "Enable hiding gappy columns?", onChange: () => {
57
- model.setHideGaps(!hideGaps);
58
- } }),
59
- hideGaps ? (React.createElement("div", { className: classes.flex },
60
- React.createElement(Typography, null,
61
- "Hide columns w/ >",
62
- allowedGappyness,
63
- "% gaps"),
64
- React.createElement(Slider, { className: classes.field, min: 1, max: 100, value: allowedGappyness, onChange: (_, val) => {
65
- model.setAllowedGappyness(val);
66
- } }))) : null,
67
- React.createElement("div", { className: classes.flex },
68
- React.createElement(Typography, null,
69
- "Column width (",
70
- toP(colWidth),
71
- "px)"),
72
- React.createElement(Slider, { className: classes.field, min: 1, max: 50, value: colWidth, onChange: (_, val) => {
73
- model.setColWidth(val);
74
- } })),
75
- React.createElement("div", { className: classes.flex },
76
- React.createElement(Typography, null,
77
- "Row height (",
78
- toP(rowHeight),
79
- "px)"),
80
- React.createElement(Slider, { className: classes.field, min: 1, max: 50, value: rowHeight, onChange: (_, val) => {
81
- model.setRowHeight(val);
82
- } })),
83
- React.createElement(TextField, { select: true, label: "Color scheme", value: colorSchemeName, onChange: event => {
84
- model.setColorSchemeName(event.target.value);
85
- } }, Object.keys(colorSchemes).map(option => (React.createElement(MenuItem, { key: option, value: option }, option))))));
86
- });
87
- const SettingsDialog = observer(function ({ model, onClose, }) {
88
- const { classes } = useStyles();
89
- return (React.createElement(Dialog, { open: true, title: "Settings", maxWidth: "xl", onClose: () => {
90
- onClose();
91
- } },
92
- React.createElement(DialogContent, { className: classes.minw },
93
- React.createElement(SettingsContent, { model: model }),
94
- React.createElement(DialogActions, null,
95
- React.createElement(Button, { variant: "contained", color: "primary", onClick: () => {
96
- onClose();
97
- } }, "Submit")))));
98
- });
99
- export default SettingsDialog;
100
- //# sourceMappingURL=SettingsDialog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SettingsDialog.js","sourceRoot":"","sources":["../../../src/components/dialogs/SettingsDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EACL,MAAM,EACN,aAAa,EACb,aAAa,EACb,QAAQ,EACR,MAAM,EACN,SAAS,EACT,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,YAAY,MAAM,uBAAuB,CAAA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C,cAAc,EACpB,KAAK,EAAE,eAAe,EACtB,QAAQ,EAAE,KAAK,CAAC,EAAE;gBAChB,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YAC9C,CAAC,IAEA,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CACvC,oBAAC,QAAQ,IAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,IACjC,MAAM,CACE,CACZ,CAAC,CACQ,CACR,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG,QAAQ,CAAC,UAAU,EACxC,KAAK,EACL,OAAO,GAIR;IACC,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAA;IAC/B,OAAO,CACL,oBAAC,MAAM,IACL,IAAI,QACJ,KAAK,EAAC,UAAU,EAChB,QAAQ,EAAC,IAAI,EACb,OAAO,EAAE,GAAG,EAAE;YACZ,OAAO,EAAE,CAAA;QACX,CAAC;QAED,oBAAC,aAAa,IAAC,SAAS,EAAE,OAAO,CAAC,IAAI;YACpC,oBAAC,eAAe,IAAC,KAAK,EAAE,KAAK,GAAI;YACjC,oBAAC,aAAa;gBACZ,oBAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,GAAG,EAAE;wBACZ,OAAO,EAAE,CAAA;oBACX,CAAC,aAGM,CACK,CACF,CACT,CACV,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,cAAc,CAAA"}
@@ -1,27 +0,0 @@
1
- import React from 'react';
2
- import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
3
- import MoreVert from '@mui/icons-material/Menu';
4
- import Visibility from '@mui/icons-material/Visibility';
5
- import { observer } from 'mobx-react';
6
- const HeaderMenu = observer(({ model }) => {
7
- const { tracks, turnedOffTracks } = model;
8
- return (React.createElement(CascadingMenuButton, { menuItems: [
9
- {
10
- label: 'Tracks',
11
- icon: Visibility,
12
- type: 'subMenu',
13
- subMenu: tracks.map(track => ({
14
- label: track.model.name,
15
- type: 'checkbox',
16
- checked: !turnedOffTracks.has(track.model.id),
17
- onClick: () => {
18
- model.toggleTrack(track.model.id);
19
- },
20
- })),
21
- },
22
- ...model.extraViewMenuItems(),
23
- ], anchorOrigin: { vertical: 'bottom', horizontal: 'left' }, transformOrigin: { vertical: 'top', horizontal: 'left' } },
24
- React.createElement(MoreVert, null)));
25
- });
26
- export default HeaderMenu;
27
- //# sourceMappingURL=HeaderMenu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HeaderMenu.js","sourceRoot":"","sources":["../../../src/components/header/HeaderMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,mBAAmB,MAAM,sCAAsC,CAAA;AACtE,OAAO,QAAQ,MAAM,0BAA0B,CAAA;AAC/C,OAAO,UAAU,MAAM,gCAAgC,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIrC,MAAM,UAAU,GAAG,QAAQ,CAAC,CAAC,EAAE,KAAK,EAA2B,EAAE,EAAE;IACjE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,KAAK,CAAA;IACzC,OAAO,CACL,oBAAC,mBAAmB,IAClB,SAAS,EAAE;YACT;gBACE,KAAK,EAAE,QAAQ;gBACf,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;oBAC5B,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI;oBACvB,IAAI,EAAE,UAAmB;oBACzB,OAAO,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;oBAC7C,OAAO,EAAE,GAAG,EAAE;wBACZ,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;oBACnC,CAAC;iBACF,CAAC,CAAC;aACJ;YACD,GAAG,KAAK,CAAC,kBAAkB,EAAE;SAC9B,EACD,YAAY,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,EACxD,eAAe,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE;QAExD,oBAAC,QAAQ,OAAG,CACQ,CACvB,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,UAAU,CAAA"}
@@ -1 +0,0 @@
1
- export declare function mathPower(num: number): string;
@@ -1,7 +0,0 @@
1
- export function mathPower(num) {
2
- if (num < 999) {
3
- return String(num);
4
- }
5
- return `${mathPower(~~(num / 1000))},${`00${~~(num % 1000)}`.slice(-3, -3 + 3)}`;
6
- }
7
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/components/util.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC;QACd,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;IACpB,CAAC;IACD,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,CAChE,CAAC,CAAC,EACF,CAAC,CAAC,GAAG,CAAC,CACP,EAAE,CAAA;AACL,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"webpack.js","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,yBAA0B,CAAA;AAC7D,OAAO,EAAqB,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAA;AAEpE,cAAc,kBAAkB,CAAA;AAEhC,OAAO,EAAE,KAAK,EAAE,CAAA"}
@@ -1,234 +0,0 @@
1
- import React from 'react'
2
-
3
- import { Dialog } from '@jbrowse/core/ui'
4
- import {
5
- Button,
6
- DialogActions,
7
- DialogContent,
8
- MenuItem,
9
- Slider,
10
- TextField,
11
- Typography,
12
- } from '@mui/material'
13
- import { observer } from 'mobx-react'
14
- import { makeStyles } from 'tss-react/mui'
15
-
16
- import colorSchemes from '../../colorSchemes.ts'
17
- import Checkbox2 from '../Checkbox2.tsx'
18
-
19
- import type { MsaViewModel } from '../../model.ts'
20
-
21
- const useStyles = makeStyles()(theme => ({
22
- field: {
23
- margin: theme.spacing(4),
24
- },
25
- flex: {
26
- display: 'flex',
27
- },
28
- minw: {
29
- width: '80em',
30
- },
31
- }))
32
-
33
- const toP = (s = 0) => +s.toFixed(1)
34
-
35
- const SettingsContent = observer(function ({ model }: { model: MsaViewModel }) {
36
- return (
37
- <>
38
- <TreeSettings model={model} />
39
- <MSASettings model={model} />
40
- </>
41
- )
42
- })
43
-
44
- const TreeSettings = observer(function TreeSettings({
45
- model,
46
- }: {
47
- model: MsaViewModel
48
- }) {
49
- const {
50
- drawTree,
51
- drawLabels,
52
- drawNodeBubbles,
53
- labelsAlignRight,
54
- showBranchLen,
55
- } = model
56
-
57
- return (
58
- <div>
59
- <h1>Tree options</h1>
60
- <Checkbox2
61
- checked={showBranchLen}
62
- label="Show branch length?"
63
- onChange={() => {
64
- model.setShowBranchLen(!showBranchLen)
65
- }}
66
- />
67
-
68
- <Checkbox2
69
- checked={drawNodeBubbles}
70
- label="Draw clickable bubbles on tree branches?"
71
- onChange={() => {
72
- model.setDrawNodeBubbles(!drawNodeBubbles)
73
- }}
74
- />
75
- <Checkbox2
76
- checked={drawTree}
77
- label="Show tree?"
78
- onChange={() => {
79
- model.setDrawTree(!drawTree)
80
- }}
81
- />
82
-
83
- <Checkbox2
84
- checked={labelsAlignRight}
85
- label="Tree labels align right?"
86
- onChange={() => {
87
- model.setLabelsAlignRight(!labelsAlignRight)
88
- }}
89
- />
90
-
91
- <Checkbox2
92
- checked={drawLabels}
93
- label="Draw labels"
94
- onChange={() => {
95
- model.setDrawLabels(!drawLabels)
96
- }}
97
- />
98
- </div>
99
- )
100
- })
101
-
102
- const MSASettings = observer(function MSASettings({
103
- model,
104
- }: {
105
- model: MsaViewModel
106
- }) {
107
- const { classes } = useStyles()
108
- const {
109
- bgColor,
110
- colWidth,
111
- allowedGappyness,
112
- drawMsaLetters,
113
- colorSchemeName,
114
- hideGaps,
115
- rowHeight,
116
- } = model
117
-
118
- return (
119
- <div>
120
- <h1>MSA options</h1>
121
- <Checkbox2
122
- checked={drawMsaLetters}
123
- label="Draw letters"
124
- onChange={() => {
125
- model.setDrawMsaLetters(!drawMsaLetters)
126
- }}
127
- />
128
- <Checkbox2
129
- checked={bgColor}
130
- label="Color letters instead of background of tiles"
131
- onChange={() => {
132
- model.setBgColor(!bgColor)
133
- }}
134
- />
135
- <Checkbox2
136
- checked={hideGaps}
137
- label="Enable hiding gappy columns?"
138
- onChange={() => {
139
- model.setHideGaps(!hideGaps)
140
- }}
141
- />
142
- {hideGaps ? (
143
- <div className={classes.flex}>
144
- <Typography>Hide columns w/ &gt;{allowedGappyness}% gaps</Typography>
145
- <Slider
146
- className={classes.field}
147
- min={1}
148
- max={100}
149
- value={allowedGappyness}
150
- onChange={(_, val) => {
151
- model.setAllowedGappyness(val)
152
- }}
153
- />
154
- </div>
155
- ) : null}
156
- <div className={classes.flex}>
157
- <Typography>Column width ({toP(colWidth)}px)</Typography>
158
- <Slider
159
- className={classes.field}
160
- min={1}
161
- max={50}
162
- value={colWidth}
163
- onChange={(_, val) => {
164
- model.setColWidth(val)
165
- }}
166
- />
167
- </div>
168
- <div className={classes.flex}>
169
- <Typography>Row height ({toP(rowHeight)}px)</Typography>
170
- <Slider
171
- className={classes.field}
172
- min={1}
173
- max={50}
174
- value={rowHeight}
175
- onChange={(_, val) => {
176
- model.setRowHeight(val)
177
- }}
178
- />
179
- </div>
180
-
181
- <TextField
182
- select
183
- label="Color scheme"
184
- value={colorSchemeName}
185
- onChange={event => {
186
- model.setColorSchemeName(event.target.value)
187
- }}
188
- >
189
- {Object.keys(colorSchemes).map(option => (
190
- <MenuItem key={option} value={option}>
191
- {option}
192
- </MenuItem>
193
- ))}
194
- </TextField>
195
- </div>
196
- )
197
- })
198
-
199
- const SettingsDialog = observer(function ({
200
- model,
201
- onClose,
202
- }: {
203
- model: MsaViewModel
204
- onClose: () => void
205
- }) {
206
- const { classes } = useStyles()
207
- return (
208
- <Dialog
209
- open
210
- title="Settings"
211
- maxWidth="xl"
212
- onClose={() => {
213
- onClose()
214
- }}
215
- >
216
- <DialogContent className={classes.minw}>
217
- <SettingsContent model={model} />
218
- <DialogActions>
219
- <Button
220
- variant="contained"
221
- color="primary"
222
- onClick={() => {
223
- onClose()
224
- }}
225
- >
226
- Submit
227
- </Button>
228
- </DialogActions>
229
- </DialogContent>
230
- </Dialog>
231
- )
232
- })
233
-
234
- export default SettingsDialog