oncoprintjs 6.0.7 → 6.1.1
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 +13 -13
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/js/bucketsort.d.ts +3 -3
- package/dist/js/oncoprint.d.ts +7 -6
- package/dist/js/oncoprintheaderview.d.ts +1 -0
- package/dist/js/oncoprintlabelview.d.ts +1 -0
- package/dist/js/oncoprintlegendrenderer.d.ts +1 -0
- package/dist/js/oncoprintminimapview.d.ts +2 -1
- package/dist/js/oncoprintmodel.d.ts +37 -36
- package/dist/js/oncoprintruleset.d.ts +8 -8
- package/dist/js/oncoprintshape.d.ts +20 -20
- package/dist/js/oncoprintshapetovertexes.d.ts +1 -1
- package/dist/js/oncoprinttooltip.d.ts +2 -1
- package/dist/js/oncoprinttrackinfoview.d.ts +1 -0
- package/dist/js/oncoprinttrackoptionsview.d.ts +2 -1
- package/dist/js/oncoprintwebglcellview.d.ts +8 -7
- package/dist/js/oncoprintzoomslider.d.ts +2 -1
- package/dist/js/polyfill.d.ts +1 -1
- package/dist/js/utils.d.ts +1 -1
- package/dist/js/workers/clustering-worker.d.ts +5 -5
- package/package.json +6 -9
- package/src/js/oncoprintmodel.ts +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __awaiter, __generator,
|
|
1
|
+
import { __awaiter, __generator, __spreadArray, __extends } from 'tslib';
|
|
2
2
|
import $$1 from 'jquery';
|
|
3
3
|
import _, { isNumber } from 'lodash';
|
|
4
4
|
import gl_matrix from 'gl-matrix';
|
|
@@ -354,7 +354,7 @@ function fastParseInt16(x) {
|
|
|
354
354
|
return ret;
|
|
355
355
|
}
|
|
356
356
|
function rgbString(color) {
|
|
357
|
-
return "rgb("
|
|
357
|
+
return "rgb(".concat(color[0], ",").concat(color[1], ",").concat(color[2], ")");
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
var string_type = typeof '';
|
|
@@ -1636,7 +1636,7 @@ var OncoprintModel = /** @class */ (function () {
|
|
|
1636
1636
|
var indexesAfterGap = model.column_indexes_after_a_gap.get();
|
|
1637
1637
|
// the indexes come AFTER a gap, so we need to include zero up front
|
|
1638
1638
|
// in order to get initial slice of data
|
|
1639
|
-
var groupStartIndexes =
|
|
1639
|
+
var groupStartIndexes = __spreadArray([0], indexesAfterGap, true);
|
|
1640
1640
|
// using the group start indexes, slice the id data into corresponding groups
|
|
1641
1641
|
return groupStartIndexes.map(function (n, i) {
|
|
1642
1642
|
if (i === groupStartIndexes.length - 1) {
|
|
@@ -3794,7 +3794,7 @@ function rgbaToHex(rgba) {
|
|
|
3794
3794
|
if (hexB.length === 1) {
|
|
3795
3795
|
hexB = '0' + hexB;
|
|
3796
3796
|
}
|
|
3797
|
-
return "#"
|
|
3797
|
+
return "#".concat(hexR).concat(hexG).concat(hexB);
|
|
3798
3798
|
}
|
|
3799
3799
|
|
|
3800
3800
|
function rectangleToSVG(params, offset_x, offset_y) {
|
|
@@ -3960,7 +3960,7 @@ var svgfactory = {
|
|
|
3960
3960
|
fillOpacity = fillSpecification.value[3];
|
|
3961
3961
|
}
|
|
3962
3962
|
else {
|
|
3963
|
-
fill = "url(#"
|
|
3963
|
+
fill = "url(#".concat(fillSpecification.value, ")");
|
|
3964
3964
|
}
|
|
3965
3965
|
return makesvgelement('rect', {
|
|
3966
3966
|
x: x,
|
|
@@ -4526,7 +4526,7 @@ var Line = /** @class */ (function (_super) {
|
|
|
4526
4526
|
}(Shape));
|
|
4527
4527
|
|
|
4528
4528
|
function getVertexShaderSource(columnsRightAfterGapsSize) {
|
|
4529
|
-
return "precision highp float;\n attribute float aPosVertex;\n attribute float aColVertex;\n attribute float aVertexOncoprintColumn;\n\n uniform float gapSize;\n\n uniform float columnsRightAfterGaps["
|
|
4529
|
+
return "precision highp float;\n attribute float aPosVertex;\n attribute float aColVertex;\n attribute float aVertexOncoprintColumn;\n\n uniform float gapSize;\n\n uniform float columnsRightAfterGaps[".concat(columnsRightAfterGapsSize, "]; // sorted in ascending order\n\n uniform float columnWidth;\n uniform float scrollX;\n uniform float zoomX;\n uniform float scrollY;\n uniform float zoomY;\n uniform mat4 uMVMatrix;\n uniform mat4 uPMatrix;\n uniform float offsetY;\n uniform float supersamplingRatio;\n uniform float positionBitPackBase;\n uniform float texSize;\n varying float texCoord;\n \n \n\n vec3 getUnpackedPositionVec3() {\n \tfloat pos0 = floor(aPosVertex / (positionBitPackBase * positionBitPackBase));\n \tfloat pos0Contr = pos0 * positionBitPackBase * positionBitPackBase;\n \tfloat pos1 = floor((aPosVertex - pos0Contr)/positionBitPackBase);\n \tfloat pos1Contr = pos1 * positionBitPackBase;\n \tfloat pos2 = aPosVertex - pos0Contr - pos1Contr;\n \treturn vec3(pos0, pos1, pos2);\n }\n\n float getGapOffset() {\n // first do binary search to compute the number of gaps before this column, G(c)\n // G(c) = the index in columnsRightAfterGaps of the first entry thats greater than c\n \n int lower_incl = 0;\n int upper_excl = ").concat(columnsRightAfterGapsSize, ";\n int numGaps = 0;\n \n for (int loopDummyVar = 0; loopDummyVar == 0; loopDummyVar += 0) {\n if (lower_incl >= upper_excl) {\n break;\n }\n \n int middle = (lower_incl + upper_excl)/2;\n if (columnsRightAfterGaps[middle] < aVertexOncoprintColumn) {\n // G(c) > middle\n lower_incl = middle + 1;\n } else if (columnsRightAfterGaps[middle] == aVertexOncoprintColumn) {\n // G(c) = middle + 1\n numGaps = middle + 1;\n break;\n } else {\n // columnsRightAfterGaps[middle] > column, so G(c) <= middle\n if (middle == 0) {\n // 0 <= G(c) <= 0 -> G(c) = 0\n numGaps = 0;\n break;\n } else if (columnsRightAfterGaps[middle-1] < aVertexOncoprintColumn) {\n // G(c) = middle\n numGaps = middle;\n break;\n } else {\n // columnsRightAfterGaps[middle-1] >= column, so G(c) <= middle-1\n upper_excl = middle;\n }\n }\n }\n \n // multiply it by the gap size to get the total offset\n return float(numGaps)*gapSize;\n }\n\n void main(void) {\n \tgl_Position = vec4(getUnpackedPositionVec3(), 1.0);\n \tgl_Position[0] += aVertexOncoprintColumn*columnWidth;\n \tgl_Position *= vec4(zoomX, zoomY, 1.0, 1.0);\n\n // gaps should not be affected by zoom:\n gl_Position[0] += getGapOffset();\n\n // offsetY is given zoomed:\n \tgl_Position[1] += offsetY;\n\n \tgl_Position -= vec4(scrollX, scrollY, 0.0, 0.0);\n \tgl_Position[0] *= supersamplingRatio;\n \tgl_Position[1] *= supersamplingRatio;\n \tgl_Position = uPMatrix * uMVMatrix * gl_Position;\n\n \ttexCoord = (aColVertex + 0.5) / texSize;\n }");
|
|
4530
4530
|
}
|
|
4531
4531
|
function getFragmentShaderSource() {
|
|
4532
4532
|
return "precision mediump float;\n varying float texCoord;\n uniform sampler2D uSampler;\n void main(void) {\n gl_FragColor = texture2D(uSampler, vec2(texCoord, 0.5));\n }";
|
|
@@ -4906,7 +4906,7 @@ var OncoprintWebGLCellView = /** @class */ (function () {
|
|
|
4906
4906
|
var clientRect = self.$overlay_canvas[0].getBoundingClientRect();
|
|
4907
4907
|
self.hoveredGap = overlappingGap;
|
|
4908
4908
|
tooltip.center = false;
|
|
4909
|
-
tooltip.show(250, clientRect.left + overlappingGap.origin_x, clientRect.top + overlappingGap.origin_y - 20, $$1("<span>"
|
|
4909
|
+
tooltip.show(250, clientRect.left + overlappingGap.origin_x, clientRect.top + overlappingGap.origin_y - 20, $$1("<span>".concat(overlappingGap.data.tooltipFormatter(), "</span>")), false);
|
|
4910
4910
|
}
|
|
4911
4911
|
if (!overlapping_data && !overlappingGap) {
|
|
4912
4912
|
tooltip.hideIfNotAlreadyGoingTo(150);
|
|
@@ -5770,7 +5770,7 @@ var OncoprintWebGLCellView = /** @class */ (function () {
|
|
|
5770
5770
|
shapeToVertexes(_shape, zindex, function (pos, col) {
|
|
5771
5771
|
pos = pos.map(Math.round);
|
|
5772
5772
|
position_1.push(packPos(pos));
|
|
5773
|
-
var col_hash = col[0]
|
|
5773
|
+
var col_hash = "".concat(col[0], ",").concat(col[1], ",").concat(col[2], ",").concat(col[3]);
|
|
5774
5774
|
var col_index = color_bank_index[col_hash];
|
|
5775
5775
|
if (typeof col_index === 'undefined') {
|
|
5776
5776
|
col_index = color_vertexes.length;
|
|
@@ -9528,7 +9528,7 @@ var OncoprintHeaderView = /** @class */ (function () {
|
|
|
9528
9528
|
'pointer-events': 'auto',
|
|
9529
9529
|
});
|
|
9530
9530
|
// add label
|
|
9531
|
-
$$1("<span>"
|
|
9531
|
+
$$1("<span>".concat(group.header.label.text, "</span>"))
|
|
9532
9532
|
.appendTo($headerDiv)
|
|
9533
9533
|
.css({
|
|
9534
9534
|
'margin-right': 10,
|
|
@@ -11485,7 +11485,7 @@ var OncoprintZoomSlider = /** @class */ (function () {
|
|
|
11485
11485
|
'min-height': params.btn_size,
|
|
11486
11486
|
'min-width': params.btn_size,
|
|
11487
11487
|
'background-color': '#ffffff',
|
|
11488
|
-
border: "solid "
|
|
11488
|
+
border: "solid ".concat(icon_div_border_size, "px black"),
|
|
11489
11489
|
'border-radius': '3px',
|
|
11490
11490
|
cursor: 'pointer',
|
|
11491
11491
|
})
|
|
@@ -11506,7 +11506,7 @@ var OncoprintZoomSlider = /** @class */ (function () {
|
|
|
11506
11506
|
'min-height': params.btn_size,
|
|
11507
11507
|
'min-width': params.btn_size,
|
|
11508
11508
|
'background-color': '#ffffff',
|
|
11509
|
-
border: "solid "
|
|
11509
|
+
border: "solid ".concat(icon_div_border_size, "px black"),
|
|
11510
11510
|
'border-radius': '3px',
|
|
11511
11511
|
cursor: 'pointer',
|
|
11512
11512
|
})
|
|
@@ -11994,7 +11994,7 @@ var OncoprintMinimapView = /** @class */ (function () {
|
|
|
11994
11994
|
})
|
|
11995
11995
|
.addClass('oncoprint-zoomtofit-btn')
|
|
11996
11996
|
.appendTo($div);
|
|
11997
|
-
$$1("<img src=\""
|
|
11997
|
+
$$1("<img src=\"".concat(img, "\" alt=\"Zoom to Fit Icon\" />"))
|
|
11998
11998
|
.css({
|
|
11999
11999
|
height: btn_height - 4,
|
|
12000
12000
|
width: btn_width - 4,
|
|
@@ -13424,7 +13424,7 @@ var Oncoprint = /** @class */ (function () {
|
|
|
13424
13424
|
position: 'absolute',
|
|
13425
13425
|
top: '0px',
|
|
13426
13426
|
left: '0px',
|
|
13427
|
-
'pointer-events': 'none',
|
|
13427
|
+
'pointer-events': 'none', // since column label canvas is on top of cell overlay canvas, we need to make it not capture any mouse events
|
|
13428
13428
|
})
|
|
13429
13429
|
.addClass('noselect')
|
|
13430
13430
|
.addClass('oncoprintjs__column_label_canvas');
|