@teselagen/ove 0.3.10 → 0.3.12

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 (148) hide show
  1. package/index.js +453 -319
  2. package/index.mjs +453 -319
  3. package/index.umd.js +397 -287
  4. package/package.json +2 -2
  5. package/src/AlignmentView/AlignmentVisibilityTool.js +1 -1
  6. package/src/AlignmentView/EditTrackNameDialog.js +1 -5
  7. package/src/AlignmentView/HorizontalPanelDragHandle.js +2 -2
  8. package/src/AlignmentView/Minimap.js +12 -12
  9. package/src/AlignmentView/PairwiseAlignmentView.js +1 -1
  10. package/src/AlignmentView/getGapMap.js +1 -1
  11. package/src/AlignmentView/getTrackFromEvent.js +1 -1
  12. package/src/AlignmentView/index.js +32 -37
  13. package/src/AutoAnnotate.js +48 -48
  14. package/src/CircularView/Cutsites.js +3 -3
  15. package/src/CircularView/Labels/index.js +7 -7
  16. package/src/CircularView/Labels/relaxLabels_DEPRECATED.js +5 -5
  17. package/src/CircularView/RotateCircularViewSlider.js +1 -1
  18. package/src/CircularView/SelectionLayer.js +2 -2
  19. package/src/CircularView/drawAnnotations.js +3 -3
  20. package/src/CircularView/getAngleForPositionMidpoint.js +1 -1
  21. package/src/CircularView/index.d.ts +11 -11
  22. package/src/CircularView/index.js +9 -9
  23. package/src/CreateAnnotationsPage.js +7 -5
  24. package/src/CreateCustomEnzyme/index.js +1 -5
  25. package/src/CutsiteFilter/AdditionalCutsiteInfoDialog.js +11 -11
  26. package/src/CutsiteFilter/index.js +12 -12
  27. package/src/DigestTool/AddLaddersDialog.js +1 -1
  28. package/src/DigestTool/DigestTool.js +3 -3
  29. package/src/DigestTool/Ladder.js +8 -8
  30. package/src/DigestTool/ladderDefaults.js +1 -2
  31. package/src/Editor/CommandHotkeyHandler.js +1 -1
  32. package/src/Editor/DropHandler.js +2 -2
  33. package/src/Editor/index.js +14 -14
  34. package/src/Editor/userDefinedHandlersAndOpts.js +2 -0
  35. package/src/FindBar/index.js +6 -6
  36. package/src/GlobalDialogUtils.js +6 -0
  37. package/src/LinearView/ZoomLinearView.js +1 -1
  38. package/src/LinearView/index.js +7 -7
  39. package/src/MenuBar/index.js +1 -1
  40. package/src/MenuBar/viewSubmenu.js +1 -1
  41. package/src/PCRTool/PCRTool.js +19 -19
  42. package/src/Reflex/Browser.js +4 -5
  43. package/src/Reflex/ReflexContainer.js +3 -3
  44. package/src/Reflex/ReflexElement.js +2 -2
  45. package/src/RowItem/Axis.js +1 -1
  46. package/src/RowItem/Caret/index.js +1 -1
  47. package/src/RowItem/Chromatograms/Chromatogram.js +3 -3
  48. package/src/RowItem/CutsiteSelectionLayers.js +1 -1
  49. package/src/RowItem/Cutsites.js +1 -1
  50. package/src/RowItem/Labels.js +2 -2
  51. package/src/RowItem/Orfs.js +2 -2
  52. package/src/RowItem/Sequence.js +4 -4
  53. package/src/RowItem/StackedAnnotations/PointedAnnotation.js +3 -3
  54. package/src/RowItem/StackedAnnotations/getStructuredBases.js +1 -1
  55. package/src/RowItem/Translations/AASliver.js +71 -75
  56. package/src/RowItem/Translations/index.js +1 -1
  57. package/src/RowItem/getCutsiteLabelHeights.js +1 -1
  58. package/src/RowItem/index.js +14 -8
  59. package/src/RowView/estimateRowHeight.js +5 -5
  60. package/src/RowView/index.d.ts +7 -7
  61. package/src/RowView/index.js +11 -12
  62. package/src/SimpleCircularOrLinearView.js +6 -6
  63. package/src/StatusBar/MeltingTemp.js +3 -3
  64. package/src/ToolBar/ToolbarItem.js +2 -2
  65. package/src/ToolBar/alignmentTool.js +9 -9
  66. package/src/ToolBar/editTool.js +1 -1
  67. package/src/ToolBar/findTool.js +2 -2
  68. package/src/ToolBar/importTool.js +1 -1
  69. package/src/ToolBar/index.js +2 -2
  70. package/src/ToolBar/oligoTool.js +1 -1
  71. package/src/ToolBar/orfTool.js +1 -6
  72. package/src/ToolBar/printTool.js +2 -2
  73. package/src/ToolBar/visibilityTool.js +1 -1
  74. package/src/VersionHistoryView/index.js +2 -2
  75. package/src/commands/index.js +236 -230
  76. package/src/createVectorEditor/index.js +4 -4
  77. package/src/fileUtils.js +18 -18
  78. package/src/helperComponents/AddOrEditAnnotationDialog/index.js +22 -15
  79. package/src/helperComponents/AddOrEditFeatureDialog/index.js +2 -2
  80. package/src/helperComponents/AddOrEditPartDialog/index.js +2 -2
  81. package/src/helperComponents/AddOrEditPrimerDialog/index.js +5 -5
  82. package/src/helperComponents/EnzymesDialog/index.js +17 -22
  83. package/src/helperComponents/GoToDialog.js +5 -1
  84. package/src/helperComponents/MergeFeaturesDialog/index.js +3 -3
  85. package/src/helperComponents/PinchHelper/PinchHelper.js +1 -1
  86. package/src/helperComponents/PrintDialog/index.js +4 -4
  87. package/src/helperComponents/PropertiesDialog/CutsiteProperties.js +3 -3
  88. package/src/helperComponents/PropertiesDialog/GenbankView.js +1 -1
  89. package/src/helperComponents/PropertiesDialog/GeneralProperties.js +5 -5
  90. package/src/helperComponents/PropertiesDialog/GenericAnnotationProperties.js +136 -138
  91. package/src/helperComponents/PropertiesDialog/OrfProperties.js +3 -3
  92. package/src/helperComponents/PropertiesDialog/PrimerProperties.js +1 -1
  93. package/src/helperComponents/PropertiesDialog/TranslationProperties.js +2 -2
  94. package/src/helperComponents/PropertiesDialog/index.js +3 -3
  95. package/src/helperComponents/RemoveDuplicates/index.js +3 -3
  96. package/src/helperComponents/SelectDialog.js +3 -3
  97. package/src/helperComponents/UncontrolledSliderWithPlusMinusBtns.js +5 -5
  98. package/src/helperComponents/createSimpleDialog.js +1 -1
  99. package/src/helperComponents/partTagSearch.js +2 -5
  100. package/src/helperComponents/withHover.js +3 -3
  101. package/src/redux/alignments.js +6 -6
  102. package/src/redux/annotationVisibility.js +4 -4
  103. package/src/redux/featureLengthsToHide.js +1 -1
  104. package/src/redux/frameTranslations.js +3 -3
  105. package/src/redux/middleware.js +2 -2
  106. package/src/redux/panelsShown.js +19 -19
  107. package/src/redux/partLengthsToHide.js +1 -1
  108. package/src/redux/primerLengthsToHide.js +1 -1
  109. package/src/redux/readOnly.js +1 -4
  110. package/src/redux/selectionLayer.js +1 -1
  111. package/src/redux/sequenceData/features.js +1 -1
  112. package/src/redux/sequenceData/upsertDeleteActionGenerator.js +1 -1
  113. package/src/redux/sequenceDataHistory.js +5 -5
  114. package/src/redux/toolBar.js +2 -4
  115. package/src/redux/utils/createMetaAction.js +2 -2
  116. package/src/redux/versionHistory.js +1 -2
  117. package/src/selectors/annotationSearchSelector.js +4 -4
  118. package/src/selectors/circularSelector.js +1 -1
  119. package/src/selectors/cutsiteLabelColorSelector.js +1 -1
  120. package/src/selectors/filteredCutsitesSelector.js +6 -6
  121. package/src/selectors/filteredFeaturesSelector.js +4 -4
  122. package/src/selectors/filteredPartsSelector.js +5 -5
  123. package/src/selectors/filteredPrimersSelector.js +3 -3
  124. package/src/selectors/isEnzymeFilterAndSelector.js +1 -1
  125. package/src/selectors/orfsSelector.js +1 -1
  126. package/src/selectors/restrictionEnzymesSelector.js +2 -2
  127. package/src/selectors/searchLayersSelector.js +7 -7
  128. package/src/selectors/sequenceLengthSelector.js +1 -1
  129. package/src/selectors/sequenceSelector.js +1 -1
  130. package/src/selectors/tagsToBoldSelector.js +1 -1
  131. package/src/selectors/translationsSelector.js +7 -7
  132. package/src/updateEditor.js +1 -1
  133. package/src/utils/PassThrough.js +1 -1
  134. package/src/utils/addWrappedAddons.js +1 -1
  135. package/src/utils/annotationTypes.js +2 -2
  136. package/src/utils/combineReducersDontIgnoreKeys.js +1 -1
  137. package/src/utils/editorUtils.js +2 -2
  138. package/src/utils/massageTickSpacing.js +1 -1
  139. package/src/utils/onlyUpdateForKeysDeep.js +1 -1
  140. package/src/utils/pureNoFunc.js +1 -1
  141. package/src/utils/shouldRerender.js +1 -1
  142. package/src/utils/showFileDialog.js +6 -7
  143. package/src/utils/updateLabelsForInViewFeatures.js +1 -1
  144. package/src/utils/useAnnotationLimits.js +1 -1
  145. package/src/withEditorInteractions/Keyboard.js +2 -3
  146. package/src/withEditorInteractions/createSequenceInputPopup.js +4 -4
  147. package/src/withEditorInteractions/index.js +93 -55
  148. package/src/withEditorProps/index.js +40 -37
