plotly.js 2.13.3 → 2.14.0

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,5 +1,5 @@
1
1
  /**
2
- * plotly.js (cartesian) v2.13.3
2
+ * plotly.js (cartesian) v2.14.0
3
3
  * Copyright 2012-2022, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -45305,6 +45305,10 @@ function draw(gd) {
45305
45305
  }
45306
45306
  }
45307
45307
 
45308
+ function couldHaveActiveSelection(gd) {
45309
+ return gd._context.editSelection;
45310
+ }
45311
+
45308
45312
  function drawOne(gd, index) {
45309
45313
  // remove the existing selection if there is one.
45310
45314
  // because indices can change, we need to look in all selection layers
@@ -45341,7 +45345,7 @@ function drawOne(gd, index) {
45341
45345
  lineDash = 'solid';
45342
45346
  }
45343
45347
 
45344
- var isActiveSelection =
45348
+ var isActiveSelection = couldHaveActiveSelection(gd) &&
45345
45349
  gd._fullLayout._activeSelectionIndex === index;
45346
45350
 
45347
45351
  if(isActiveSelection) {
@@ -45408,6 +45412,8 @@ function setClipPath(selectionPath, gd, selectionOptions) {
45408
45412
 
45409
45413
 
45410
45414
  function activateSelection(gd, path) {
45415
+ if(!couldHaveActiveSelection(gd)) return;
45416
+
45411
45417
  var element = path.node();
45412
45418
  var id = +element.getAttribute('data-index');
45413
45419
  if(id >= 0) {
@@ -45424,6 +45430,8 @@ function activateSelection(gd, path) {
45424
45430
  }
45425
45431
 
45426
45432
  function activateLastSelection(gd) {
45433
+ if(!couldHaveActiveSelection(gd)) return;
45434
+
45427
45435
  var id = gd._fullLayout.selections.length - 1;
45428
45436
  gd._fullLayout._activeSelectionIndex = id;
45429
45437
  gd._fullLayout._deactivateSelection = deactivateSelection;
@@ -45431,6 +45439,8 @@ function activateLastSelection(gd) {
45431
45439
  }
45432
45440
 
45433
45441
  function deactivateSelection(gd) {
45442
+ if(!couldHaveActiveSelection(gd)) return;
45443
+
45434
45444
  var id = gd._fullLayout._activeSelectionIndex;
45435
45445
  if(id >= 0) {
45436
45446
  clearOutlineControllers(gd);
@@ -64705,6 +64715,11 @@ var configAttributes = {
64705
64715
  }
64706
64716
  },
64707
64717
 
64718
+ editSelection: {
64719
+ valType: 'boolean',
64720
+ dflt: true,
64721
+ },
64722
+
64708
64723
  autosizable: {
64709
64724
  valType: 'boolean',
64710
64725
  dflt: false,
@@ -104934,7 +104949,7 @@ function getSortFunc(opts, d2c) {
104934
104949
  'use strict';
104935
104950
 
104936
104951
  // package version injected by `npm run preprocess`
104937
- exports.version = '2.13.3';
104952
+ exports.version = '2.14.0';
104938
104953
 
104939
104954
  },{}]},{},[15])(15)
104940
104955
  });