@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,208 +0,0 @@
1
- /* Copyright (C) 2018 TeselaGen Biotechnology, Inc. */
2
-
3
- import { Tab, Tabs } from "@blueprintjs/core";
4
- import { wrapDialog } from "@teselagen/ui";
5
-
6
- const highlightStyle = {
7
- background: "red",
8
- marginTop: 2
9
- };
10
- export const AutoAnnotateBpMatchingDialog = wrapDialog({
11
- title: "Annotation Matching"
12
- })(function ({ isRegex }) {
13
- return (
14
- <div className="bp3-dialog-body">
15
- <Tabs defaultSelectedTabId={isRegex ? "regex" : "iupac"}>
16
- <Tab
17
- id="iupac"
18
- title="IUPAC"
19
- panel={
20
- <div>
21
- <p>
22
- When in standard (IUPAC) mode, annotations are matched
23
- case-insensitively. You can use any degenerate IUPAC base pair
24
- as well as a couple special characters.
25
- </p>
26
- <h4>Special Characters:</h4>
27
- <div
28
- style={{
29
- display: "grid",
30
- columnGap: 20,
31
- gridTemplateColumns: "1fr 5fr",
32
- maxHeight: 200,
33
- overflow: "auto"
34
- }}
35
- >
36
- <div>#</div>
37
- <div>
38
- Any arbitrary string of zero or more bases can be matched
39
- here.
40
- </div>
41
- <div>{"<"}</div>
42
- <div>Any bases before a {"<"} are considered optional</div>
43
- <div>{">"}</div>
44
- <div>Any bases after a {">"} are considered optional</div>
45
- <div>M</div> <div>AC</div>
46
- <div>R</div> <div>AG</div>
47
- <div>W</div> <div>AT</div>
48
- <div>S</div> <div>CG</div>
49
- <div>Y</div> <div>CT</div>
50
- <div>K</div> <div>GT</div>
51
- <div>V</div> <div>ACG</div>
52
- <div>H</div> <div>ACT</div>
53
- <div>D</div> <div>AGT</div>
54
- <div>B</div> <div>CGT</div>
55
- <div>X</div> <div>GATC</div>
56
- <div>N</div> <div>GATC</div>
57
- <div>.</div> <div>GATC</div>
58
- </div>
59
- <br></br>
60
- <h4>Examples:</h4>
61
- <div
62
- style={{
63
- display: "grid",
64
- columnGap: 20,
65
- gridTemplateColumns: "2fr 5fr"
66
- }}
67
- >
68
- <h6>Annotation</h6>
69
- <h6>
70
- Sequence (matches in <span style={highlightStyle}>red</span>)
71
- </h6>
72
- <div>AATT</div>
73
- <div>
74
- AA<span style={highlightStyle}>AATT</span>TTGGGGGCCCCCAAGT
75
- </div>
76
- <div>aAkT</div>
77
- <div>
78
- AA<span style={highlightStyle}>AATT</span>TTGGGGGCCCCC
79
- <span style={highlightStyle}>AAGT</span>
80
- </div>
81
- <div>ANT</div>
82
- <div>
83
- AA<span style={highlightStyle}>AAT</span>TTTGGGGGCCCCCA
84
- <span style={highlightStyle}>AGT</span>
85
- </div>
86
- <div>T#C</div>
87
- <div>
88
- AAAATTT<span style={highlightStyle}>TGGGGGC</span>CCCCAAGT
89
- </div>
90
- <div>CA{"<"}ATTT</div>
91
- <div>
92
- AA<span style={highlightStyle}>AATTT</span>TGGGGGCCCCCAAGT
93
- </div>
94
- <div>
95
- CA{"<"}ATT{">"}TTGAG
96
- </div>
97
- <div>
98
- AA<span style={highlightStyle}>AATTTTG</span>GGGGCCCCCAAGT
99
- </div>
100
- </div>
101
-
102
- <br></br>
103
- {/* <ConvertApeToRegexTool></ConvertApeToRegexTool> */}
104
- </div>
105
- }
106
- ></Tab>
107
- <Tab
108
- id="regex"
109
- title="Regex"
110
- panel={
111
- <div>
112
- <p>
113
- When in regex mode, you can use any custom regex to match base
114
- pairs
115
- </p>
116
- <p>
117
- You can learn more and try out your custom regexes at{" "}
118
- <a href="https://regex101.com/">https://regex101.com/</a>
119
- </p>
120
- <br></br>
121
- <h4>Examples:</h4>
122
- <div
123
- style={{
124
- display: "grid",
125
- columnGap: 20,
126
- gridTemplateColumns: "2fr 5fr"
127
- }}
128
- >
129
- <h6>Annotation</h6>
130
- <h6>
131
- Sequence (matches in <span style={highlightStyle}>red</span>)
132
- </h6>
133
- <div>AATT</div>
134
- <div>
135
- AA<span style={highlightStyle}>AATT</span>TTGGGGGCCCCCAAGT
136
- </div>
137
- <div>aAtT</div>
138
- <div>
139
- AA<span style={highlightStyle}>AATT</span>TTGGGGGCCCCCAAGT
140
- </div>
141
- <div>A.T</div>
142
- <div>
143
- AA<span style={highlightStyle}>AAT</span>TTTGGGGGCCCCCA
144
- <span style={highlightStyle}>AGT</span>
145
- </div>
146
- <div>T.*C</div>
147
- <div>
148
- AAAA<span style={highlightStyle}>TTTTGGGGGCCCCC</span>AAGT
149
- </div>
150
- <div>T[^T]*?C</div>
151
- <div>
152
- AAAATTT<span style={highlightStyle}>TGGGGGC</span>CCCCAAGT
153
- </div>
154
- <div>C?A?ATT</div>
155
- <div>
156
- AA<span style={highlightStyle}>AATTT</span>TGGGGGCCCCCAAGT
157
- </div>
158
- <div>C?A?ATTT?T?C?</div>
159
- <div>
160
- AA<span style={highlightStyle}>AATTTT</span>GGGGGCCCCCAAGT
161
- </div>
162
- </div>
163
- <br></br>
164
-
165
- {/* <ConvertApeToRegexTool></ConvertApeToRegexTool> */}
166
- </div>
167
- }
168
- ></Tab>
169
- </Tabs>
170
- </div>
171
- );
172
- });
173
-
174
- // function ConvertApeToRegexTool() {
175
- // const [inputVal, setInput] = useState("CA<ANT>TTGAG");
176
-
177
- // let convertedVal = "";
178
- // try {
179
- // convertedVal = convertApELikeRegexToRegex(inputVal);
180
- // } catch (error) {
181
- // convertedVal = "Error trying to convert to regex";
182
- // }
183
- // return (
184
- // <div
185
- // style={{
186
- // display: "grid",
187
- // rowGap: 10,
188
- // columnGap: 10,
189
- // gridTemplateColumns: "1fr 5fr"
190
- // }}
191
- // >
192
- // <div>Input:</div>
193
- // <TextArea
194
- // value={inputVal}
195
- // onChange={e => {
196
- // setInput(e.target.value.replace(/\s/g, "X"));
197
- // }}
198
- // ></TextArea>
199
-
200
- // <div>Output:</div>
201
- // <div
202
- // style={{ maxHeight: 200, overflowWrap: "anywhere", overflow: "auto" }}
203
- // >
204
- // {convertedVal}
205
- // </div>
206
- // </div>
207
- // );
208
- // }
package/Axis.js DELETED
@@ -1,151 +0,0 @@
1
- import { normalizePositionByRangeLength } from "@teselagen/range-utils";
2
- import getXStartAndWidthOfRangeWrtRow from "./getXStartAndWidthOfRangeWrtRow";
3
- import React, { useMemo } from "react";
4
- import calculateTickMarkPositionsForGivenRange from "../utils/calculateTickMarkPositionsForGivenRange";
5
- import { divideBy3 } from "../utils/proteinUtils";
6
- import { view } from "@risingstack/react-easy-state";
7
- import { getVisibleStartEnd } from "../utils/getVisibleStartEnd";
8
-
9
- const Axis = function (props) {
10
- const {
11
- row,
12
- tickSpacing,
13
- bpsPerRow,
14
- charWidth,
15
- annotationHeight,
16
- marginTop,
17
- sequenceLength,
18
- showAxisNumbers = true,
19
- getGaps,
20
- scrollData,
21
- isProtein,
22
- style,
23
- isLinearView
24
- } = props;
25
- const noRows = row.start === 0 && row.end === 0;
26
- /* eslint-disable react-hooks/exhaustive-deps */
27
- //memoize this function because it does the heavy lifting
28
- const tickMarkPositions = useMemo(() => {
29
- if (noRows) return [];
30
- return calculateTickMarkPositionsForGivenRange({
31
- tickSpacing,
32
- range: row,
33
- sequenceLength,
34
- isProtein
35
- }).map(tickMarkPosition => {
36
- const gaps = getGaps ? getGaps(tickMarkPosition).gapsBefore : 0;
37
- const xCenter =
38
- (tickMarkPosition - (isProtein ? 1 : 0) + gaps) * charWidth +
39
- charWidth / 2;
40
- return {
41
- tickMarkPosition,
42
- xCenter
43
- };
44
- });
45
- }, [
46
- noRows,
47
- tickSpacing,
48
- row.start,
49
- row.end,
50
- sequenceLength,
51
- isProtein,
52
- charWidth
53
- ]);
54
- /* eslint-enable react-hooks/exhaustive-deps*/
55
- if (noRows) {
56
- return null;
57
- }
58
- const { xStart, width } = getXStartAndWidthOfRangeWrtRow({
59
- row,
60
- range: row,
61
- charWidth,
62
- sequenceLength,
63
- ...(getGaps ? getGaps(row) : {})
64
- });
65
- //this function should take in a desired tickSpacing (eg 10 bps between tick mark)
66
- //and output an array of tickMarkPositions for the given row (eg, [0, 10, 20])
67
- const xEnd = xStart + width;
68
- let visibleStart, visibleEnd;
69
- if (scrollData) {
70
- const val = getVisibleStartEnd({
71
- scrollData,
72
- width: sequenceLength * charWidth
73
- });
74
- //add a small buffer to either side of the visible start/end
75
- visibleStart = val.visibleStart - 400;
76
- visibleEnd = val.visibleEnd + 400;
77
- }
78
-
79
- const yStart = 0;
80
- const tickMarkSVG = [];
81
-
82
- tickMarkPositions.forEach(function ({ tickMarkPosition, xCenter }, i) {
83
- // const xCenterPlusXStart = xCenter + xStart;
84
-
85
- if (scrollData && !(xCenter < visibleEnd && xCenter > visibleStart)) return;
86
- tickMarkSVG.push(
87
- <rect
88
- className="veAxisTick"
89
- data-test={tickMarkPosition + 1}
90
- key={"axisTickMarkPath " + i + " " + tickMarkPosition}
91
- x={xCenter}
92
- width={1}
93
- height={5}
94
- />
95
- );
96
- if (showAxisNumbers) {
97
- const position =
98
- normalizePositionByRangeLength(
99
- row.start + tickMarkPosition,
100
- sequenceLength
101
- ) + (isProtein ? 0 : 1);
102
- const positionLength = position.toString().length * 4;
103
- const textInner = divideBy3(position + (isProtein ? 1 : 0), isProtein);
104
-
105
- let x = xCenter;
106
- if (!isLinearView) {
107
- x =
108
- i === 0 //if first label in row, or last label in row, we add checks to make sure the axis number labels don't go outside of the width of the row
109
- ? Math.max(positionLength, xCenter)
110
- : i === tickMarkPositions.length - 1
111
- ? Math.min(bpsPerRow * charWidth - positionLength, xCenter)
112
- : xCenter;
113
- }
114
- if (i === tickMarkPositions.length - 1) {
115
- x = Math.min(x, xEnd - positionLength / 2);
116
- }
117
- tickMarkSVG.push(
118
- <text
119
- data-tick-mark={textInner}
120
- key={"axisTickMarkText " + i + " " + tickMarkPosition}
121
- fill="black"
122
- x={x}
123
- y={annotationHeight}
124
- style={{ textAnchor: "middle", fontSize: 10, fontFamily: "Verdana" }}
125
- >
126
- {textInner}
127
- </text>
128
- );
129
- }
130
- });
131
-
132
- return (
133
- <svg
134
- className="veRowViewAxis veAxis"
135
- height={annotationHeight}
136
- width={width}
137
- style={{ marginTop, overflow: "visible", display: "block", ...style }}
138
- >
139
- {tickMarkSVG}
140
- <path
141
- className="veAxisLine"
142
- d={"M" + xStart + "," + yStart + " L" + xEnd + "," + yStart}
143
- stroke="black"
144
- />
145
- </svg>
146
- );
147
- };
148
-
149
- // export default Axis
150
- export default view(Axis);
151
- // export default pureNoFunc(Axis);
package/AxisNumbers.js DELETED
@@ -1,35 +0,0 @@
1
- import React from "react";
2
- import shouldFlipText from "./shouldFlipText";
3
- import { divideBy3 } from "../utils/proteinUtils";
4
-
5
- export function AxisNumbers({
6
- rotationRadians,
7
- textHeightOffset = -5,
8
- annotation,
9
- isProtein,
10
- hideNumbers
11
- }) {
12
- const shouldFlip = shouldFlipText(annotation.startAngle + rotationRadians);
13
- return (
14
- <g>
15
- <rect y={-17} width={1} height={5} fill="black"></rect>
16
- {!hideNumbers && (
17
- <text
18
- transform={
19
- (shouldFlip ? "rotate(180)" : "") +
20
- ` translate(0, ${
21
- shouldFlip ? -textHeightOffset : textHeightOffset
22
- })`
23
- }
24
- style={{
25
- textAnchor: "middle",
26
- dominantBaseline: "central",
27
- fontSize: "small"
28
- }}
29
- >
30
- {divideBy3(annotation.tickPosition + 1, isProtein) + ""}
31
- </text>
32
- )}
33
- </g>
34
- );
35
- }
package/Browser.js DELETED
@@ -1,106 +0,0 @@
1
- /////////////////////////////////////////////////////////
2
- // Browser Utils
3
- //
4
- /////////////////////////////////////////////////////////
5
- class Browser {
6
- // Check if not running on server
7
- static isBrowser() {
8
- return typeof window !== "undefined";
9
- }
10
-
11
- // // Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
12
- // static isOpera() {
13
- // return (
14
- // Browser.isBrowser() &&
15
- // (!!window.opera || navigator.userAgent.indexOf(" OPR/") >= 0)
16
- // );
17
- // }
18
-
19
- static isOpera() {
20
- return Browser.isBrowser() && Browser.getUserAgent().match(/Opera Mini/i);
21
- }
22
-
23
- // Firefox 1.0+
24
- static isFirefox() {
25
- return Browser.isBrowser() && typeof InstallTrigger !== "undefined";
26
- }
27
-
28
- // Safari 3.0+
29
- static isSafari() {
30
- if (!Browser.isBrowser()) {
31
- return false;
32
- }
33
-
34
- return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
35
- }
36
-
37
- // Internet Explorer 6-11
38
- static isIE() {
39
- /*@cc_on!@*/
40
- return Browser.isBrowser() && !!document.documentMode;
41
- }
42
-
43
- // Edge 20+
44
- static isEdge() {
45
- return Browser.isBrowser() && !Browser.isIE() && !!window.StyleMedia;
46
- }
47
-
48
- // Chrome 1+
49
- static isChrome() {
50
- return Browser.isBrowser() && !!window.chrome && !!window.chrome.webstore;
51
- }
52
-
53
- // Blink engine detection
54
- static isBlink() {
55
- return (
56
- Browser.isBrowser() &&
57
- (Browser.isChrome() || Browser.isOpera()) &&
58
- !!window.CSS
59
- );
60
- }
61
-
62
- static getUserAgent() {
63
- return typeof navigator === "undefined" ? "" : navigator.userAgent;
64
- }
65
-
66
- static isAndroid() {
67
- return Browser.isBrowser() && Browser.getUserAgent().match(/Android/i);
68
- }
69
-
70
- static isBlackBerry() {
71
- return Browser.isBrowser() && Browser.getUserAgent().match(/BlackBerry/i);
72
- }
73
-
74
- static isIOS() {
75
- return (
76
- Browser.isBrowser() && Browser.getUserAgent().match(/iPhone|iPad|iPod/i)
77
- );
78
- }
79
-
80
- static isWindows() {
81
- return (
82
- (Browser.isBrowser() && Browser.isWindowsDesktop()) ||
83
- Browser.isWindowsMobile()
84
- );
85
- }
86
-
87
- static isWindowsMobile() {
88
- return Browser.isBrowser() && Browser.getUserAgent().match(/IEMobile/i);
89
- }
90
-
91
- static isWindowsDesktop() {
92
- return Browser.isBrowser() && Browser.getUserAgent().match(/WPDesktop/i);
93
- }
94
-
95
- static isMobile() {
96
- return (
97
- Browser.isBrowser() &&
98
- (Browser.isWindowsMobile() ||
99
- Browser.isBlackBerry() ||
100
- Browser.isAndroid() ||
101
- Browser.isIOS())
102
- );
103
- }
104
- }
105
-
106
- export default Browser;
package/Caret.js DELETED
@@ -1,63 +0,0 @@
1
- import isNumber from "lodash/isNumber";
2
- import { getRangeAngles } from "@teselagen/range-utils";
3
- import PositionAnnotationOnCircle from "./PositionAnnotationOnCircle";
4
- import React from "react";
5
- import draggableClassnames from "../constants/draggableClassnames";
6
- import pureNoFunc from "../utils/pureNoFunc";
7
- import { getSelectionMessage } from "../utils/editorUtils";
8
-
9
- function Caret({
10
- caretPosition,
11
- sequenceLength,
12
- className,
13
- onClick,
14
- isSelection,
15
- innerRadius,
16
- outerRadius,
17
- isProtein,
18
- selectionMessage
19
- }) {
20
- const { startAngle, endAngle } = getRangeAngles(
21
- { start: caretPosition, end: caretPosition },
22
- sequenceLength || 1
23
- );
24
- if (!isNumber(startAngle)) {
25
- console.error("we've got a problem!");
26
- }
27
- const { transform } = PositionAnnotationOnCircle({
28
- sAngle: startAngle,
29
- eAngle: endAngle,
30
- height: 0
31
- });
32
- return (
33
- <g
34
- onClick={onClick}
35
- transform={transform}
36
- className={className + " veCaret " + draggableClassnames.caret}
37
- >
38
- <title>
39
- {selectionMessage ||
40
- getSelectionMessage({ caretPosition, isProtein, sequenceLength })}
41
- </title>
42
- <line
43
- strokeWidth="1.5px"
44
- x1={0}
45
- y1={-innerRadius}
46
- x2={0}
47
- y2={-outerRadius}
48
- // stroke="black"
49
- />
50
- {isSelection ? (
51
- <polygon
52
- className="vePolygonCaretHandle"
53
- fill="black"
54
- points={`0,${-outerRadius + 2} 5,${-outerRadius - 10} -5,${
55
- -outerRadius - 10
56
- }`}
57
- />
58
- ) : null}
59
- </g>
60
- );
61
- }
62
-
63
- export default pureNoFunc(Caret);