@teselagen/ove 0.7.28 → 0.7.30-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. package/CreateAnnotationsPage.d.ts +4 -3
  2. package/README.md +1 -1
  3. package/fileUtils.d.ts +12 -0
  4. package/html2canvas.esm--JN4fLQL.js +7891 -0
  5. package/html2canvas.esm-B7d7VJmQ.cjs +7891 -0
  6. package/index.cjs.js +1305 -1121
  7. package/index.es.js +1305 -1121
  8. package/index.umd.js +189161 -0
  9. package/ove.css +17 -4
  10. package/package.json +5 -9
  11. package/redux/findTool.d.ts +1 -0
  12. package/selectors/searchLayersSelector.d.ts +1 -1
  13. package/src/AutoAnnotate.js +1 -1
  14. package/src/CreateAnnotationsPage.js +1 -2
  15. package/src/Editor/style.css +8 -3
  16. package/src/FindBar/index.js +32 -1
  17. package/src/RowItem/SelectionLayer/index.js +42 -4
  18. package/src/RowItem/SelectionLayer/style.css +8 -0
  19. package/src/fileUtils.js +103 -0
  20. package/src/helperComponents/PropertiesDialog/TranslationProperties.js +1 -1
  21. package/src/redux/findTool.js +9 -0
  22. package/src/selectors/searchLayersSelector.js +40 -2
  23. package/style.css +12098 -1
  24. package/AASliver.js +0 -187
  25. package/AddLaddersDialog.js +0 -82
  26. package/AdditionalCutsiteInfoDialog.js +0 -599
  27. package/AlignmentVisibilityTool.js +0 -105
  28. package/AnnotationContainerHolder.js +0 -20
  29. package/AnnotationPositioner.js +0 -27
  30. package/AutoAnnotate.js +0 -501
  31. package/AutoAnnotateBpMatchingDialog.js +0 -208
  32. package/Axis.js +0 -151
  33. package/AxisNumbers.js +0 -35
  34. package/Browser.js +0 -106
  35. package/Caret.js +0 -63
  36. package/Chromatogram.js +0 -293
  37. package/CircularDnaSequence.js +0 -73
  38. package/CircularZoomMinimap.js +0 -16
  39. package/ColorPicker.js +0 -30
  40. package/CommandHotkeyHandler.js +0 -44
  41. package/CreateAnnotationsPage.js +0 -98
  42. package/Cutsite.js +0 -18
  43. package/CutsiteProperties.js +0 -176
  44. package/CutsiteSelectionLayers.js +0 -47
  45. package/Cutsites.js +0 -271
  46. package/DeletionLayer.js +0 -28
  47. package/DropHandler.css +0 -21
  48. package/DropHandler.js +0 -64
  49. package/EditCaretPosition.js +0 -234
  50. package/EditTrackNameDialog.js +0 -30
  51. package/Feature.js +0 -83
  52. package/FeatureProperties.js +0 -6
  53. package/FillWindow.js +0 -47
  54. package/GenbankView.js +0 -74
  55. package/GeneralProperties.js +0 -117
  56. package/GenericAnnotationProperties.js +0 -406
  57. package/GlobalDialog.js +0 -73
  58. package/GlobalDialogUtils.js +0 -110
  59. package/GoToDialog.js +0 -25
  60. package/HorizontalPanelDragHandle.js +0 -35
  61. package/Keyboard.js +0 -85
  62. package/Labels.js +0 -327
  63. package/Ladder.css +0 -20
  64. package/Ladder.js +0 -303
  65. package/MeltingTemp.js +0 -85
  66. package/Menlo.ttf +0 -0
  67. package/Minimap.js +0 -515
  68. package/Mismatches.js +0 -134
  69. package/Monaco.ttf +0 -0
  70. package/MultipleSeqsDetectedOnImportDialog.js +0 -74
  71. package/Orf.js +0 -109
  72. package/OrfProperties.js +0 -117
  73. package/Orfs.js +0 -35
  74. package/PCRTool.js +0 -179
  75. package/PairwiseAlignmentView.js +0 -68
  76. package/Part.js +0 -34
  77. package/PartProperties.js +0 -9
  78. package/PassThrough.js +0 -3
  79. package/PerformantSelectionLayer.js +0 -32
  80. package/PinchHelper.js +0 -24
  81. package/PointedAnnotation.js +0 -347
  82. package/PositionAnnotationOnCircle.js +0 -26
  83. package/Primer.js +0 -41
  84. package/PrimerProperties.js +0 -19
  85. package/ReflexContainer.js +0 -802
  86. package/ReflexElement.js +0 -160
  87. package/ReflexEvents.js +0 -77
  88. package/ReflexSplitter.js +0 -205
  89. package/RenameSequenceDialog.js +0 -7
  90. package/RotateCircularViewSlider.js +0 -93
  91. package/SelectDialog.js +0 -150
  92. package/SequenceName.js +0 -15
  93. package/SimpleCircularOrLinearView.js +0 -381
  94. package/SimpleOligoPreview.js +0 -39
  95. package/SingleEnzymeCutsiteInfo.js +0 -139
  96. package/ToolbarItem.js +0 -192
  97. package/Translation.js +0 -198
  98. package/TranslationProperties.js +0 -149
  99. package/UncontrolledSliderWithPlusMinusBtns.css +0 -5
  100. package/UncontrolledSliderWithPlusMinusBtns.js +0 -134
  101. package/VeTopRightContainer.js +0 -12
  102. package/ZoomCircularViewSlider.js +0 -62
  103. package/ZoomLinearView.js +0 -47
  104. package/addAlignment.js +0 -6
  105. package/addMetaToActionCreators.js +0 -12
  106. package/addWrappedAddons.js +0 -20
  107. package/alignmentTool.js +0 -503
  108. package/alignments.js +0 -379
  109. package/annotationLabelVisibility.js +0 -2
  110. package/annotationSearchSelector.js +0 -24
  111. package/annotationTypes.js +0 -35
  112. package/annotationVisibility.js +0 -196
  113. package/annotationsToSupport.js +0 -104
  114. package/arrayToObjWithIds.js +0 -17
  115. package/arrayUtils.js +0 -19
  116. package/array_move.js +0 -10
  117. package/calculateTickMarkPositionsForGivenRange.js +0 -47
  118. package/caretPosition.js +0 -27
  119. package/cdsFeaturesSelector.js +0 -9
  120. package/charWidth.js +0 -22
  121. package/circular.js +0 -19
  122. package/circularSelector.js +0 -4
  123. package/clickAndDragUtils.js +0 -576
  124. package/coerceInitialValue.js +0 -7
  125. package/combineReducersDontIgnoreKeys.js +0 -12
  126. package/commandUtils.js +0 -20
  127. package/constants.js +0 -2
  128. package/copyOptions.js +0 -34
  129. package/createFragmentLines.js +0 -120
  130. package/createMergedDefaultStateReducer.js +0 -30
  131. package/createMetaAction.js +0 -12
  132. package/createSequenceInputPopup.js +0 -290
  133. package/createSequenceInputPopupStyle.css +0 -87
  134. package/createSimpleDialog.js +0 -89
  135. package/createYourOwnEnzyme.js +0 -39
  136. package/cutsiteLabelColorSelector.js +0 -6
  137. package/cutsiteTool.js +0 -88
  138. package/cutsitesByRangeSelector.js +0 -5
  139. package/cutsitesSelector.js +0 -61
  140. package/darkmode.css +0 -98
  141. package/defaultConfig.js +0 -150
  142. package/deletionLayers.js +0 -36
  143. package/description.js +0 -21
  144. package/digestTool.js +0 -34
  145. package/dnaToColor.js +0 -17
  146. package/downloadTool.js +0 -39
  147. package/draggableClassnames.js +0 -5
  148. package/drawAnnotations.js +0 -440
  149. package/drawDirectedPiePiece.js +0 -142
  150. package/editTool.js +0 -49
  151. package/editorSelector.js +0 -2
  152. package/editorUtils.js +0 -205
  153. package/estimateRowHeight.js +0 -184
  154. package/featureLengthsToHide.js +0 -27
  155. package/featureTool.js +0 -34
  156. package/features.js +0 -19
  157. package/featuresSelector.js +0 -8
  158. package/filteredCutsitesSelector.js +0 -136
  159. package/filteredFeaturesSelector.js +0 -32
  160. package/filteredPartsSelector.js +0 -57
  161. package/filteredPrimersSelector.js +0 -27
  162. package/filteredRestrictionEnzymesSelector.js +0 -1
  163. package/find.png +0 -0
  164. package/findTool.js +0 -79
  165. package/findToolConstants.js +0 -1
  166. package/frameTranslations.js +0 -52
  167. package/fullscreen.png +0 -0
  168. package/getAdditionalEnzymesSelector.js +0 -46
  169. package/getAngleForPositionMidpoint.js +0 -3
  170. package/getAnnotationClassnames.js +0 -12
  171. package/getAnnotationNameAndStartStopString.js +0 -61
  172. package/getBpsPerRow.js +0 -19
  173. package/getCutsiteLabelHeights.js +0 -56
  174. package/getGapMap.js +0 -12
  175. package/getGaps.js +0 -27
  176. package/getInternalLabel.js +0 -40
  177. package/getOveHotkeyDefs.js +0 -12
  178. package/getPairwiseOverviewLinearViewOptions.js +0 -38
  179. package/getRangeAnglesSpecial.js +0 -12
  180. package/getStructuredBases.js +0 -97
  181. package/getTrackFromEvent.js +0 -25
  182. package/getVisibleStartEnd.js +0 -7
  183. package/getXStartAndWidthFromNonCircularRange.js +0 -12
  184. package/getXStartAndWidthOfRangeWrtRow.js +0 -27
  185. package/getXStartAndWidthOfRowAnnotation.js +0 -19
  186. package/getYOffset.js +0 -15
  187. package/hoveredAnnotation.js +0 -24
  188. package/importTool.js +0 -27
  189. package/index.js +0 -71
  190. package/inlineFindTool.js +0 -38
  191. package/isElementInViewport.js +0 -29
  192. package/isEnzymeFilterAndSelector.js +0 -1
  193. package/isTargetWithinEl.js +0 -6
  194. package/labelLineIntensity.js +0 -25
  195. package/labelSize.js +0 -23
  196. package/ladderDefaults.js +0 -25
  197. package/lastSavedId.js +0 -20
  198. package/lineageLines.js +0 -11
  199. package/linear.png +0 -0
  200. package/makeStore.js +0 -34
  201. package/massageTickSpacing.js +0 -19
  202. package/materiallyAvailable.js +0 -19
  203. package/middleware.js +0 -112
  204. package/minimumOrfSize.js +0 -24
  205. package/minimumOrfSizeSelector.js +0 -2
  206. package/modalActions.js +0 -3
  207. package/moveCaret.js +0 -58
  208. package/name.js +0 -19
  209. package/normalizeAngle.js +0 -3
  210. package/normalizeAngleRange.js +0 -9
  211. package/oligoTool.js +0 -30
  212. package/onlyUpdateForKeysDeep.js +0 -31
  213. package/orfFrameToColorMap.js +0 -10
  214. package/orfTool.js +0 -136
  215. package/orfsSelector.js +0 -15
  216. package/panelsShown.js +0 -294
  217. package/partLengthsToHide.js +0 -23
  218. package/partOverhangs.js +0 -6
  219. package/partTagSearch.js +0 -69
  220. package/partTool.js +0 -45
  221. package/parts.js +0 -19
  222. package/partsSelector.js +0 -8
  223. package/pie.png +0 -0
  224. package/polarToSpecialCartesian.js +0 -7
  225. package/positionCutsites.js +0 -6
  226. package/prepareRowData.js +0 -64
  227. package/primerBases.js +0 -221
  228. package/primerLengthsToHide.js +0 -27
  229. package/primers.js +0 -19
  230. package/primersSelector.js +0 -8
  231. package/print.png +0 -0
  232. package/printTool.js +0 -31
  233. package/propertiesTool.js +0 -40
  234. package/proteinUtils.js +0 -3
  235. package/pureNoFunc.js +0 -18
  236. package/readOnly.js +0 -25
  237. package/redoTool.js +0 -30
  238. package/reflex-styles.css +0 -128
  239. package/reflex-styles.css.map +0 -9
  240. package/relaxLabelAngles.js +0 -157
  241. package/relaxLabels_DEPRECATED.js +0 -105
  242. package/replacementLayers.js +0 -36
  243. package/restrictionEnzymes.js +0 -52
  244. package/restrictionEnzymesSelector.js +0 -34
  245. package/rowviewContants.js +0 -3
  246. package/ruler.css +0 -89
  247. package/save.png +0 -0
  248. package/saveTool.js +0 -44
  249. package/searchLayersSelector.js +0 -71
  250. package/selectedAnnotations.js +0 -89
  251. package/selectedAnnotationsSelector.js +0 -1
  252. package/selectedCutsitesSelector.js +0 -21
  253. package/selectedPartTags.js +0 -21
  254. package/selectionLayer.js +0 -25
  255. package/sequence.js +0 -12
  256. package/sequenceDataHistory.js +0 -43
  257. package/sequenceDataSelector.js +0 -2
  258. package/sequenceLengthSelector.js +0 -5
  259. package/sequenceSelector.js +0 -4
  260. package/sharedActionCreators.js +0 -0
  261. package/shouldFlipText.js +0 -4
  262. package/shouldRerender.js +0 -27
  263. package/showFileDialog.js +0 -25
  264. package/showGCContent.js +0 -23
  265. package/show_cut_sites.png +0 -0
  266. package/show_features.png +0 -0
  267. package/show_orfs.png +0 -0
  268. package/show_primers.png +0 -0
  269. package/simpleDialog.css +0 -13
  270. package/specialCutsiteFilterOptions.js +0 -22
  271. package/tagsToBoldSelector.js +0 -2
  272. package/toggle_views.svg +0 -1
  273. package/toolBar.js +0 -23
  274. package/translationSearchMatchesSelector.js +0 -14
  275. package/translations.js +0 -20
  276. package/translationsRawSelector.js +0 -8
  277. package/translationsSelector.js +0 -137
  278. package/typeField.js +0 -24
  279. package/undoTool.js +0 -30
  280. package/updateEditor.js +0 -200
  281. package/updateLabelsForInViewFeatures.js +0 -55
  282. package/updateLabelsForInViewFeaturesCircView.js +0 -41
  283. package/updateTrackHelper.js +0 -58
  284. package/uppercaseSequenceMapFont.js +0 -25
  285. package/upsertDeleteActionGenerator.js +0 -31
  286. package/useAAColorType.js +0 -8
  287. package/useAdditionalOrfStartCodons.js +0 -24
  288. package/useAnnotationLimits.js +0 -42
  289. package/useChromatogramPrefs.js +0 -31
  290. package/useFormValue.js +0 -7
  291. package/useLadders.js +0 -6
  292. package/useMeltingTemp.js +0 -7
  293. package/useTmType.js +0 -10
  294. package/userDefinedHandlersAndOpts.js +0 -61
  295. package/utils.js +0 -37
  296. package/versionHistory.js +0 -26
  297. package/versionHistoryTool.js +0 -21
  298. package/viewSubmenu.js +0 -479
  299. package/visibilityTool.js +0 -39
  300. package/withHover.js +0 -113
  301. package/withRestrictionEnzymes.js +0 -15
