@teselagen/ove 0.8.37 → 0.8.39

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 CHANGED
@@ -95195,7 +95195,44 @@ function getCurrentDateString() {
95195
95195
  return day2 + "-" + month + "-" + year;
95196
95196
  }
95197
95197
  __name(getCurrentDateString, "getCurrentDateString");
95198
+ const standardLineLength = 79;
95198
95199
  function featureNoteInDataToGenbankString(name2, value, options) {
95200
+ const valueString = mangleOrStripUrls(value, options);
95201
+ if (valueString.length > standardLineLength - 25 - name2.length) {
95202
+ const lines = [];
95203
+ let currentIndex = 0;
95204
+ while (currentIndex < valueString.length) {
95205
+ if (currentIndex === 0) {
95206
+ const chunk = valueString.substring(
95207
+ currentIndex,
95208
+ currentIndex + standardLineLength - name2.length - 24
95209
+ );
95210
+ lines.push(
95211
+ StringUtil.lpad("/", " ", 22) + name2 + '="' + chunk + (currentIndex + standardLineLength - 22 - name2.length >= valueString.length ? '"' : "")
95212
+ );
95213
+ currentIndex += standardLineLength - name2.length - 24;
95214
+ } else {
95215
+ const chunk = valueString.substring(
95216
+ currentIndex,
95217
+ currentIndex + standardLineLength - 21
95218
+ );
95219
+ if (currentIndex + standardLineLength - 21 >= valueString.length) {
95220
+ const lineString = " ".repeat(21) + chunk;
95221
+ if (lineString.length === standardLineLength) {
95222
+ lines.push(lineString);
95223
+ lines.push(" ".repeat(21) + '"');
95224
+ } else {
95225
+ lines.push(lineString + '"');
95226
+ }
95227
+ } else {
95228
+ const lineString = " ".repeat(21) + chunk;
95229
+ lines.push(lineString);
95230
+ }
95231
+ currentIndex += standardLineLength - 21;
95232
+ }
95233
+ }
95234
+ return lines.join("\r\n");
95235
+ }
95199
95236
  return StringUtil.lpad("/", " ", 22) + name2 + '="' + mangleOrStripUrls(value, options) + '"';
95200
95237
  }
95201
95238
  __name(featureNoteInDataToGenbankString, "featureNoteInDataToGenbankString");
@@ -98059,13 +98096,13 @@ function addCustomEnzyme(newEnz) {
98059
98096
  );
98060
98097
  }
98061
98098
  __name(addCustomEnzyme, "addCustomEnzyme");