@@ -20,7 +20,6 @@ class Browser {
20
20
  return Browser.isBrowser() && Browser.getUserAgent().match(/Opera Mini/i);
21
21
  }
22
22
 
23
-
24
23
  // Firefox 1.0+
25
24
  static isFirefox() {
26
25
  return Browser.isBrowser() && typeof InstallTrigger !== "undefined";
@@ -43,19 +42,20 @@ class Browser {
43
42
 
44
43
  // Edge 20+
45
44
  static isEdge() {
46
- return Browser.isBrowser() && (!Browser.isIE() && !!window.StyleMedia);
45
+ return Browser.isBrowser() && !Browser.isIE() && !!window.StyleMedia;
47
46
  }
48
47
 
49
48
  // Chrome 1+
50
49
  static isChrome() {
51
- return Browser.isBrowser() && (!!window.chrome && !!window.chrome.webstore);
50
+ return Browser.isBrowser() && !!window.chrome && !!window.chrome.webstore;
52
51
  }
53
52
 
54
53
  // Blink engine detection
55
54
  static isBlink() {
56
55
  return (
57
56
  Browser.isBrowser() &&
58
- ((Browser.isChrome() || Browser.isOpera()) && !!window.CSS)
57
+ (Browser.isChrome() || Browser.isOpera()) &&
58
+ !!window.CSS
59
59
  );
60
60
  }
61
61
 
@@ -77,7 +77,6 @@ class Browser {
77
77
  );
78
78
  }
79
79
 
80
-
81
80
  static isWindows() {
82
81
  return (
83
82
  (Browser.isBrowser() && Browser.isWindowsDesktop()) ||
@@ -517,7 +517,7 @@ class ReflexContainer extends React.Component {
517
517
 
518
518
  const newFlex =
519
519
  currentFlex > 0
520
- ? currentFlex * newSize / size
520
+ ? (currentFlex * newSize) / size
521
521
  : this.computePixelFlex() * newSize;
522
522
 
523
523
  // eslint-disable-next-line react/no-direct-mutation-state
@@ -717,8 +717,8 @@ class ReflexContainer extends React.Component {
717
717
  guid(format = "xxxx-xxxx") {
718
718
  let d = new Date().getTime();
719
719
 
720
- return format.replace(/[xy]/g, function(c) {
721
- const r = ((d + Math.random() * 16) % 16) | 0;
720
+ return format.replace(/[xy]/g, function (c) {
721
+ const r = (d + Math.random() * 16) % 16 | 0;
722
722
  d = Math.floor(d / 16);
723
723
  // eslint-disable-next-line eqeqeq
724
724
  return (c == "x" ? r : (r & 0x7) | 0x8).toString(16);
@@ -46,7 +46,7 @@ export default class ReflexElement extends React.Component {
46
46
 
47
47
  this.onResize = this.onResize.bind(this);
48
48
 
49
- this.setStateThrottled = throttle((state) => {
49
+ this.setStateThrottled = throttle(state => {
50
50
  this.setState(state);
51
51
  }, this.props.renderOnResizeRate);
52
52
 
@@ -107,7 +107,7 @@ export default class ReflexElement extends React.Component {
107
107
  /////////////////////////////////////////////////////////
108
108
  renderChildren() {
109
109
  if (this.props.propagateDimensions) {
110
- return React.Children.map(this.props.children, (child) => {
110
+ return React.Children.map(this.props.children, child => {
111
111
  const newProps = Object.assign({}, child.props, {
112
112
  dimensions: this.state.dimensions
113
113
  });
@@ -32,7 +32,7 @@ const Axis = function (props) {
32
32
  range: row,
33
33
  sequenceLength,
34
34
  isProtein
35
- }).map((tickMarkPosition) => {
35
+ }).map(tickMarkPosition => {
36
36
  const gaps = getGaps ? getGaps(tickMarkPosition).gapsBefore : 0;
37
37
  const xCenter =
38
38
  (tickMarkPosition - (isProtein ? 1 : 0) + gaps) * charWidth +
@@ -31,7 +31,7 @@ function Caret(props) {
31
31
  onClick={onClick}
32
32
  onContextMenu={
33
33
  onRightClick
34
- ? (e) => {
34
+ ? e => {
35
35
  onRightClick(e);
36
36
  }
37
37
  : undefined
@@ -61,7 +61,7 @@ export default function Chromatogram(props) {
61
61
  style={{
62
62
  position: "relative"
63
63
  }}
64
- onContextMenu={(e) => {
64
+ onContextMenu={e => {
65
65
  showContextMenu([chromatogramMenu], undefined, e);
66
66
  }}
67
67
  >
@@ -70,7 +70,7 @@ export default function Chromatogram(props) {
70
70
  data-tip="Scale Chromatogram Up"
71
71
  className="scaleChromatogramButtonUp"
72
72
  icon="caret-up"
73
- onClick={(e) => {
73
+ onClick={e => {
74
74
  e.stopPropagation();
75
75
  setScalePct(scalePct + 0.01);
76
76
  }}
@@ -85,7 +85,7 @@ export default function Chromatogram(props) {
85
85
  data-tip="Scale Chromatogram Down"
86
86
  className="scaleChromatogramButtonDown"
87
87
  icon="caret-down"
88
- onClick={(e) => {
88
+ onClick={e => {
89
89
  e.stopPropagation();
90
90
  setScalePct(scalePct - 0.01);
91
91
  }}
@@ -17,7 +17,7 @@ export const CutsiteSelectionLayers = connectToEditor(
17
17
  row
18
18
  }) {
19
19
  return Object.keys(cutsites)
20
- .sort((a) => (cutsites[a].id === hoveredAnnotation ? 1 : -1))
20
+ .sort(a => (cutsites[a].id === hoveredAnnotation ? 1 : -1))
21
21
  .map(function (id, index) {
22
22
  const cutsite = cutsites[id];
23
23
  const isHovered = hoveredAnnotation === cutsite.id;
@@ -118,7 +118,7 @@ function Cutsites(props) {
118
118
  const snips = [];
119
119
  const snipConnectors = [];
120
120
  Object.keys(annotationRanges)
121
- .sort((a) =>
121
+ .sort(a =>
122
122
  annotationRanges[a].annotation.id === hoveredAnnotation ? 1 : -1
123
123
  )
124
124
  .forEach(function (key) {
@@ -73,7 +73,7 @@ function Labels(props) {
73
73
  )
74
74
  );
75
75
 
76
- filter(annotationRanges, (r) => {
76
+ filter(annotationRanges, r => {
77
77
  if (onlyShowLabelsThatDoNotFit) {
78
78
  //tnrtodo: more work needs to be done here to make this actually configurable
79
79
  //check if annotation name will fit
@@ -298,7 +298,7 @@ const DrawLabel = withHover(
298
298
 
299
299
  {!noLabelLine && (
300
300
  <div
301
- ref={(n) => {
301
+ ref={n => {
302
302
  if (n) this.n = n;
303
303
  }}
304
304
  className="veLabelLine"
@@ -7,7 +7,7 @@ function getExtraInnerCompProps(annotationRange, props) {
7
7
  const { annotation, start, end } = annotationRange;
8
8
  const { frame, internalStartCodonIndices = [] } = annotation;
9
9
  const normalizedInternalStartCodonIndices = internalStartCodonIndices
10
- .filter(function(position) {
10
+ .filter(function (position) {
11
11
  if (
12
12
  position >= row.start &&
13
13
  position >= start &&
@@ -17,7 +17,7 @@ function getExtraInnerCompProps(annotationRange, props) {
17
17
  return true;
18
18
  } else return false;
19
19
  })
20
- .map(function(position) {
20
+ .map(function (position) {
21
21
  return position - start;
22
22
  });
23
23
 
@@ -43,12 +43,12 @@ class Sequence extends React.Component {
43
43
  const rowSeqLen = sequence.length;
44
44
  let overlapToBold;
45
45
  let isDigestPart;
46
- [hoveredAnnEasyStore.hoveredAnn].forEach((ann) => {
46
+ [hoveredAnnEasyStore.hoveredAnn].forEach(ann => {
47
47
  if (ann && !isReplacementLayer) {
48
48
  let start = ann.start;
49
49
  let end = ann.end - 1;
50
50
 
51
- partOverhangs.forEach((h) => {
51
+ partOverhangs.forEach(h => {
52
52
  if (ann[h]) {
53
53
  isDigestPart = true;
54
54
  if (h.includes("Underhang") && isReverse) {
@@ -101,7 +101,7 @@ class Sequence extends React.Component {
101
101
  scrollData,
102
102
  width
103
103
  });
104
- inner = times(numChunks, (i) => {
104
+ inner = times(numChunks, i => {
105
105
  const seqChunk = getChunk(sequence, chunkSize, i);
106
106
  const textLength = charWidth * seqChunk.length;
107
107
  const x = i * chunkWidth;
@@ -194,7 +194,7 @@ class ColoredSequence extends React.Component {
194
194
  const { props } = this;
195
195
  if (
196
196
  ["charWidth", "sequence", "height", "isReverse", "width"].some(
197
- (key) => props[key] !== newProps[key]
197
+ key => props[key] !== newProps[key]
198
198
  )
199
199
  )
200
200
  return true;
@@ -69,7 +69,7 @@ function PointedAnnotation(props) {
69
69
  let partOverhangStart;
70
70
  let partOverhangEnd;
71
71
 
72
- partOverhangs.forEach((h) => {
72
+ partOverhangs.forEach(h => {
73
73
  const overhangBps = props[h];
74
74
  if (overhangBps) {
75
75
  if (h.includes("fivePrime")) {
@@ -255,7 +255,7 @@ function PointedAnnotation(props) {
255
255
  (rangeType === (forward ? "start" : "end") ||
256
256
  rangeType === "beginningAndEnd") && (
257
257
  <Tooltip
258
- onInteraction={(isOpen) => {
258
+ onInteraction={isOpen => {
259
259
  setOpen(isOpen);
260
260
  }}
261
261
  isOpen={isOpen}
@@ -277,7 +277,7 @@ function PointedAnnotation(props) {
277
277
  (rangeType === (forward ? "end" : "start") ||
278
278
  rangeType === "beginningAndEnd") && (
279
279
  <Tooltip
280
- onInteraction={(isOpen) => {
280
+ onInteraction={isOpen => {
281
281
  setOpen2(isOpen);
282
282
  }}
283
283
  isOpen={isOpen2}
@@ -89,7 +89,7 @@ export function getStructuredBases({
89
89
  r.allBasesWithMetaData.splice(
90
90
  index,
91
91
  0,
92
- ...bases.split("").map((b) => ({ b, isMatch: false }))
92
+ ...bases.split("").map(b => ({ b, isMatch: false }))
93
93
  );
94
94
  });
95
95
 
@@ -107,83 +107,79 @@ function AASliver(props) {
107
107
  z`;
108
108
  return (
109
109
  <g
110
- onClick={onClick}
111
- onContextMenu={onContextMenu}
112
- transform={
113
- "scale(" +
114
- (width / 100) * 1.25 +
115
- ", " +
116
- height / 100 +
117
- ") translate(" +
118
- ((forward ? -20 : -50) +
119
- ((relativeAAPositionInTranslation - 1) * 100) / 1.25) +
120
- ",0)"
121
- }
122
- >
123
- <title>{title}</title>
124
- {showAAColors &&
125
- (isFiller ? (
126
- <polyline
127
- className={letter}
128
- transform={
129
- forward ? "scale(3,1)" : "translate(300,0) scale(-3,1) "
130
- }
131
- points={
132
- isFiller
133
- ? "25,0 49,0 60,50 49,100 25,100 38,50 25,0"
134
- : isTruncatedStart
135
- ? "0,0 50,0 60,50 50,100 00,100 16,50 0,0"
136
- : isTruncatedEnd
137
- ? "24,0 74,0 84,50 74,100 24,100 40,50 24,0"
138
- : "0,0 74,0 85,50 74,100 0,100 16,50 0,0"
139
- }
140
- strokeWidth="5"
141
- fill={color || "gray"}
142
- />
143
- ) : (
144
- <path
145
- className={letter}
146
- transform={
147
- forward ? "scale(3,1)" : "translate(300,0) scale(-3,1) "
148
- }
149
- d={path}
150
- strokeWidth="5"
151
- fill={color || "gray"}
152
- />
153
- ))}
110
+ onClick={onClick}
111
+ onContextMenu={onContextMenu}
112
+ transform={
113
+ "scale(" +
114
+ (width / 100) * 1.25 +
115
+ ", " +
116
+ height / 100 +
117
+ ") translate(" +
118
+ ((forward ? -20 : -50) +
119
+ ((relativeAAPositionInTranslation - 1) * 100) / 1.25) +
120
+ ",0)"
121
+ }
122
+ >
123
+ <title>{title}</title>
124
+ {showAAColors &&
125
+ (isFiller ? (
126
+ <polyline
127
+ className={letter}
128
+ transform={forward ? "scale(3,1)" : "translate(300,0) scale(-3,1) "}
129
+ points={
130
+ isFiller
131
+ ? "25,0 49,0 60,50 49,100 25,100 38,50 25,0"
132
+ : isTruncatedStart
133
+ ? "0,0 50,0 60,50 50,100 00,100 16,50 0,0"
134
+ : isTruncatedEnd
135
+ ? "24,0 74,0 84,50 74,100 24,100 40,50 24,0"
136
+ : "0,0 74,0 85,50 74,100 0,100 16,50 0,0"
137
+ }
138
+ strokeWidth="5"
139
+ fill={color || "gray"}
140
+ />
141
+ ) : (
142
+ <path
143
+ className={letter}
144
+ transform={forward ? "scale(3,1)" : "translate(300,0) scale(-3,1) "}
145
+ d={path}
146
+ strokeWidth="5"
147
+ fill={color || "gray"}
148
+ />
149
+ ))}
154
150
 
155
- {!isFiller && (
156
- <text
157
- fontSize={25}
158
- stroke="black"
159
- strokeWidth={2}
160
- transform={`scale(${(3 / width) * 10},3) translate(${
161
- ((forward ? 45 : 55) * width) / 10
162
- },21)`}
163
- x="0"
164
- y="4"
165
- style={{ textAnchor: "middle" }}
166
- >
167
- {letter}
168
- </text>
169
- )}
151
+ {!isFiller && (
152
+ <text
153
+ fontSize={25}
154
+ stroke="black"
155
+ strokeWidth={2}
156
+ transform={`scale(${(3 / width) * 10},3) translate(${
157
+ ((forward ? 45 : 55) * width) / 10
158
+ },21)`}
159
+ x="0"
160
+ y="4"
161
+ style={{ textAnchor: "middle" }}
162
+ >
163
+ {letter}
164
+ </text>
165
+ )}
170
166
 
171
- {showAminoAcidNumbers && (aminoAcidIndex + 1) % 5 === 0 && (
172
- <text
173
- fontSize={25}
174
- stroke="black"
175
- strokeWidth={2}
176
- transform={`scale(${(3 / width) * 10},3) translate(${
177
- ((forward ? 45 : 55) * width) / 10
178
- },51)`}
179
- x="0"
180
- y="4"
181
- style={{ textAnchor: "middle" }}
182
- >
183
- {aminoAcidIndex + 1}
184
- </text>
185
- )}
186
- </g>
167
+ {showAminoAcidNumbers && (aminoAcidIndex + 1) % 5 === 0 && (
168
+ <text
169
+ fontSize={25}
170
+ stroke="black"
171
+ strokeWidth={2}
172
+ transform={`scale(${(3 / width) * 10},3) translate(${
173
+ ((forward ? 45 : 55) * width) / 10
174
+ },51)`}
175
+ x="0"
176
+ y="4"
177
+ style={{ textAnchor: "middle" }}
178
+ >
179
+ {aminoAcidIndex + 1}
180
+ </text>
181
+ )}
182
+ </g>
187
183
  );
188
184
  }
189
185
 
@@ -37,7 +37,7 @@ function Translations(props) {
37
37
  {...{
38
38
  ...props,
39
39
  annotationRanges: props.annotationRanges.filter(
40
- (t) => !t.isJoinedLocation
40
+ t => !t.isJoinedLocation
41
41
  ),
42
42
  annotationHeight:
43
43
  props.annotationHeight +
@@ -19,7 +19,7 @@ export default function getCutsiteLabelHeights({
19
19
  let maxAnnotationYOffset = 0;
20
20
  const rowCenter = rowLength / 2;
21
21
  const iTree = new IntervalTree(rowCenter);
22
- forEach(annotationRanges, function(annotationRange) {
22
+ forEach(annotationRanges, function (annotationRange) {
23
23
  counter++;
24
24
  if (counter > 50) return;
25
25
  let annotation = annotationRange.annotation;
@@ -3,7 +3,15 @@ import {
3
3
  getSequenceWithinRange,
4
4
  getOverlapsOfPotentiallyCircularRanges
5
5
  } from "@teselagen/range-utils";
6
- import { map, camelCase, startCase, startsWith, flatMap, assign, noop } from "lodash";
6
+ import {
7
+ map,
8
+ camelCase,
9
+ startCase,
10
+ startsWith,
11
+ flatMap,
12
+ assign,
13
+ noop
14
+ } from "lodash";
7
15
  import { getComplementSequenceString } from "@teselagen/sequence-utils";
8
16
  import React, { useMemo } from "react";
9
17
  import pluralize from "pluralize";
@@ -24,15 +32,13 @@ import { filter } from "lodash";
24
32
  import { defaultCharWidth } from "../constants/rowviewContants";
25
33
  import { CutsiteSelectionLayers } from "./CutsiteSelectionLayers";
26
34
 
27
-
28
-
29
35
  function filterRanges(ranges, extraProps = {}) {
30
36
  if (!ranges) return ranges;
31
37
  if (extraProps.onlyForward) {
32
- ranges = filter(ranges, (a) => a.annotation.forward);
38
+ ranges = filter(ranges, a => a.annotation.forward);
33
39
  }
34
40
  if (extraProps.onlyReverse) {
35
- ranges = filter(ranges, (a) => !a.annotation.forward);
41
+ ranges = filter(ranges, a => !a.annotation.forward);
36
42
  }
37
43
  return ranges;
38
44
  }
@@ -149,7 +155,7 @@ export default function RowItem(props) {
149
155
  if (alignmentData) {
150
156
  const gapMap = getGapMap(alignmentData.sequence);
151
157
  //this function is used to calculate the number of spaces that come before or inside a range
152
- return (rangeOrCaretPosition) => {
158
+ return rangeOrCaretPosition => {
153
159
  if (typeof rangeOrCaretPosition !== "object") {
154
160
  return {
155
161
  gapsBefore:
@@ -211,7 +217,7 @@ export default function RowItem(props) {
211
217
  const pluralType = pluralize(type);
212
218
  const ranges = filterRanges(
213
219
  annotationLabelVisibility[pluralType] && annotationVisibility[pluralType]
214
- ? map(row[pluralType], (a) =>
220
+ ? map(row[pluralType], a =>
215
221
  assign(a, {
216
222
  onClick: props[type + "Clicked"],
217
223
  onRightClick: props[type + "RightClicked"],
@@ -629,7 +635,7 @@ export default function RowItem(props) {
629
635
 
630
636
  function getGapMap(sequence) {
631
637
  const gapMap = [0]; //a map of position to how many gaps come before that position [0,0,0,5,5,5,5,17,17,17, ]
632
- sequence.split("").forEach((char) => {
638
+ sequence.split("").forEach(char => {
633
639
  if (char === "-") {
634
640
  gapMap[Math.max(0, gapMap.length - 1)] =
635
641
  (gapMap[Math.max(0, gapMap.length - 1)] || 0) + 1;
@@ -25,7 +25,7 @@ export const rowHeights = {
25
25
 
26
26
  rowHeights.primaryProteinSequence = rowHeights.translations;
27
27
 
28
- Object.keys(rowHeights).forEach((k) => {
28
+ Object.keys(rowHeights).forEach(k => {
29
29
  rowHeights[k].type = k;
30
30
  rowHeights[k].marginTop = rowHeights[k].marginTop || 0;
31
31
  rowHeights[k].marginBottom = rowHeights[k].marginBottom || 0;
@@ -33,7 +33,7 @@ Object.keys(rowHeights).forEach((k) => {
33
33
  rowHeights[k].spaceBetweenAnnotations || 0;
34
34
  });
35
35
  const translations = {
36
- getHeight: (props) => {
36
+ getHeight: props => {
37
37
  if (props.annotationVisibility.aminoAcidNumbers) {
38
38
  return [rowHeights.aminoAcidNumbers.type, rowHeights.translations.type];
39
39
  }
@@ -88,7 +88,7 @@ const annotationsToCompute = {
88
88
  }
89
89
  };
90
90
 
91
- export default (props) => {
91
+ export default props => {
92
92
  let {
93
93
  index,
94
94
  cache,
@@ -133,7 +133,7 @@ export default (props) => {
133
133
  if (hasYOffset) {
134
134
  let maxYOffset = 0;
135
135
  annotations &&
136
- annotations.forEach((a) => {
136
+ annotations.forEach(a => {
137
137
  if (a.yOffset + 1 > maxYOffset) maxYOffset = a.yOffset + 1;
138
138
  });
139
139
  heightToAdd = maxYOffset * annotationHeight;
@@ -175,7 +175,7 @@ function getHeights(heightKey, props) {
175
175
  function getSummedHeights(heightKeys, props) {
176
176
  let height = 0;
177
177
  let marginHeight = 0;
178
- (Array.isArray(heightKeys) ? heightKeys : [heightKeys]).forEach((k) => {
178
+ (Array.isArray(heightKeys) ? heightKeys : [heightKeys]).forEach(k => {
179
179
  const [h, m] = getHeights(k, props);
180
180
  height += h;
181
181
  marginHeight += m;
@@ -1,10 +1,10 @@
1
1
  import React from "react";
2
2
  export interface RowViewProps {
3
- editorName: string, //the name of the editor instance (this should match what you've set up in your redux store)
4
- height: number, //default = 400
5
- width: number,
6
- marginWidth: number,
7
- charWidth: number,
8
- RowItemProps: object, //props passed to RowItem
3
+ editorName: string; //the name of the editor instance (this should match what you've set up in your redux store)
4
+ height: number; //default = 400
5
+ width: number;
6
+ marginWidth: number;
7
+ charWidth: number;
8
+ RowItemProps: object; //props passed to RowItem
9
9
  }
10
- export default class RowView extends React.Component <RowViewProps> {}
10
+ export default class RowView extends React.Component<RowViewProps> {}
@@ -26,7 +26,6 @@ import {
26
26
  import { defaultMemoize } from "reselect";
27
27
  import { connect } from "react-redux";
28
28
 
29
-
30
29
  const rowJumpButtonStyle = {
31
30
  height: rowHeights.rowJumpButtons.height
32
31
  };
@@ -285,7 +284,7 @@ class _RowView extends React.Component {
285
284
 
286
285
  cache = {};
287
286
 
288
- renderItem = (index) => {
287
+ renderItem = index => {
289
288
  // if (this.cache[index]) return this.cache[index];
290
289
  const {
291
290
  //currently found in props
@@ -319,7 +318,7 @@ class _RowView extends React.Component {
319
318
  icon="arrow-down"
320
319
  minimal
321
320
  data-test="jumpToEndButton"
322
- onClick={(e) => {
321
+ onClick={e => {
323
322
  e.stopPropagation();
324
323
  this.InfiniteScroller &&
325
324
  this.InfiniteScroller.scrollTo(rowData.length);
@@ -338,7 +337,7 @@ class _RowView extends React.Component {
338
337
  icon="arrow-up"
339
338
  minimal
340
339
  data-test="jumpToStartButton"
341
- onClick={(e) => {
340
+ onClick={e => {
342
341
  e.stopPropagation();
343
342
  this.InfiniteScroller && this.InfiniteScroller.scrollTo(0);
344
343
  }}
@@ -362,7 +361,7 @@ class _RowView extends React.Component {
362
361
  truncateLabelsThatDoNotFit,
363
362
  rowBottomComp,
364
363
  scalePct: this.state?.scalePct,
365
- setScalePct: (scalePct) => {
364
+ setScalePct: scalePct => {
366
365
  this.setState({ scalePct });
367
366
  },
368
367
  isRowView: true,
@@ -389,11 +388,11 @@ class _RowView extends React.Component {
389
388
  return null;
390
389
  }
391
390
  };
392
- onDrag = (event) => {
391
+ onDrag = event => {
393
392
  if (isMobile({ tablet: true })) {
394
393
  if (
395
394
  //only allow dragging on mobile if the user is grabbing the cursor
396
- !some(draggableClassnames, (cn) => {
395
+ !some(draggableClassnames, cn => {
397
396
  if (event.target.classList.contains(cn)) {
398
397
  return true;
399
398
  }
@@ -407,7 +406,7 @@ class _RowView extends React.Component {
407
406
  const rowData = this.rowData;
408
407
  this.getNearestCursorPositionToMouseEvent(rowData, event, editorDragged);
409
408
  };
410
- onStart = (event) => {
409
+ onStart = event => {
411
410
  this.dragging = true;
412
411
  const rowData = this.rowData;
413
412
  this.getNearestCursorPositionToMouseEvent(
@@ -422,16 +421,16 @@ class _RowView extends React.Component {
422
421
  editorDragStopped();
423
422
  };
424
423
 
425
- getRef = (ref) => (this.node = ref);
424
+ getRef = ref => (this.node = ref);
426
425
 
427
- onContextMenu = (event) => {
426
+ onContextMenu = event => {
428
427
  this.getNearestCursorPositionToMouseEvent(
429
428
  this.rowData,
430
429
  event,
431
430
  this.props.backgroundRightClicked
432
431
  );
433
432
  };
434
- onClick = (event) => {
433
+ onClick = event => {
435
434
  this.getNearestCursorPositionToMouseEvent(
436
435
  this.rowData,
437
436
  event,
@@ -439,7 +438,7 @@ class _RowView extends React.Component {
439
438
  );
440
439
  };
441
440
 
442
- getReactListRef = (c) => {
441
+ getReactListRef = c => {
443
442
  this.InfiniteScroller = c;
444
443
  !this.calledUpdateScrollOnce && this.updateScrollPosition({}, this.props); //trigger the scroll here as well because now we actually have the infinite scroller component accessible
445
444
  };