@@ -1,234 +0,0 @@
1
- /* eslint-disable no-var */
2
- const EditCaretPositioning = {};
3
-
4
- export default EditCaretPositioning;
5
-
6
- if (window.getSelection && document.createRange) {
7
- //saves caret position(s)
8
- EditCaretPositioning.saveSelection = function (containerEl) {
9
- var range = window.getSelection().getRangeAt(0);
10
- var preSelectionRange = range.cloneRange();
11
- preSelectionRange.selectNodeContents(containerEl);
12
- preSelectionRange.setEnd(range.startContainer, range.startOffset);
13
- var start = preSelectionRange.toString().length;
14
-
15
- return {
16
- start: start,
17
- end: start + range.toString().length
18
- };
19
- };
20
- //restores caret position(s)
21
- EditCaretPositioning.restoreSelection = function (containerEl, savedSel) {
22
- var charIndex = 0,
23
- range = document.createRange();
24
- range.setStart(containerEl, 0);
25
- range.collapse(true);
26
- var nodeStack = [containerEl],
27
- node,
28
- foundStart = false,
29
- stop = false;
30
-
31
- while (!stop && (node = nodeStack.pop())) {
32
- if (node.nodeType === 3) {
33
- var nextCharIndex = charIndex + node.length;
34
- if (
35
- !foundStart &&
36
- savedSel.start >= charIndex &&
37
- savedSel.start <= nextCharIndex
38
- ) {
39
- range.setStart(node, savedSel.start - charIndex);
40
- foundStart = true;
41
- }
42
- if (
43
- foundStart &&
44
- savedSel.end >= charIndex &&
45
- savedSel.end <= nextCharIndex
46
- ) {
47
- range.setEnd(node, savedSel.end - charIndex);
48
- stop = true;
49
- }
50
- charIndex = nextCharIndex;
51
- } else {
52
- var i = node.childNodes.length;
53
- while (i--) {
54
- nodeStack.push(node.childNodes[i]);
55
- }
56
- }
57
- }
58
-
59
- var sel = window.getSelection();
60
- sel.removeAllRanges();
61
- sel.addRange(range);
62
- };
63
- } else if (document.selection && document.body.createTextRange) {
64
- //saves caret position(s)
65
- EditCaretPositioning.saveSelection = function (containerEl) {
66
- var selectedTextRange = document.selection.createRange();
67
- var preSelectionTextRange = document.body.createTextRange();
68
- preSelectionTextRange.moveToElementText(containerEl);
69
- preSelectionTextRange.setEndPoint("EndToStart", selectedTextRange);
70
- var start = preSelectionTextRange.text.length;
71
-
72
- return {
73
- start: start,
74
- end: start + selectedTextRange.text.length
75
- };
76
- };
77
- //restores caret position(s)
78
- EditCaretPositioning.restoreSelection = function (containerEl, savedSel) {
79
- var textRange = document.body.createTextRange();
80
- textRange.moveToElementText(containerEl);
81
- textRange.collapse(true);
82
- textRange.moveEnd("character", savedSel.end);
83
- textRange.moveStart("character", savedSel.start);
84
- textRange.select();
85
- };
86
- }
87
-
88
- // getCaretPosition: return [start, end] as offsets to elem.textContent that
89
- // correspond to the selected portion of text
90
- // (if start == end, caret is at given position and no text is selected)
91
-
92
- // export function getCaretPosition(elem) {
93
- // const sel = window.getSelection();
94
- // let cum_length = [0, 0];
95
-
96
- // if (sel.anchorNode == elem) cum_length = [sel.anchorOffset, sel.extentOffset];
97
- // else {
98
- // const nodes_to_find = [sel.anchorNode, sel.extentNode];
99
- // if (!elem.contains(sel.anchorNode) || !elem.contains(sel.extentNode))
100
- // return undefined;
101
- // else {
102
- // const found = [0, 0];
103
- // let i;
104
- // node_walk(elem, function (node) {
105
- // for (i = 0; i < 2; i++) {
106
- // if (node == nodes_to_find[i]) {
107
- // found[i] = true;
108
- // if (found[i == 0 ? 1 : 0]) return false; // all done
109
- // }
110
- // }
111
-
112
- // if (node.textContent && !node.firstChild) {
113
- // for (i = 0; i < 2; i++) {
114
- // if (!found[i]) cum_length[i] += node.textContent.length;
115
- // }
116
- // }
117
- // });
118
- // cum_length[0] += sel.anchorOffset;
119
- // cum_length[1] += sel.extentOffset;
120
- // }
121
- // }
122
- // if (cum_length[0] <= cum_length[1]) return cum_length;
123
- // return [cum_length[1], cum_length[0]];
124
- // }
125
-
126
- // no operation
127
- const noop = () => null;
128
-
129
- /**
130
- * @function
131
- * @description
132
- * @param {DOMElement} container The container in which the cursor position must be saved
133
- * @return {Function} A function used to restore caret position
134
- */
135
- export function selectionSaveCaretPosition(container) {
136
- const selection = window.getSelection();
137
-
138
- if (!selection || selection.rangeCount === 0) {
139
- return noop;
140
- }
141
-
142
- const range = selection.getRangeAt(0);
143
- const clone = range.cloneRange();
144
-
145
- // find the range start index
146
- clone.selectNodeContents(container);
147
- clone.setStart(container, 0);
148
- clone.setEnd(range.startContainer, range.startOffset);
149
- const startIndex = clone.toString().length;
150
-
151
- // find the range end index
152
- clone.selectNodeContents(container);
153
- clone.setStart(container, 0);
154
- clone.setEnd(range.endContainer, range.endOffset);
155
- const endIndex = clone.toString().length;
156
-
157
- return function restoreCaretPosition() {
158
- const start = getTextNodeAtPosition(container, startIndex);
159
- const end = getTextNodeAtPosition(container, endIndex);
160
- const newRange = new Range();
161
-
162
- newRange.setStart(start.node, start.position);
163
- newRange.setEnd(end.node, end.position);
164
-
165
- selection.removeAllRanges();
166
- selection.addRange(newRange);
167
- container.focus();
168
- };
169
- }
170
-
171
- /**
172
- * @function
173
- * @description This function is used to determine the text node and it's index within
174
- * a "root" DOM element.
175
- *
176
- * @param {DOMElement} rootEl The root
177
- * @param {Integer} index The index within the root element of which you want to find the text node
178
- * @return {Object} An object that contains the text node, and the index within that text node
179
- */
180
- function getTextNodeAtPosition(rootEl, index) {
181
- const treeWalker = document.createTreeWalker(
182
- rootEl,
183
- NodeFilter.SHOW_TEXT,
184
- function next(elem) {
185
- if (index > elem.textContent.length) {
186
- index -= elem.textContent.length;
187
- return NodeFilter.FILTER_REJECT;
188
- }
189
- return NodeFilter.FILTER_ACCEPT;
190
- }
191
- );
192
- const node = treeWalker.nextNode();
193
-
194
- return {
195
- node: node ? node : rootEl,
196
- position: node ? index : 0
197
- };
198
- }
199
-
200
- // node_walk: walk the element tree, stop when func(node) returns false
201
- // function node_walk(node, func) {
202
- // let result = func(node);
203
- // for (
204
- // node = node.firstChild;
205
- // result !== false && node;
206
- // node = node.nextSibling
207
- // )
208
- // result = node_walk(node, func);
209
- // return result;
210
- // }
211
-
212
- // const charpos = getCaretPosition(inputRef.current);
213
-
214
- // let isChangeCloserToEnd;
215
- // if (charpos && charpos[0]) {
216
- // if (charpos[0] > newVal.length - charpos[0]) {
217
- // isChangeCloserToEnd = true;
218
- // }
219
- // }
220
- // if (forward && !isChangeCloserToEnd) {
221
- // if (end || end === 0) {
222
- // change(
223
- // "start",
224
- // normalizePositionByRangeLength(end - textLength + 1, seqLen)
225
- // );
226
- // }
227
- // } else {
228
- // if (start || start === 0) {
229
- // change(
230
- // "end",
231
- // normalizePositionByRangeLength(start + textLength - 1, seqLen)
232
- // );
233
- // }
234
- // }
@@ -1,30 +0,0 @@
1
- import React from "react";
2
- import { DialogFooter, InputField, wrapDialog } from "@teselagen/ui";
3
- import { compose } from "recompose";
4
- import { reduxForm } from "redux-form";
5
-
6
- export const EditTrackNameDialog = compose(
7
- wrapDialog({
8
- title: "Edit Track Name"
9
- }),
10
- reduxForm({ form: "EditTrackNameDialog" })
11
- )(function ({ handleSubmit, updateName, hideModal }) {
12
- return (
13
- <div>
14
- <div className="bp3-dialog-body">
15
- <InputField
16
- autoFocus
17
- label="New Name"
18
- isRequired
19
- name="name"
20
- ></InputField>
21
- </div>
22
- <DialogFooter
23
- onClick={handleSubmit(async ({ name }) => {
24
- await updateName({ newName: name });
25
- hideModal();
26
- })}
27
- ></DialogFooter>
28
- </div>
29
- );
30
- });
package/Feature.js DELETED
@@ -1,83 +0,0 @@
1
- import { startsWith } from "lodash-es";
2
- import React from "react";
3
-
4
- import drawDirectedPiePiece from "./drawDirectedPiePiece";
5
- import { getInternalLabel } from "./getInternalLabel";
6
- import shouldFlipText from "./shouldFlipText";
7
-
8
- export default function Feature(props) {
9
- const {
10
- color = "orange",
11
- radius,
12
- containsLocations,
13
- arrowheadLength = 0.5,
14
- annotationHeight,
15
- className,
16
- ellipsizedName,
17
- annotationType,
18
- arrowheadType,
19
- overlapsSelf,
20
- rotationRadians,
21
- centerAngle,
22
- totalAngle,
23
- locationNumber
24
- } = props;
25
- const isPart = annotationType === "part";
26
- let colorToUse = color;
27
- if (isPart) {
28
- colorToUse = startsWith(color, "override_")
29
- ? color.replace("override_", "")
30
- : "#ac68cc";
31
- }
32
- const labelNeedsFlip = shouldFlipText(centerAngle + rotationRadians);
33
- if (containsLocations) {
34
- const path = drawDirectedPiePiece({
35
- radius: radius,
36
- labelNeedsFlip,
37
- annotationHeight: annotationHeight / 8,
38
- totalAngle,
39
- arrowheadLength: 80 / radius,
40
- tailThickness: 1 //feature specific
41
- });
42
- return (
43
- <path
44
- className={className}
45
- strokeWidth=".5"
46
- stroke="black"
47
- fill={colorToUse}
48
- d={path.print()}
49
- />
50
- );
51
- }
52
- const [path, textPath] = drawDirectedPiePiece({
53
- returnTextPath: true,
54
- overlapsSelf,
55
- arrowheadType,
56
- hasLabel: ellipsizedName,
57
- labelNeedsFlip,
58
- radius,
59
- annotationHeight,
60
- totalAngle,
61
- arrowheadLength,
62
- tailThickness: 1 //feature specific
63
- });
64
-
65
- return (
66
- <>
67
- <path
68
- className={className}
69
- strokeWidth=".5"
70
- stroke={isPart ? colorToUse : "black"}
71
- fill={isPart ? undefined : colorToUse}
72
- d={path.print()}
73
- />
74
- {getInternalLabel({
75
- ...props,
76
- colorToUse,
77
- textPath,
78
- isPart,
79
- locationNumber
80
- })}
81
- </>
82
- );
83
- }
@@ -1,6 +0,0 @@
1
- import { featuresSubmenu } from "../../MenuBar/viewSubmenu";
2
- import genericAnnotationProperties from "./GenericAnnotationProperties";
3
- export default genericAnnotationProperties({
4
- visSubmenu: featuresSubmenu,
5
- annotationType: "feature"
6
- });
package/FillWindow.js DELETED
@@ -1,47 +0,0 @@
1
- import React from "react";
2
- import { debounce } from "lodash-es";
3
-
4
- export default class FillWindow extends React.Component {
5
- updateDimensions = debounce(() => {
6
- if (this.props.disabled) return;
7
- this.setState({ randomRerenderTrigger: Math.random() });
8
- }, 100);
9
-
10
- componentDidMount() {
11
- window.addEventListener("resize", this.updateDimensions);
12
- }
13
- componentWillUnmount() {
14
- window.removeEventListener("resize", this.updateDimensions);
15
- }
16
- render() {
17
- const w = window,
18
- d = document,
19
- e = d.documentElement,
20
- g = d.getElementsByTagName("body")[0],
21
- width = w.innerWidth || e.clientWidth || g.clientWidth,
22
- height = w.innerHeight || e.clientHeight || g.clientHeight;
23
- const windowDimensions = {
24
- width,
25
- height
26
- };
27
- const { children, disabled, style, ...rest } = this.props;
28
- if (disabled) return children(windowDimensions);
29
- return (
30
- <div
31
- {...rest}
32
- style={{
33
- zIndex: 10,
34
- width,
35
- height,
36
- position: "fixed",
37
- top: 0,
38
- left: 0,
39
- background: "white",
40
- ...style
41
- }}
42
- >
43
- {children(windowDimensions)}
44
- </div>
45
- );
46
- }
47
- }
package/GenbankView.js DELETED
@@ -1,74 +0,0 @@
1
- import React from "react";
2
- // import { Button } from "@blueprintjs/core";
3
- import {
4
- jsonToGenbank,
5
- jsonToFasta,
6
- cleanUpTeselagenJsonForExport
7
- } from "@teselagen/bio-parsers";
8
- import { HTMLSelect } from "@blueprintjs/core";
9
- import { connectToEditor } from "../../withEditorProps";
10
- import { compose } from "recompose";
11
-
12
- class GenbankView extends React.Component {
13
- state = {
14
- fileTypeToView: "genbank"
15
- };
16
- select = () => this._input?.select();
17
- render() {
18
- const { sequenceData = {} } = this.props;
19
- let filestring;
20
- switch (this.state.fileTypeToView) {
21
- case "fasta":
22
- filestring = jsonToFasta(sequenceData);
23
- break;
24
- case "teselagen":
25
- filestring = JSON.stringify(
26
- cleanUpTeselagenJsonForExport(sequenceData),
27
- null,
28
- 4
29
- );
30
- break;
31
- default:
32
- filestring = jsonToGenbank(sequenceData);
33
- }
34
-
35
- return (
36
- <>
37
- <HTMLSelect
38
- className="genbankFileView-type"
39
- fill={false}
40
- options={[
41
- { label: "Genbank", value: "genbank" },
42
- { label: "Fasta", value: "fasta" },
43
- { label: "Teselagen JSON", value: "teselagen" }
44
- ]}
45
- onChange={e => {
46
- this.setState({ fileTypeToView: e.target.value });
47
- }}
48
- />
49
- <textarea
50
- data-test="ve-genbank-text"
51
- readOnly
52
- onClick={this.select}
53
- style={{
54
- whiteSpace: "pre",
55
- overflowWrap: "normal",
56
- overflowX: "scroll",
57
- fontSize: 11,
58
- fontFamily: "monospace",
59
- height: 350
60
- }}
61
- value={filestring}
62
- />
63
- </>
64
- );
65
- }
66
- }
67
-
68
- export default compose(
69
- connectToEditor(({ sequenceData = {} }) => {
70
- return {
71
- sequenceData
72
- };
73
- })
74
- )(GenbankView);
@@ -1,117 +0,0 @@
1
- import React from "react";
2
- import { InputField, TextareaField } from "@teselagen/ui";
3
- import { reduxForm } from "redux-form";
4
- import withEditorProps from "../../withEditorProps";
5
- import { compose } from "recompose";
6
- import {
7
- EditAvailabilityItem,
8
- EditCircularityItem,
9
- EditReadOnlyItem
10
- } from "../../StatusBar";
11
-
12
- class GeneralProperties extends React.Component {
13
- updateSeqDesc = val => {
14
- return this.props.sequenceDescriptionUpdate(val);
15
- };
16
- render() {
17
- const {
18
- readOnly,
19
- showReadOnly = true,
20
- isProtein,
21
- disableSetReadOnly,
22
- sequenceData,
23
- onSave,
24
- showAvailability,
25
- beforeReadOnlyChange,
26
- editorName,
27
- disableBpEditing,
28
- sequenceNameUpdate
29
- } = this.props;
30
- const {
31
- description,
32
- name,
33
- isOligo,
34
- isRna,
35
- sequence = "",
36
- proteinSequence = ""
37
- } = sequenceData || {};
38
- return (
39
- <React.Fragment>
40
- <div className="ve-flex-row">
41
- <div className="ve-column-left bp3-label">Name</div>{" "}
42
- <div className="ve-column-right">
43
- <InputField
44
- disabled={readOnly}
45
- onFieldSubmit={val => {
46
- sequenceNameUpdate(val);
47
- }}
48
- name="name"
49
- enableReinitialize
50
- defaultValue={name}
51
- />{" "}
52
- </div>
53
- </div>
54
-
55
- {!isProtein && !isOligo && !isRna && (
56
- <div className="ve-flex-row circularLinearSelect">
57
- <div className="ve-column-left bp3-label">Circular/Linear</div>{" "}
58
- <div className="ve-column-right">
59
- {" "}
60
- <EditCircularityItem editorName={editorName} showCircularity />
61
- </div>
62
- </div>
63
- )}
64
-
65
- {showAvailability && (
66
- <div className="ve-flex-row">
67
- <div className="ve-column-left bp3-label">
68
- Material Availability
69
- </div>{" "}
70
- <div className="ve-column-right">
71
- {" "}
72
- <EditAvailabilityItem editorName={editorName} showAvailability />
73
- </div>
74
- </div>
75
- )}
76
- <div className="ve-flex-row">
77
- <div className="ve-column-left bp3-label">Length</div>{" "}
78
- <div className="ve-column-right">
79
- {" "}
80
- {isProtein ? proteinSequence.length : sequence.length}
81
- </div>
82
- </div>
83
- {showReadOnly && (
84
- <div className="ve-flex-row">
85
- <div className="ve-column-left bp3-label">Is Editable</div>{" "}
86
- <div className="ve-column-right">
87
- {" "}
88
- <EditReadOnlyItem
89
- beforeReadOnlyChange={beforeReadOnlyChange}
90
- editorName={editorName}
91
- onSave={onSave}
92
- disableBpEditing={disableBpEditing}
93
- disableSetReadOnly={disableSetReadOnly}
94
- showReadOnly={showReadOnly}
95
- />
96
- </div>
97
- </div>
98
- )}
99
- <div>Description</div>
100
- <TextareaField
101
- clickToEdit
102
- name="description"
103
- onFieldSubmit={this.updateSeqDesc}
104
- defaultValue={description}
105
- disabled={readOnly}
106
- />
107
- </React.Fragment>
108
- );
109
- }
110
- }
111
-
112
- export default compose(
113
- withEditorProps,
114
- reduxForm({
115
- form: "GeneralProperties"
116
- })
117
- )(GeneralProperties);