oncoprintjs 5.0.3 → 6.0.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.
Files changed (100) hide show
  1. package/README.md +34 -0
  2. package/dist/index.d.ts +4 -0
  3. package/dist/index.es.js +14746 -0
  4. package/dist/index.es.js.map +1 -0
  5. package/dist/index.js +14760 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/js/CachedProperty.d.ts +10 -10
  8. package/dist/js/binarysearch.d.ts +1 -1
  9. package/dist/js/bucketsort.d.ts +16 -16
  10. package/dist/js/clustering.d.ts +14 -14
  11. package/dist/js/extractrgba.d.ts +4 -4
  12. package/dist/js/haselementsininterval.d.ts +1 -1
  13. package/dist/js/heatmapcolors.d.ts +5 -4
  14. package/dist/js/makesvgelement.d.ts +1 -1
  15. package/dist/js/modelutils.d.ts +7 -7
  16. package/dist/js/oncoprint.d.ts +168 -170
  17. package/dist/js/oncoprintheaderview.d.ts +23 -22
  18. package/dist/js/oncoprintlabelview.d.ts +79 -78
  19. package/dist/js/oncoprintlegendrenderer.d.ts +32 -31
  20. package/dist/js/oncoprintminimapview.d.ts +69 -68
  21. package/dist/js/oncoprintmodel.d.ts +403 -398
  22. package/dist/js/oncoprintruleset.d.ts +176 -177
  23. package/dist/js/oncoprintshape.d.ts +67 -67
  24. package/dist/js/oncoprintshapetosvg.d.ts +2 -2
  25. package/dist/js/oncoprintshapetovertexes.d.ts +5 -5
  26. package/dist/js/oncoprinttooltip.d.ts +23 -22
  27. package/dist/js/oncoprinttrackinfoview.d.ts +40 -39
  28. package/dist/js/oncoprinttrackoptionsview.d.ts +58 -57
  29. package/dist/js/oncoprintwebglcellview.d.ts +168 -167
  30. package/dist/js/oncoprintzoomslider.d.ts +28 -27
  31. package/dist/js/polyfill.d.ts +4 -4
  32. package/dist/js/precomputedcomparator.d.ts +13 -13
  33. package/dist/js/shaders.d.ts +2 -2
  34. package/dist/js/svgfactory.d.ts +24 -23
  35. package/dist/js/utils.d.ts +16 -16
  36. package/dist/js/workers/clustering-worker.d.ts +19 -20
  37. package/dist/test/gradientCategoricalRuleset.spec.d.ts +1 -1
  38. package/dist/test/monolith.spec.d.ts +1 -1
  39. package/jest.config.ts +2 -0
  40. package/package.json +20 -26
  41. package/rollup.config.ts +14 -0
  42. package/rules/geneticrules.ts +344 -305
  43. package/server.js +11 -0
  44. package/src/img/menudots.svg +9 -9
  45. package/src/img/zoomtofit.svg +12 -12
  46. package/src/index.tsx +13 -0
  47. package/src/js/CachedProperty.ts +6 -7
  48. package/src/js/binarysearch.ts +8 -3
  49. package/src/js/bucketsort.ts +89 -47
  50. package/src/js/clustering.ts +22 -10
  51. package/src/js/extractrgba.ts +16 -12
  52. package/src/js/haselementsininterval.ts +8 -4
  53. package/src/js/heatmapcolors.ts +515 -515
  54. package/src/js/main.js +1 -1
  55. package/src/js/makesvgelement.ts +2 -2
  56. package/src/js/modelutils.ts +11 -8
  57. package/src/js/oncoprint.ts +706 -385
  58. package/src/js/oncoprintheaderview.ts +165 -125
  59. package/src/js/oncoprintlabelview.ts +388 -170
  60. package/src/js/oncoprintlegendrenderer.ts +203 -72
  61. package/src/js/oncoprintminimapview.ts +965 -423
  62. package/src/js/oncoprintmodel.ts +905 -532
  63. package/src/js/oncoprintruleset.ts +694 -379
  64. package/src/js/oncoprintshape.ts +240 -97
  65. package/src/js/oncoprintshapetosvg.ts +77 -26
  66. package/src/js/oncoprintshapetovertexes.ts +153 -48
  67. package/src/js/oncoprinttooltip.ts +58 -27
  68. package/src/js/oncoprinttrackinfoview.ts +115 -59
  69. package/src/js/oncoprinttrackoptionsview.ts +354 -187
  70. package/src/js/oncoprintwebglcellview.ts +951 -415
  71. package/src/js/oncoprintzoomslider.ts +172 -107
  72. package/src/js/polyfill.ts +7 -3
  73. package/src/js/precomputedcomparator.ts +133 -50
  74. package/src/js/shaders.ts +2 -4
  75. package/src/js/svgfactory.ts +128 -73
  76. package/src/js/utils.ts +51 -31
  77. package/src/js/workers/clustering-worker.ts +50 -42
  78. package/src/test/gradientCategoricalRuleset.spec.ts +55 -38
  79. package/src/test/monolith.spec.ts +718 -285
  80. package/test/generate_data.py +108 -0
  81. package/test/glyphmap-data.js +1041 -0
  82. package/test/heatmap-data.js +1027 -0
  83. package/test/index.html +21 -0
  84. package/test/oncoprint-glyphmap.js +79 -0
  85. package/test/oncoprint-heatmap.js +123 -0
  86. package/tsconfig.json +4 -10
  87. package/tsconfig.test.json +11 -0
  88. package/.idea/misc.xml +0 -6
  89. package/.idea/modules.xml +0 -8
  90. package/.idea/oncoprintjs.iml +0 -12
  91. package/.idea/vcs.xml +0 -6
  92. package/.idea/workspace.xml +0 -105
  93. package/dist/.gitkeep +0 -0
  94. package/dist/js/minimaputils.d.ts +0 -0
  95. package/dist/oncoprint.bundle.js +0 -44313
  96. package/jest.config.js +0 -12
  97. package/src/js/minimaputils.ts +0 -0
  98. package/typings/custom.d.ts +0 -7
  99. package/typings/missing.d.ts +0 -7
  100. package/webpack.config.js +0 -43
