react-msaview 4.4.6 → 4.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 (122) hide show
  1. package/bundle/index.js +9 -9
  2. package/bundle/index.js.LICENSE.txt +8 -8
  3. package/bundle/index.js.map +1 -1
  4. package/dist/colorSchemes.d.ts +0 -6
  5. package/dist/colorSchemes.js +1 -119
  6. package/dist/colorSchemes.js.map +1 -1
  7. package/dist/components/ConservationTrack.d.ts +8 -0
  8. package/dist/components/ConservationTrack.js +54 -0
  9. package/dist/components/ConservationTrack.js.map +1 -0
  10. package/dist/components/Loading.js +14 -2
  11. package/dist/components/Loading.js.map +1 -1
  12. package/dist/components/MSAView.js +36 -0
  13. package/dist/components/MSAView.js.map +1 -1
  14. package/dist/components/SequenceTextArea.js +3 -2
  15. package/dist/components/SequenceTextArea.js.map +1 -1
  16. package/dist/components/TextTrack.d.ts +3 -3
  17. package/dist/components/TextTrack.js +4 -1
  18. package/dist/components/TextTrack.js.map +1 -1
  19. package/dist/components/Track.js +21 -8
  20. package/dist/components/Track.js.map +1 -1
  21. package/dist/components/dialogs/ExportSVGDialog.js +19 -3
  22. package/dist/components/dialogs/ExportSVGDialog.js.map +1 -1
  23. package/dist/components/header/GappynessSlider.d.ts +6 -0
  24. package/dist/components/header/GappynessSlider.js +19 -0
  25. package/dist/components/header/GappynessSlider.js.map +1 -0
  26. package/dist/components/header/Header.js +3 -1
  27. package/dist/components/header/Header.js.map +1 -1
  28. package/dist/components/header/HeaderMenu.js +30 -14
  29. package/dist/components/header/HeaderMenu.js.map +1 -1
  30. package/dist/components/minimap/MinimapSVG.js +4 -3
  31. package/dist/components/minimap/MinimapSVG.js.map +1 -1
  32. package/dist/components/msa/MSACanvasBlock.js +56 -42
  33. package/dist/components/msa/MSACanvasBlock.js.map +1 -1
  34. package/dist/components/msa/renderMSABlock.js +71 -26
  35. package/dist/components/msa/renderMSABlock.js.map +1 -1
  36. package/dist/components/msa/renderMSAMouseover.js +8 -1
  37. package/dist/components/msa/renderMSAMouseover.js.map +1 -1
  38. package/dist/components/tracks/renderTracksSvg.d.ts +29 -0
  39. package/dist/components/tracks/renderTracksSvg.js +83 -0
  40. package/dist/components/tracks/renderTracksSvg.js.map +1 -0
  41. package/dist/components/tree/TreeNodeMenu.js +2 -2
  42. package/dist/components/tree/TreeNodeMenu.js.map +1 -1
  43. package/dist/components/tree/renderTreeCanvas.d.ts +0 -1
  44. package/dist/components/tree/renderTreeCanvas.js +23 -24
  45. package/dist/components/tree/renderTreeCanvas.js.map +1 -1
  46. package/dist/constants.d.ts +22 -0
  47. package/dist/constants.js +26 -0
  48. package/dist/constants.js.map +1 -0
  49. package/dist/layout.js.map +1 -1
  50. package/dist/model/msaModel.js +3 -2
  51. package/dist/model/msaModel.js.map +1 -1
  52. package/dist/model/treeModel.js +9 -8
  53. package/dist/model/treeModel.js.map +1 -1
  54. package/dist/model.d.ts +271 -15
  55. package/dist/model.js +427 -128
  56. package/dist/model.js.map +1 -1
  57. package/dist/neighborJoining.d.ts +1 -0
  58. package/dist/neighborJoining.js +839 -0
  59. package/dist/neighborJoining.js.map +1 -0
  60. package/dist/neighborJoining.test.d.ts +1 -0
  61. package/dist/neighborJoining.test.js +110 -0
  62. package/dist/neighborJoining.test.js.map +1 -0
  63. package/dist/parsers/A3mMSA.d.ts +43 -0
  64. package/dist/parsers/A3mMSA.js +277 -0
  65. package/dist/parsers/A3mMSA.js.map +1 -0
  66. package/dist/parsers/A3mMSA.test.d.ts +1 -0
  67. package/dist/parsers/A3mMSA.test.js +138 -0
  68. package/dist/parsers/A3mMSA.test.js.map +1 -0
  69. package/dist/parsers/ClustalMSA.d.ts +4 -4
  70. package/dist/parsers/ClustalMSA.js +3 -1
  71. package/dist/parsers/ClustalMSA.js.map +1 -1
  72. package/dist/parsers/FastaMSA.js +17 -16
  73. package/dist/parsers/FastaMSA.js.map +1 -1
  74. package/dist/renderToSvg.d.ts +1 -0
  75. package/dist/renderToSvg.js +48 -18
  76. package/dist/renderToSvg.js.map +1 -1
  77. package/dist/rowCoordinateCalculations.js +2 -0
  78. package/dist/rowCoordinateCalculations.js.map +1 -1
  79. package/dist/types.d.ts +2 -3
  80. package/dist/util.js +17 -9
  81. package/dist/util.js.map +1 -1
  82. package/dist/version.d.ts +1 -1
  83. package/dist/version.js +1 -1
  84. package/package.json +6 -6
  85. package/src/colorSchemes.ts +1 -179
  86. package/src/components/ConservationTrack.tsx +104 -0
  87. package/src/components/Loading.tsx +44 -2
  88. package/src/components/MSAView.tsx +68 -0
  89. package/src/components/SequenceTextArea.tsx +3 -2
  90. package/src/components/TextTrack.tsx +7 -4
  91. package/src/components/Track.tsx +25 -9
  92. package/src/components/dialogs/ExportSVGDialog.tsx +25 -1
  93. package/src/components/header/GappynessSlider.tsx +35 -0
  94. package/src/components/header/Header.tsx +3 -1
  95. package/src/components/header/HeaderMenu.tsx +36 -15
  96. package/src/components/minimap/MinimapSVG.tsx +6 -3
  97. package/src/components/msa/MSACanvasBlock.tsx +66 -48
  98. package/src/components/msa/renderMSABlock.ts +103 -40
  99. package/src/components/msa/renderMSAMouseover.ts +9 -0
  100. package/src/components/tracks/renderTracksSvg.ts +157 -0
  101. package/src/components/tree/TreeNodeMenu.tsx +2 -2
  102. package/src/components/tree/renderTreeCanvas.ts +25 -34
  103. package/src/constants.ts +27 -0
  104. package/src/layout.ts +1 -6
  105. package/src/model/msaModel.ts +4 -2
  106. package/src/model/treeModel.ts +19 -8
  107. package/src/model.ts +517 -140
  108. package/src/neighborJoining.test.ts +129 -0
  109. package/src/neighborJoining.ts +885 -0
  110. package/src/parsers/A3mMSA.test.ts +164 -0
  111. package/src/parsers/A3mMSA.ts +321 -0
  112. package/src/parsers/ClustalMSA.ts +7 -5
  113. package/src/parsers/FastaMSA.ts +17 -17
  114. package/src/renderToSvg.tsx +105 -26
  115. package/src/rowCoordinateCalculations.ts +2 -0
  116. package/src/types.ts +2 -4
  117. package/src/util.ts +21 -8
  118. package/src/version.ts +1 -1
  119. package/dist/components/dialogs/TracklistDialog.d.ts +0 -7
  120. package/dist/components/dialogs/TracklistDialog.js +0 -23
  121. package/dist/components/dialogs/TracklistDialog.js.map +0 -1
  122. package/src/components/dialogs/TracklistDialog.tsx +0 -73
