geneviewer-js 0.3.0 → 0.3.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.
@@ -6047,7 +6047,8 @@ function shiftAnnotation(options, shift) {
6047
6047
  }
6048
6048
  if (options.position !== null && options.position !== void 0) {
6049
6049
  if (options.type === "rectangle") {
6050
- options.position = [options.position].flat(0).map((corners) => {
6050
+ const rectangles = Array.isArray(options.position) ? options.position : [options.position];
6051
+ options.position = rectangles.map((corners) => {
6051
6052
  if (!Array.isArray(corners)) return [move(corners)];
6052
6053
  return corners.map((point) => Array.isArray(point) ? [move(point[0]), ...point.slice(1)] : move(point));
6053
6054
  });
@@ -7297,7 +7298,7 @@ function createSaveIcon(widgetId, el, container2, iconClass = null, save = downl
7297
7298
  }
7298
7299
 
7299
7300
  // src/lib/chart.js
7300
- var version = "0.3.0";
7301
+ var version = "0.3.2";
7301
7302
  var renderSequence = 0;
7302
7303
  var chartCount = 0;
7303
7304
  var activeShortcuts = null;
@@ -7537,9 +7538,15 @@ function newChart(target, renderModel, options) {
7537
7538
  return keyOf(item) === key;
7538
7539
  });
7539
7540
  };
7541
+ var copyItem = function(item) {
7542
+ return item === null ? null : structuredClone(item);
7543
+ };
7544
+ var copySelection = function() {
7545
+ return selection.map(copyItem);
7546
+ };
7540
7547
  var reportSelection = function() {
7541
- report("select", selected);
7542
- report("selection", selection);
7548
+ report("select", copyItem(selected));
7549
+ report("selection", copySelection());
7543
7550
  };
7544
7551
  var applySelection = function(refresh) {
7545
7552
  var previous = JSON.stringify(selection.map(function(item) {
@@ -8910,7 +8917,7 @@ function newChart(target, renderModel, options) {
8910
8917
  changeSelection(matchItems(items == null ? [] : Array.isArray(items) ? items : [items]), "replace");
8911
8918
  },
8912
8919
  getSelection: function() {
8913
- return selection.slice();
8920
+ return copySelection();
8914
8921
  },
8915
8922
  undo: function() {
8916
8923
  if (!destroyed) step(true);