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,70 +1,87 @@
1
- import OncoprintRuleSet, {RuleSetParams, RuleSetType} from "../js/oncoprintruleset";
2
- import {assert} from "chai";
1
+ import OncoprintRuleSet, {
2
+ RuleSetParams,
3
+ RuleSetType,
4
+ } from '../js/oncoprintruleset';
5
+ import { assert } from 'chai';
3
6
 
4
7
  type Datum = {
5
- id:string;
6
- category:string|undefined;
7
- profile_data:number|null;
8
- truncation?:any;
8
+ id: string;
9
+ category: string | undefined;
10
+ profile_data: number | null;
11
+ truncation?: any;
9
12
  };
10
13
 
11
- describe("GradientCategoricalRuleSet", function() {
12
-
13
- const mixParams:RuleSetParams = {
14
+ describe('GradientCategoricalRuleSet', function() {
15
+ const mixParams: RuleSetParams = {
14
16
  type: RuleSetType.GRADIENT_AND_CATEGORICAL,
15
- legend_label: "this is a label",
16
- value_key: "profile_data",
17
- value_range: [1,8],
18
- value_stop_points: [1,2,8],
19
- colors: [[255,0,0,1],[0,0,0,1],[0,255,0,1]],
20
- null_color: [224,224,224,1],
21
- category_key: "category"
17
+ legend_label: 'this is a label',
18
+ value_key: 'profile_data',
19
+ value_range: [1, 8],
20
+ value_stop_points: [1, 2, 8],
21
+ colors: [
22
+ [255, 0, 0, 1],
23
+ [0, 0, 0, 1],
24
+ [0, 255, 0, 1],
25
+ ],
26
+ null_color: [224, 224, 224, 1],
27
+ category_key: 'category',
22
28
  };
23
29
 
24
- const categoryDatum:Datum = {
25
- id:"a",
26
- category: ">8",
27
- profile_data: 8
30
+ const categoryDatum: Datum = {
31
+ id: 'a',
32
+ category: '>8',
33
+ profile_data: 8,
28
34
  };
29
35
 
30
- const gradientDatumLargest:Datum = {
31
- id:"b",
36
+ const gradientDatumLargest: Datum = {
37
+ id: 'b',
32
38
  category: undefined,
33
- profile_data: 8
39
+ profile_data: 8,
34
40
  };
35
41
 
36
- const gradientDatumSmallest:Datum = {
37
- id:"c",
42
+ const gradientDatumSmallest: Datum = {
43
+ id: 'c',
38
44
  category: undefined,
39
- profile_data: 1
45
+ profile_data: 1,
40
46
  };
41
47
 
42
- const naDatum:Datum = {
43
- id:"d",
48
+ const naDatum: Datum = {
49
+ id: 'd',
44
50
  category: undefined,
45
51
  profile_data: null,
46
- truncation: undefined
52
+ truncation: undefined,
47
53
  };
48
54
 
49
- it("Formats gradient value", function() {
55
+ it('Formats gradient value', function() {
50
56
  var mixRuleSet = OncoprintRuleSet(mixParams);
51
- var elements = mixRuleSet.getSpecificShapesForDatum([gradientDatumLargest, gradientDatumSmallest, naDatum], 12, 12, undefined, "id");
57
+ var elements = mixRuleSet.getSpecificShapesForDatum(
58
+ [gradientDatumLargest, gradientDatumSmallest, naDatum],
59
+ 12,
60
+ 12,
61
+ undefined,
62
+ 'id'
63
+ );
52
64
  assert.equal(elements.length, 3);
53
- assert.deepEqual(elements[0][0].fill,[0,255,0,1]);
54
- assert.deepEqual(elements[1][0].fill,[255,0,0,1]);
55
- assert.deepEqual(elements[2][0].fill,[224,224,224,1]);
65
+ assert.deepEqual(elements[0][0].fill, [0, 255, 0, 1]);
66
+ assert.deepEqual(elements[1][0].fill, [255, 0, 0, 1]);
67
+ assert.deepEqual(elements[2][0].fill, [224, 224, 224, 1]);
56
68
  });
57
69
 
58
- it("Formats categorical value", function() {
70
+ it('Formats categorical value', function() {
59
71
  var mixRuleSet = OncoprintRuleSet(mixParams);
60
- var elements = mixRuleSet.getSpecificShapesForDatum([categoryDatum], 12, 12, undefined, "id");
72
+ var elements = mixRuleSet.getSpecificShapesForDatum(
73
+ [categoryDatum],
74
+ 12,
75
+ 12,
76
+ undefined,
77
+ 'id'
78
+ );
61
79
  assert.equal(elements.length, 1);
62
80
  });
63
81
 
64
- it("Suppresses duplicate No Data rules", function() {
82
+ it('Suppresses duplicate No Data rules', function() {
65
83
  var mixRuleSet = OncoprintRuleSet(mixParams);
66
84
  var elements = mixRuleSet.getSpecificRulesForDatum();
67
85
  assert.equal(elements.length, 2);
68
86
  });
69
-
70
87
  });