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.es.js +8 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/js/oncoprinttrackinfoview.ts +8 -4
package/dist/index.es.js
CHANGED
|
@@ -11075,6 +11075,7 @@ var OncoprintTrackInfoView = /** @class */ (function () {
|
|
|
11075
11075
|
var self = this;
|
|
11076
11076
|
var _loop_1 = function (j) {
|
|
11077
11077
|
(function () {
|
|
11078
|
+
var _a, _b;
|
|
11078
11079
|
var i = j;
|
|
11079
11080
|
var $new_label = $$1('<span>')
|
|
11080
11081
|
.css({
|
|
@@ -11089,19 +11090,22 @@ var OncoprintTrackInfoView = /** @class */ (function () {
|
|
|
11089
11090
|
if (!text) {
|
|
11090
11091
|
return;
|
|
11091
11092
|
}
|
|
11092
|
-
var
|
|
11093
|
+
var num = (_a = text.match(/^[\d\.]*/)) === null || _a === void 0 ? void 0 : _a[0];
|
|
11094
|
+
var suffix = (_b = text.match(/[^\d]*$/)) === null || _b === void 0 ? void 0 : _b[0];
|
|
11095
|
+
var float = parseFloat(num);
|
|
11093
11096
|
var formattedPercent = '';
|
|
11094
11097
|
if (isNaN(float)) {
|
|
11095
11098
|
formattedPercent = 'N/P';
|
|
11099
|
+
suffix = ''; // we don't want any suffix in this case
|
|
11096
11100
|
}
|
|
11097
11101
|
else if (isNumber(float)) {
|
|
11098
11102
|
formattedPercent =
|
|
11099
11103
|
float < 1 && float > 0
|
|
11100
|
-
? '<1
|
|
11101
|
-
: Math.round(float)
|
|
11104
|
+
? '<1'
|
|
11105
|
+
: Math.round(float).toString();
|
|
11102
11106
|
}
|
|
11103
11107
|
else ;
|
|
11104
|
-
$new_label.text(formattedPercent);
|
|
11108
|
+
$new_label.text(formattedPercent + suffix);
|
|
11105
11109
|
$new_label.appendTo(self.$text_ctr);
|
|
11106
11110
|
self.$label_elts.push($new_label);
|
|
11107
11111
|
setTimeout(function () {
|