@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
package/undoTool.js DELETED
@@ -1,30 +0,0 @@
1
- import React from "react";
2
- import { Icon } from "@blueprintjs/core";
3
- import ToolbarItem from "./ToolbarItem";
4
- import { connectToEditor } from "../withEditorProps";
5
-
6
- export default connectToEditor(editorState => {
7
- return {
8
- disabled: !(
9
- editorState.sequenceDataHistory &&
10
- editorState.sequenceDataHistory.past &&
11
- editorState.sequenceDataHistory.past.length
12
- )
13
- };
14
- })(({ toolbarItemProps, undo, disabled }) => {
15
- return (
16
- <ToolbarItem
17
- {...{
18
- Icon: <Icon data-test="veUndoTool" icon="undo" />,
19
- disabled,
20
- onIconClick: undo,
21
- tooltip: (
22
- <span>
23
- Undo <span style={{ fontSize: 10 }}>(Cmd/Ctrl+Z)</span>
24
- </span>
25
- ),
26
- ...toolbarItemProps
27
- }}
28
- />
29
- );
30
- });
package/updateEditor.js DELETED
@@ -1,200 +0,0 @@
1
- import { set } from "lodash-es";
2
- import { tidyUpSequenceData } from "@teselagen/sequence-utils";
3
- import { annotationTypes } from "@teselagen/sequence-utils";
4
-
5
- export default function updateEditor(
6
- store,
7
- editorName,
8
- initialValues = {},
9
- extraMeta = {},
10
- { convertAnnotationsFromAAIndices } = {}
11
- ) {
12
- const {
13
- sequenceData,
14
- annotationVisibility,
15
- annotationsToSupport,
16
- findTool,
17
- justPassingPartialSeqData
18
- } = initialValues;
19
- const currentEditor = store.getState().VectorEditor[editorName] || {};
20
- const isAlreadyProteinEditor =
21
- currentEditor.sequenceData && currentEditor.sequenceData.isProtein;
22
- const isAlreadyRnaEditor =
23
- currentEditor.sequenceData && currentEditor.sequenceData.isRna;
24
- const isAlreadyOligoEditor =
25
- currentEditor.sequenceData && currentEditor.sequenceData.isOligo;
26
- const reverseSequenceShouldBeUpdate =
27
- currentEditor.sequenceData?.isSingleStrandedDNA !==
28
- sequenceData?.isSingleStrandedDNA ||
29
- currentEditor.sequenceData?.isDoubleStrandedRNA !==
30
- sequenceData?.isDoubleStrandedRNA;
31
-
32
- const isAlreadySpecialEditor =
33
- isAlreadyProteinEditor ||
34
- isAlreadyRnaEditor ||
35
- isAlreadyOligoEditor ||
36
- reverseSequenceShouldBeUpdate;
37
-
38
- let toSpread = {};
39
- let payload;
40
- if (justPassingPartialSeqData) {
41
- payload = {
42
- sequenceData: tidyUpSequenceData(
43
- { ...currentEditor.sequenceData, ...sequenceData },
44
- {
45
- convertAnnotationsFromAAIndices,
46
- //if we have sequence data coming in make sure to tidy it up for the user :)
47
- annotationsAsObjects: true
48
- }
49
- )
50
- };
51
- } else {
52
- if (sequenceData) {
53
- const isDna =
54
- !sequenceData.isOligo && !sequenceData.isRna && !sequenceData.isProtein;
55
- if (sequenceData.isProtein && !isAlreadyProteinEditor) {
56
- //we're editing a protein but haven't initialized the protein editor yet
57
- toSpread = {
58
- findTool: {
59
- dnaOrAA: "AA",
60
- ...findTool //we spread this here to allow the user to override this .. if they must!
61
- },
62
-
63
- annotationVisibility: {
64
- caret: true,
65
- sequence: false,
66
- reverseSequence: false,
67
- cutsites: false,
68
- translations: false,
69
- aminoAcidNumbers: false,
70
- primaryProteinSequence: true,
71
- ...annotationVisibility //we spread this here to allow the user to override this .. if they must!
72
- },
73
- annotationsToSupport: {
74
- features: true,
75
- translations: false,
76
- primaryProteinSequence: true,
77
- parts: true,
78
- orfs: false,
79
- cutsites: false,
80
- primers: false,
81
- ...annotationsToSupport
82
- }
83
- };
84
- } else if (sequenceData.isOligo && !isAlreadyOligoEditor) {
85
- toSpread = {
86
- findTool: {
87
- dnaOrAA: "DNA",
88
- ...findTool //we spread this here to allow the user to override this .. if they must!
89
- },
90
- annotationVisibility: {
91
- caret: true,
92
- sequence: true,
93
- cutsites: false,
94
- reverseSequence: false,
95
- translations: false,
96
- aminoAcidNumbers: false,
97
- primaryProteinSequence: false,
98
- ...annotationVisibility //we spread this here to allow the user to override this .. if they must!
99
- },
100
- annotationsToSupport: {
101
- features: true,
102
- translations: true,
103
- primaryProteinSequence: false,
104
- parts: true,
105
- orfs: false,
106
- cutsites: true,
107
- primers: false,
108
- ...annotationsToSupport //we spread this here to allow the user to override this .. if they must!
109
- }
110
- };
111
- } else if (sequenceData.isRna && !isAlreadyRnaEditor) {
112
- toSpread = {
113
- findTool: {
114
- dnaOrAA: "DNA",
115
- ...findTool //we spread this here to allow the user to override this .. if they must!
116
- },
117
- annotationVisibility: {
118
- caret: true,
119
- sequence: true,
120
- cutsites: false,
121
- reverseSequence: Boolean(sequenceData?.isDoubleStrandedRNA),
122
- translations: false,
123
- aminoAcidNumbers: false,
124
- primaryProteinSequence: false,
125
- ...annotationVisibility //we spread this here to allow the user to override this .. if they must!
126
- },
127
- annotationsToSupport: {
128
- features: true,
129
- translations: true,
130
- primaryProteinSequence: false,
131
- parts: true,
132
- orfs: true,
133
- cutsites: true,
134
- primers: true,
135
- ...annotationsToSupport //we spread this here to allow the user to override this .. if they must!
136
- }
137
- };
138
- } else if (isAlreadySpecialEditor && isDna) {
139
- //we're editing dna but haven't initialized the dna editor yet
140
- sequenceData.isProtein = false;
141
- toSpread = {
142
- findTool: {
143
- dnaOrAA: "DNA",
144
- ...findTool //we spread this here to allow the user to override this .. if they must!
145
- },
146
- annotationVisibility: {
147
- caret: true,
148
- sequence: true,
149
- reverseSequence: !sequenceData?.isSingleStrandedDNA,
150
- translations: false,
151
- aminoAcidNumbers: false,
152
- primaryProteinSequence: false,
153
- ...annotationVisibility //we spread this here to allow the user to override this .. if they must!
154
- },
155
- annotationsToSupport: {
156
- features: true,
157
- translations: true,
158
- primaryProteinSequence: false,
159
- parts: true,
160
- orfs: true,
161
- cutsites: true,
162
- primers: true,
163
- ...annotationsToSupport //we spread this here to allow the user to override this .. if they must!
164
- }
165
- };
166
- }
167
- }
168
- payload = {
169
- ...initialValues,
170
- ...toSpread,
171
- ...(sequenceData && {
172
- sequenceData: tidyUpSequenceData(sequenceData, {
173
- convertAnnotationsFromAAIndices,
174
- //if we have sequence data coming in make sure to tidy it up for the user :)
175
- annotationsAsObjects: true
176
- })
177
- })
178
- };
179
- }
180
- annotationTypes.forEach(t => {
181
- if (Object.keys(sequenceData?.[t] || {}).length > 100) {
182
- set(payload, `annotationLabelVisibility.${t}`, false);
183
- }
184
- });
185
- if (sequenceData && sequenceData.size > 20000) {
186
- set(payload, "annotationVisibility.translations", false);
187
- set(payload, "annotationVisibility.cutsites", false);
188
- }
189
-
190
- store.dispatch({
191
- type: "VECTOR_EDITOR_UPDATE",
192
- payload,
193
- meta: {
194
- mergeStateDeep: true,
195
- editorName,
196
- disregardUndo: true,
197
- ...extraMeta
198
- }
199
- });
200
- }
@@ -1,55 +0,0 @@
1
- import {
2
- isElWithinAnotherEl,
3
- isElWithinAnotherElWithDiff
4
- } from "../withEditorInteractions/isElementInViewport";
5
-
6
- export function updateLabelsForInViewFeatures({
7
- rectElement = ".veLinearView"
8
- } = {}) {
9
- const feats = Array.from(
10
- document.querySelectorAll(`.veLinearView .veRowViewFeature`)
11
- );
12
- const parts = Array.from(
13
- document.querySelectorAll(`.veLinearView .veRowViewPart`)
14
- );
15
- const primers = Array.from(
16
- document.querySelectorAll(`.veLinearView .veRowViewPrimer`)
17
- );
18
- const els = [...feats, ...parts, ...primers];
19
- const boundingRect = document
20
- .querySelector(rectElement)
21
- .getBoundingClientRect();
22
-
23
- els.forEach(el => {
24
- const elBounds = el.getBoundingClientRect();
25
- const isElIn = isElWithinAnotherEl(elBounds, boundingRect);
26
-
27
- if (isElIn) {
28
- const label = el.querySelector(".veLabelText");
29
- if (!label) return;
30
- const labelBounds = label.getBoundingClientRect();
31
- const [isLabelIn, diff] = isElWithinAnotherElWithDiff(labelBounds, {
32
- left: Math.max(boundingRect.left, elBounds.left),
33
- right: Math.min(boundingRect.right, elBounds.right)
34
- });
35
- if (!isLabelIn) {
36
- const l = window.getComputedStyle(label, null),
37
- t = l.getPropertyValue("transform");
38
-
39
- // If t return other than "none"
40
- // Split content into several value
41
- // The fourth one is the translateX value
42
-
43
- if (t !== "none") {
44
- const v = t.split("(")[1],
45
- // w = v.split(")")[0],
46
- x = v.split(",");
47
-
48
- const newX = Number(x[4]) + diff;
49
- const newY = Number(x[5].replace(")", ""));
50
- label.setAttribute("transform", `translate(${newX},${newY})`);
51
- }
52
- }
53
- }
54
- });
55
- }
@@ -1,41 +0,0 @@
1
- // import {
2
- // isElWithinAnotherEl,
3
- // isElWithinAnotherElWithDiff
4
- // } from "../withEditorInteractions/isElementInViewport";
5
-
6
- // export function updateLabelsForInViewFeaturesCircView({
7
- // rectElement = ".veCircularView",
8
- // radius
9
- // } = {}) {
10
- // const feats = Array.from(
11
- // document.querySelectorAll(`.veCircularView .veFeature`)
12
- // );
13
- // // const parts = Array.from(
14
- // // document.querySelectorAll(`.veCircularView .vePart`)
15
- // // );
16
- // // const primers = Array.from(
17
- // // document.querySelectorAll(`.veCircularView .vePrimer`)
18
- // // );
19
- // const els = [...feats];
20
- // // const els = [...feats, ...parts, ...primers];
21
- // const boundingRect = document
22
- // .querySelector(rectElement)
23
- // .getBoundingClientRect();
24
- // els.forEach((el) => {
25
- // // const elBounds = el.getBoundingClientRect();
26
- // // const isElIn = isElWithinAnotherEl(elBounds, boundingRect);
27
- // const label = el.querySelector(".veLabelText");
28
- // if (!label) return;
29
- // const labelBounds = label.getBoundingClientRect();
30
- // const [isLabelIn, diff] = isElWithinAnotherElWithDiff(labelBounds, {
31
- // left: Math.max(boundingRect.left, 0 /* elBounds.left */),
32
- // right: Math.min(boundingRect.right, 0 /* elBounds.right */)
33
- // });
34
- // if (!isLabelIn) {
35
- // label.setAttribute("transform", `rotate(-40)`);
36
- // }
37
- // // if (isElIn) {
38
-
39
- // // }
40
- // });
41
- // }
@@ -1,58 +0,0 @@
1
- import { insertItem, removeItem } from "../utils/arrayUtils";
2
-
3
- export function updateTrackHelper({
4
- currentPairwiseAlignmentIndex,
5
- pairwiseAlignments,
6
- upsertAlignmentRun,
7
- hasBeenTrimmed,
8
- alignmentId,
9
- alignmentTracks,
10
- alignmentTrackIndex,
11
- update
12
- }) {
13
- const updateATs = (atsToUse, alignmentTrackIndex) => {
14
- const removed = removeItem(atsToUse, alignmentTrackIndex);
15
- return insertItem(
16
- removed,
17
- {
18
- ...atsToUse[alignmentTrackIndex],
19
- alignmentData: {
20
- ...atsToUse[alignmentTrackIndex].alignmentData,
21
- ...update
22
- },
23
- sequenceData: {
24
- ...atsToUse[alignmentTrackIndex].sequenceData,
25
- ...update
26
- }
27
- },
28
- alignmentTrackIndex
29
- );
30
- };
31
-
32
- upsertAlignmentRun({
33
- id: alignmentId,
34
- hasBeenTrimmed,
35
- ...(pairwiseAlignments
36
- ? {
37
- pairwiseAlignments: pairwiseAlignments.map((ats, i) => {
38
- if (alignmentTrackIndex === 0) {
39
- return updateATs(ats, 0);
40
- }
41
- if (
42
- currentPairwiseAlignmentIndex !== undefined
43
- ? currentPairwiseAlignmentIndex === i
44
- : alignmentTrackIndex - 1 === i
45
- ) {
46
- return updateATs(ats, 1);
47
- }
48
- return ats;
49
- })
50
- }
51
- : {
52
- alignmentTracks: updateATs(
53
- alignmentTracks,
54
- Number(alignmentTrackIndex)
55
- )
56
- })
57
- });
58
- }
@@ -1,25 +0,0 @@
1
- import { createReducer } from "redux-act";
2
-
3
- //./caretPosition.js
4
- import createAction from "./utils/createMetaAction";
5
- // import createReducer from "./utils/createMergedDefaultStateReducer";
6
-
7
- // ------------------------------------
8
- // Actions
9
- // ------------------------------------
10
- export const updateSequenceCase = createAction("updateSequenceCase");
11
-
12
- const newVal = window.localStorage.getItem("uppercaseSequenceMapFont");
13
-
14
- // ------------------------------------
15
- // Reducer
16
- // ------------------------------------
17
- export default createReducer(
18
- {
19
- [updateSequenceCase]: (state, payload) => {
20
- localStorage.setItem("uppercaseSequenceMapFont", payload);
21
- return payload;
22
- }
23
- },
24
- newVal || "noPreference" // noPreference || uppercase || lowercase
25
- );
@@ -1,31 +0,0 @@
1
- import omit from "lodash/omit";
2
- import uuid from "shortid";
3
-
4
- // ------------------------------------
5
- // Reducer
6
- // ------------------------------------
7
- export default function upsertDeleteActionGenerator(
8
- upsertAction,
9
- deleteAction
10
- ) {
11
- return {
12
- [upsertAction]: (state, payload) => {
13
- const idToUse = payload.id || uuid();
14
- return {
15
- ...state,
16
- [idToUse]: { ...(state[idToUse] || {}), ...payload, id: idToUse }
17
- };
18
- },
19
- [deleteAction]: (state, payload) => {
20
- let ids;
21
- if (Array.isArray(payload)) {
22
- ids = payload.map(val => {
23
- return val.id || val;
24
- });
25
- } else {
26
- ids = [payload.id || payload];
27
- }
28
- return omit(state, ids);
29
- }
30
- };
31
- }
package/useAAColorType.js DELETED
@@ -1,8 +0,0 @@
1
- import tgUseLocalStorageState from "tg-use-local-storage-state";
2
-
3
- const useAAColorType = () =>
4
- tgUseLocalStorageState("aaColorType", {
5
- isSimpleString: true,
6
- defaultValue: "byHydrophobicity"
7
- });
8
- export default useAAColorType;
@@ -1,24 +0,0 @@
1
- //./caretPosition.js
2
- import { createReducer } from "redux-act";
3
- import createAction from "./utils/createMetaAction";
4
- import { noop } from "lodash-es";
5
-
6
- // ------------------------------------
7
- // Actions
8
- // ------------------------------------
9
- export const useAdditionalOrfStartCodonsToggle = createAction(
10
- "useAdditionalOrfStartCodonsToggle",
11
- noop
12
- );
13
-
14
- // ------------------------------------
15
- // Reducer
16
- // ------------------------------------
17
- export default createReducer(
18
- {
19
- [useAdditionalOrfStartCodonsToggle]: state => {
20
- return !state;
21
- }
22
- },
23
- false
24
- );
@@ -1,42 +0,0 @@
1
- import React from "react";
2
- import { MenuItem } from "@blueprintjs/core";
3
- import tgUseLocalStorageState from "tg-use-local-storage-state";
4
-
5
- const useAnnotationLimits = () =>
6
- tgUseLocalStorageState("annotationLimits", {
7
- defaultValue: {
8
- features: 50,
9
- parts: 50,
10
- primers: 50,
11
- warnings: 50,
12
- assemblyPieces: 50,
13
- lineageAnnotations: 50,
14
- cutsites: 100
15
- }
16
- });
17
- export default useAnnotationLimits;
18
-
19
- export function LimitAnnotations({ type, ...rest }) {
20
- const [limits = {}, setLimits] = useAnnotationLimits();
21
- return (
22
- <MenuItem icon="blank" shouldDismissPopover={false} {...rest}>
23
- {[50, 100, 200, 400].map(n => (
24
- <MenuItem
25
- shouldDismissPopover={false}
26
- icon={
27
- (
28
- !limits[type]
29
- ? n === 50 //if this hasn't been set yet, default it here
30
- : limits[type] === n
31
- )
32
- ? "small-tick"
33
- : "blank"
34
- }
35
- key={n}
36
- text={n}
37
- onClick={() => setLimits({ ...limits, [type]: n })}
38
- ></MenuItem>
39
- ))}
40
- </MenuItem>
41
- );
42
- }
@@ -1,31 +0,0 @@
1
- import React from "react";
2
- import { MenuItem } from "@blueprintjs/core";
3
- import tgUseLocalStorageState from "tg-use-local-storage-state";
4
-
5
- const useShowChromQualScores = () => {
6
- return tgUseLocalStorageState("showChromQualScores", { defaultValue: true });
7
- };
8
-
9
- const ShowChromQualScoresMenu = () =>
10
- function ShowChromQualScoresMenu(props) {
11
- const [showChromQualScores, setShowChromQualScores] =
12
- useShowChromQualScores();
13
- return (
14
- <MenuItem
15
- {...props}
16
- text="Show Quality Scores"
17
- shouldDismissPopover={false}
18
- onClick={() => {
19
- setShowChromQualScores(!showChromQualScores);
20
- }}
21
- icon={showChromQualScores ? "small-tick" : "blank"}
22
- ></MenuItem>
23
- );
24
- };
25
- const chromatogramMenu = {
26
- text: "Chromatogram (Quality Scores)",
27
- cmd: "showChromQualScoresMenu",
28
- component: ShowChromQualScoresMenu(),
29
- shouldDismissPopover: false
30
- };
31
- export { chromatogramMenu, useShowChromQualScores };
package/useFormValue.js DELETED
@@ -1,7 +0,0 @@
1
- /* Copyright (C) 2018 TeselaGen Biotechnology, Inc. */
2
- import { useSelector } from "react-redux";
3
- import { get } from "lodash";
4
-
5
- export const useFormValue = (formName, field) => {
6
- return useSelector(state => get(state.form?.[formName]?.values, field));
7
- };
package/useLadders.js DELETED
@@ -1,6 +0,0 @@
1
- import tgUseLocalStorageState from "tg-use-local-storage-state";
2
-
3
- const useLadders = () => {
4
- return tgUseLocalStorageState("tg-additional-ladder", { defaultValue: [] });
5
- };
6
- export default useLadders;
package/useMeltingTemp.js DELETED
@@ -1,7 +0,0 @@
1
- import tgUseLocalStorageState from "tg-use-local-storage-state";
2
-
3
- const useMeltingTemp = () => {
4
- return tgUseLocalStorageState("showMeltingTemp");
5
- };
6
-
7
- export default useMeltingTemp;
package/useTmType.js DELETED
@@ -1,10 +0,0 @@
1
- import tgUseLocalStorageState from "tg-use-local-storage-state";
2
-
3
- const useTmType = () => {
4
- return tgUseLocalStorageState("tmType", {
5
- isSimpleString: true,
6
- defaultValue: "default"
7
- });
8
- };
9
-
10
- export default useTmType;
@@ -1,61 +0,0 @@
1
- export const userDefinedHandlersAndOpts = [
2
- "beforeReadOnlyChange",
3
- "defaultLinkedOligoMessage",
4
- "allowMultipleFeatureDirections",
5
- "getAdditionalEditAnnotationComps",
6
- "getAdditionalCreateOpts",
7
- "getLinkedOligoLink",
8
- "additionalTopRightToolbarButtons",
9
- "getCustomAutoAnnotateList",
10
- "allowPartsToOverlapSelf",
11
- "allowPrimerBasesToBeEdited",
12
- "truncateLabelsThatDoNotFit",
13
- "smartCircViewLabelRender",
14
- "onConfigureFeatureTypesClick",
15
- "allPartTags",
16
- "bpLimit",
17
- "editTagsLink",
18
- "readOnly",
19
- "shouldAutosave",
20
- "hideSingleImport",
21
- "beforeAnnotationCreate",
22
- "disableSetReadOnly",
23
- "allowAnnotationEditLocking",
24
- "disableBpEditing",
25
- "massageCmds",
26
- "showReadOnly",
27
- "showCircularity",
28
- "onHiddenEnzymeAdd",
29
- "showMoleculeType",
30
- "showAvailability",
31
- "showCicularViewInternalLabels",
32
- "showGCContentByDefault",
33
- "GCDecimalDigits",
34
- "onlyShowLabelsThatDoNotFit",
35
- "fullscreenMode",
36
- "maxAnnotationsToDisplay",
37
- "onNew",
38
- "onImport",
39
- "onSave",
40
- "onSaveAs",
41
- "alwaysAllowSave",
42
- "generatePng",
43
- "onRename",
44
- "getVersionList",
45
- "getSequenceAtVersion",
46
- "onDuplicate",
47
- "onSelectionOrCaretChanged",
48
- "beforeSequenceInsertOrDelete",
49
- "enzymeManageOverride",
50
- "enzymeGroupsOverride",
51
- "additionalEnzymes",
52
- "onDelete",
53
- "onCopy",
54
- "autoAnnotateFeatures",
55
- "autoAnnotateParts",
56
- "autoAnnotatePrimers",
57
- "onCreateNewFromSubsequence",
58
- "onPreviewModeFullscreenClose",
59
- "onPaste",
60
- "menuFilter"
61
- ];
package/utils.js DELETED
@@ -1,37 +0,0 @@
1
- import React from "react";
2
- import { convertDnaCaretPositionOrRangeToAA } from "@teselagen/sequence-utils";
3
- import { convertRangeTo1Based } from "@teselagen/range-utils";
4
-
5
- export const sizeSchema = isProtein => ({
6
- path: "size",
7
- type: "number",
8
- render: (val, _record) => {
9
- const record = isProtein
10
- ? convertDnaCaretPositionOrRangeToAA(_record)
11
- : _record;
12
- const base1Range = convertRangeTo1Based(record);
13
- const hasJoinedLocations = record.locations && record.locations.length > 1;
14
-
15
- return (
16
- <span>
17
- {isProtein ? Math.floor(val / 3) : val}{" "}
18
- <span style={{ fontSize: 10 }}>
19
- {hasJoinedLocations ? (
20
- record.locations.map((loc, i) => {
21
- const base1Range = convertRangeTo1Based(loc);
22
- return (
23
- <span key={i}>
24
- ({base1Range.start}-{base1Range.end})
25
- </span>
26
- );
27
- })
28
- ) : (
29
- <span>
30
- ({base1Range.start}-{base1Range.end})
31
- </span>
32
- )}
33
- </span>
34
- </span>
35
- );
36
- }
37
- });