@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.
- package/index.cjs.js +1055 -996
- package/index.es.js +1055 -996
- package/index.umd.js +189036 -0
- package/ove.css +1 -1
- package/package.json +2 -6
- package/src/helperComponents/PropertiesDialog/TranslationProperties.js +1 -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/style.css +0 -10
- 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
package/EditCaretPosition.js
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-var */
|
|
2
|
-
const EditCaretPositioning = {};
|
|
3
|
-
|
|
4
|
-
export default EditCaretPositioning;
|
|
5
|
-
|
|
6
|
-
if (window.getSelection && document.createRange) {
|
|
7
|
-
//saves caret position(s)
|
|
8
|
-
EditCaretPositioning.saveSelection = function (containerEl) {
|
|
9
|
-
var range = window.getSelection().getRangeAt(0);
|
|
10
|
-
var preSelectionRange = range.cloneRange();
|
|
11
|
-
preSelectionRange.selectNodeContents(containerEl);
|
|
12
|
-
preSelectionRange.setEnd(range.startContainer, range.startOffset);
|
|
13
|
-
var start = preSelectionRange.toString().length;
|
|
14
|
-
|
|
15
|
-
return {
|
|
16
|
-
start: start,
|
|
17
|
-
end: start + range.toString().length
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
//restores caret position(s)
|
|
21
|
-
EditCaretPositioning.restoreSelection = function (containerEl, savedSel) {
|
|
22
|
-
var charIndex = 0,
|
|
23
|
-
range = document.createRange();
|
|
24
|
-
range.setStart(containerEl, 0);
|
|
25
|
-
range.collapse(true);
|
|
26
|
-
var nodeStack = [containerEl],
|
|
27
|
-
node,
|
|
28
|
-
foundStart = false,
|
|
29
|
-
stop = false;
|
|
30
|
-
|
|
31
|
-
while (!stop && (node = nodeStack.pop())) {
|
|
32
|
-
if (node.nodeType === 3) {
|
|
33
|
-
var nextCharIndex = charIndex + node.length;
|
|
34
|
-
if (
|
|
35
|
-
!foundStart &&
|
|
36
|
-
savedSel.start >= charIndex &&
|
|
37
|
-
savedSel.start <= nextCharIndex
|
|
38
|
-
) {
|
|
39
|
-
range.setStart(node, savedSel.start - charIndex);
|
|
40
|
-
foundStart = true;
|
|
41
|
-
}
|
|
42
|
-
if (
|
|
43
|
-
foundStart &&
|
|
44
|
-
savedSel.end >= charIndex &&
|
|
45
|
-
savedSel.end <= nextCharIndex
|
|
46
|
-
) {
|
|
47
|
-
range.setEnd(node, savedSel.end - charIndex);
|
|
48
|
-
stop = true;
|
|
49
|
-
}
|
|
50
|
-
charIndex = nextCharIndex;
|
|
51
|
-
} else {
|
|
52
|
-
var i = node.childNodes.length;
|
|
53
|
-
while (i--) {
|
|
54
|
-
nodeStack.push(node.childNodes[i]);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
var sel = window.getSelection();
|
|
60
|
-
sel.removeAllRanges();
|
|
61
|
-
sel.addRange(range);
|
|
62
|
-
};
|
|
63
|
-
} else if (document.selection && document.body.createTextRange) {
|
|
64
|
-
//saves caret position(s)
|
|
65
|
-
EditCaretPositioning.saveSelection = function (containerEl) {
|
|
66
|
-
var selectedTextRange = document.selection.createRange();
|
|
67
|
-
var preSelectionTextRange = document.body.createTextRange();
|
|
68
|
-
preSelectionTextRange.moveToElementText(containerEl);
|
|
69
|
-
preSelectionTextRange.setEndPoint("EndToStart", selectedTextRange);
|
|
70
|
-
var start = preSelectionTextRange.text.length;
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
start: start,
|
|
74
|
-
end: start + selectedTextRange.text.length
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
//restores caret position(s)
|
|
78
|
-
EditCaretPositioning.restoreSelection = function (containerEl, savedSel) {
|
|
79
|
-
var textRange = document.body.createTextRange();
|
|
80
|
-
textRange.moveToElementText(containerEl);
|
|
81
|
-
textRange.collapse(true);
|
|
82
|
-
textRange.moveEnd("character", savedSel.end);
|
|
83
|
-
textRange.moveStart("character", savedSel.start);
|
|
84
|
-
textRange.select();
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// getCaretPosition: return [start, end] as offsets to elem.textContent that
|
|
89
|
-
// correspond to the selected portion of text
|
|
90
|
-
// (if start == end, caret is at given position and no text is selected)
|
|
91
|
-
|
|
92
|
-
// export function getCaretPosition(elem) {
|
|
93
|
-
// const sel = window.getSelection();
|
|
94
|
-
// let cum_length = [0, 0];
|
|
95
|
-
|
|
96
|
-
// if (sel.anchorNode == elem) cum_length = [sel.anchorOffset, sel.extentOffset];
|
|
97
|
-
// else {
|
|
98
|
-
// const nodes_to_find = [sel.anchorNode, sel.extentNode];
|
|
99
|
-
// if (!elem.contains(sel.anchorNode) || !elem.contains(sel.extentNode))
|
|
100
|
-
// return undefined;
|
|
101
|
-
// else {
|
|
102
|
-
// const found = [0, 0];
|
|
103
|
-
// let i;
|
|
104
|
-
// node_walk(elem, function (node) {
|
|
105
|
-
// for (i = 0; i < 2; i++) {
|
|
106
|
-
// if (node == nodes_to_find[i]) {
|
|
107
|
-
// found[i] = true;
|
|
108
|
-
// if (found[i == 0 ? 1 : 0]) return false; // all done
|
|
109
|
-
// }
|
|
110
|
-
// }
|
|
111
|
-
|
|
112
|
-
// if (node.textContent && !node.firstChild) {
|
|
113
|
-
// for (i = 0; i < 2; i++) {
|
|
114
|
-
// if (!found[i]) cum_length[i] += node.textContent.length;
|
|
115
|
-
// }
|
|
116
|
-
// }
|
|
117
|
-
// });
|
|
118
|
-
// cum_length[0] += sel.anchorOffset;
|
|
119
|
-
// cum_length[1] += sel.extentOffset;
|
|
120
|
-
// }
|
|
121
|
-
// }
|
|
122
|
-
// if (cum_length[0] <= cum_length[1]) return cum_length;
|
|
123
|
-
// return [cum_length[1], cum_length[0]];
|
|
124
|
-
// }
|
|
125
|
-
|
|
126
|
-
// no operation
|
|
127
|
-
const noop = () => null;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* @function
|
|
131
|
-
* @description
|
|
132
|
-
* @param {DOMElement} container The container in which the cursor position must be saved
|
|
133
|
-
* @return {Function} A function used to restore caret position
|
|
134
|
-
*/
|
|
135
|
-
export function selectionSaveCaretPosition(container) {
|
|
136
|
-
const selection = window.getSelection();
|
|
137
|
-
|
|
138
|
-
if (!selection || selection.rangeCount === 0) {
|
|
139
|
-
return noop;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const range = selection.getRangeAt(0);
|
|
143
|
-
const clone = range.cloneRange();
|
|
144
|
-
|
|
145
|
-
// find the range start index
|
|
146
|
-
clone.selectNodeContents(container);
|
|
147
|
-
clone.setStart(container, 0);
|
|
148
|
-
clone.setEnd(range.startContainer, range.startOffset);
|
|
149
|
-
const startIndex = clone.toString().length;
|
|
150
|
-
|
|
151
|
-
// find the range end index
|
|
152
|
-
clone.selectNodeContents(container);
|
|
153
|
-
clone.setStart(container, 0);
|
|
154
|
-
clone.setEnd(range.endContainer, range.endOffset);
|
|
155
|
-
const endIndex = clone.toString().length;
|
|
156
|
-
|
|
157
|
-
return function restoreCaretPosition() {
|
|
158
|
-
const start = getTextNodeAtPosition(container, startIndex);
|
|
159
|
-
const end = getTextNodeAtPosition(container, endIndex);
|
|
160
|
-
const newRange = new Range();
|
|
161
|
-
|
|
162
|
-
newRange.setStart(start.node, start.position);
|
|
163
|
-
newRange.setEnd(end.node, end.position);
|
|
164
|
-
|
|
165
|
-
selection.removeAllRanges();
|
|
166
|
-
selection.addRange(newRange);
|
|
167
|
-
container.focus();
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* @function
|
|
173
|
-
* @description This function is used to determine the text node and it's index within
|
|
174
|
-
* a "root" DOM element.
|
|
175
|
-
*
|
|
176
|
-
* @param {DOMElement} rootEl The root
|
|
177
|
-
* @param {Integer} index The index within the root element of which you want to find the text node
|
|
178
|
-
* @return {Object} An object that contains the text node, and the index within that text node
|
|
179
|
-
*/
|
|
180
|
-
function getTextNodeAtPosition(rootEl, index) {
|
|
181
|
-
const treeWalker = document.createTreeWalker(
|
|
182
|
-
rootEl,
|
|
183
|
-
NodeFilter.SHOW_TEXT,
|
|
184
|
-
function next(elem) {
|
|
185
|
-
if (index > elem.textContent.length) {
|
|
186
|
-
index -= elem.textContent.length;
|
|
187
|
-
return NodeFilter.FILTER_REJECT;
|
|
188
|
-
}
|
|
189
|
-
return NodeFilter.FILTER_ACCEPT;
|
|
190
|
-
}
|
|
191
|
-
);
|
|
192
|
-
const node = treeWalker.nextNode();
|
|
193
|
-
|
|
194
|
-
return {
|
|
195
|
-
node: node ? node : rootEl,
|
|
196
|
-
position: node ? index : 0
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// node_walk: walk the element tree, stop when func(node) returns false
|
|
201
|
-
// function node_walk(node, func) {
|
|
202
|
-
// let result = func(node);
|
|
203
|
-
// for (
|
|
204
|
-
// node = node.firstChild;
|
|
205
|
-
// result !== false && node;
|
|
206
|
-
// node = node.nextSibling
|
|
207
|
-
// )
|
|
208
|
-
// result = node_walk(node, func);
|
|
209
|
-
// return result;
|
|
210
|
-
// }
|
|
211
|
-
|
|
212
|
-
// const charpos = getCaretPosition(inputRef.current);
|
|
213
|
-
|
|
214
|
-
// let isChangeCloserToEnd;
|
|
215
|
-
// if (charpos && charpos[0]) {
|
|
216
|
-
// if (charpos[0] > newVal.length - charpos[0]) {
|
|
217
|
-
// isChangeCloserToEnd = true;
|
|
218
|
-
// }
|
|
219
|
-
// }
|
|
220
|
-
// if (forward && !isChangeCloserToEnd) {
|
|
221
|
-
// if (end || end === 0) {
|
|
222
|
-
// change(
|
|
223
|
-
// "start",
|
|
224
|
-
// normalizePositionByRangeLength(end - textLength + 1, seqLen)
|
|
225
|
-
// );
|
|
226
|
-
// }
|
|
227
|
-
// } else {
|
|
228
|
-
// if (start || start === 0) {
|
|
229
|
-
// change(
|
|
230
|
-
// "end",
|
|
231
|
-
// normalizePositionByRangeLength(start + textLength - 1, seqLen)
|
|
232
|
-
// );
|
|
233
|
-
// }
|
|
234
|
-
// }
|
package/EditTrackNameDialog.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { DialogFooter, InputField, wrapDialog } from "@teselagen/ui";
|
|
3
|
-
import { compose } from "recompose";
|
|
4
|
-
import { reduxForm } from "redux-form";
|
|
5
|
-
|
|
6
|
-
export const EditTrackNameDialog = compose(
|
|
7
|
-
wrapDialog({
|
|
8
|
-
title: "Edit Track Name"
|
|
9
|
-
}),
|
|
10
|
-
reduxForm({ form: "EditTrackNameDialog" })
|
|
11
|
-
)(function ({ handleSubmit, updateName, hideModal }) {
|
|
12
|
-
return (
|
|
13
|
-
<div>
|
|
14
|
-
<div className="bp3-dialog-body">
|
|
15
|
-
<InputField
|
|
16
|
-
autoFocus
|
|
17
|
-
label="New Name"
|
|
18
|
-
isRequired
|
|
19
|
-
name="name"
|
|
20
|
-
></InputField>
|
|
21
|
-
</div>
|
|
22
|
-
<DialogFooter
|
|
23
|
-
onClick={handleSubmit(async ({ name }) => {
|
|
24
|
-
await updateName({ newName: name });
|
|
25
|
-
hideModal();
|
|
26
|
-
})}
|
|
27
|
-
></DialogFooter>
|
|
28
|
-
</div>
|
|
29
|
-
);
|
|
30
|
-
});
|
package/Feature.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { startsWith } from "lodash-es";
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
import drawDirectedPiePiece from "./drawDirectedPiePiece";
|
|
5
|
-
import { getInternalLabel } from "./getInternalLabel";
|
|
6
|
-
import shouldFlipText from "./shouldFlipText";
|
|
7
|
-
|
|
8
|
-
export default function Feature(props) {
|
|
9
|
-
const {
|
|
10
|
-
color = "orange",
|
|
11
|
-
radius,
|
|
12
|
-
containsLocations,
|
|
13
|
-
arrowheadLength = 0.5,
|
|
14
|
-
annotationHeight,
|
|
15
|
-
className,
|
|
16
|
-
ellipsizedName,
|
|
17
|
-
annotationType,
|
|
18
|
-
arrowheadType,
|
|
19
|
-
overlapsSelf,
|
|
20
|
-
rotationRadians,
|
|
21
|
-
centerAngle,
|
|
22
|
-
totalAngle,
|
|
23
|
-
locationNumber
|
|
24
|
-
} = props;
|
|
25
|
-
const isPart = annotationType === "part";
|
|
26
|
-
let colorToUse = color;
|
|
27
|
-
if (isPart) {
|
|
28
|
-
colorToUse = startsWith(color, "override_")
|
|
29
|
-
? color.replace("override_", "")
|
|
30
|
-
: "#ac68cc";
|
|
31
|
-
}
|
|
32
|
-
const labelNeedsFlip = shouldFlipText(centerAngle + rotationRadians);
|
|
33
|
-
if (containsLocations) {
|
|
34
|
-
const path = drawDirectedPiePiece({
|
|
35
|
-
radius: radius,
|
|
36
|
-
labelNeedsFlip,
|
|
37
|
-
annotationHeight: annotationHeight / 8,
|
|
38
|
-
totalAngle,
|
|
39
|
-
arrowheadLength: 80 / radius,
|
|
40
|
-
tailThickness: 1 //feature specific
|
|
41
|
-
});
|
|
42
|
-
return (
|
|
43
|
-
<path
|
|
44
|
-
className={className}
|
|
45
|
-
strokeWidth=".5"
|
|
46
|
-
stroke="black"
|
|
47
|
-
fill={colorToUse}
|
|
48
|
-
d={path.print()}
|
|
49
|
-
/>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
const [path, textPath] = drawDirectedPiePiece({
|
|
53
|
-
returnTextPath: true,
|
|
54
|
-
overlapsSelf,
|
|
55
|
-
arrowheadType,
|
|
56
|
-
hasLabel: ellipsizedName,
|
|
57
|
-
labelNeedsFlip,
|
|
58
|
-
radius,
|
|
59
|
-
annotationHeight,
|
|
60
|
-
totalAngle,
|
|
61
|
-
arrowheadLength,
|
|
62
|
-
tailThickness: 1 //feature specific
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<>
|
|
67
|
-
<path
|
|
68
|
-
className={className}
|
|
69
|
-
strokeWidth=".5"
|
|
70
|
-
stroke={isPart ? colorToUse : "black"}
|
|
71
|
-
fill={isPart ? undefined : colorToUse}
|
|
72
|
-
d={path.print()}
|
|
73
|
-
/>
|
|
74
|
-
{getInternalLabel({
|
|
75
|
-
...props,
|
|
76
|
-
colorToUse,
|
|
77
|
-
textPath,
|
|
78
|
-
isPart,
|
|
79
|
-
locationNumber
|
|
80
|
-
})}
|
|
81
|
-
</>
|
|
82
|
-
);
|
|
83
|
-
}
|
package/FeatureProperties.js
DELETED
package/FillWindow.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { debounce } from "lodash-es";
|
|
3
|
-
|
|
4
|
-
export default class FillWindow extends React.Component {
|
|
5
|
-
updateDimensions = debounce(() => {
|
|
6
|
-
if (this.props.disabled) return;
|
|
7
|
-
this.setState({ randomRerenderTrigger: Math.random() });
|
|
8
|
-
}, 100);
|
|
9
|
-
|
|
10
|
-
componentDidMount() {
|
|
11
|
-
window.addEventListener("resize", this.updateDimensions);
|
|
12
|
-
}
|
|
13
|
-
componentWillUnmount() {
|
|
14
|
-
window.removeEventListener("resize", this.updateDimensions);
|
|
15
|
-
}
|
|
16
|
-
render() {
|
|
17
|
-
const w = window,
|
|
18
|
-
d = document,
|
|
19
|
-
e = d.documentElement,
|
|
20
|
-
g = d.getElementsByTagName("body")[0],
|
|
21
|
-
width = w.innerWidth || e.clientWidth || g.clientWidth,
|
|
22
|
-
height = w.innerHeight || e.clientHeight || g.clientHeight;
|
|
23
|
-
const windowDimensions = {
|
|
24
|
-
width,
|
|
25
|
-
height
|
|
26
|
-
};
|
|
27
|
-
const { children, disabled, style, ...rest } = this.props;
|
|
28
|
-
if (disabled) return children(windowDimensions);
|
|
29
|
-
return (
|
|
30
|
-
<div
|
|
31
|
-
{...rest}
|
|
32
|
-
style={{
|
|
33
|
-
zIndex: 10,
|
|
34
|
-
width,
|
|
35
|
-
height,
|
|
36
|
-
position: "fixed",
|
|
37
|
-
top: 0,
|
|
38
|
-
left: 0,
|
|
39
|
-
background: "white",
|
|
40
|
-
...style
|
|
41
|
-
}}
|
|
42
|
-
>
|
|
43
|
-
{children(windowDimensions)}
|
|
44
|
-
</div>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
}
|
package/GenbankView.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
// import { Button } from "@blueprintjs/core";
|
|
3
|
-
import {
|
|
4
|
-
jsonToGenbank,
|
|
5
|
-
jsonToFasta,
|
|
6
|
-
cleanUpTeselagenJsonForExport
|
|
7
|
-
} from "@teselagen/bio-parsers";
|
|
8
|
-
import { HTMLSelect } from "@blueprintjs/core";
|
|
9
|
-
import { connectToEditor } from "../../withEditorProps";
|
|
10
|
-
import { compose } from "recompose";
|
|
11
|
-
|
|
12
|
-
class GenbankView extends React.Component {
|
|
13
|
-
state = {
|
|
14
|
-
fileTypeToView: "genbank"
|
|
15
|
-
};
|
|
16
|
-
select = () => this._input?.select();
|
|
17
|
-
render() {
|
|
18
|
-
const { sequenceData = {} } = this.props;
|
|
19
|
-
let filestring;
|
|
20
|
-
switch (this.state.fileTypeToView) {
|
|
21
|
-
case "fasta":
|
|
22
|
-
filestring = jsonToFasta(sequenceData);
|
|
23
|
-
break;
|
|
24
|
-
case "teselagen":
|
|
25
|
-
filestring = JSON.stringify(
|
|
26
|
-
cleanUpTeselagenJsonForExport(sequenceData),
|
|
27
|
-
null,
|
|
28
|
-
4
|
|
29
|
-
);
|
|
30
|
-
break;
|
|
31
|
-
default:
|
|
32
|
-
filestring = jsonToGenbank(sequenceData);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<>
|
|
37
|
-
<HTMLSelect
|
|
38
|
-
className="genbankFileView-type"
|
|
39
|
-
fill={false}
|
|
40
|
-
options={[
|
|
41
|
-
{ label: "Genbank", value: "genbank" },
|
|
42
|
-
{ label: "Fasta", value: "fasta" },
|
|
43
|
-
{ label: "Teselagen JSON", value: "teselagen" }
|
|
44
|
-
]}
|
|
45
|
-
onChange={e => {
|
|
46
|
-
this.setState({ fileTypeToView: e.target.value });
|
|
47
|
-
}}
|
|
48
|
-
/>
|
|
49
|
-
<textarea
|
|
50
|
-
data-test="ve-genbank-text"
|
|
51
|
-
readOnly
|
|
52
|
-
onClick={this.select}
|
|
53
|
-
style={{
|
|
54
|
-
whiteSpace: "pre",
|
|
55
|
-
overflowWrap: "normal",
|
|
56
|
-
overflowX: "scroll",
|
|
57
|
-
fontSize: 11,
|
|
58
|
-
fontFamily: "monospace",
|
|
59
|
-
height: 350
|
|
60
|
-
}}
|
|
61
|
-
value={filestring}
|
|
62
|
-
/>
|
|
63
|
-
</>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export default compose(
|
|
69
|
-
connectToEditor(({ sequenceData = {} }) => {
|
|
70
|
-
return {
|
|
71
|
-
sequenceData
|
|
72
|
-
};
|
|
73
|
-
})
|
|
74
|
-
)(GenbankView);
|
package/GeneralProperties.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { InputField, TextareaField } from "@teselagen/ui";
|
|
3
|
-
import { reduxForm } from "redux-form";
|
|
4
|
-
import withEditorProps from "../../withEditorProps";
|
|
5
|
-
import { compose } from "recompose";
|
|
6
|
-
import {
|
|
7
|
-
EditAvailabilityItem,
|
|
8
|
-
EditCircularityItem,
|
|
9
|
-
EditReadOnlyItem
|
|
10
|
-
} from "../../StatusBar";
|
|
11
|
-
|
|
12
|
-
class GeneralProperties extends React.Component {
|
|
13
|
-
updateSeqDesc = val => {
|
|
14
|
-
return this.props.sequenceDescriptionUpdate(val);
|
|
15
|
-
};
|
|
16
|
-
render() {
|
|
17
|
-
const {
|
|
18
|
-
readOnly,
|
|
19
|
-
showReadOnly = true,
|
|
20
|
-
isProtein,
|
|
21
|
-
disableSetReadOnly,
|
|
22
|
-
sequenceData,
|
|
23
|
-
onSave,
|
|
24
|
-
showAvailability,
|
|
25
|
-
beforeReadOnlyChange,
|
|
26
|
-
editorName,
|
|
27
|
-
disableBpEditing,
|
|
28
|
-
sequenceNameUpdate
|
|
29
|
-
} = this.props;
|
|
30
|
-
const {
|
|
31
|
-
description,
|
|
32
|
-
name,
|
|
33
|
-
isOligo,
|
|
34
|
-
isRna,
|
|
35
|
-
sequence = "",
|
|
36
|
-
proteinSequence = ""
|
|
37
|
-
} = sequenceData || {};
|
|
38
|
-
return (
|
|
39
|
-
<React.Fragment>
|
|
40
|
-
<div className="ve-flex-row">
|
|
41
|
-
<div className="ve-column-left bp3-label">Name</div>{" "}
|
|
42
|
-
<div className="ve-column-right">
|
|
43
|
-
<InputField
|
|
44
|
-
disabled={readOnly}
|
|
45
|
-
onFieldSubmit={val => {
|
|
46
|
-
sequenceNameUpdate(val);
|
|
47
|
-
}}
|
|
48
|
-
name="name"
|
|
49
|
-
enableReinitialize
|
|
50
|
-
defaultValue={name}
|
|
51
|
-
/>{" "}
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
{!isProtein && !isOligo && !isRna && (
|
|
56
|
-
<div className="ve-flex-row circularLinearSelect">
|
|
57
|
-
<div className="ve-column-left bp3-label">Circular/Linear</div>{" "}
|
|
58
|
-
<div className="ve-column-right">
|
|
59
|
-
{" "}
|
|
60
|
-
<EditCircularityItem editorName={editorName} showCircularity />
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
)}
|
|
64
|
-
|
|
65
|
-
{showAvailability && (
|
|
66
|
-
<div className="ve-flex-row">
|
|
67
|
-
<div className="ve-column-left bp3-label">
|
|
68
|
-
Material Availability
|
|
69
|
-
</div>{" "}
|
|
70
|
-
<div className="ve-column-right">
|
|
71
|
-
{" "}
|
|
72
|
-
<EditAvailabilityItem editorName={editorName} showAvailability />
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
)}
|
|
76
|
-
<div className="ve-flex-row">
|
|
77
|
-
<div className="ve-column-left bp3-label">Length</div>{" "}
|
|
78
|
-
<div className="ve-column-right">
|
|
79
|
-
{" "}
|
|
80
|
-
{isProtein ? proteinSequence.length : sequence.length}
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
{showReadOnly && (
|
|
84
|
-
<div className="ve-flex-row">
|
|
85
|
-
<div className="ve-column-left bp3-label">Is Editable</div>{" "}
|
|
86
|
-
<div className="ve-column-right">
|
|
87
|
-
{" "}
|
|
88
|
-
<EditReadOnlyItem
|
|
89
|
-
beforeReadOnlyChange={beforeReadOnlyChange}
|
|
90
|
-
editorName={editorName}
|
|
91
|
-
onSave={onSave}
|
|
92
|
-
disableBpEditing={disableBpEditing}
|
|
93
|
-
disableSetReadOnly={disableSetReadOnly}
|
|
94
|
-
showReadOnly={showReadOnly}
|
|
95
|
-
/>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
)}
|
|
99
|
-
<div>Description</div>
|
|
100
|
-
<TextareaField
|
|
101
|
-
clickToEdit
|
|
102
|
-
name="description"
|
|
103
|
-
onFieldSubmit={this.updateSeqDesc}
|
|
104
|
-
defaultValue={description}
|
|
105
|
-
disabled={readOnly}
|
|
106
|
-
/>
|
|
107
|
-
</React.Fragment>
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export default compose(
|
|
113
|
-
withEditorProps,
|
|
114
|
-
reduxForm({
|
|
115
|
-
form: "GeneralProperties"
|
|
116
|
-
})
|
|
117
|
-
)(GeneralProperties);
|