plotly.js 2.6.4 → 2.7.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 v2.6.4
2
+ * plotly.js v2.7.0
3
3
  * Copyright 2012-2021, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -68,7 +68,7 @@ exports.topojson = saneTopojson;
68
68
  'use strict';
69
69
 
70
70
  // package version injected by `npm run preprocess`
71
- exports.version = '2.6.4';
71
+ exports.version = '2.7.0';
72
72
 
73
73
  },{}]},{},[16])(16)
74
74
  });
@@ -1,5 +1,5 @@
1
1
  /**
2
- * plotly.js (geo) v2.6.4
2
+ * plotly.js (geo) v2.7.0
3
3
  * Copyright 2012-2021, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -65421,7 +65421,8 @@ function findUIPattern(key, patternSpecs) {
65421
65421
  var spec = patternSpecs[i];
65422
65422
  var match = key.match(spec.pattern);
65423
65423
  if(match) {
65424
- return {head: match[1], attr: spec.attr};
65424
+ var head = match[1] || '';
65425
+ return {head: head, tail: key.substr(head.length + 1), attr: spec.attr};
65425
65426
  }
65426
65427
  }
65427
65428
  }
@@ -65473,26 +65474,54 @@ function valsMatch(v1, v2) {
65473
65474
 
65474
65475
  function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
65475
65476
  var layoutPreGUI = oldFullLayout._preGUI;
65476
- var key, revAttr, oldRev, newRev, match, preGUIVal, newNP, newVal;
65477
+ var key, revAttr, oldRev, newRev, match, preGUIVal, newNP, newVal, head, tail;
65477
65478
  var bothInheritAutorange = [];
65479
+ var newAutorangeIn = {};
65478
65480
  var newRangeAccepted = {};
65479
65481
  for(key in layoutPreGUI) {
65480
65482
  match = findUIPattern(key, layoutUIControlPatterns);
65481
65483
  if(match) {
65482
- revAttr = match.attr || (match.head + '.uirevision');
65484
+ head = match.head;
65485
+ tail = match.tail;
65486
+ revAttr = match.attr || (head + '.uirevision');
65483
65487
  oldRev = nestedProperty(oldFullLayout, revAttr).get();
65484
65488
  newRev = oldRev && getNewRev(revAttr, layout);
65489
+
65485
65490
  if(newRev && (newRev === oldRev)) {
65486
65491
  preGUIVal = layoutPreGUI[key];
65487
65492
  if(preGUIVal === null) preGUIVal = undefined;
65488
65493
  newNP = nestedProperty(layout, key);
65489
65494
  newVal = newNP.get();
65495
+
65490
65496
  if(valsMatch(newVal, preGUIVal)) {
65491
- if(newVal === undefined && key.substr(key.length - 9) === 'autorange') {
65492
- bothInheritAutorange.push(key.substr(0, key.length - 10));
65497
+ if(newVal === undefined && tail === 'autorange') {
65498
+ bothInheritAutorange.push(head);
65493
65499
  }
65494
65500
  newNP.set(undefinedToNull(nestedProperty(oldFullLayout, key).get()));
65495
65501
  continue;
65502
+ } else if(tail === 'autorange' || tail.substr(0, 6) === 'range[') {
65503
+ // Special case for (auto)range since we push it back into the layout
65504
+ // so all null should be treated equivalently to autorange: true with any range
65505
+ var pre0 = layoutPreGUI[head + '.range[0]'];
65506
+ var pre1 = layoutPreGUI[head + '.range[1]'];
65507
+ var preAuto = layoutPreGUI[head + '.autorange'];
65508
+ if(preAuto || (preAuto === null && pre0 === null && pre1 === null)) {
65509
+ // Only read the input layout once and stash the result,
65510
+ // so we get it before we start modifying it
65511
+ if(!(head in newAutorangeIn)) {
65512
+ var newContainer = nestedProperty(layout, head).get();
65513
+ newAutorangeIn[head] = newContainer && (
65514
+ newContainer.autorange ||
65515
+ (newContainer.autorange !== false && (
65516
+ !newContainer.range || newContainer.range.length !== 2)
65517
+ )
65518
+ );
65519
+ }
65520
+ if(newAutorangeIn[head]) {
65521
+ newNP.set(undefinedToNull(nestedProperty(oldFullLayout, key).get()));
65522
+ continue;
65523
+ }
65524
+ }
65496
65525
  }
65497
65526
  }
65498
65527
  } else {
@@ -65503,12 +65532,12 @@ function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
65503
65532
  // so remove it from _preGUI for next time.
65504
65533
  delete layoutPreGUI[key];
65505
65534
 
65506
- if(key.substr(key.length - 8, 6) === 'range[') {
65507
- newRangeAccepted[key.substr(0, key.length - 9)] = 1;
65535
+ if(match && match.tail.substr(0, 6) === 'range[') {
65536
+ newRangeAccepted[match.head] = 1;
65508
65537
  }
65509
65538
  }
65510
65539
 
65511
- // Special logic for `autorange`, since it interacts with `range`:
65540
+ // More special logic for `autorange`, since it interacts with `range`:
65512
65541
  // If the new figure's matching `range` was kept, and `autorange`
65513
65542
  // wasn't supplied explicitly in either the original or the new figure,
65514
65543
  // we shouldn't alter that - but we may just have done that, so fix it.
@@ -95047,7 +95076,7 @@ function getSortFunc(opts, d2c) {
95047
95076
  'use strict';
95048
95077
 
95049
95078
  // package version injected by `npm run preprocess`
95050
- exports.version = '2.6.4';
95079
+ exports.version = '2.7.0';
95051
95080
 
95052
95081
  },{}]},{},[8])(8)
95053
95082
  });