98062
- function pareDownAnnotations(annotations, max2) {
98099
+ function pareDownAnnotations(annotations, max2, sequenceLength) {
98063
98100
  let annotationsToPass = annotations;
98064
98101
  let paredDown = false;
98065
98102
  if (Object.keys(annotations).length > max2) {
98066
98103
  paredDown = true;
98067
98104
  const sortedAnnotations = sortBy$1(annotations, function(annotation) {
98068
- return -getRangeLength(annotation);
98105
+ return -getRangeLength(annotation, sequenceLength);
98069
98106
  });
98070
98107
  annotationsToPass = sortedAnnotations.slice(0, max2).reduce(function(obj, item) {
98071
98108
  obj[item.id] = item;
@@ -117208,7 +117245,7 @@ function showFileDialog({ multiple = false, onSelect }) {
117208
117245
  input.click();
117209
117246
  }
117210
117247
  __name(showFileDialog, "showFileDialog");
117211
- const version = "0.8.37";
117248
+ const version = "0.8.39";
117212
117249
  const packageJson = {
117213
117250
  version
117214
117251
  };
@@ -124606,7 +124643,8 @@ const __LinearView = class __LinearView extends React.Component {
124606
124643
  const maxToShow = (maxAnnotationsToDisplay ? maxAnnotationsToDisplay[type2] : limits[type2]) || 50;
124607
124644
  const [annotations, paredDown] = pareDownAnnotations(
124608
124645
  sequenceData2["filtered" + nameUpper] || sequenceData2[type2] || {},
124609
- maxToShow
124646
+ maxToShow,
124647
+ sequenceData2.sequence ? sequenceData2.sequence.length : sequenceData2.size || 0
124610
124648
  );
124611
124649
  if (paredDown) {
124612
124650
  this.paredDownMessages.push(
@@ -124896,7 +124934,7 @@ const __LinearView = class __LinearView extends React.Component {
124896
124934
  fullSequence: sequenceData2.sequence,
124897
124935
  emptyText: getEmptyText({ sequenceData: sequenceData2, caretPosition: caretPosition2 }),
124898
124936
  tickSpacing: tickSpacingToUse,
124899
- annotationVisibility: __spreadValues(__spreadValues(__spreadValues({}, rest.annotationVisibility), (!isLinViewZoomed || this.charWidth < 5) && {
124937
+ annotationVisibility: __spreadValues(__spreadValues(__spreadValues({}, rest.annotationVisibility), (!isLinViewZoomed || this.charWidth < 5) && bpsPerRow >= 50 && {
124900
124938
  translations: false,
124901
124939
  primaryProteinSequence: false,
124902
124940
  reverseSequence: false,
@@ -126797,7 +126835,7 @@ function CircularView(props) {
126797
126835
  }
126798
126836
  const innerRadius = radius - 10;
126799
126837
  const initialRadius = radius;
126800
- const showSeq = isZoomedIn && rangeToShowLength < 140;
126838
+ const showSeq = rangeToShowLength < 140 && (isZoomedIn || sequenceLength < 50);
126801
126839
  const showSeqText = rangeToShowLength < 80;
126802
126840
  const layersToDraw = [
126803
126841
  { zIndex: 10, layerName: "sequenceChars" },
@@ -127050,7 +127088,7 @@ function CircularView(props) {
127050
127088
  }
127051
127089
  );
127052
127090
  const maxToShow = !isZoomedIn && ((maxAnnotationsToDisplay ? maxAnnotationsToDisplay[layerName] : limits[layerName]) || 50);
127053
- const [trimmedAndParedAnns, paredDown] = maxToShow ? pareDownAnnotations(trimmedAnnotations, maxToShow) : [trimmedAnnotations];
127091
+ const [trimmedAndParedAnns, paredDown] = maxToShow ? pareDownAnnotations(trimmedAnnotations, maxToShow, sequenceLength) : [trimmedAnnotations];
127054
127092
  if (paredDown) {
127055
127093
  paredDownMessages.push(
127056
127094
  getParedDownWarning({
package/index.es.js CHANGED
@@ -95177,7 +95177,44 @@ function getCurrentDateString() {
95177
95177
  return day2 + "-" + month + "-" + year;
95178
95178
  }
95179
95179
  __name(getCurrentDateString, "getCurrentDateString");
95180
+ const standardLineLength = 79;
95180
95181
  function featureNoteInDataToGenbankString(name2, value, options) {
95182
+ const valueString = mangleOrStripUrls(value, options);
95183
+ if (valueString.length > standardLineLength - 25 - name2.length) {
95184
+ const lines = [];
95185
+ let currentIndex = 0;
95186
+ while (currentIndex < valueString.length) {
95187
+ if (currentIndex === 0) {
95188
+ const chunk = valueString.substring(
95189
+ currentIndex,
95190
+ currentIndex + standardLineLength - name2.length - 24
95191
+ );
95192
+ lines.push(
95193
+ StringUtil.lpad("/", " ", 22) + name2 + '="' + chunk + (currentIndex + standardLineLength - 22 - name2.length >= valueString.length ? '"' : "")
95194
+ );
95195
+ currentIndex += standardLineLength - name2.length - 24;
95196
+ } else {
95197
+ const chunk = valueString.substring(
95198
+ currentIndex,
95199
+ currentIndex + standardLineLength - 21
95200
+ );
95201
+ if (currentIndex + standardLineLength - 21 >= valueString.length) {
95202
+ const lineString = " ".repeat(21) + chunk;
95203
+ if (lineString.length === standardLineLength) {
95204
+ lines.push(lineString);
95205
+ lines.push(" ".repeat(21) + '"');
95206
+ } else {
95207
+ lines.push(lineString + '"');
95208
+ }
95209
+ } else {
95210
+ const lineString = " ".repeat(21) + chunk;
95211
+ lines.push(lineString);
95212
+ }
95213
+ currentIndex += standardLineLength - 21;
95214
+ }
95215
+ }
95216
+ return lines.join("\r\n");
95217
+ }
95181
95218
  return StringUtil.lpad("/", " ", 22) + name2 + '="' + mangleOrStripUrls(value, options) + '"';
95182
95219
  }
95183
95220
  __name(featureNoteInDataToGenbankString, "featureNoteInDataToGenbankString");
@@ -98041,13 +98078,13 @@ function addCustomEnzyme(newEnz) {
98041
98078
  );
98042
98079
  }
98043
98080
  __name(addCustomEnzyme, "addCustomEnzyme");
98044
- function pareDownAnnotations(annotations, max2) {
98081
+ function pareDownAnnotations(annotations, max2, sequenceLength) {
98045
98082
  let annotationsToPass = annotations;
98046
98083
  let paredDown = false;
98047
98084
  if (Object.keys(annotations).length > max2) {
98048
98085
  paredDown = true;
98049
98086
  const sortedAnnotations = sortBy$1(annotations, function(annotation) {
98050
- return -getRangeLength(annotation);
98087
+ return -getRangeLength(annotation, sequenceLength);
98051
98088
  });
98052
98089
  annotationsToPass = sortedAnnotations.slice(0, max2).reduce(function(obj, item) {
98053
98090
  obj[item.id] = item;
@@ -117190,7 +117227,7 @@ function showFileDialog({ multiple = false, onSelect }) {
117190
117227
  input.click();
117191
117228
  }
117192
117229
  __name(showFileDialog, "showFileDialog");
117193
- const version = "0.8.37";
117230
+ const version = "0.8.39";
117194
117231
  const packageJson = {
117195
117232
  version
117196
117233
  };
@@ -124588,7 +124625,8 @@ const __LinearView = class __LinearView extends React__default.Component {
124588
124625
  const maxToShow = (maxAnnotationsToDisplay ? maxAnnotationsToDisplay[type2] : limits[type2]) || 50;
124589
124626
  const [annotations, paredDown] = pareDownAnnotations(
124590
124627
  sequenceData2["filtered" + nameUpper] || sequenceData2[type2] || {},
124591
- maxToShow
124628
+ maxToShow,
124629
+ sequenceData2.sequence ? sequenceData2.sequence.length : sequenceData2.size || 0
124592
124630
  );
124593
124631
  if (paredDown) {
124594
124632
  this.paredDownMessages.push(
@@ -124878,7 +124916,7 @@ const __LinearView = class __LinearView extends React__default.Component {
124878
124916
  fullSequence: sequenceData2.sequence,
124879
124917
  emptyText: getEmptyText({ sequenceData: sequenceData2, caretPosition: caretPosition2 }),
124880
124918
  tickSpacing: tickSpacingToUse,
124881
- annotationVisibility: __spreadValues(__spreadValues(__spreadValues({}, rest.annotationVisibility), (!isLinViewZoomed || this.charWidth < 5) && {
124919
+ annotationVisibility: __spreadValues(__spreadValues(__spreadValues({}, rest.annotationVisibility), (!isLinViewZoomed || this.charWidth < 5) && bpsPerRow >= 50 && {
124882
124920
  translations: false,
124883
124921
  primaryProteinSequence: false,
124884
124922
  reverseSequence: false,
@@ -126779,7 +126817,7 @@ function CircularView(props) {
126779
126817
  }
126780
126818
  const innerRadius = radius - 10;
126781
126819
  const initialRadius = radius;
126782
- const showSeq = isZoomedIn && rangeToShowLength < 140;
126820
+ const showSeq = rangeToShowLength < 140 && (isZoomedIn || sequenceLength < 50);
126783
126821
  const showSeqText = rangeToShowLength < 80;
126784
126822
  const layersToDraw = [
126785
126823
  { zIndex: 10, layerName: "sequenceChars" },
@@ -127032,7 +127070,7 @@ function CircularView(props) {
127032
127070
  }
127033
127071
  );
127034
127072
  const maxToShow = !isZoomedIn && ((maxAnnotationsToDisplay ? maxAnnotationsToDisplay[layerName] : limits[layerName]) || 50);
127035
- const [trimmedAndParedAnns, paredDown] = maxToShow ? pareDownAnnotations(trimmedAnnotations, maxToShow) : [trimmedAnnotations];
127073
+ const [trimmedAndParedAnns, paredDown] = maxToShow ? pareDownAnnotations(trimmedAnnotations, maxToShow, sequenceLength) : [trimmedAnnotations];
127036
127074
  if (paredDown) {
127037
127075
  paredDownMessages.push(
127038
127076
  getParedDownWarning({
package/index.umd.js CHANGED
@@ -124096,7 +124096,44 @@ ${seq.sequence}
124096
124096
  return day2 + "-" + month + "-" + year;
124097
124097
  }
124098
124098
  __name(getCurrentDateString, "getCurrentDateString");
124099
+ const standardLineLength = 79;
124099
124100
  function featureNoteInDataToGenbankString(name2, value, options) {
124101
+ const valueString = mangleOrStripUrls(value, options);
124102
+ if (valueString.length > standardLineLength - 25 - name2.length) {
124103
+ const lines = [];
124104
+ let currentIndex = 0;
124105
+ while (currentIndex < valueString.length) {
124106
+ if (currentIndex === 0) {
124107
+ const chunk = valueString.substring(
124108
+ currentIndex,
124109
+ currentIndex + standardLineLength - name2.length - 24
124110
+ );
124111
+ lines.push(
124112
+ StringUtil.lpad("/", " ", 22) + name2 + '="' + chunk + (currentIndex + standardLineLength - 22 - name2.length >= valueString.length ? '"' : "")
124113
+ );
124114
+ currentIndex += standardLineLength - name2.length - 24;
124115
+ } else {
124116
+ const chunk = valueString.substring(
124117
+ currentIndex,
124118
+ currentIndex + standardLineLength - 21
124119
+ );
124120
+ if (currentIndex + standardLineLength - 21 >= valueString.length) {
124121
+ const lineString = " ".repeat(21) + chunk;
124122
+ if (lineString.length === standardLineLength) {
124123
+ lines.push(lineString);
124124
+ lines.push(" ".repeat(21) + '"');
124125
+ } else {
124126
+ lines.push(lineString + '"');
124127
+ }
124128
+ } else {
124129
+ const lineString = " ".repeat(21) + chunk;
124130
+ lines.push(lineString);
124131
+ }
124132
+ currentIndex += standardLineLength - 21;
124133
+ }
124134
+ }
124135
+ return lines.join("\r\n");
124136
+ }
124100
124137
  return StringUtil.lpad("/", " ", 22) + name2 + '="' + mangleOrStripUrls(value, options) + '"';
124101
124138
  }
124102
124139
  __name(featureNoteInDataToGenbankString, "featureNoteInDataToGenbankString");
@@ -126207,13 +126244,13 @@ ${seq.sequence}
126207
126244
  );
126208
126245
  }
126209
126246
  __name(addCustomEnzyme, "addCustomEnzyme");
126210
- function pareDownAnnotations(annotations, max2) {
126247
+ function pareDownAnnotations(annotations, max2, sequenceLength) {
126211
126248
  let annotationsToPass = annotations;
126212
126249
  let paredDown = false;
126213
126250
  if (Object.keys(annotations).length > max2) {
126214
126251
  paredDown = true;
126215
126252
  const sortedAnnotations = sortBy$1(annotations, function(annotation) {
126216
- return -getRangeLength(annotation);
126253
+ return -getRangeLength(annotation, sequenceLength);
126217
126254
  });
126218
126255
  annotationsToPass = sortedAnnotations.slice(0, max2).reduce(function(obj, item) {
126219
126256
  obj[item.id] = item;
@@ -145306,7 +145343,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
145306
145343
  input.click();
145307
145344
  }
145308
145345
  __name(showFileDialog, "showFileDialog");
145309
- const version = "0.8.37";
145346
+ const version = "0.8.39";
145310
145347
  const packageJson = {
145311
145348
  version
145312
145349
  };
@@ -151102,7 +151139,8 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
151102
151139
  const maxToShow = (maxAnnotationsToDisplay ? maxAnnotationsToDisplay[type2] : limits[type2]) || 50;
151103
151140
  const [annotations, paredDown] = pareDownAnnotations(
151104
151141
  sequenceData2["filtered" + nameUpper] || sequenceData2[type2] || {},
151105
- maxToShow
151142
+ maxToShow,
151143
+ sequenceData2.sequence ? sequenceData2.sequence.length : sequenceData2.size || 0
151106
151144
  );
151107
151145
  if (paredDown) {
151108
151146
  this.paredDownMessages.push(
@@ -151392,7 +151430,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
151392
151430
  fullSequence: sequenceData2.sequence,
151393
151431
  emptyText: getEmptyText({ sequenceData: sequenceData2, caretPosition: caretPosition2 }),
151394
151432
  tickSpacing: tickSpacingToUse,
151395
- annotationVisibility: __spreadValues(__spreadValues(__spreadValues({}, rest.annotationVisibility), (!isLinViewZoomed || this.charWidth < 5) && {
151433
+ annotationVisibility: __spreadValues(__spreadValues(__spreadValues({}, rest.annotationVisibility), (!isLinViewZoomed || this.charWidth < 5) && bpsPerRow >= 50 && {
151396
151434
  translations: false,
151397
151435
  primaryProteinSequence: false,
151398
151436
  reverseSequence: false,
@@ -153293,7 +153331,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
153293
153331
  }
153294
153332
  const innerRadius = radius - 10;
153295
153333
  const initialRadius = radius;
153296
- const showSeq = isZoomedIn && rangeToShowLength < 140;
153334
+ const showSeq = rangeToShowLength < 140 && (isZoomedIn || sequenceLength < 50);
153297
153335
  const showSeqText = rangeToShowLength < 80;
153298
153336
  const layersToDraw = [
153299
153337
  { zIndex: 10, layerName: "sequenceChars" },
@@ -153546,7 +153584,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
153546
153584
  }
153547
153585
  );
153548
153586
  const maxToShow = !isZoomedIn && ((maxAnnotationsToDisplay ? maxAnnotationsToDisplay[layerName] : limits[layerName]) || 50);
153549
- const [trimmedAndParedAnns, paredDown] = maxToShow ? pareDownAnnotations(trimmedAnnotations, maxToShow) : [trimmedAnnotations];
153587
+ const [trimmedAndParedAnns, paredDown] = maxToShow ? pareDownAnnotations(trimmedAnnotations, maxToShow, sequenceLength) : [trimmedAnnotations];
153550
153588
  if (paredDown) {
153551
153589
  paredDownMessages.push(
153552
153590
  getParedDownWarning({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ove",
3
- "version": "0.8.37",
3
+ "version": "0.8.39",
4
4
  "main": "./src/index.js",
5
5
  "type": "module",
6
6
  "repository": "https://github.com/TeselaGen/tg-oss",
@@ -15,7 +15,7 @@
15
15
  "@blueprintjs/core": "3.54.0",
16
16
  "@hello-pangea/dnd": "16.2.0",
17
17
  "@risingstack/react-easy-state": "^6.3.0",
18
- "@teselagen/bio-parsers": "0.4.35",
18
+ "@teselagen/bio-parsers": "0.4.36",
19
19
  "@teselagen/file-utils": "0.3.23",
20
20
  "@teselagen/range-utils": "0.3.20",
21
21
  "@teselagen/react-list": "0.8.18",
@@ -241,7 +241,8 @@ export function CircularView(props) {
241
241
  }
242
242
  const innerRadius = radius - 10;
243
243
  const initialRadius = radius;
244
- const showSeq = isZoomedIn && rangeToShowLength < 140;
244
+ const showSeq =
245
+ rangeToShowLength < 140 && (isZoomedIn || sequenceLength < 50);
245
246
  const showSeqText = rangeToShowLength < 80;
246
247
 
247
248
  //RENDERING CONCEPTS:
@@ -521,7 +522,7 @@ export function CircularView(props) {
521
522
  : limits[layerName]) ||
522
523
  50);
523
524
  const [trimmedAndParedAnns, paredDown] = maxToShow
524
- ? pareDownAnnotations(trimmedAnnotations, maxToShow)
525
+ ? pareDownAnnotations(trimmedAnnotations, maxToShow, sequenceLength)
525
526
  : [trimmedAnnotations];
526
527
 
527
528
  if (paredDown) {
@@ -118,7 +118,10 @@ class _LinearView extends React.Component {
118
118
  : limits[type]) || 50;
119
119
  const [annotations, paredDown] = pareDownAnnotations(
120
120
  sequenceData["filtered" + nameUpper] || sequenceData[type] || {},
121
- maxToShow
121
+ maxToShow,
122
+ sequenceData.sequence
123
+ ? sequenceData.sequence.length
124
+ : sequenceData.size || 0
122
125
  );
123
126
 
124
127
  if (paredDown) {
@@ -363,13 +366,14 @@ class _LinearView extends React.Component {
363
366
  tickSpacing: tickSpacingToUse,
364
367
  annotationVisibility: {
365
368
  ...rest.annotationVisibility,
366
- ...((!isLinViewZoomed || this.charWidth < 5) && {
367
- translations: false,
368
- primaryProteinSequence: false,
369
- reverseSequence: false,
370
- sequence: false,
371
- cutsitesInSequence: false
372
- }),
369
+ ...((!isLinViewZoomed || this.charWidth < 5) &&
370
+ bpsPerRow >= 50 && {
371
+ translations: false,
372
+ primaryProteinSequence: false,
373
+ reverseSequence: false,
374
+ sequence: false,
375
+ cutsitesInSequence: false
376
+ }),
373
377
  ...annotationVisibilityOverrides
374
378
  },
375
379
  ...RowItemProps
@@ -111,13 +111,13 @@ export function addCustomEnzyme(newEnz) {
111
111
  );
112
112
  }
113
113
 
114
- export function pareDownAnnotations(annotations, max) {
114
+ export function pareDownAnnotations(annotations, max, sequenceLength) {
115
115
  let annotationsToPass = annotations;
116
116
  let paredDown = false;
117
117
  if (Object.keys(annotations).length > max) {
118
118
  paredDown = true;
119
119
  const sortedAnnotations = sortBy(annotations, function (annotation) {
120
- return -getRangeLength(annotation);
120
+ return -getRangeLength(annotation, sequenceLength);
121
121
  });
122
122
  annotationsToPass = sortedAnnotations.slice(0, max).reduce(function (
123
123
  obj,
@@ -21,7 +21,7 @@ export function getEmptyText({ sequenceData, caretPosition }: {
21
21
  export function tryToRefocusEditor(): void;
22
22
  export function getCustomEnzymes(): any;
23
23
  export function addCustomEnzyme(newEnz: any): void;
24
- export function pareDownAnnotations(annotations: any, max: any): any[];
24
+ export function pareDownAnnotations(annotations: any, max: any, sequenceLength: any): any[];
25
25
  export function getParedDownWarning({ nameUpper, maxToShow, isAdjustable }: {
26
26
  nameUpper: any;
27
27
  maxToShow: any;