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 (gl2d) v2.6.4
2
+ * plotly.js (gl2d) v2.7.0
3
3
  * Copyright 2012-2021, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -64873,7 +64873,8 @@ function findUIPattern(key, patternSpecs) {
64873
64873
  var spec = patternSpecs[i];
64874
64874
  var match = key.match(spec.pattern);
64875
64875
  if(match) {
64876
- return {head: match[1], attr: spec.attr};
64876
+ var head = match[1] || '';
64877
+ return {head: head, tail: key.substr(head.length + 1), attr: spec.attr};
64877
64878
  }
64878
64879
  }
64879
64880
  }
@@ -64925,26 +64926,54 @@ function valsMatch(v1, v2) {
64925
64926
 
64926
64927
  function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
64927
64928
  var layoutPreGUI = oldFullLayout._preGUI;
64928
- var key, revAttr, oldRev, newRev, match, preGUIVal, newNP, newVal;
64929
+ var key, revAttr, oldRev, newRev, match, preGUIVal, newNP, newVal, head, tail;
64929
64930
  var bothInheritAutorange = [];
64931
+ var newAutorangeIn = {};
64930
64932
  var newRangeAccepted = {};
64931
64933
  for(key in layoutPreGUI) {
64932
64934
  match = findUIPattern(key, layoutUIControlPatterns);
64933
64935
  if(match) {
64934
- revAttr = match.attr || (match.head + '.uirevision');
64936
+ head = match.head;
64937
+ tail = match.tail;
64938
+ revAttr = match.attr || (head + '.uirevision');
64935
64939
  oldRev = nestedProperty(oldFullLayout, revAttr).get();
64936
64940
  newRev = oldRev && getNewRev(revAttr, layout);
64941
+
64937
64942
  if(newRev && (newRev === oldRev)) {
64938
64943
  preGUIVal = layoutPreGUI[key];
64939
64944
  if(preGUIVal === null) preGUIVal = undefined;
64940
64945
  newNP = nestedProperty(layout, key);
64941
64946
  newVal = newNP.get();
64947
+
64942
64948
  if(valsMatch(newVal, preGUIVal)) {
64943
- if(newVal === undefined && key.substr(key.length - 9) === 'autorange') {
64944
- bothInheritAutorange.push(key.substr(0, key.length - 10));
64949
+ if(newVal === undefined && tail === 'autorange') {
64950
+ bothInheritAutorange.push(head);
64945
64951
  }
64946
64952
  newNP.set(undefinedToNull(nestedProperty(oldFullLayout, key).get()));
64947
64953
  continue;
64954
+ } else if(tail === 'autorange' || tail.substr(0, 6) === 'range[') {
64955
+ // Special case for (auto)range since we push it back into the layout
64956
+ // so all null should be treated equivalently to autorange: true with any range
64957
+ var pre0 = layoutPreGUI[head + '.range[0]'];
64958
+ var pre1 = layoutPreGUI[head + '.range[1]'];
64959
+ var preAuto = layoutPreGUI[head + '.autorange'];
64960
+ if(preAuto || (preAuto === null && pre0 === null && pre1 === null)) {
64961
+ // Only read the input layout once and stash the result,
64962
+ // so we get it before we start modifying it
64963
+ if(!(head in newAutorangeIn)) {
64964
+ var newContainer = nestedProperty(layout, head).get();
64965
+ newAutorangeIn[head] = newContainer && (
64966
+ newContainer.autorange ||
64967
+ (newContainer.autorange !== false && (
64968
+ !newContainer.range || newContainer.range.length !== 2)
64969
+ )
64970
+ );
64971
+ }
64972
+ if(newAutorangeIn[head]) {
64973
+ newNP.set(undefinedToNull(nestedProperty(oldFullLayout, key).get()));
64974
+ continue;
64975
+ }
64976
+ }
64948
64977
  }
64949
64978
  }
64950
64979
  } else {
@@ -64955,12 +64984,12 @@ function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
64955
64984
  // so remove it from _preGUI for next time.
64956
64985
  delete layoutPreGUI[key];
64957
64986
 
64958
- if(key.substr(key.length - 8, 6) === 'range[') {
64959
- newRangeAccepted[key.substr(0, key.length - 9)] = 1;
64987
+ if(match && match.tail.substr(0, 6) === 'range[') {
64988
+ newRangeAccepted[match.head] = 1;
64960
64989
  }
64961
64990
  }
64962
64991
 
64963
- // Special logic for `autorange`, since it interacts with `range`:
64992
+ // More special logic for `autorange`, since it interacts with `range`:
64964
64993
  // If the new figure's matching `range` was kept, and `autorange`
64965
64994
  // wasn't supplied explicitly in either the original or the new figure,
64966
64995
  // we shouldn't alter that - but we may just have done that, so fix it.
@@ -100563,7 +100592,7 @@ function getSortFunc(opts, d2c) {
100563
100592
  'use strict';
100564
100593
 
100565
100594
  // package version injected by `npm run preprocess`
100566
- exports.version = '2.6.4';
100595
+ exports.version = '2.7.0';
100567
100596
 
100568
100597
  },{}],588:[function(_dereq_,module,exports){
100569
100598
  (function (global){(function (){