oncoprintjs 6.1.3 → 6.1.4

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.
@@ -1,13 +1,13 @@
1
1
 
2
- > oncoprintjs@6.1.3 build /home/runner/work/cbioportal-frontend/cbioportal-frontend/packages/oncoprintjs
2
+ > oncoprintjs@6.1.4 build /home/runner/work/cbioportal-frontend/cbioportal-frontend/packages/oncoprintjs
3
3
  > cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=2048 pnpm run rollup
4
4
 
5
5
 
6
- > oncoprintjs@6.1.3 rollup /home/runner/work/cbioportal-frontend/cbioportal-frontend/packages/oncoprintjs
6
+ > oncoprintjs@6.1.4 rollup /home/runner/work/cbioportal-frontend/cbioportal-frontend/packages/oncoprintjs
7
7
  > rollup -c rollup.config.ts
8
8
 
9
9
  
10
10
  src/index.tsx → dist/index.js, dist/index.es.js...
11
11
  (!) Circular dependency
12
12
  src/js/oncoprinttrackoptionsview.ts -> src/js/oncoprintheaderview.ts -> src/js/oncoprinttrackoptionsview.ts
13
- created dist/index.js, dist/index.es.js in 20.6s
13
+ created dist/index.js, dist/index.es.js in 19.4s
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { __awaiter, __generator, __spreadArray, __extends as __extends$1 } from 'tslib';
1
+ import { __awaiter, __generator, __spreadArray, __extends } from 'tslib';
2
2
  import $$2 from 'jquery';
3
3
  import _, { isNumber } from 'lodash';
4
4
  import gl_matrix from 'gl-matrix';