@@ -1,31 +1,36 @@
1
- import {ComputedShapeParams, Rectangle} from "./oncoprintshape";
2
- import {RGBAColor} from "./oncoprintruleset";
1
+ import { ComputedShapeParams, Rectangle } from './oncoprintshape';
2
+ import { RGBAColor } from './oncoprintruleset';
3
3
 
4
4
  const halfsqrt2 = Math.sqrt(2) / 2;
5
5
 
6
- function normalizeRGBA(color:RGBAColor):[number, number, number, number] {
7
- return [
8
- color[0],
9
- color[1],
10
- color[2],
11
- color[3]*255
12
- ]
6
+ function normalizeRGBA(color: RGBAColor): [number, number, number, number] {
7
+ return [color[0], color[1], color[2], color[3] * 255];
13
8
  }
14
9
 
15
- type AddVertexCallback = (vertex:[number,number,number], color:[number,number,number,number])=>void;
16
-
17
- function rectangleToVertexes(params:ComputedShapeParams, z_index:number, addVertex:AddVertexCallback) {
18
- const x = params.x, y = params.y, height = params.height, width = params.width;
10
+ type AddVertexCallback = (
11
+ vertex: [number, number, number],
12
+ color: [number, number, number, number]
13
+ ) => void;
14
+
15
+ function rectangleToVertexes(
16
+ params: ComputedShapeParams,
17
+ z_index: number,
18
+ addVertex: AddVertexCallback
19
+ ) {
20
+ const x = params.x,
21
+ y = params.y,
22
+ height = params.height,
23
+ width = params.width;
19
24
 
20
25
  // Fill
21
26
  const fill_rgba = normalizeRGBA(params.fill);
22
- addVertex([x,y,z_index], fill_rgba);
23
- addVertex([x+width, y, z_index], fill_rgba);
24
- addVertex([x+width, y+height, z_index], fill_rgba);
27
+ addVertex([x, y, z_index], fill_rgba);
28
+ addVertex([x + width, y, z_index], fill_rgba);
29
+ addVertex([x + width, y + height, z_index], fill_rgba);
25
30
 
26
- addVertex([x,y,z_index], fill_rgba);
27
- addVertex([x+width, y+height, z_index], fill_rgba);
28
- addVertex([x,y+height,z_index],fill_rgba);
31
+ addVertex([x, y, z_index], fill_rgba);
32
+ addVertex([x + width, y + height, z_index], fill_rgba);
33
+ addVertex([x, y + height, z_index], fill_rgba);
29
34
 
30
35
  // Stroke
31
36
  const stroke_width = params['stroke-width'];
@@ -69,53 +74,124 @@ function rectangleToVertexes(params:ComputedShapeParams, z_index:number, addVert
69
74
  }
70
75
  }
71
76
 
72
- function triangleToVertexes(params:ComputedShapeParams, z_index:number, addVertex:AddVertexCallback) {
77
+ function triangleToVertexes(
78
+ params: ComputedShapeParams,
79
+ z_index: number,
80
+ addVertex: AddVertexCallback
81
+ ) {
73
82
  const fill_rgba = normalizeRGBA(params.fill);
74
83
  addVertex([params.x1, params.y1, z_index], fill_rgba);
75
84
  addVertex([params.x2, params.y2, z_index], fill_rgba);
76
85
  addVertex([params.x3, params.y3, z_index], fill_rgba);
77
86
  }
78
87
 
79
- function ellipseToVertexes(params:ComputedShapeParams, z_index:number, addVertex:AddVertexCallback) {
80
- const center = {x:params.x +params.width / 2, y:params.y +params.height / 2};
81
- const horzrad =params.width / 2;
82
- const vertrad =params.height / 2;
88
+ function ellipseToVertexes(
89
+ params: ComputedShapeParams,
90
+ z_index: number,
91
+ addVertex: AddVertexCallback
92
+ ) {
93
+ const center = {
94
+ x: params.x + params.width / 2,
95
+ y: params.y + params.height / 2,
96
+ };
97
+ const horzrad = params.width / 2;
98
+ const vertrad = params.height / 2;
83
99
 
84
100
  const fill_rgba = normalizeRGBA(params.fill);
85
101
  addVertex([center.x, center.y, z_index], fill_rgba);
86
102
  addVertex([center.x + horzrad, center.y, z_index], fill_rgba);
87
- addVertex([center.x + halfsqrt2 * horzrad, center.y + halfsqrt2 * vertrad, z_index], fill_rgba);
103
+ addVertex(
104
+ [
105
+ center.x + halfsqrt2 * horzrad,
106
+ center.y + halfsqrt2 * vertrad,
107
+ z_index,
108
+ ],
109
+ fill_rgba
110
+ );
88
111
 
89
112
  addVertex([center.x, center.y, z_index], fill_rgba);
90
- addVertex([center.x + halfsqrt2 * horzrad, center.y + halfsqrt2 * vertrad, z_index], fill_rgba);
113
+ addVertex(
114
+ [
115
+ center.x + halfsqrt2 * horzrad,
116
+ center.y + halfsqrt2 * vertrad,
117
+ z_index,
118
+ ],
119
+ fill_rgba
120
+ );
91
121
  addVertex([center.x, center.y + vertrad, z_index], fill_rgba);
92
122
 
93
123
  addVertex([center.x, center.y, z_index], fill_rgba);
94
124
  addVertex([center.x, center.y + vertrad, z_index], fill_rgba);
95
- addVertex([center.x - halfsqrt2 * horzrad, center.y + halfsqrt2 * vertrad, z_index], fill_rgba);
125
+ addVertex(
126
+ [
127
+ center.x - halfsqrt2 * horzrad,
128
+ center.y + halfsqrt2 * vertrad,
129
+ z_index,
130
+ ],
131
+ fill_rgba
132
+ );
96
133
 
97
134
  addVertex([center.x, center.y, z_index], fill_rgba);
98
- addVertex([center.x - halfsqrt2 * horzrad, center.y + halfsqrt2 * vertrad, z_index], fill_rgba);
135
+ addVertex(
136
+ [
137
+ center.x - halfsqrt2 * horzrad,
138
+ center.y + halfsqrt2 * vertrad,
139
+ z_index,
140
+ ],
141
+ fill_rgba
142
+ );
99
143
  addVertex([center.x - horzrad, center.y, z_index], fill_rgba);
100
144
 
101
145
  addVertex([center.x, center.y, z_index], fill_rgba);
102
146
  addVertex([center.x - horzrad, center.y, z_index], fill_rgba);
103
- addVertex([center.x - halfsqrt2 * horzrad, center.y - halfsqrt2 * vertrad, z_index], fill_rgba);
147
+ addVertex(
148
+ [
149
+ center.x - halfsqrt2 * horzrad,
150
+ center.y - halfsqrt2 * vertrad,
151
+ z_index,
152
+ ],
153
+ fill_rgba
154
+ );
104
155
 
105
156
  addVertex([center.x, center.y, z_index], fill_rgba);
106
- addVertex([center.x - halfsqrt2 * horzrad, center.y - halfsqrt2 * vertrad, z_index], fill_rgba);
157
+ addVertex(
158
+ [
159
+ center.x - halfsqrt2 * horzrad,
160
+ center.y - halfsqrt2 * vertrad,
161
+ z_index,
162
+ ],
163
+ fill_rgba
164
+ );
107
165
  addVertex([center.x, center.y - vertrad, z_index], fill_rgba);
108
166
 
109
167
  addVertex([center.x, center.y, z_index], fill_rgba);
110
168
  addVertex([center.x, center.y - vertrad, z_index], fill_rgba);
111
- addVertex([center.x + halfsqrt2 * horzrad, center.y - halfsqrt2 * vertrad, z_index], fill_rgba);
169
+ addVertex(
170
+ [
171
+ center.x + halfsqrt2 * horzrad,
172
+ center.y - halfsqrt2 * vertrad,
173
+ z_index,
174
+ ],
175
+ fill_rgba
176
+ );
112
177
 
113
178
  addVertex([center.x, center.y, z_index], fill_rgba);
114
- addVertex([center.x + halfsqrt2 * horzrad, center.y - halfsqrt2 * vertrad, z_index], fill_rgba);
179
+ addVertex(
180
+ [
181
+ center.x + halfsqrt2 * horzrad,
182
+ center.y - halfsqrt2 * vertrad,
183
+ z_index,
184
+ ],
185
+ fill_rgba
186
+ );
115
187
  addVertex([center.x + horzrad, center.y, z_index], fill_rgba);
116
188
  }
117
189
 
118
- function lineToVertexes(params:ComputedShapeParams, z_index:number, addVertex:AddVertexCallback) {
190
+ function lineToVertexes(
191
+ params: ComputedShapeParams,
192
+ z_index: number,
193
+ addVertex: AddVertexCallback
194
+ ) {
119
195
  // For simplicity of dealing with webGL we'll implement lines as thin triangle pairs
120
196
  let x1 = params.x1;
121
197
  let x2 = params.x2;
@@ -135,11 +211,20 @@ function lineToVertexes(params:ComputedShapeParams, z_index:number, addVertex:Ad
135
211
  }
136
212
 
137
213
  const perpendicular_vector = [y2 - y1, x1 - x2];
138
- const perpendicular_vector_length = Math.sqrt(perpendicular_vector[0] * perpendicular_vector[0] + perpendicular_vector[1] * perpendicular_vector[1]);
139
- const unit_perp_vector = [perpendicular_vector[0] / perpendicular_vector_length, perpendicular_vector[1] / perpendicular_vector_length];
214
+ const perpendicular_vector_length = Math.sqrt(
215
+ perpendicular_vector[0] * perpendicular_vector[0] +
216
+ perpendicular_vector[1] * perpendicular_vector[1]
217
+ );
218
+ const unit_perp_vector = [
219
+ perpendicular_vector[0] / perpendicular_vector_length,
220
+ perpendicular_vector[1] / perpendicular_vector_length,
221
+ ];
140
222
 
141
223
  const half_stroke_width = params['stroke-width'] / 2;
142
- const direction1 = [unit_perp_vector[0] * half_stroke_width, unit_perp_vector[1] * half_stroke_width];
224
+ const direction1 = [
225
+ unit_perp_vector[0] * half_stroke_width,
226
+ unit_perp_vector[1] * half_stroke_width,
227
+ ];
143
228
  const direction2 = [direction1[0] * -1, direction1[1] * -1];
144
229
  const A = [x1 + direction1[0], y1 + direction1[1]];
145
230
  const B = [x1 + direction2[0], y1 + direction2[1]];
@@ -156,25 +241,45 @@ function lineToVertexes(params:ComputedShapeParams, z_index:number, addVertex:Ad
156
241
  addVertex([B[0], B[1], z_index], stroke_rgba);
157
242
  }
158
243
 
159
- export default function(oncoprint_shape_computed_params:ComputedShapeParams, z_index:number, addVertex:AddVertexCallback) {
244
+ export default function(
245
+ oncoprint_shape_computed_params: ComputedShapeParams,
246
+ z_index: number,
247
+ addVertex: AddVertexCallback
248
+ ) {
160
249
  // target_position_array is an array with 3-d float vertexes
161
250
  // target_color_array is an array with rgba values in [0,1]
162
251
  // We pass them in to save on concatenation costs
163
252
 
164
253
  const type = oncoprint_shape_computed_params.type;
165
- if (type === "rectangle") {
166
- return rectangleToVertexes(oncoprint_shape_computed_params, z_index, addVertex);
167
- } else if (type === "triangle") {
168
- return triangleToVertexes(oncoprint_shape_computed_params, z_index, addVertex);
169
- } else if (type === "ellipse") {
170
- return ellipseToVertexes(oncoprint_shape_computed_params, z_index, addVertex);
171
- } else if (type === "line") {
172
- return lineToVertexes(oncoprint_shape_computed_params, z_index, addVertex);
254
+ if (type === 'rectangle') {
255
+ return rectangleToVertexes(
256
+ oncoprint_shape_computed_params,
257
+ z_index,
258
+ addVertex
259
+ );
260
+ } else if (type === 'triangle') {
261
+ return triangleToVertexes(
262
+ oncoprint_shape_computed_params,
263
+ z_index,
264
+ addVertex
265
+ );
266
+ } else if (type === 'ellipse') {
267
+ return ellipseToVertexes(
268
+ oncoprint_shape_computed_params,
269
+ z_index,
270
+ addVertex
271
+ );
272
+ } else if (type === 'line') {
273
+ return lineToVertexes(
274
+ oncoprint_shape_computed_params,
275
+ z_index,
276
+ addVertex
277
+ );
173
278
  }
174
279
  }
175
280
 
176
- export function getNumWebGLVertexes(shape:ComputedShapeParams) {
177
- let ret:number;
281
+ export function getNumWebGLVertexes(shape: ComputedShapeParams) {
282
+ let ret: number;
178
283
  switch (shape.type) {
179
284
  case 'rectangle':
180
285
  if (shape['stroke-width'] > 0) {
@@ -194,4 +299,4 @@ export function getNumWebGLVertexes(shape:ComputedShapeParams) {
194
299
  break;
195
300
  }
196
301
  return ret;
197
- }
302
+ }
@@ -1,22 +1,32 @@
1
- import $ from "jquery";
1
+ import $ from 'jquery';
2
2
 
3
- const TOOLTIP_CLASS = "oncoprintjs__tooltip";
3
+ const TOOLTIP_CLASS = 'oncoprintjs__tooltip';
4
4
 
5
- export type OncoprintTooltipParams = { noselect?:boolean };
5
+ export type OncoprintTooltipParams = { noselect?: boolean };
6
6
 
7
7
  export default class OncoprintToolTip {
8
- private $div:JQuery;
9
- private hide_timeout_id:number|undefined;
10
- private show_timeout_id:number|undefined;
11
- public center:boolean;
12
- private shown:boolean;
8
+ private $div: JQuery;
9
+ private hide_timeout_id: number | undefined;
10
+ private show_timeout_id: number | undefined;
11
+ public center: boolean;
12
+ private shown: boolean;
13
13
 
14
- constructor(private $container:JQuery, params?:OncoprintTooltipParams) {
14
+ constructor(private $container: JQuery, params?: OncoprintTooltipParams) {
15
15
  params = params || {};
16
16
 
17
- this.$div = $('<div></div>').addClass(TOOLTIP_CLASS).appendTo($container).css({'background-color':'rgba(255,255,255,1)', 'position':'absolute', 'display':'none', 'border':'1px solid black', 'max-width':300, 'min-width':150});
17
+ this.$div = $('<div></div>')
18
+ .addClass(TOOLTIP_CLASS)
19
+ .appendTo($container)
20
+ .css({
21
+ 'background-color': 'rgba(255,255,255,1)',
22
+ position: 'absolute',
23
+ display: 'none',
24
+ border: '1px solid black',
25
+ 'max-width': 300,
26
+ 'min-width': 150,
27
+ });
18
28
  if (params.noselect) {
19
- this.$div.addClass("noselect");
29
+ this.$div.addClass('noselect');
20
30
  }
21
31
  this.hide_timeout_id = undefined;
22
32
  this.show_timeout_id = undefined;
@@ -25,16 +35,22 @@ export default class OncoprintToolTip {
25
35
  this.shown = false;
26
36
 
27
37
  const self = this;
28
- this.$div.on("mousemove", function(evt) {
38
+ this.$div.on('mousemove', function(evt) {
29
39
  evt.stopPropagation();
30
40
  self.cancelScheduledHide();
31
41
  });
32
- this.$div.on("mouseleave", function(evt) {
42
+ this.$div.on('mouseleave', function(evt) {
33
43
  evt.stopPropagation();
34
44
  self.hide();
35
45
  });
36
46
  }
37
- public show(wait:number|undefined, viewport_x:number, viewport_y:number, $contents:JQuery, fade?:boolean) {
47
+ public show(
48
+ wait: number | undefined,
49
+ viewport_x: number,
50
+ viewport_y: number,
51
+ $contents: JQuery,
52
+ fade?: boolean
53
+ ) {
38
54
  this.cancelScheduledHide();
39
55
 
40
56
  if (typeof wait !== 'undefined' && !this.shown) {
@@ -42,16 +58,21 @@ export default class OncoprintToolTip {
42
58
  this.cancelScheduledShow();
43
59
  this.show_timeout_id = setTimeout(function() {
44
60
  self.doShow(viewport_x, viewport_y, $contents, fade);
45
- }, wait);
61
+ }, wait) as any;
46
62
  } else {
47
63
  this.doShow(viewport_x, viewport_y, $contents, fade);
48
64
  }
49
65
  }
50
- private doShow(viewport_x:number, viewport_y:number, $contents:JQuery, fade?:boolean) {
66
+ private doShow(
67
+ viewport_x: number,
68
+ viewport_y: number,
69
+ $contents: JQuery,
70
+ fade?: boolean
71
+ ) {
51
72
  this.cancelScheduledShow();
52
73
  this.show_timeout_id = undefined;
53
74
  this.$div.empty();
54
- this.$div.css({'top':0, 'left':0, 'z-index':9999}); // put up top left so that it doesnt cause any page expansion, before the position calculation which depends on page size
75
+ this.$div.css({ top: 0, left: 0, 'z-index': 9999 }); // put up top left so that it doesnt cause any page expansion, before the position calculation which depends on page size
55
76
  this.$div.append($contents);
56
77
  if (!fade) {
57
78
  this.$div.show();
@@ -59,7 +80,7 @@ export default class OncoprintToolTip {
59
80
  this.$div.stop().fadeIn('fast');
60
81
  }
61
82
  // adjust tooltip position based on size of contents
62
- let x = viewport_x - (this.center ? this.$div.width()/2 : 0);
83
+ let x = viewport_x - (this.center ? this.$div.width() / 2 : 0);
63
84
  let y = viewport_y - this.$div.height();
64
85
  // clamp to visible area
65
86
  const min_padding = 20;
@@ -68,10 +89,10 @@ export default class OncoprintToolTip {
68
89
  x = Math.max(x, min_padding); // make sure not too left
69
90
  x = Math.min(x, $(window).width() - this.$div.width() - min_padding); // make sure not too right
70
91
 
71
- this.$div.css({'top':y, 'left':x, 'z-index':9999});
92
+ this.$div.css({ top: y, left: x, 'z-index': 9999 });
72
93
  this.shown = true;
73
94
  }
74
- private doHide(fade?:boolean) {
95
+ private doHide(fade?: boolean) {
75
96
  this.cancelScheduledHide();
76
97
  this.hide_timeout_id = undefined;
77
98
  if (!fade) {
@@ -80,7 +101,7 @@ export default class OncoprintToolTip {
80
101
  this.$div.fadeOut();
81
102
  }
82
103
  this.shown = false;
83
- };
104
+ }
84
105
  private cancelScheduledShow() {
85
106
  clearTimeout(this.show_timeout_id);
86
107
  this.show_timeout_id = undefined;
@@ -89,17 +110,22 @@ export default class OncoprintToolTip {
89
110
  clearTimeout(this.hide_timeout_id);
90
111
  this.hide_timeout_id = undefined;
91
112
  }
92
- public showIfNotAlreadyGoingTo(wait:number|undefined, viewport_x:number, viewport_y:number, $contents:JQuery) {
113
+ public showIfNotAlreadyGoingTo(
114
+ wait: number | undefined,
115
+ viewport_x: number,
116
+ viewport_y: number,
117
+ $contents: JQuery
118
+ ) {
93
119
  if (typeof this.show_timeout_id === 'undefined') {
94
120
  this.show(wait, viewport_x, viewport_y, $contents);
95
121
  }
96
122
  }
97
- public hideIfNotAlreadyGoingTo(wait?:number) {
123
+ public hideIfNotAlreadyGoingTo(wait?: number) {
98
124
  if (typeof this.hide_timeout_id === 'undefined') {
99
125
  this.hide(wait);
100
126
  }
101
127
  }
102
- public hide(wait?:number) {
128
+ public hide(wait?: number) {
103
129
  this.cancelScheduledShow();
104
130
 
105
131
  if (!this.shown) {
@@ -111,12 +137,17 @@ export default class OncoprintToolTip {
111
137
  this.cancelScheduledHide();
112
138
  this.hide_timeout_id = setTimeout(function() {
113
139
  self.doHide();
114
- }, wait);
140
+ }, wait) as any;
115
141
  } else {
116
142
  this.doHide();
117
143
  }
118
144
  }
119
- public fadeIn(wait:number|undefined, viewport_x:number, viewport_y:number, $contents:JQuery) {
145
+ public fadeIn(
146
+ wait: number | undefined,
147
+ viewport_x: number,
148
+ viewport_y: number,
149
+ $contents: JQuery
150
+ ) {
120
151
  this.show(wait, viewport_x, viewport_y, $contents, true);
121
152
  }
122
- }
153
+ }