oncoprintjs 6.0.4 → 6.0.5

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/dist/index.js CHANGED
@@ -11085,6 +11085,7 @@ var OncoprintTrackInfoView = /** @class */ (function () {
11085
11085
  var self = this;
11086
11086
  var _loop_1 = function (j) {
11087
11087
  (function () {
11088
+ var _a, _b;
11088
11089
  var i = j;
11089
11090
  var $new_label = $__default["default"]('<span>')
11090
11091
  .css({
@@ -11099,19 +11100,22 @@ var OncoprintTrackInfoView = /** @class */ (function () {
11099
11100
  if (!text) {
11100
11101
  return;
11101
11102
  }
11102
- var float = parseFloat(text);
11103
+ var num = (_a = text.match(/^[\d\.]*/)) === null || _a === void 0 ? void 0 : _a[0];
11104
+ var suffix = (_b = text.match(/[^\d]*$/)) === null || _b === void 0 ? void 0 : _b[0];
11105
+ var float = parseFloat(num);
11103
11106
  var formattedPercent = '';
11104
11107
  if (isNaN(float)) {
11105
11108
  formattedPercent = 'N/P';
11109
+ suffix = ''; // we don't want any suffix in this case
11106
11110
  }
11107
11111
  else if (_.isNumber(float)) {
11108
11112
  formattedPercent =
11109
11113
  float < 1 && float > 0
11110
- ? '<1%'
11111
- : Math.round(float) + '%';
11114
+ ? '<1'
11115
+ : Math.round(float).toString();
11112
11116
  }
11113
11117
  else ;
11114
- $new_label.text(formattedPercent);
11118
+ $new_label.text(formattedPercent + suffix);
11115
11119
  $new_label.appendTo(self.$text_ctr);
11116
11120
  self.$label_elts.push($new_label);
11117
11121
  setTimeout(function () {