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,195 +1,508 @@
1
- import Oncoprint from "../js/oncoprint";
2
- import * as BucketSort from "../js/bucketsort";
3
- import binarySearch from "../js/binarysearch";
4
- import {assert} from "chai";
5
- import {doesCellIntersectPixel} from "../js/utils";
1
+ import Oncoprint from '../js/oncoprint';
2
+ import * as BucketSort from '../js/bucketsort';
3
+ import binarySearch from '../js/binarysearch';
4
+ import { assert } from 'chai';
5
+ import { doesCellIntersectPixel } from '../js/utils';
6
6
 
7
- describe("test", function() {
8
- it("should have oncoprint object", function() {
7
+ describe('test', function() {
8
+ it('should have oncoprint object', function() {
9
9
  assert.isDefined(Oncoprint);
10
10
  });
11
11
  });
12
12
 
13
- describe("binarySearch", function() {
14
- it("case: empty input", function() {
15
- assert.equal(binarySearch([], 0, function(x) { return x; }, true), -1);
13
+ describe('binarySearch', function() {
14
+ it('case: empty input', function() {
15
+ assert.equal(
16
+ binarySearch(
17
+ [],
18
+ 0,
19
+ function(x) {
20
+ return x;
21
+ },
22
+ true
23
+ ),
24
+ -1
25
+ );
16
26
  });
17
27
 
18
- it("case: key not found, return closest option false", function() {
19
- assert.equal(binarySearch([0,1,2], 1.5, function(x) { return x; }, false), -1);
28
+ it('case: key not found, return closest option false', function() {
29
+ assert.equal(
30
+ binarySearch(
31
+ [0, 1, 2],
32
+ 1.5,
33
+ function(x) {
34
+ return x;
35
+ },
36
+ false
37
+ ),
38
+ -1
39
+ );
20
40
  });
21
41
 
22
- it("case: key not found, return closest option true - should give the nearest smaller index", function() {
23
- assert.equal(binarySearch([0,1,2], -0.5, function(x) { return x; }, true), 0);
24
- assert.equal(binarySearch([0,1,2], 0.5, function(x) { return x; }, true), 0);
25
- assert.equal(binarySearch([0,1,2], 1.5, function(x) { return x; }, true), 1);
26
- assert.equal(binarySearch([0,1,2], 2.5, function(x) { return x; }, true), 2);
27
- assert.equal(binarySearch([0,1,2], 3.5, function(x) { return x; }, true), 2);
42
+ it('case: key not found, return closest option true - should give the nearest smaller index', function() {
43
+ assert.equal(
44
+ binarySearch(
45
+ [0, 1, 2],
46
+ -0.5,
47
+ function(x) {
48
+ return x;
49
+ },
50
+ true
51
+ ),
52
+ 0
53
+ );
54
+ assert.equal(
55
+ binarySearch(
56
+ [0, 1, 2],
57
+ 0.5,
58
+ function(x) {
59
+ return x;
60
+ },
61
+ true
62
+ ),
63
+ 0
64
+ );
65
+ assert.equal(
66
+ binarySearch(
67
+ [0, 1, 2],
68
+ 1.5,
69
+ function(x) {
70
+ return x;
71
+ },
72
+ true
73
+ ),
74
+ 1
75
+ );
76
+ assert.equal(
77
+ binarySearch(
78
+ [0, 1, 2],
79
+ 2.5,
80
+ function(x) {
81
+ return x;
82
+ },
83
+ true
84
+ ),
85
+ 2
86
+ );
87
+ assert.equal(
88
+ binarySearch(
89
+ [0, 1, 2],
90
+ 3.5,
91
+ function(x) {
92
+ return x;
93
+ },
94
+ true
95
+ ),
96
+ 2
97
+ );
28
98
 
29
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], -1.5, function(x) { return x; }, true), 0);
30
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], -0.5, function(x) { return x; }, true), 0);
31
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 0.5, function(x) { return x; }, true), 0);
32
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 1.5, function(x) { return x; }, true), 1);
33
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 2.5, function(x) { return x; }, true), 2);
34
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 3.5, function(x) { return x; }, true), 3);
35
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 4.5, function(x) { return x; }, true), 4);
36
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 5.5, function(x) { return x; }, true), 5);
37
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 6.5, function(x) { return x; }, true), 6);
38
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 7.5, function(x) { return x; }, true), 7);
39
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 8.5, function(x) { return x; }, true), 7);
99
+ assert.equal(
100
+ binarySearch(
101
+ [0, 1, 2, 3, 4, 5, 6, 7],
102
+ -1.5,
103
+ function(x) {
104
+ return x;
105
+ },
106
+ true
107
+ ),
108
+ 0
109
+ );
110
+ assert.equal(
111
+ binarySearch(
112
+ [0, 1, 2, 3, 4, 5, 6, 7],
113
+ -0.5,
114
+ function(x) {
115
+ return x;
116
+ },
117
+ true
118
+ ),
119
+ 0
120
+ );
121
+ assert.equal(
122
+ binarySearch(
123
+ [0, 1, 2, 3, 4, 5, 6, 7],
124
+ 0.5,
125
+ function(x) {
126
+ return x;
127
+ },
128
+ true
129
+ ),
130
+ 0
131
+ );
132
+ assert.equal(
133
+ binarySearch(
134
+ [0, 1, 2, 3, 4, 5, 6, 7],
135
+ 1.5,
136
+ function(x) {
137
+ return x;
138
+ },
139
+ true
140
+ ),
141
+ 1
142
+ );
143
+ assert.equal(
144
+ binarySearch(
145
+ [0, 1, 2, 3, 4, 5, 6, 7],
146
+ 2.5,
147
+ function(x) {
148
+ return x;
149
+ },
150
+ true
151
+ ),
152
+ 2
153
+ );
154
+ assert.equal(
155
+ binarySearch(
156
+ [0, 1, 2, 3, 4, 5, 6, 7],
157
+ 3.5,
158
+ function(x) {
159
+ return x;
160
+ },
161
+ true
162
+ ),
163
+ 3
164
+ );
165
+ assert.equal(
166
+ binarySearch(
167
+ [0, 1, 2, 3, 4, 5, 6, 7],
168
+ 4.5,
169
+ function(x) {
170
+ return x;
171
+ },
172
+ true
173
+ ),
174
+ 4
175
+ );
176
+ assert.equal(
177
+ binarySearch(
178
+ [0, 1, 2, 3, 4, 5, 6, 7],
179
+ 5.5,
180
+ function(x) {
181
+ return x;
182
+ },
183
+ true
184
+ ),
185
+ 5
186
+ );
187
+ assert.equal(
188
+ binarySearch(
189
+ [0, 1, 2, 3, 4, 5, 6, 7],
190
+ 6.5,
191
+ function(x) {
192
+ return x;
193
+ },
194
+ true
195
+ ),
196
+ 6
197
+ );
198
+ assert.equal(
199
+ binarySearch(
200
+ [0, 1, 2, 3, 4, 5, 6, 7],
201
+ 7.5,
202
+ function(x) {
203
+ return x;
204
+ },
205
+ true
206
+ ),
207
+ 7
208
+ );
209
+ assert.equal(
210
+ binarySearch(
211
+ [0, 1, 2, 3, 4, 5, 6, 7],
212
+ 8.5,
213
+ function(x) {
214
+ return x;
215
+ },
216
+ true
217
+ ),
218
+ 7
219
+ );
40
220
  });
