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 (gl3d) v2.6.4
2
+ * plotly.js (gl3d) v2.7.0
3
3
  * Copyright 2012-2021, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -52033,7 +52033,8 @@ function findUIPattern(key, patternSpecs) {
52033
52033
  var spec = patternSpecs[i];
52034
52034
  var match = key.match(spec.pattern);
52035
52035
  if(match) {
52036
- return {head: match[1], attr: spec.attr};
52036
+ var head = match[1] || '';
52037
+ return {head: head, tail: key.substr(head.length + 1), attr: spec.attr};
52037
52038
  }
52038
52039
  }
52039
52040
  }
@@ -52085,26 +52086,54 @@ function valsMatch(v1, v2) {
52085
52086
 
52086
52087
  function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
52087
52088
  var layoutPreGUI = oldFullLayout._preGUI;
52088
- var key, revAttr, oldRev, newRev, match, preGUIVal, newNP, newVal;
52089
+ var key, revAttr, oldRev, newRev, match, preGUIVal, newNP, newVal, head, tail;
52089
52090
  var bothInheritAutorange = [];
52091
+ var newAutorangeIn = {};
52090
52092
  var newRangeAccepted = {};
52091
52093
  for(key in layoutPreGUI) {
52092
52094
  match = findUIPattern(key, layoutUIControlPatterns);
52093
52095
  if(match) {
52094
- revAttr = match.attr || (match.head + '.uirevision');
52096
+ head = match.head;
52097
+ tail = match.tail;
52098
+ revAttr = match.attr || (head + '.uirevision');
52095
52099
  oldRev = nestedProperty(oldFullLayout, revAttr).get();
52096
52100
  newRev = oldRev && getNewRev(revAttr, layout);
52101
+
52097
52102
  if(newRev && (newRev === oldRev)) {
52098
52103
  preGUIVal = layoutPreGUI[key];
52099
52104
  if(preGUIVal === null) preGUIVal = undefined;
52100
52105
  newNP = nestedProperty(layout, key);
52101
52106
  newVal = newNP.get();
52107
+
52102
52108
  if(valsMatch(newVal, preGUIVal)) {
52103
- if(newVal === undefined && key.substr(key.length - 9) === 'autorange') {
52104
- bothInheritAutorange.push(key.substr(0, key.length - 10));
52109
+ if(newVal === undefined && tail === 'autorange') {
52110
+ bothInheritAutorange.push(head);
52105
52111
  }
52106
52112
  newNP.set(undefinedToNull(nestedProperty(oldFullLayout, key).get()));
52107
52113
  continue;
52114
+ } else if(tail === 'autorange' || tail.substr(0, 6) === 'range[') {
52115
+ // Special case for (auto)range since we push it back into the layout
52116
+ // so all null should be treated equivalently to autorange: true with any range
52117
+ var pre0 = layoutPreGUI[head + '.range[0]'];
52118
+ var pre1 = layoutPreGUI[head + '.range[1]'];
52119
+ var preAuto = layoutPreGUI[head + '.autorange'];
52120
+ if(preAuto || (preAuto === null && pre0 === null && pre1 === null)) {
52121
+ // Only read the input layout once and stash the result,
52122
+ // so we get it before we start modifying it
52123
+ if(!(head in newAutorangeIn)) {
52124
+ var newContainer = nestedProperty(layout, head).get();
52125
+ newAutorangeIn[head] = newContainer && (
52126
+ newContainer.autorange ||
52127
+ (newContainer.autorange !== false && (
52128
+ !newContainer.range || newContainer.range.length !== 2)
52129
+ )
52130
+ );
52131
+ }
52132
+ if(newAutorangeIn[head]) {
52133
+ newNP.set(undefinedToNull(nestedProperty(oldFullLayout, key).get()));
52134
+ continue;
52135
+ }
52136
+ }
52108
52137
  }
52109
52138
  }
52110
52139
  } else {
@@ -52115,12 +52144,12 @@ function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
52115
52144
  // so remove it from _preGUI for next time.
52116
52145
  delete layoutPreGUI[key];
52117
52146
 
52118
- if(key.substr(key.length - 8, 6) === 'range[') {
52119
- newRangeAccepted[key.substr(0, key.length - 9)] = 1;
52147
+ if(match && match.tail.substr(0, 6) === 'range[') {
52148
+ newRangeAccepted[match.head] = 1;
52120
52149
  }
52121
52150
  }
52122
52151
 
52123
- // Special logic for `autorange`, since it interacts with `range`:
52152
+ // More special logic for `autorange`, since it interacts with `range`:
52124
52153
  // If the new figure's matching `range` was kept, and `autorange`
52125
52154
  // wasn't supplied explicitly in either the original or the new figure,
52126
52155
  // we shouldn't alter that - but we may just have done that, so fix it.
@@ -85954,7 +85983,7 @@ function getSortFunc(opts, d2c) {
85954
85983
  'use strict';
85955
85984
 
85956
85985
  // package version injected by `npm run preprocess`
85957
- exports.version = '2.6.4';
85986
+ exports.version = '2.7.0';
85958
85987
 
85959
85988
  },{}],435:[function(_dereq_,module,exports){
85960
85989
  (function (global){(function (){