@@ -2852,18 +2852,36 @@ var OncoprintModel = /** @class */ (function () {
2852
2852
  if (nearest_id_index === -1) {
2853
2853
  return null;
2854
2854
  }
2855
- // Next, see if it's in a track
2855
+ // Next, see if it's in a track.
2856
+ // Try binary search first for performance, but fall back to linear
2857
+ // scan if the result is invalid. cell_tops may not be monotonically
2858
+ // ordered relative to the tracks array during async clustering
2859
+ // transitions, which causes binary search to return wrong results.
2856
2860
  var tracks = this.getTracks();
2857
2861
  var cell_tops = this.getCellTops();
2862
+ var nearest_track;
2858
2863
  var nearest_track_index = binarysearch(tracks, y, function (track) {
2859
2864
  return cell_tops[track];
2860
2865
  }, true);
2861
- if (nearest_track_index === -1) {
2862
- return null;
2866
+ if (nearest_track_index !== -1) {
2867
+ var candidate = tracks[nearest_track_index];
2868
+ if (y >= cell_tops[candidate] &&
2869
+ y < cell_tops[candidate] + this.getCellHeight(candidate)) {
2870
+ nearest_track = candidate;
2871
+ }
2872
+ }
2873
+ if (nearest_track === undefined) {
2874
+ // Binary search failed (tracks out of order) - linear fallback
2875
+ for (var t = 0; t < tracks.length; t++) {
2876
+ var top_1 = cell_tops[tracks[t]];
2877
+ if (y >= top_1 &&
2878
+ y < top_1 + this.getCellHeight(tracks[t])) {
2879
+ nearest_track = tracks[t];
2880
+ break;
2881
+ }
2882
+ }
2863
2883
  }
2864
- var nearest_track = tracks[nearest_track_index];
2865
- if (y >= cell_tops[nearest_track] + this.getCellHeight(nearest_track)) {
2866
- // we know y is past the top of the track (>= cell_tops[nearest_track]), so this checks if y is past the bottom of the track
2884
+ if (nearest_track === undefined) {
2867
2885
  return null;
2868
2886
  }
2869
2887
  // At this point, we know y is inside a track
@@ -4233,42 +4251,6 @@ function getNumWebGLVertexes(shape) {
4233
4251
  return ret;
4234
4252
  }
4235
4253
 
4236
- /******************************************************************************
4237
- Copyright (c) Microsoft Corporation.
4238
-
4239
- Permission to use, copy, modify, and/or distribute this software for any
4240
- purpose with or without fee is hereby granted.
4241
-
4242
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
4243
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
4244
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
4245
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
4246
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
4247
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4248
- PERFORMANCE OF THIS SOFTWARE.
4249
- ***************************************************************************** */
4250
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
4251
-
4252
- var extendStatics = function(d, b) {
4253
- extendStatics = Object.setPrototypeOf ||
4254
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
4255
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
4256
- return extendStatics(d, b);
4257
- };
4258
-
4259
- function __extends(d, b) {
4260
- if (typeof b !== "function" && b !== null)
4261
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
4262
- extendStatics(d, b);
4263
- function __() { this.constructor = d; }
4264
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4265
- }
4266
-
4267
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
4268
- var e = new Error(message);
4269
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
4270
- };
4271
-
4272
4254
  var default_parameter_values = {
4273
4255
  width: 100,
4274
4256
  height: 100,
@@ -8348,7 +8330,7 @@ var RuleSet = /** @class */ (function () {
8348
8330
  return RuleSet;
8349
8331
  }());
8350
8332
  var LookupRuleSet = /** @class */ (function (_super) {
8351
- __extends$1(LookupRuleSet, _super);
8333
+ __extends(LookupRuleSet, _super);
8352
8334
  function LookupRuleSet() {
8353
8335
  var _this = _super !== null && _super.apply(this, arguments) || this;
8354
8336
  Object.defineProperty(_this, "lookup_map_by_key_and_value", {
@@ -8468,7 +8450,7 @@ var LookupRuleSet = /** @class */ (function (_super) {
8468
8450
  return LookupRuleSet;
8469
8451
  }(RuleSet));
8470
8452
  var ConditionRuleSet = /** @class */ (function (_super) {
8471
- __extends$1(ConditionRuleSet, _super);
8453
+ __extends(ConditionRuleSet, _super);
8472
8454
  function ConditionRuleSet(params, omitNArule) {
8473
8455
  var _this = _super.call(this, params) || this;
8474
8456
  Object.defineProperty(_this, "rule_id_to_condition", {
@@ -8529,7 +8511,7 @@ var ConditionRuleSet = /** @class */ (function (_super) {
8529
8511
  return ConditionRuleSet;
8530
8512
  }(RuleSet));
8531
8513
  var CategoricalRuleSet = /** @class */ (function (_super) {
8532
- __extends$1(CategoricalRuleSet, _super);
8514
+ __extends(CategoricalRuleSet, _super);
8533
8515
  function CategoricalRuleSet(params, omitNArule) {
8534
8516
  var _this = _super.call(this, params) || this;
8535
8517
  Object.defineProperty(_this, "category_key", {
@@ -8635,7 +8617,7 @@ var LinearInterpRangeType;
8635
8617
  LinearInterpRangeType["NON_POSITIVE"] = "NON_POSITIVE";
8636
8618
  })(LinearInterpRangeType || (LinearInterpRangeType = {}));
8637
8619
  var LinearInterpRuleSet = /** @class */ (function (_super) {
8638
- __extends$1(LinearInterpRuleSet, _super);
8620
+ __extends(LinearInterpRuleSet, _super);
8639
8621
  function LinearInterpRuleSet(params) {
8640
8622
  var _this = _super.call(this, params) || this;
8641
8623
  Object.defineProperty(_this, "value_key", {
@@ -8800,7 +8782,7 @@ var LinearInterpRuleSet = /** @class */ (function (_super) {
8800
8782
  return LinearInterpRuleSet;
8801
8783
  }(ConditionRuleSet));
8802
8784
  var GradientRuleSet = /** @class */ (function (_super) {
8803
- __extends$1(GradientRuleSet, _super);
8785
+ __extends(GradientRuleSet, _super);
8804
8786
  function GradientRuleSet(params) {
8805
8787
  var _a;
8806
8788
  var _this = _super.call(this, params) || this;
@@ -8946,7 +8928,7 @@ var GradientRuleSet = /** @class */ (function (_super) {
8946
8928
  return GradientRuleSet;
8947
8929
  }(LinearInterpRuleSet));
8948
8930
  var BarRuleSet = /** @class */ (function (_super) {
8949
- __extends$1(BarRuleSet, _super);
8931
+ __extends(BarRuleSet, _super);
8950
8932
  function BarRuleSet(params) {
8951
8933
  var _this = _super.call(this, params) || this;
8952
8934
  Object.defineProperty(_this, "fill", {
@@ -9075,7 +9057,7 @@ var BarRuleSet = /** @class */ (function (_super) {
9075
9057
  return BarRuleSet;
9076
9058
  }(LinearInterpRuleSet));
9077
9059
  var StackedBarRuleSet = /** @class */ (function (_super) {
9078
- __extends$1(StackedBarRuleSet, _super);
9060
+ __extends(StackedBarRuleSet, _super);
9079
9061
  function StackedBarRuleSet(params) {
9080
9062
  var _this = _super.call(this, params) || this;
9081
9063
  var value_key = params.value_key;
@@ -9137,7 +9119,7 @@ var StackedBarRuleSet = /** @class */ (function (_super) {
9137
9119
  return StackedBarRuleSet;
9138
9120
  }(ConditionRuleSet));
9139
9121
  var GeneticAlterationRuleSet = /** @class */ (function (_super) {
9140
- __extends$1(GeneticAlterationRuleSet, _super);
9122
+ __extends(GeneticAlterationRuleSet, _super);
9141
9123
  function GeneticAlterationRuleSet(params) {
9142
9124
  var _this = _super.call(this, params) || this;
9143
9125
  _this.addRulesFromParams(params);
@@ -9282,7 +9264,7 @@ var Rule = /** @class */ (function () {
9282
9264
  return Rule;
9283
9265
  }());
9284
9266
  var GradientCategoricalRuleSet = /** @class */ (function (_super) {
9285
- __extends$1(GradientCategoricalRuleSet, _super);
9267
+ __extends(GradientCategoricalRuleSet, _super);
9286
9268
  function GradientCategoricalRuleSet(params) {
9287
9269
  var _this = _super.call(this, params) || this;
9288
9270
  Object.defineProperty(_this, "gradientRuleSet", {