41
221
 
42
- it("case: key found", function() {
43
- assert.equal(binarySearch([0,1,2], 0, function(x) { return x*x; }, true), 0);
44
- assert.equal(binarySearch([0,1,2], 1, function(x) { return x*x; }, true), 1);
45
- assert.equal(binarySearch([0,1,2], 4, function(x) { return x*x; }, true), 2);
222
+ it('case: key found', function() {
223
+ assert.equal(
224
+ binarySearch(
225
+ [0, 1, 2],
226
+ 0,
227
+ function(x) {
228
+ return x * x;
229
+ },
230
+ true
231
+ ),
232
+ 0
233
+ );
234
+ assert.equal(
235
+ binarySearch(
236
+ [0, 1, 2],
237
+ 1,
238
+ function(x) {
239
+ return x * x;
240
+ },
241
+ true
242
+ ),
243
+ 1
244
+ );
245
+ assert.equal(
246
+ binarySearch(
247
+ [0, 1, 2],
248
+ 4,
249
+ function(x) {
250
+ return x * x;
251
+ },
252
+ true
253
+ ),
254
+ 2
255
+ );
46
256
 
47
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 0, function(x) { return x*x; }, true), 0);
48
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 1, function(x) { return x*x; }, true), 1);
49
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 4, function(x) { return x*x; }, true), 2);
50
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 9, function(x) { return x*x; }, true), 3);
51
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 16, function(x) { return x*x; }, true), 4);
52
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 25, function(x) { return x*x; }, true), 5);
53
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 36, function(x) { return x*x; }, true), 6);
54
- assert.equal(binarySearch([0,1,2,3,4,5,6,7], 49, function(x) { return x*x; }, true), 7);
257
+ assert.equal(
258
+ binarySearch(
259
+ [0, 1, 2, 3, 4, 5, 6, 7],
260
+ 0,
261
+ function(x) {
262
+ return x * x;
263
+ },
264
+ true
265
+ ),
266
+ 0
267
+ );
268
+ assert.equal(
269
+ binarySearch(
270
+ [0, 1, 2, 3, 4, 5, 6, 7],
271
+ 1,
272
+ function(x) {
273
+ return x * x;
274
+ },
275
+ true
276
+ ),
277
+ 1
278
+ );
279
+ assert.equal(
280
+ binarySearch(
281
+ [0, 1, 2, 3, 4, 5, 6, 7],
282
+ 4,
283
+ function(x) {
284
+ return x * x;
285
+ },
286
+ true
287
+ ),
288
+ 2
289
+ );
290
+ assert.equal(
291
+ binarySearch(
292
+ [0, 1, 2, 3, 4, 5, 6, 7],
293
+ 9,
294
+ function(x) {
295
+ return x * x;
296
+ },
297
+ true
298
+ ),
299
+ 3
300
+ );
301
+ assert.equal(
302
+ binarySearch(
303
+ [0, 1, 2, 3, 4, 5, 6, 7],
304
+ 16,
305
+ function(x) {
306
+ return x * x;
307
+ },
308
+ true
309
+ ),
310
+ 4
311
+ );
312
+ assert.equal(
313
+ binarySearch(
314
+ [0, 1, 2, 3, 4, 5, 6, 7],
315
+ 25,
316
+ function(x) {
317
+ return x * x;
318
+ },
319
+ true
320
+ ),
321
+ 5
322
+ );
323
+ assert.equal(
324
+ binarySearch(
325
+ [0, 1, 2, 3, 4, 5, 6, 7],
326
+ 36,
327
+ function(x) {
328
+ return x * x;
329
+ },
330
+ true
331
+ ),
332
+ 6
333
+ );
334
+ assert.equal(
335
+ binarySearch(
336
+ [0, 1, 2, 3, 4, 5, 6, 7],
337
+ 49,
338
+ function(x) {
339
+ return x * x;
340
+ },
341
+ true
342
+ ),
343
+ 7
344
+ );
55
345
  });