@@ -0,0 +1,27 @@
1
+ // Main model defaults
2
+ export const defaultRowHeight = 16
3
+ export const defaultColWidth = 12
4
+ export const defaultHeight = 550
5
+ export const defaultScrollX = 0
6
+ export const defaultScrollY = 0
7
+ export const defaultCurrentAlignment = 0
8
+ export const defaultShowDomains = false
9
+ export const defaultHideGaps = true
10
+ export const defaultAllowedGappyness = 100
11
+ export const defaultContrastLettering = true
12
+ export const defaultSubFeatureRows = false
13
+ export const defaultDrawMsaLetters = true
14
+
15
+ // MSA model defaults
16
+ export const defaultBgColor = true
17
+ export const defaultColorSchemeName = 'maeditor'
18
+
19
+ // Tree model defaults
20
+ export const defaultDrawLabels = true
21
+ export const defaultLabelsAlignRight = false
22
+ export const defaultTreeAreaWidth = 400
23
+ export const defaultTreeWidth = 300
24
+ export const defaultTreeWidthMatchesArea = true
25
+ export const defaultShowBranchLen = true
26
+ export const defaultDrawTree = true
27
+ export const defaultDrawNodeBubbles = true
package/src/layout.ts CHANGED
@@ -63,12 +63,7 @@ export default class Layout {
63
63
  return false
64
64
  }
