oncoprintjs 6.0.0 → 6.0.2

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 CHANGED
@@ -1167,6 +1167,12 @@ var OncoprintModel = /** @class */ (function () {
1167
1167
  writable: true,
1168
1168
  value: void 0
1169
1169
  });
1170
+ Object.defineProperty(this, "track_gap_change_callback", {
1171
+ enumerable: true,
1172
+ configurable: true,
1173
+ writable: true,
1174
+ value: void 0
1175
+ });
1170
1176
  Object.defineProperty(this, "track_data", {
1171
1177
  enumerable: true,
1172
1178
  configurable: true,
@@ -1450,6 +1456,7 @@ var OncoprintModel = /** @class */ (function () {
1450
1456
  this.track_sort_direction_changeable = {};
1451
1457
  this.track_sort_direction = {}; // 1: ascending, -1: descending, 0: not
1452
1458
  this.track_sort_direction_change_callback = {};
1459
+ this.track_gap_change_callback = {};
1453
1460
  this.track_data = {};
1454
1461
  this.track_rule_set_id = {}; // track id -> rule set id
1455
1462
  this.track_active_rules = {}; // from track id to active rule map (map with rule ids as keys)
@@ -1687,6 +1694,7 @@ var OncoprintModel = /** @class */ (function () {
1687
1694
  writable: true,
1688
1695
  value: function (trackId, show) {
1689
1696
  this.track_show_gaps[trackId] = show;
1697
+ this.track_gap_change_callback[trackId](trackId, show);
1690
1698
  this.ids_after_a_gap.update(this);
1691
1699
  }
1692
1700
  });
@@ -2536,11 +2544,18 @@ var OncoprintModel = /** @class */ (function () {
2536
2544
  this.track_expand_button_getter[track_id] =
2537
2545
  params.expandButtonTextGetter;
2538
2546
  }
2547
+ this.track_sort_direction[track_id] = ifndef(params.init_sort_direction, 1);
2539
2548
  this.track_can_show_gaps[track_id] = ifndef(params.track_can_show_gaps, false);
2540
- this.track_show_gaps[track_id] = ifndef(params.show_gaps_on_init, false);
2549
+ var trackShowGaps = ifndef(params.show_gaps_on_init, false);
2550
+ this.track_show_gaps[track_id] = trackShowGaps;
2551
+ var trackNotSorted = this.track_sort_direction[track_id] === 0;
2552
+ if (trackShowGaps && trackNotSorted) {
2553
+ this.track_sort_direction[track_id] = 1;
2554
+ }
2541
2555
  this.track_sort_cmp_fn[track_id] = params.sortCmpFn;
2542
2556
  this.track_sort_direction_changeable[track_id] = ifndef(params.sort_direction_changeable, false);
2543
2557
  this.track_sort_direction_change_callback[track_id] = ifndef(params.onSortDirectionChange, function () { });
2558
+ this.track_gap_change_callback[track_id] = ifndef(params.onGapChange, function () { });
2544
2559
  this.track_data[track_id] = ifndef(params.data, []);
2545
2560
  this.track_data_id_key[track_id] = ifndef(params.data_id_key, 'id');
2546
2561
  this.track_info[track_id] = ifndef(params.track_info, '');
@@ -2556,7 +2571,6 @@ var OncoprintModel = /** @class */ (function () {
2556
2571
  if (params.important_ids) {
2557
2572
  this.setTrackImportantIds(track_id, params.important_ids);
2558
2573
  }
2559
- this.track_sort_direction[track_id] = ifndef(params.init_sort_direction, 1);
2560
2574
  params.target_group = ifndef(params.target_group, 0);
2561
2575
  this.ensureTrackGroupExists(params.target_group);
2562
2576
  // add track to target group
@@ -10032,6 +10046,7 @@ var OncoprintTrackOptionsView = /** @class */ (function () {
10032
10046
  configurable: true,
10033
10047
  writable: true,
10034
10048
  value: function (model, getCellViewHeight) {
10049
+ this.setTrackShowGaps(model, getCellViewHeight);
10035
10050
  this.renderAllOptions(model);
10036
10051
  this.resize(model, getCellViewHeight);
10037
10052
  }