@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
package/typeField.js DELETED
@@ -1,24 +0,0 @@
1
- import React from "react";
2
- import { getFeatureToColorMap } from "@teselagen/sequence-utils";
3
-
4
- export const typeField = {
5
- path: "type",
6
- type: "string",
7
- render: (name, { color }) => {
8
- const colorToUse =
9
- color || getFeatureToColorMap({ includeHidden: true })[name];
10
- return (
11
- <div style={{ display: "flex", alignItems: "center" }}>
12
- <div
13
- style={{
14
- height: 20,
15
- width: 20,
16
- background: colorToUse,
17
- marginRight: 3
18
- }}
19
- />
20
- {name}
21
- </div>
22
- );
23
- }
24
- };
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
- ];