56
346
  });
57
347
 
58
- describe("bucketSort", function() {
59
- describe("bucketSort", function() {
60
- it("case: empty input", function() {
61
- assert.deepEqual(
62
- BucketSort.bucketSort([]),
63
- []
64
- );
348
+ describe('bucketSort', function() {
349
+ describe('bucketSort', function() {
350
+ it('case: empty input', function() {
351
+ assert.deepEqual(BucketSort.bucketSort([]), []);
65
352
  });
66
- it("case: size 1 vectors", function() {
67
- assert.deepEqual(
68
- BucketSort.bucketSort([[3],[1],[2]]),
69
- [[1],[2],[3]]
70
- );
353
+ it('case: size 1 vectors', function() {
354
+ assert.deepEqual(BucketSort.bucketSort([[3], [1], [2]]), [
355
+ [1],
356
+ [2],
357
+ [3],
358
+ ]);
71
359
  });
72
- it("case: sorting with infinity", function() {
360
+ it('case: sorting with infinity', function() {
73
361
  assert.deepEqual(
74
- BucketSort.bucketSort([[Number.POSITIVE_INFINITY, 0], [0, 1]]),
75
- [[0,1],[Number.POSITIVE_INFINITY, 0]]
362
+ BucketSort.bucketSort([
363
+ [Number.POSITIVE_INFINITY, 0],
364
+ [0, 1],
365
+ ]),
366
+ [
367
+ [0, 1],
368
+ [Number.POSITIVE_INFINITY, 0],
369
+ ]
76
370
  );
77
371
  assert.deepEqual(
78
- BucketSort.bucketSort([[0, 0], [Number.NEGATIVE_INFINITY, 1]]),
79
- [[Number.NEGATIVE_INFINITY,1],[0, 0]]
372
+ BucketSort.bucketSort([
373
+ [0, 0],
374
+ [Number.NEGATIVE_INFINITY, 1],
375
+ ]),
376
+ [
377
+ [Number.NEGATIVE_INFINITY, 1],
378
+ [0, 0],
379
+ ]
80
380
  );
81
381
  });
82
- it("case: simple size 4 vectors", function() {
382
+ it('case: simple size 4 vectors', function() {
83
383
  assert.deepEqual(
84
384
  BucketSort.bucketSort([
85
- [3,3,3,3],
86
- [0,0,0,0],
87
- [2,2,2,2],
88
- [1,1,1,1]
385
+ [3, 3, 3, 3],
386
+ [0, 0, 0, 0],
387
+ [2, 2, 2, 2],
388
+ [1, 1, 1, 1],
89
389
  ]),
90
390
  [
91
- [0,0,0,0],
92
- [1,1,1,1],
93
- [2,2,2,2],
94
- [3,3,3,3]
391
+ [0, 0, 0, 0],
392
+ [1, 1, 1, 1],
393
+ [2, 2, 2, 2],
394
+ [3, 3, 3, 3],
95
395
  ]
96
396
  );
97
397
  });
98
- it("case: general size 4 vectors", function() {
398
+ it('case: general size 4 vectors', function() {
99
399
  assert.deepEqual(
100
400
  BucketSort.bucketSort([
101
- [13,10,-11,5],
102
- [-8,1,-8,-24],
103
- [-12, 23,-17,15],
104
- [-21,6,11,4],
105
- [12,22,21,8]
401
+ [13, 10, -11, 5],
402
+ [-8, 1, -8, -24],
403
+ [-12, 23, -17, 15],
404
+ [-21, 6, 11, 4],
405
+ [12, 22, 21, 8],
106
406
  ]),
107
407
  [
108
- [-21,6,11,4],
109
- [-12, 23,-17,15],
110
- [-8,1,-8,-24],
111
- [12,22,21,8],
112
- [13,10,-11,5]
408
+ [-21, 6, 11, 4],
409
+ [-12, 23, -17, 15],
410
+ [-8, 1, -8, -24],
411
+ [12, 22, 21, 8],
412
+ [13, 10, -11, 5],
113
413
  ]
114
414
  );
115
415
 
116
416
  assert.deepEqual(
117
417
  BucketSort.bucketSort([
118
- [13,10,-11,5],
119
- [13,1,-8,-24],
120
- [-12, 23,-17,15],
121
- [-12,6,11,4],
122
- [12,22,21,8]
418
+ [13, 10, -11, 5],
419
+ [13, 1, -8, -24],
420
+ [-12, 23, -17, 15],
421
+ [-12, 6, 11, 4],
422
+ [12, 22, 21, 8],
123
423
  ]),
124
424
  [
125
- [-12,6,11,4],
126
- [-12, 23,-17,15],
127
- [12,22,21,8],
128
- [13,1,-8,-24],
129
- [13,10,-11,5]
425
+ [-12, 6, 11, 4],
426
+ [-12, 23, -17, 15],
427
+ [12, 22, 21, 8],
428
+ [13, 1, -8, -24],
429
+ [13, 10, -11, 5],
130
430
  ]
131
431
  );
132
432
  assert.deepEqual(
133
433
  BucketSort.bucketSort([
134
- [0,10,-11,5],
135
- [0,1,-8,-24],
136
- [0, 23,-17,15],
137
- [0,6,11,4],
138
- [0,22,21,8]
434
+ [0, 10, -11, 5],
435
+ [0, 1, -8, -24],
436
+ [0, 23, -17, 15],
437
+ [0, 6, 11, 4],
438
+ [0, 22, 21, 8],
139
439
  ]),
140
440
  [
141
- [0,1,-8,-24],
142
- [0,6,11,4],
143
- [0,10,-11,5],
144
- [0,22,21,8],
145
- [0, 23,-17,15]
441
+ [0, 1, -8, -24],
442
+ [0, 6, 11, 4],
443
+ [0, 10, -11, 5],
444
+ [0, 22, 21, 8],
445
+ [0, 23, -17, 15],
146
446
  ]
147
447
  );
148
448
  assert.deepEqual(
149
449
  BucketSort.bucketSort([
150
- [0,10,-11,5],
151
- [0,10],
450
+ [0, 10, -11, 5],
451
+ [0, 10],
152
452
  [0],
153
- [0,10,-11]
453
+ [0, 10, -11],
154
454
  ]),
155
- [
156
- [0],
157
- [0,10],
158
- [0,10,-11],
159
- [0,10,-11,5]
160
- ]
455
+ [[0], [0, 10], [0, 10, -11], [0, 10, -11, 5]]
161
456
  );
162
457
  });
163
- it("case: size 2 vectors with compareEquals on the sample id", function() {
458
+ it('case: size 2 vectors with compareEquals on the sample id', function() {
164
459
  assert.deepEqual(
165
- BucketSort.bucketSort([
166
- {sample:"D", vector:[13,8]},
167
- {sample:"A", vector:[13,10]},
168
- {sample:"C", vector:[12,10]}
169
- ], function(d) { return d.vector; }, function(d1, d2) { return d1.sample.localeCompare(d2.sample); }),
460
+ BucketSort.bucketSort(
461
+ [
462
+ { sample: 'D', vector: [13, 8] },
463
+ { sample: 'A', vector: [13, 10] },
464
+ { sample: 'C', vector: [12, 10] },
465
+ ],
466
+ function(d) {
467
+ return d.vector;
468
+ },
469
+ function(d1, d2) {
470
+ return d1.sample.localeCompare(d2.sample);
471
+ }
472
+ ),
170
473
  [
171
- {sample:"C", vector:[12,10]},
172
- {sample:"D", vector:[13,8]},
173
- {sample:"A", vector:[13,10]}
474
+ { sample: 'C', vector: [12, 10] },
475
+ { sample: 'D', vector: [13, 8] },
476
+ { sample: 'A', vector: [13, 10] },
174
477
  ]
175
478
  );
176
479
 
177
480
  assert.deepEqual(
178
- BucketSort.bucketSort([
179
- {sample:"D", vector:[13,10]},
180
- {sample:"A", vector:[13,10]},
181
- {sample:"C", vector:[12,10]}
182
- ], function(d) { return d.vector; }, function(d1, d2) { return d1.sample.localeCompare(d2.sample); }),
481
+ BucketSort.bucketSort(
482
+ [
483
+ { sample: 'D', vector: [13, 10] },
484
+ { sample: 'A', vector: [13, 10] },
485
+ { sample: 'C', vector: [12, 10] },
486
+ ],
487
+ function(d) {
488
+ return d.vector;
489
+ },
490
+ function(d1, d2) {
491
+ return d1.sample.localeCompare(d2.sample);
492
+ }
493
+ ),
183
494
  [
184
- {sample:"C", vector:[12,10]},
185
- {sample:"A", vector:[13,10]},
186
- {sample:"D", vector:[13,10]}
495
+ { sample: 'C', vector: [12, 10] },
496
+ { sample: 'A', vector: [13, 10] },
497
+ { sample: 'D', vector: [13, 10] },
187
498
  ]
188
499
  );
189
500
  });
190
- it("case: randomized tests", function() {
191
- function randInt(magnitude:number) {
192
- var ret = Math.round(Math.random()*magnitude - Math.random()*magnitude);
501
+ it('case: randomized tests', function() {
502
+ function randInt(magnitude: number) {
503
+ var ret = Math.round(
504
+ Math.random() * magnitude - Math.random() * magnitude
505
+ );
193
506
  if (ret === 0) {
194
507
  // to deal w issues w negative zero
195
508
  ret = 0;
@@ -197,10 +510,10 @@ describe("bucketSort", function() {
197
510
  return ret;
198
511
  }
199
512
 
200
- function generateVector(size:number) {
513
+ function generateVector(size: number) {
201
514
  var ret = [];
202
- var vectorSize = size+Math.round(Math.random()*4);
203
- for (var i=0; i<vectorSize; i++) {
515
+ var vectorSize = size + Math.round(Math.random() * 4);
516
+ for (var i = 0; i < vectorSize; i++) {
204
517
  ret.push(randInt(3));
205
518
  }
206
519
  return ret;
@@ -208,19 +521,25 @@ describe("bucketSort", function() {
208
521
 
209
522
  var vectors;
210
523
 
211
- for (var size=0; size<20; size++) {
524
+ for (var size = 0; size < 20; size++) {
212
525
  vectors = [];
213
- for (var i=0; i<100; i++) {
526
+ for (var i = 0; i < 100; i++) {
214
527
  vectors.push(generateVector(size));
215
528
  }
216
529
  var sorted = BucketSort.bucketSort(vectors);
217
530
  vectors.sort(BucketSort.compare); // sort using equivalent comparator - resultant order should be same
218
- assert.deepEqual(sorted, vectors, "randomized test: vector size "+size);
531
+ assert.deepEqual(
532
+ sorted,
533
+ vectors,
534
+ 'randomized test: vector size ' + size
535
+ );
219
536
  }
220
537
  });
221
- it("case: randomized tests, with compareEquals", function() {
222
- function randInt(magnitude:number) {
223
- var ret = Math.round(Math.random()*magnitude - Math.random()*magnitude);
538
+ it('case: randomized tests, with compareEquals', function() {
539
+ function randInt(magnitude: number) {
540
+ var ret = Math.round(
541
+ Math.random() * magnitude - Math.random() * magnitude
542
+ );
224
543
  if (ret === 0) {
225
544
  // to deal w issues w negative zero
226
545
  ret = 0;
@@ -228,10 +547,10 @@ describe("bucketSort", function() {
228
547
  return ret;
229
548
  }
230
549
 
231
- function generateVector(size:number) {
550
+ function generateVector(size: number) {
232
551
  var ret = [];
233
- var vectorSize = size+Math.round(Math.random()*4);
234
- for (var i=0; i<vectorSize; i++) {
552
+ var vectorSize = size + Math.round(Math.random() * 4);
553
+ for (var i = 0; i < vectorSize; i++) {
235
554
  ret.push(randInt(3));
236
555
  }
237
556
  return ret;
@@ -242,33 +561,61 @@ describe("bucketSort", function() {
242
561
  var vector;
243
562
  var name;
244
563
 
245
- var getVector = function(d:any) { return d.vector; };
246
- var compareEquals = function(d1:any, d2:any) {return d1.name.localeCompare(d2.name);};
564
+ var getVector = function(d: any) {
565
+ return d.vector;
566
+ };
567
+ var compareEquals = function(d1: any, d2: any) {
568
+ return d1.name.localeCompare(d2.name);
569
+ };
247
570
 
248
- for (var size=0; size<20; size++) {
571
+ for (var size = 0; size < 20; size++) {
249
572
  names = [];
250
- for (var i=0; i<100; i++) {
251
- names.push("TCGA-"+(i<10 ? "0" : "")+(i<100 ? "0" : "") + i);
573
+ for (var i = 0; i < 100; i++) {
574
+ names.push(
575
+ 'TCGA-' + (i < 10 ? '0' : '') + (i < 100 ? '0' : '') + i
576
+ );
252
577
  }
253
578
  data = [];
254
- for (var i=0; i<100; i++) {
579
+ for (var i = 0; i < 100; i++) {
255
580
  vector = generateVector(size);
256
- name = names.splice(Math.floor(Math.random()*names.length), 1)[0];
257
- data.push({name:name, vector:vector});
581
+ name = names.splice(
582
+ Math.floor(Math.random() * names.length),
583
+ 1
584
+ )[0];
585
+ data.push({ name: name, vector: vector });
258
586
  }
259
- var sorted = BucketSort.bucketSort(data, getVector, compareEquals);
260
- data.sort(function(d1, d2) { return BucketSort.compareFull(d1, d2, getVector, compareEquals); })// sort using equivalent comparator - resultant order should be same
261
- assert.deepEqual(sorted, data, "randomized test: vector size "+size);
587
+ var sorted = BucketSort.bucketSort(
588
+ data,
589
+ getVector,
590
+ compareEquals
591
+ );
592
+ data.sort(function(d1, d2) {
593
+ return BucketSort.compareFull(
594
+ d1,
595
+ d2,
596
+ getVector,
597
+ compareEquals
598
+ );
599
+ }); // sort using equivalent comparator - resultant order should be same
600
+ assert.deepEqual(
601
+ sorted,
602
+ data,
603
+ 'randomized test: vector size ' + size
604
+ );
262
605
  }
263
606
  });
264
- it("case: randomized tests, with strings", function() {
265
- var names:string[] = [];
266
- for (var i=0; i<100; i++) {
267
- names.push("TCGA-"+(i<10 ? "0" : "")+(i<100 ? "0" : "") + i);
607
+ it('case: randomized tests, with strings', function() {
608
+ var names: string[] = [];
609
+ for (var i = 0; i < 100; i++) {
610
+ names.push(
611
+ 'TCGA-' + (i < 10 ? '0' : '') + (i < 100 ? '0' : '') + i
612
+ );
268
613
  }
269
614
 
270
- function randInt(magnitude:number) {
271
- var ret = Math.round(Math.random()*magnitude - Math.random()*magnitude);
615
+ function randInt(magnitude: number) {
616
+ var ret = Math.round(
617
+ Math.random() * magnitude - Math.random() * magnitude
618
+ );
272
619
  if (ret === 0) {
273
620
  // to deal w issues w negative zero
274
621
  ret = 0;
@@ -276,14 +623,20 @@ describe("bucketSort", function() {
276
623
  return ret;
277
624
  }
278
625
 
279
- function generateVector(size:number) {
626
+ function generateVector(size: number) {
280
627
  var ret = [];
281
- var vectorSize = size+Math.round(Math.random()*4);
282
- for (var i=0; i<vectorSize; i++) {
628
+ var vectorSize = size + Math.round(Math.random() * 4);
629
+ for (var i = 0; i < vectorSize; i++) {
283
630
  if (i % 2) {
284
631
  ret.push(randInt(3));
285
632
  } else {
286
- ret.push(Math.random() < 0.5 ? names[Math.floor(Math.random()*names.length)] : "");
633
+ ret.push(
634
+ Math.random() < 0.5
635
+ ? names[
636
+ Math.floor(Math.random() * names.length)
637
+ ]
638
+ : ''
639
+ );
287
640
  }
288
641
  }
289
642
  return ret;
@@ -291,160 +644,240 @@ describe("bucketSort", function() {
291
644
 
292
645
  var vectors;
293
646
 
294
- for (var size=0; size<20; size++) {
647
+ for (var size = 0; size < 20; size++) {
295
648
  vectors = [];
296
- for (var i=0; i<100; i++) {
649
+ for (var i = 0; i < 100; i++) {
297
650
  vectors.push(generateVector(size));
298
651
  }
299
652
  var sorted = BucketSort.bucketSort(vectors);
300
653
  vectors.sort(BucketSort.compare); // sort using equivalent comparator - resultant order should be same
301
- assert.deepEqual(sorted, vectors, "randomized test: vector size "+size);
654
+ assert.deepEqual(
655
+ sorted,
656
+ vectors,
657
+ 'randomized test: vector size ' + size
658
+ );
302
659
  }
303
660
  });
304
661
  });
305
- describe("stringToVector", function() {
306
- it("creates the right vectors", function() {
307
- assert.deepEqual(
308
- BucketSort.stringToVector(""), []
309
- );
310
- assert.deepEqual(
311
- BucketSort.stringToVector("a"), [97]
312
- );
313
- assert.deepEqual(
314
- BucketSort.stringToVector("abc"), [97, 98, 99]
315
- );
316
- assert.deepEqual(
317
- BucketSort.stringToVector("abc123abc456c"), [97, 98, 99, 123, 97, 98, 99, 456, 99]
318
- );
319
- assert.deepEqual(
320
- BucketSort.stringToVector("abc123abc456"), [97, 98, 99, 123, 97, 98, 99, 456]
321
- );
322
- assert.deepEqual(
323
- BucketSort.stringToVector("000"), [0]
324
- );
662
+ describe('stringToVector', function() {
663
+ it('creates the right vectors', function() {
664
+ assert.deepEqual(BucketSort.stringToVector(''), []);
665
+ assert.deepEqual(BucketSort.stringToVector('a'), [97]);
666
+ assert.deepEqual(BucketSort.stringToVector('abc'), [97, 98, 99]);
667
+ assert.deepEqual(BucketSort.stringToVector('abc123abc456c'), [
668
+ 97,
669
+ 98,
670
+ 99,
671
+ 123,
672
+ 97,
673
+ 98,
674
+ 99,
675
+ 456,
676
+ 99,
677
+ ]);
678
+ assert.deepEqual(BucketSort.stringToVector('abc123abc456'), [
679
+ 97,
680
+ 98,
681
+ 99,
682
+ 123,
683
+ 97,
684
+ 98,
685
+ 99,
686
+ 456,
687
+ ]);
688
+ assert.deepEqual(BucketSort.stringToVector('000'), [0]);
689
+ assert.deepEqual(BucketSort.stringToVector('1'), [1]);
690
+ });
691
+ });
692
+ describe('stringSort', function() {
693
+ it('sorts a list in right order', function() {
325
694
  assert.deepEqual(
326
- BucketSort.stringToVector("1"), [1]
695
+ BucketSort.stringSort([
696
+ 'A20',
697
+ 'P20',
698
+ 'P04',
699
+ 'P2',
700
+ 'P13',
701
+ 'ABCDE',
702
+ ]),
703
+ ['A20', 'ABCDE', 'P2', 'P04', 'P13', 'P20']
327
704
  );
328
705
  });
329
- });
330
- describe("stringSort", function() {
331
- it("sorts a list in right order", function(){
332
- assert.deepEqual(BucketSort.stringSort([
333
- "A20",
334
- "P20",
335
- "P04",
336
- "P2",
337
- "P13",
338
- "ABCDE"
339
- ]),[
340
- "A20",
341
- "ABCDE",
342
- "P2",
343
- "P04",
344
- "P13",
345
- "P20"
346
- ]);
347
- })
348
- it("sorts four tcga ids in right order", function() {
349
- assert.deepEqual(BucketSort.stringSort(
350
- ["TCGA-AA-A01I", "TCGA-AG-3599", "TCGA-AG-3605", "TCGA-AA-3556"]),
351
- ["TCGA-AA-A01I", "TCGA-AA-3556", "TCGA-AG-3599", "TCGA-AG-3605"]
706
+ it('sorts four tcga ids in right order', function() {
707
+ assert.deepEqual(
708
+ BucketSort.stringSort([
709
+ 'TCGA-AA-A01I',
710
+ 'TCGA-AG-3599',
711
+ 'TCGA-AG-3605',
712
+ 'TCGA-AA-3556',
713
+ ]),
714
+ ['TCGA-AA-A01I', 'TCGA-AA-3556', 'TCGA-AG-3599', 'TCGA-AG-3605']
352
715
  );
353
716
  });
354
- it("sorts a list of tcga ids in right order", function() {
355
- assert.deepEqual(BucketSort.stringSort(["TCGA-AG-3605","TCGA-AA-3680","TCGA-AA-3520","TCGA-AA-3854","TCGA-AA-3818","TCGA-AG-3575","TCGA-AA-3522","TCGA-AA-3814","TCGA-AA-3986","TCGA-AA-3696","TCGA-AA-A00Q","TCGA-AA-A00K","TCGA-AA-3561","TCGA-AF-2692","TCGA-AG-3901","TCGA-AA-3556","TCGA-AG-3580","TCGA-AA-3695","TCGA-AA-3930","TCGA-AG-3902","TCGA-AG-3727","TCGA-AA-A029","TCGA-A6-2683","TCGA-AG-3599","TCGA-AA-A01K","TCGA-AG-3878","TCGA-AA-3994","TCGA-AA-3979","TCGA-AG-3887","TCGA-AA-A01G","TCGA-AA-3560","TCGA-AA-3842","TCGA-AA-3837","TCGA-AG-3586","TCGA-AA-A01F","TCGA-AA-3870","TCGA-AA-3521","TCGA-AA-3673","TCGA-AA-A01I","TCGA-AF-2689","TCGA-AA-A02W","TCGA-AA-3681","TCGA-AG-3896","TCGA-AA-3851","TCGA-AA-3548","TCGA-AA-3852","TCGA-AA-3530","TCGA-AA-3939","TCGA-AG-3594","TCGA-AG-3909","TCGA-AA-3532","TCGA-AG-3581","TCGA-AG-3726","TCGA-AG-3611","TCGA-AA-3848","TCGA-AG-3583","TCGA-AG-3602"]),
717
+ it('sorts a list of tcga ids in right order', function() {
718
+ assert.deepEqual(
719
+ BucketSort.stringSort([
720
+ 'TCGA-AG-3605',
721
+ 'TCGA-AA-3680',
722
+ 'TCGA-AA-3520',
723
+ 'TCGA-AA-3854',
724
+ 'TCGA-AA-3818',
725
+ 'TCGA-AG-3575',
726
+ 'TCGA-AA-3522',
727
+ 'TCGA-AA-3814',
728
+ 'TCGA-AA-3986',
729
+ 'TCGA-AA-3696',
730
+ 'TCGA-AA-A00Q',
731
+ 'TCGA-AA-A00K',
732
+ 'TCGA-AA-3561',
733
+ 'TCGA-AF-2692',
734
+ 'TCGA-AG-3901',
735
+ 'TCGA-AA-3556',
736
+ 'TCGA-AG-3580',
737
+ 'TCGA-AA-3695',
738
+ 'TCGA-AA-3930',
739
+ 'TCGA-AG-3902',
740
+ 'TCGA-AG-3727',
741
+ 'TCGA-AA-A029',
742
+ 'TCGA-A6-2683',
743
+ 'TCGA-AG-3599',
744
+ 'TCGA-AA-A01K',
745
+ 'TCGA-AG-3878',
746
+ 'TCGA-AA-3994',
747
+ 'TCGA-AA-3979',
748
+ 'TCGA-AG-3887',
749
+ 'TCGA-AA-A01G',
750
+ 'TCGA-AA-3560',
751
+ 'TCGA-AA-3842',
752
+ 'TCGA-AA-3837',
753
+ 'TCGA-AG-3586',
754
+ 'TCGA-AA-A01F',
755
+ 'TCGA-AA-3870',
756
+ 'TCGA-AA-3521',
757
+ 'TCGA-AA-3673',
758
+ 'TCGA-AA-A01I',
759
+ 'TCGA-AF-2689',
760
+ 'TCGA-AA-A02W',
761
+ 'TCGA-AA-3681',
762
+ 'TCGA-AG-3896',
763
+ 'TCGA-AA-3851',
764
+ 'TCGA-AA-3548',
765
+ 'TCGA-AA-3852',
766
+ 'TCGA-AA-3530',
767
+ 'TCGA-AA-3939',
768
+ 'TCGA-AG-3594',
769
+ 'TCGA-AG-3909',
770
+ 'TCGA-AA-3532',
771
+ 'TCGA-AG-3581',
772
+ 'TCGA-AG-3726',
773
+ 'TCGA-AG-3611',
774
+ 'TCGA-AA-3848',
775
+ 'TCGA-AG-3583',
776
+ 'TCGA-AG-3602',
777
+ ]),
356
778
  [
357
- "TCGA-A6-2683",
358
- "TCGA-AA-A00K",
359
- "TCGA-AA-A00Q",
360
- "TCGA-AA-A01F",
361
- "TCGA-AA-A01G",
362
- "TCGA-AA-A01I",
363
- "TCGA-AA-A01K",
364
- "TCGA-AA-A02W",
365
- "TCGA-AA-A029",
366
- "TCGA-AA-3520",
367
- "TCGA-AA-3521",
368
- "TCGA-AA-3522",
369
- "TCGA-AA-3530",
370
- "TCGA-AA-3532",
371
- "TCGA-AA-3548",
372
- "TCGA-AA-3556",
373
- "TCGA-AA-3560",
374
- "TCGA-AA-3561",
375
- "TCGA-AA-3673",
376
- "TCGA-AA-3680",
377
- "TCGA-AA-3681",
378
- "TCGA-AA-3695",
379
- "TCGA-AA-3696",
380
- "TCGA-AA-3814",
381
- "TCGA-AA-3818",
382
- "TCGA-AA-3837",
383
- "TCGA-AA-3842",
384
- "TCGA-AA-3848",
385
- "TCGA-AA-3851",
386
- "TCGA-AA-3852",
387
- "TCGA-AA-3854",
388
- "TCGA-AA-3870",
389
- "TCGA-AA-3930",
390
- "TCGA-AA-3939",
391
- "TCGA-AA-3979",
392
- "TCGA-AA-3986",
393
- "TCGA-AA-3994",
394
- "TCGA-AF-2689",
395
- "TCGA-AF-2692",
396
- "TCGA-AG-3575",
397
- "TCGA-AG-3580",
398
- "TCGA-AG-3581",
399
- "TCGA-AG-3583",
400
- "TCGA-AG-3586",
401
- "TCGA-AG-3594",
402
- "TCGA-AG-3599",
403
- "TCGA-AG-3602",
404
- "TCGA-AG-3605",
405
- "TCGA-AG-3611",
406
- "TCGA-AG-3726",
407
- "TCGA-AG-3727",
408
- "TCGA-AG-3878",
409
- "TCGA-AG-3887",
410
- "TCGA-AG-3896",
411
- "TCGA-AG-3901",
412
- "TCGA-AG-3902",
413
- "TCGA-AG-3909"
414
- ]);
779
+ 'TCGA-A6-2683',
780
+ 'TCGA-AA-A00K',
781
+ 'TCGA-AA-A00Q',
782
+ 'TCGA-AA-A01F',
783
+ 'TCGA-AA-A01G',
784
+ 'TCGA-AA-A01I',
785
+ 'TCGA-AA-A01K',
786
+ 'TCGA-AA-A02W',
787
+ 'TCGA-AA-A029',
788
+ 'TCGA-AA-3520',
789
+ 'TCGA-AA-3521',
790
+ 'TCGA-AA-3522',
791
+ 'TCGA-AA-3530',
792
+ 'TCGA-AA-3532',
793
+ 'TCGA-AA-3548',
794
+ 'TCGA-AA-3556',
795
+ 'TCGA-AA-3560',
796
+ 'TCGA-AA-3561',
797
+ 'TCGA-AA-3673',
798
+ 'TCGA-AA-3680',
799
+ 'TCGA-AA-3681',
800
+ 'TCGA-AA-3695',
801
+ 'TCGA-AA-3696',
802
+ 'TCGA-AA-3814',
803
+ 'TCGA-AA-3818',
804
+ 'TCGA-AA-3837',
805
+ 'TCGA-AA-3842',
806
+ 'TCGA-AA-3848',
807
+ 'TCGA-AA-3851',
808
+ 'TCGA-AA-3852',
809
+ 'TCGA-AA-3854',
810
+ 'TCGA-AA-3870',
811
+ 'TCGA-AA-3930',
812
+ 'TCGA-AA-3939',
813
+ 'TCGA-AA-3979',
814
+ 'TCGA-AA-3986',
815
+ 'TCGA-AA-3994',
816
+ 'TCGA-AF-2689',
817
+ 'TCGA-AF-2692',
818
+ 'TCGA-AG-3575',
819
+ 'TCGA-AG-3580',
820
+ 'TCGA-AG-3581',
821
+ 'TCGA-AG-3583',
822
+ 'TCGA-AG-3586',
823
+ 'TCGA-AG-3594',
824
+ 'TCGA-AG-3599',
825
+ 'TCGA-AG-3602',
826
+ 'TCGA-AG-3605',
827
+ 'TCGA-AG-3611',
828
+ 'TCGA-AG-3726',
829
+ 'TCGA-AG-3727',
830
+ 'TCGA-AG-3878',
831
+ 'TCGA-AG-3887',
832
+ 'TCGA-AG-3896',
833
+ 'TCGA-AG-3901',
834
+ 'TCGA-AG-3902',
835
+ 'TCGA-AG-3909',
836
+ ]
837
+ );
415
838
  });
416
839
  });
417
- describe("__bucketSortHelper", function() {
418
- it("case: size 1 vector", function() {
840
+ describe('__bucketSortHelper', function() {
841
+ it('case: size 1 vector', function() {
419
842
  assert.deepEqual(
420
843
  BucketSort.bucketSortHelper(
421
- [[3],[1],[2]], function(x) { return x; }, 0, 3, 0, false
844
+ [[3], [1], [2]],
845
+ function(x) {
846
+ return x;
847
+ },
848
+ 0,
849
+ 3,
850
+ 0,
851
+ false
422
852
  ),
423
853
  {
424
- sorted_array: [[1],[2],[3]],
425
- bucket_ranges:[{lower_index_incl:0, upper_index_excl: 1},{lower_index_incl:1, upper_index_excl: 2},
426
- {lower_index_incl:2, upper_index_excl: 3}]
854
+ sorted_array: [[1], [2], [3]],
855
+ bucket_ranges: [
856
+ { lower_index_incl: 0, upper_index_excl: 1 },
857
+ { lower_index_incl: 1, upper_index_excl: 2 },
858
+ { lower_index_incl: 2, upper_index_excl: 3 },
859
+ ],
427
860
  }
428
861
  );
429
862
  });
430
863
  });
431
864
  });
432
865
 
433
- describe("doesCellIntersectPixel", function() {
434
- it("returns false in case of no intersection on the left", function() {
435
- assert.isFalse(doesCellIntersectPixel([0,1], 2));
866
+ describe('doesCellIntersectPixel', function() {
867
+ it('returns false in case of no intersection on the left', function() {
868
+ assert.isFalse(doesCellIntersectPixel([0, 1], 2));
436
869
  });
437
- it("returns true in case of half intersection from the left", function() {
438
- assert.isTrue(doesCellIntersectPixel([0,2.5], 2));
870
+ it('returns true in case of half intersection from the left', function() {
871
+ assert.isTrue(doesCellIntersectPixel([0, 2.5], 2));
439
872
  });
440
- it("returns true in case of inclusion inside pixel", function() {
441
- assert.isTrue(doesCellIntersectPixel([2,2.5], 2));
873
+ it('returns true in case of inclusion inside pixel', function() {
874
+ assert.isTrue(doesCellIntersectPixel([2, 2.5], 2));
442
875
  });
443
- it("returns true in case of half intersection from the right", function() {
444
- assert.isTrue(doesCellIntersectPixel([2.5,6], 2));
876
+ it('returns true in case of half intersection from the right', function() {
877
+ assert.isTrue(doesCellIntersectPixel([2.5, 6], 2));
445
878
  });
446
- it("returns false in case of no intersection on the right", function() {
447
- assert.isFalse(doesCellIntersectPixel([3,4], 2));
448
- assert.isFalse(doesCellIntersectPixel([4,6], 2));
879
+ it('returns false in case of no intersection on the right', function() {
880
+ assert.isFalse(doesCellIntersectPixel([3, 4], 2));
881
+ assert.isFalse(doesCellIntersectPixel([4, 6], 2));
449
882
  });
450
883
  });