65
65
 
66
- const results = this.flatbush.search(
67
- box.minX,
68
- box.minY,
69
- box.maxX,
70
- box.maxY,
71
- )
66
+ const results = this.flatbush.search(box.minX, box.minY, box.maxX, box.maxY)
72
67
 
73
68
  return results.length > 0
74
69
  }
@@ -1,5 +1,7 @@
1
1
  import { types } from 'mobx-state-tree'
2
2
 
3
+ import { defaultBgColor, defaultColorSchemeName } from '../constants'
4
+
3
5
  /**
4
6
  * #stateModel MSAModel
5
7
  */
@@ -12,13 +14,13 @@ export function MSAModelF() {
12
14
  * #property
13
15
  * draw MSA tiles with a background color
14
16
  */
15
- bgColor: true,
17
+ bgColor: defaultBgColor,
16
18
 
17
19
  /**
18
20
  * #property
19
21
  * default color scheme name
20
22
  */
21
- colorSchemeName: 'maeditor',
23
+ colorSchemeName: defaultColorSchemeName,
22
24
  })
23
25
  .actions(self => ({
24
26
  /**
@@ -1,5 +1,16 @@
1
1
  import { types } from 'mobx-state-tree'
2
2
 
3
+ import {
4
+ defaultDrawLabels,
5
+ defaultDrawNodeBubbles,
6
+ defaultDrawTree,
7
+ defaultLabelsAlignRight,
8
+ defaultShowBranchLen,
9
+ defaultTreeAreaWidth,
10
+ defaultTreeWidth,
11
+ defaultTreeWidthMatchesArea,
12
+ } from '../constants'
13
+
3
14
  /**
4
15
  * #stateModel Tree
5
16
  */
@@ -11,30 +22,30 @@ export function TreeModelF() {
11
22
  /**
12
23
  * #property
13
24
  */
14
- drawLabels: true,
25
+ drawLabels: defaultDrawLabels,
15
26
  /**
16
27
  * #property
17
28
  * right-align the labels
18
29
  */
19
- labelsAlignRight: false,
30
+ labelsAlignRight: defaultLabelsAlignRight,
20
31
 
21
32
  /**
22
33
  * #property
23
34
  * width of the area the tree is drawn in, px
24
35
  */
25
- treeAreaWidth: types.optional(types.number, 400),
36
+ treeAreaWidth: types.optional(types.number, defaultTreeAreaWidth),
26
37
 
27
38
  /**
28
39
  * #property
29
40
  * width of the tree within the treeArea, px
30
41
  */
31
- treeWidth: types.optional(types.number, 300),
42
+ treeWidth: types.optional(types.number, defaultTreeWidth),
32
43
 
33
44
  /**
34
45
  * #getter
35
46
  * synchronization that matches treeWidth to treeAreaWidth
36
47
  */
37
- treeWidthMatchesArea: true,
48
+ treeWidthMatchesArea: defaultTreeWidthMatchesArea,
38
49
 
39
50
  /**
40
51
  * #property
@@ -42,19 +53,19 @@ export function TreeModelF() {
42
53
  * lengths. if false, the layout is a "cladogram" that does not take into
43
54
  * account evolutionary distances
44
55
  */
45
- showBranchLen: true,
56
+ showBranchLen: defaultShowBranchLen,
46
57
 
47
58
  /**
48
59
  * #property
49
60
  * draw tree, boolean
50
61
  */
51
- drawTree: true,
62
+ drawTree: defaultDrawTree,
52
63
 
53
64
  /**
54
65
  * #property
55
66
  * draw clickable node bubbles on the tree
56
67
  */
57
- drawNodeBubbles: true,
68
+ drawNodeBubbles: defaultDrawNodeBubbles,
58
69
  })
59
70
  .actions(self => ({
60
71
  /**