@teselagen/ove 0.7.28 → 0.7.29

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 (285) hide show
  1. package/index.cjs.js +1055 -996
  2. package/index.es.js +1055 -996
  3. package/index.umd.js +189036 -0
  4. package/ove.css +1 -1
  5. package/package.json +2 -6
  6. package/src/helperComponents/PropertiesDialog/TranslationProperties.js +1 -1
  7. package/AASliver.js +0 -187
  8. package/AddLaddersDialog.js +0 -82
  9. package/AdditionalCutsiteInfoDialog.js +0 -599
  10. package/AlignmentVisibilityTool.js +0 -105
  11. package/AnnotationContainerHolder.js +0 -20
  12. package/AnnotationPositioner.js +0 -27
  13. package/AutoAnnotate.js +0 -501
  14. package/AutoAnnotateBpMatchingDialog.js +0 -208
  15. package/Axis.js +0 -151
  16. package/AxisNumbers.js +0 -35
  17. package/Browser.js +0 -106
  18. package/Caret.js +0 -63
  19. package/Chromatogram.js +0 -293
  20. package/CircularDnaSequence.js +0 -73
  21. package/CircularZoomMinimap.js +0 -16
  22. package/ColorPicker.js +0 -30
  23. package/CommandHotkeyHandler.js +0 -44
  24. package/CreateAnnotationsPage.js +0 -98
  25. package/Cutsite.js +0 -18
  26. package/CutsiteProperties.js +0 -176
  27. package/CutsiteSelectionLayers.js +0 -47
  28. package/Cutsites.js +0 -271
  29. package/DeletionLayer.js +0 -28
  30. package/DropHandler.css +0 -21
  31. package/DropHandler.js +0 -64
  32. package/EditCaretPosition.js +0 -234
  33. package/EditTrackNameDialog.js +0 -30
  34. package/Feature.js +0 -83
  35. package/FeatureProperties.js +0 -6
  36. package/FillWindow.js +0 -47
  37. package/GenbankView.js +0 -74
  38. package/GeneralProperties.js +0 -117
  39. package/GenericAnnotationProperties.js +0 -406
  40. package/GlobalDialog.js +0 -73
  41. package/GlobalDialogUtils.js +0 -110
  42. package/GoToDialog.js +0 -25
  43. package/HorizontalPanelDragHandle.js +0 -35
  44. package/Keyboard.js +0 -85
  45. package/Labels.js +0 -327
  46. package/Ladder.css +0 -20
  47. package/Ladder.js +0 -303
  48. package/MeltingTemp.js +0 -85
  49. package/Menlo.ttf +0 -0
  50. package/Minimap.js +0 -515
  51. package/Mismatches.js +0 -134
  52. package/Monaco.ttf +0 -0
  53. package/MultipleSeqsDetectedOnImportDialog.js +0 -74
  54. package/Orf.js +0 -109
  55. package/OrfProperties.js +0 -117
  56. package/Orfs.js +0 -35
  57. package/PCRTool.js +0 -179
  58. package/PairwiseAlignmentView.js +0 -68
  59. package/Part.js +0 -34
  60. package/PartProperties.js +0 -9
  61. package/PassThrough.js +0 -3
  62. package/PerformantSelectionLayer.js +0 -32
  63. package/PinchHelper.js +0 -24
  64. package/PointedAnnotation.js +0 -347
  65. package/PositionAnnotationOnCircle.js +0 -26
  66. package/Primer.js +0 -41
  67. package/PrimerProperties.js +0 -19
  68. package/ReflexContainer.js +0 -802
  69. package/ReflexElement.js +0 -160
  70. package/ReflexEvents.js +0 -77
  71. package/ReflexSplitter.js +0 -205
  72. package/RenameSequenceDialog.js +0 -7
  73. package/RotateCircularViewSlider.js +0 -93
  74. package/SelectDialog.js +0 -150
  75. package/SequenceName.js +0 -15
  76. package/SimpleCircularOrLinearView.js +0 -381
  77. package/SimpleOligoPreview.js +0 -39
  78. package/SingleEnzymeCutsiteInfo.js +0 -139
  79. package/ToolbarItem.js +0 -192
  80. package/Translation.js +0 -198
  81. package/TranslationProperties.js +0 -149
  82. package/UncontrolledSliderWithPlusMinusBtns.css +0 -5
  83. package/UncontrolledSliderWithPlusMinusBtns.js +0 -134
  84. package/VeTopRightContainer.js +0 -12
  85. package/ZoomCircularViewSlider.js +0 -62
  86. package/ZoomLinearView.js +0 -47
  87. package/addAlignment.js +0 -6
  88. package/addMetaToActionCreators.js +0 -12
  89. package/addWrappedAddons.js +0 -20
  90. package/alignmentTool.js +0 -503
  91. package/alignments.js +0 -379
  92. package/annotationLabelVisibility.js +0 -2
  93. package/annotationSearchSelector.js +0 -24
  94. package/annotationTypes.js +0 -35
  95. package/annotationVisibility.js +0 -196
  96. package/annotationsToSupport.js +0 -104
  97. package/arrayToObjWithIds.js +0 -17
  98. package/arrayUtils.js +0 -19
  99. package/array_move.js +0 -10
  100. package/calculateTickMarkPositionsForGivenRange.js +0 -47
  101. package/caretPosition.js +0 -27
  102. package/cdsFeaturesSelector.js +0 -9
  103. package/charWidth.js +0 -22
  104. package/circular.js +0 -19
  105. package/circularSelector.js +0 -4
  106. package/clickAndDragUtils.js +0 -576
  107. package/coerceInitialValue.js +0 -7
  108. package/combineReducersDontIgnoreKeys.js +0 -12
  109. package/commandUtils.js +0 -20
  110. package/constants.js +0 -2
  111. package/copyOptions.js +0 -34
  112. package/createFragmentLines.js +0 -120
  113. package/createMergedDefaultStateReducer.js +0 -30
  114. package/createMetaAction.js +0 -12
  115. package/createSequenceInputPopup.js +0 -290
  116. package/createSequenceInputPopupStyle.css +0 -87
  117. package/createSimpleDialog.js +0 -89
  118. package/createYourOwnEnzyme.js +0 -39
  119. package/cutsiteLabelColorSelector.js +0 -6
  120. package/cutsiteTool.js +0 -88
  121. package/cutsitesByRangeSelector.js +0 -5
  122. package/cutsitesSelector.js +0 -61
  123. package/darkmode.css +0 -98
  124. package/defaultConfig.js +0 -150
  125. package/deletionLayers.js +0 -36
  126. package/description.js +0 -21
  127. package/digestTool.js +0 -34
  128. package/dnaToColor.js +0 -17
  129. package/downloadTool.js +0 -39
  130. package/draggableClassnames.js +0 -5
  131. package/drawAnnotations.js +0 -440
  132. package/drawDirectedPiePiece.js +0 -142
  133. package/editTool.js +0 -49
  134. package/editorSelector.js +0 -2
  135. package/editorUtils.js +0 -205
  136. package/estimateRowHeight.js +0 -184
  137. package/featureLengthsToHide.js +0 -27
  138. package/featureTool.js +0 -34
  139. package/features.js +0 -19
  140. package/featuresSelector.js +0 -8
  141. package/filteredCutsitesSelector.js +0 -136
  142. package/filteredFeaturesSelector.js +0 -32
  143. package/filteredPartsSelector.js +0 -57
  144. package/filteredPrimersSelector.js +0 -27
  145. package/filteredRestrictionEnzymesSelector.js +0 -1
  146. package/find.png +0 -0
  147. package/findTool.js +0 -79
  148. package/findToolConstants.js +0 -1
  149. package/frameTranslations.js +0 -52
  150. package/fullscreen.png +0 -0
  151. package/getAdditionalEnzymesSelector.js +0 -46
  152. package/getAngleForPositionMidpoint.js +0 -3
  153. package/getAnnotationClassnames.js +0 -12
  154. package/getAnnotationNameAndStartStopString.js +0 -61
  155. package/getBpsPerRow.js +0 -19
  156. package/getCutsiteLabelHeights.js +0 -56
  157. package/getGapMap.js +0 -12
  158. package/getGaps.js +0 -27
  159. package/getInternalLabel.js +0 -40
  160. package/getOveHotkeyDefs.js +0 -12
  161. package/getPairwiseOverviewLinearViewOptions.js +0 -38
  162. package/getRangeAnglesSpecial.js +0 -12
  163. package/getStructuredBases.js +0 -97
  164. package/getTrackFromEvent.js +0 -25
  165. package/getVisibleStartEnd.js +0 -7
  166. package/getXStartAndWidthFromNonCircularRange.js +0 -12
  167. package/getXStartAndWidthOfRangeWrtRow.js +0 -27
  168. package/getXStartAndWidthOfRowAnnotation.js +0 -19
  169. package/getYOffset.js +0 -15
  170. package/hoveredAnnotation.js +0 -24
  171. package/importTool.js +0 -27
  172. package/index.js +0 -71
  173. package/inlineFindTool.js +0 -38
  174. package/isElementInViewport.js +0 -29
  175. package/isEnzymeFilterAndSelector.js +0 -1
  176. package/isTargetWithinEl.js +0 -6
  177. package/labelLineIntensity.js +0 -25
  178. package/labelSize.js +0 -23
  179. package/ladderDefaults.js +0 -25
  180. package/lastSavedId.js +0 -20
  181. package/lineageLines.js +0 -11
  182. package/linear.png +0 -0
  183. package/makeStore.js +0 -34
  184. package/massageTickSpacing.js +0 -19
  185. package/materiallyAvailable.js +0 -19
  186. package/middleware.js +0 -112
  187. package/minimumOrfSize.js +0 -24
  188. package/minimumOrfSizeSelector.js +0 -2
  189. package/modalActions.js +0 -3
  190. package/moveCaret.js +0 -58
  191. package/name.js +0 -19
  192. package/normalizeAngle.js +0 -3
  193. package/normalizeAngleRange.js +0 -9
  194. package/oligoTool.js +0 -30
  195. package/onlyUpdateForKeysDeep.js +0 -31
  196. package/orfFrameToColorMap.js +0 -10
  197. package/orfTool.js +0 -136
  198. package/orfsSelector.js +0 -15
  199. package/panelsShown.js +0 -294
  200. package/partLengthsToHide.js +0 -23
  201. package/partOverhangs.js +0 -6
  202. package/partTagSearch.js +0 -69
  203. package/partTool.js +0 -45
  204. package/parts.js +0 -19
  205. package/partsSelector.js +0 -8
  206. package/pie.png +0 -0
  207. package/polarToSpecialCartesian.js +0 -7
  208. package/positionCutsites.js +0 -6
  209. package/prepareRowData.js +0 -64
  210. package/primerBases.js +0 -221
  211. package/primerLengthsToHide.js +0 -27
  212. package/primers.js +0 -19
  213. package/primersSelector.js +0 -8
  214. package/print.png +0 -0
  215. package/printTool.js +0 -31
  216. package/propertiesTool.js +0 -40
  217. package/proteinUtils.js +0 -3
  218. package/pureNoFunc.js +0 -18
  219. package/readOnly.js +0 -25
  220. package/redoTool.js +0 -30
  221. package/reflex-styles.css +0 -128
  222. package/reflex-styles.css.map +0 -9
  223. package/relaxLabelAngles.js +0 -157
  224. package/relaxLabels_DEPRECATED.js +0 -105
  225. package/replacementLayers.js +0 -36
  226. package/restrictionEnzymes.js +0 -52
  227. package/restrictionEnzymesSelector.js +0 -34
  228. package/rowviewContants.js +0 -3
  229. package/ruler.css +0 -89
  230. package/save.png +0 -0
  231. package/saveTool.js +0 -44
  232. package/searchLayersSelector.js +0 -71
  233. package/selectedAnnotations.js +0 -89
  234. package/selectedAnnotationsSelector.js +0 -1
  235. package/selectedCutsitesSelector.js +0 -21
  236. package/selectedPartTags.js +0 -21
  237. package/selectionLayer.js +0 -25
  238. package/sequence.js +0 -12
  239. package/sequenceDataHistory.js +0 -43
  240. package/sequenceDataSelector.js +0 -2
  241. package/sequenceLengthSelector.js +0 -5
  242. package/sequenceSelector.js +0 -4
  243. package/sharedActionCreators.js +0 -0
  244. package/shouldFlipText.js +0 -4
  245. package/shouldRerender.js +0 -27
  246. package/showFileDialog.js +0 -25
  247. package/showGCContent.js +0 -23
  248. package/show_cut_sites.png +0 -0
  249. package/show_features.png +0 -0
  250. package/show_orfs.png +0 -0
  251. package/show_primers.png +0 -0
  252. package/simpleDialog.css +0 -13
  253. package/specialCutsiteFilterOptions.js +0 -22
  254. package/style.css +0 -10
  255. package/tagsToBoldSelector.js +0 -2
  256. package/toggle_views.svg +0 -1
  257. package/toolBar.js +0 -23
  258. package/translationSearchMatchesSelector.js +0 -14
  259. package/translations.js +0 -20
  260. package/translationsRawSelector.js +0 -8
  261. package/translationsSelector.js +0 -137
  262. package/typeField.js +0 -24
  263. package/undoTool.js +0 -30
  264. package/updateEditor.js +0 -200
  265. package/updateLabelsForInViewFeatures.js +0 -55
  266. package/updateLabelsForInViewFeaturesCircView.js +0 -41
  267. package/updateTrackHelper.js +0 -58
  268. package/uppercaseSequenceMapFont.js +0 -25
  269. package/upsertDeleteActionGenerator.js +0 -31
  270. package/useAAColorType.js +0 -8
  271. package/useAdditionalOrfStartCodons.js +0 -24
  272. package/useAnnotationLimits.js +0 -42
  273. package/useChromatogramPrefs.js +0 -31
  274. package/useFormValue.js +0 -7
  275. package/useLadders.js +0 -6
  276. package/useMeltingTemp.js +0 -7
  277. package/useTmType.js +0 -10
  278. package/userDefinedHandlersAndOpts.js +0 -61
  279. package/utils.js +0 -37
  280. package/versionHistory.js +0 -26
  281. package/versionHistoryTool.js +0 -21
  282. package/viewSubmenu.js +0 -479
  283. package/visibilityTool.js +0 -39
  284. package/withHover.js +0 -113
  285. 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);