@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.
- package/CreateAnnotationsPage.d.ts +4 -3
- package/README.md +1 -1
- package/fileUtils.d.ts +12 -0
- package/html2canvas.esm--JN4fLQL.js +7891 -0
- package/html2canvas.esm-B7d7VJmQ.cjs +7891 -0
- package/index.cjs.js +1305 -1121
- package/index.es.js +1305 -1121
- package/index.umd.js +189161 -0
- package/ove.css +17 -4
- package/package.json +5 -9
- package/redux/findTool.d.ts +1 -0
- package/selectors/searchLayersSelector.d.ts +1 -1
- package/src/AutoAnnotate.js +1 -1
- package/src/CreateAnnotationsPage.js +1 -2
- package/src/Editor/style.css +8 -3
- package/src/FindBar/index.js +32 -1
- package/src/RowItem/SelectionLayer/index.js +42 -4
- package/src/RowItem/SelectionLayer/style.css +8 -0
- package/src/fileUtils.js +103 -0
- package/src/helperComponents/PropertiesDialog/TranslationProperties.js +1 -1
- package/src/redux/findTool.js +9 -0
- package/src/selectors/searchLayersSelector.js +40 -2
- package/style.css +12098 -1
- package/AASliver.js +0 -187
- package/AddLaddersDialog.js +0 -82
- package/AdditionalCutsiteInfoDialog.js +0 -599
- package/AlignmentVisibilityTool.js +0 -105
- package/AnnotationContainerHolder.js +0 -20
- package/AnnotationPositioner.js +0 -27
- package/AutoAnnotate.js +0 -501
- package/AutoAnnotateBpMatchingDialog.js +0 -208
- package/Axis.js +0 -151
- package/AxisNumbers.js +0 -35
- package/Browser.js +0 -106
- package/Caret.js +0 -63
- package/Chromatogram.js +0 -293
- package/CircularDnaSequence.js +0 -73
- package/CircularZoomMinimap.js +0 -16
- package/ColorPicker.js +0 -30
- package/CommandHotkeyHandler.js +0 -44
- package/CreateAnnotationsPage.js +0 -98
- package/Cutsite.js +0 -18
- package/CutsiteProperties.js +0 -176
- package/CutsiteSelectionLayers.js +0 -47
- package/Cutsites.js +0 -271
- package/DeletionLayer.js +0 -28
- package/DropHandler.css +0 -21
- package/DropHandler.js +0 -64
- package/EditCaretPosition.js +0 -234
- package/EditTrackNameDialog.js +0 -30
- package/Feature.js +0 -83
- package/FeatureProperties.js +0 -6
- package/FillWindow.js +0 -47
- package/GenbankView.js +0 -74
- package/GeneralProperties.js +0 -117
- package/GenericAnnotationProperties.js +0 -406
- package/GlobalDialog.js +0 -73
- package/GlobalDialogUtils.js +0 -110
- package/GoToDialog.js +0 -25
- package/HorizontalPanelDragHandle.js +0 -35
- package/Keyboard.js +0 -85
- package/Labels.js +0 -327
- package/Ladder.css +0 -20
- package/Ladder.js +0 -303
- package/MeltingTemp.js +0 -85
- package/Menlo.ttf +0 -0
- package/Minimap.js +0 -515
- package/Mismatches.js +0 -134
- package/Monaco.ttf +0 -0
- package/MultipleSeqsDetectedOnImportDialog.js +0 -74
- package/Orf.js +0 -109
- package/OrfProperties.js +0 -117
- package/Orfs.js +0 -35
- package/PCRTool.js +0 -179
- package/PairwiseAlignmentView.js +0 -68
- package/Part.js +0 -34
- package/PartProperties.js +0 -9
- package/PassThrough.js +0 -3
- package/PerformantSelectionLayer.js +0 -32
- package/PinchHelper.js +0 -24
- package/PointedAnnotation.js +0 -347
- package/PositionAnnotationOnCircle.js +0 -26
- package/Primer.js +0 -41
- package/PrimerProperties.js +0 -19
- package/ReflexContainer.js +0 -802
- package/ReflexElement.js +0 -160
- package/ReflexEvents.js +0 -77
- package/ReflexSplitter.js +0 -205
- package/RenameSequenceDialog.js +0 -7
- package/RotateCircularViewSlider.js +0 -93
- package/SelectDialog.js +0 -150
- package/SequenceName.js +0 -15
- package/SimpleCircularOrLinearView.js +0 -381
- package/SimpleOligoPreview.js +0 -39
- package/SingleEnzymeCutsiteInfo.js +0 -139
- package/ToolbarItem.js +0 -192
- package/Translation.js +0 -198
- package/TranslationProperties.js +0 -149
- package/UncontrolledSliderWithPlusMinusBtns.css +0 -5
- package/UncontrolledSliderWithPlusMinusBtns.js +0 -134
- package/VeTopRightContainer.js +0 -12
- package/ZoomCircularViewSlider.js +0 -62
- package/ZoomLinearView.js +0 -47
- package/addAlignment.js +0 -6
- package/addMetaToActionCreators.js +0 -12
- package/addWrappedAddons.js +0 -20
- package/alignmentTool.js +0 -503
- package/alignments.js +0 -379
- package/annotationLabelVisibility.js +0 -2
- package/annotationSearchSelector.js +0 -24
- package/annotationTypes.js +0 -35
- package/annotationVisibility.js +0 -196
- package/annotationsToSupport.js +0 -104
- package/arrayToObjWithIds.js +0 -17
- package/arrayUtils.js +0 -19
- package/array_move.js +0 -10
- package/calculateTickMarkPositionsForGivenRange.js +0 -47
- package/caretPosition.js +0 -27
- package/cdsFeaturesSelector.js +0 -9
- package/charWidth.js +0 -22
- package/circular.js +0 -19
- package/circularSelector.js +0 -4
- package/clickAndDragUtils.js +0 -576
- package/coerceInitialValue.js +0 -7
- package/combineReducersDontIgnoreKeys.js +0 -12
- package/commandUtils.js +0 -20
- package/constants.js +0 -2
- package/copyOptions.js +0 -34
- package/createFragmentLines.js +0 -120
- package/createMergedDefaultStateReducer.js +0 -30
- package/createMetaAction.js +0 -12
- package/createSequenceInputPopup.js +0 -290
- package/createSequenceInputPopupStyle.css +0 -87
- package/createSimpleDialog.js +0 -89
- package/createYourOwnEnzyme.js +0 -39
- package/cutsiteLabelColorSelector.js +0 -6
- package/cutsiteTool.js +0 -88
- package/cutsitesByRangeSelector.js +0 -5
- package/cutsitesSelector.js +0 -61
- package/darkmode.css +0 -98
- package/defaultConfig.js +0 -150
- package/deletionLayers.js +0 -36
- package/description.js +0 -21
- package/digestTool.js +0 -34
- package/dnaToColor.js +0 -17
- package/downloadTool.js +0 -39
- package/draggableClassnames.js +0 -5
- package/drawAnnotations.js +0 -440
- package/drawDirectedPiePiece.js +0 -142
- package/editTool.js +0 -49
- package/editorSelector.js +0 -2
- package/editorUtils.js +0 -205
- package/estimateRowHeight.js +0 -184
- package/featureLengthsToHide.js +0 -27
- package/featureTool.js +0 -34
- package/features.js +0 -19
- package/featuresSelector.js +0 -8
- package/filteredCutsitesSelector.js +0 -136
- package/filteredFeaturesSelector.js +0 -32
- package/filteredPartsSelector.js +0 -57
- package/filteredPrimersSelector.js +0 -27
- package/filteredRestrictionEnzymesSelector.js +0 -1
- package/find.png +0 -0
- package/findTool.js +0 -79
- package/findToolConstants.js +0 -1
- package/frameTranslations.js +0 -52
- package/fullscreen.png +0 -0
- package/getAdditionalEnzymesSelector.js +0 -46
- package/getAngleForPositionMidpoint.js +0 -3
- package/getAnnotationClassnames.js +0 -12
- package/getAnnotationNameAndStartStopString.js +0 -61
- package/getBpsPerRow.js +0 -19
- package/getCutsiteLabelHeights.js +0 -56
- package/getGapMap.js +0 -12
- package/getGaps.js +0 -27
- package/getInternalLabel.js +0 -40
- package/getOveHotkeyDefs.js +0 -12
- package/getPairwiseOverviewLinearViewOptions.js +0 -38
- package/getRangeAnglesSpecial.js +0 -12
- package/getStructuredBases.js +0 -97
- package/getTrackFromEvent.js +0 -25
- package/getVisibleStartEnd.js +0 -7
- package/getXStartAndWidthFromNonCircularRange.js +0 -12
- package/getXStartAndWidthOfRangeWrtRow.js +0 -27
- package/getXStartAndWidthOfRowAnnotation.js +0 -19
- package/getYOffset.js +0 -15
- package/hoveredAnnotation.js +0 -24
- package/importTool.js +0 -27
- package/index.js +0 -71
- package/inlineFindTool.js +0 -38
- package/isElementInViewport.js +0 -29
- package/isEnzymeFilterAndSelector.js +0 -1
- package/isTargetWithinEl.js +0 -6
- package/labelLineIntensity.js +0 -25
- package/labelSize.js +0 -23
- package/ladderDefaults.js +0 -25
- package/lastSavedId.js +0 -20
- package/lineageLines.js +0 -11
- package/linear.png +0 -0
- package/makeStore.js +0 -34
- package/massageTickSpacing.js +0 -19
- package/materiallyAvailable.js +0 -19
- package/middleware.js +0 -112
- package/minimumOrfSize.js +0 -24
- package/minimumOrfSizeSelector.js +0 -2
- package/modalActions.js +0 -3
- package/moveCaret.js +0 -58
- package/name.js +0 -19
- package/normalizeAngle.js +0 -3
- package/normalizeAngleRange.js +0 -9
- package/oligoTool.js +0 -30
- package/onlyUpdateForKeysDeep.js +0 -31
- package/orfFrameToColorMap.js +0 -10
- package/orfTool.js +0 -136
- package/orfsSelector.js +0 -15
- package/panelsShown.js +0 -294
- package/partLengthsToHide.js +0 -23
- package/partOverhangs.js +0 -6
- package/partTagSearch.js +0 -69
- package/partTool.js +0 -45
- package/parts.js +0 -19
- package/partsSelector.js +0 -8
- package/pie.png +0 -0
- package/polarToSpecialCartesian.js +0 -7
- package/positionCutsites.js +0 -6
- package/prepareRowData.js +0 -64
- package/primerBases.js +0 -221
- package/primerLengthsToHide.js +0 -27
- package/primers.js +0 -19
- package/primersSelector.js +0 -8
- package/print.png +0 -0
- package/printTool.js +0 -31
- package/propertiesTool.js +0 -40
- package/proteinUtils.js +0 -3
- package/pureNoFunc.js +0 -18
- package/readOnly.js +0 -25
- package/redoTool.js +0 -30
- package/reflex-styles.css +0 -128
- package/reflex-styles.css.map +0 -9
- package/relaxLabelAngles.js +0 -157
- package/relaxLabels_DEPRECATED.js +0 -105
- package/replacementLayers.js +0 -36
- package/restrictionEnzymes.js +0 -52
- package/restrictionEnzymesSelector.js +0 -34
- package/rowviewContants.js +0 -3
- package/ruler.css +0 -89
- package/save.png +0 -0
- package/saveTool.js +0 -44
- package/searchLayersSelector.js +0 -71
- package/selectedAnnotations.js +0 -89
- package/selectedAnnotationsSelector.js +0 -1
- package/selectedCutsitesSelector.js +0 -21
- package/selectedPartTags.js +0 -21
- package/selectionLayer.js +0 -25
- package/sequence.js +0 -12
- package/sequenceDataHistory.js +0 -43
- package/sequenceDataSelector.js +0 -2
- package/sequenceLengthSelector.js +0 -5
- package/sequenceSelector.js +0 -4
- package/sharedActionCreators.js +0 -0
- package/shouldFlipText.js +0 -4
- package/shouldRerender.js +0 -27
- package/showFileDialog.js +0 -25
- package/showGCContent.js +0 -23
- package/show_cut_sites.png +0 -0
- package/show_features.png +0 -0
- package/show_orfs.png +0 -0
- package/show_primers.png +0 -0
- package/simpleDialog.css +0 -13
- package/specialCutsiteFilterOptions.js +0 -22
- package/tagsToBoldSelector.js +0 -2
- package/toggle_views.svg +0 -1
- package/toolBar.js +0 -23
- package/translationSearchMatchesSelector.js +0 -14
- package/translations.js +0 -20
- package/translationsRawSelector.js +0 -8
- package/translationsSelector.js +0 -137
- package/typeField.js +0 -24
- package/undoTool.js +0 -30
- package/updateEditor.js +0 -200
- package/updateLabelsForInViewFeatures.js +0 -55
- package/updateLabelsForInViewFeaturesCircView.js +0 -41
- package/updateTrackHelper.js +0 -58
- package/uppercaseSequenceMapFont.js +0 -25
- package/upsertDeleteActionGenerator.js +0 -31
- package/useAAColorType.js +0 -8
- package/useAdditionalOrfStartCodons.js +0 -24
- package/useAnnotationLimits.js +0 -42
- package/useChromatogramPrefs.js +0 -31
- package/useFormValue.js +0 -7
- package/useLadders.js +0 -6
- package/useMeltingTemp.js +0 -7
- package/useTmType.js +0 -10
- package/userDefinedHandlersAndOpts.js +0 -61
- package/utils.js +0 -37
- package/versionHistory.js +0 -26
- package/versionHistoryTool.js +0 -21
- package/viewSubmenu.js +0 -479
- package/visibilityTool.js +0 -39
- package/withHover.js +0 -113
- 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);
|