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 (finance) v2.6.4
2
+ * plotly.js (finance) v2.7.0
3
3
  * Copyright 2012-2021, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -52391,7 +52391,8 @@ function findUIPattern(key, patternSpecs) {
52391
52391
  var spec = patternSpecs[i];
52392
52392
  var match = key.match(spec.pattern);
52393
52393
  if(match) {
52394
- return {head: match[1], attr: spec.attr};
52394
+ var head = match[1] || '';
52395
+ return {head: head, tail: key.substr(head.length + 1), attr: spec.attr};
52395
52396
  }
52396
52397
  }
52397
52398
  }
@@ -52443,26 +52444,54 @@ function valsMatch(v1, v2) {
52443
52444
 
52444
52445
  function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
52445
52446
  var layoutPreGUI = oldFullLayout._preGUI;
52446
- var key, revAttr, oldRev, newRev, match, preGUIVal, newNP, newVal;
52447
+ var key, revAttr, oldRev, newRev, match, preGUIVal, newNP, newVal, head, tail;
52447
52448
  var bothInheritAutorange = [];
52449
+ var newAutorangeIn = {};
52448
52450
  var newRangeAccepted = {};
52449
52451
  for(key in layoutPreGUI) {
52450
52452
  match = findUIPattern(key, layoutUIControlPatterns);
52451
52453
  if(match) {
52452
- revAttr = match.attr || (match.head + '.uirevision');
52454
+ head = match.head;
52455
+ tail = match.tail;
52456
+ revAttr = match.attr || (head + '.uirevision');
52453
52457
  oldRev = nestedProperty(oldFullLayout, revAttr).get();
52454
52458
  newRev = oldRev && getNewRev(revAttr, layout);
52459
+
52455
52460
  if(newRev && (newRev === oldRev)) {
52456
52461
  preGUIVal = layoutPreGUI[key];
52457
52462
  if(preGUIVal === null) preGUIVal = undefined;
52458
52463
  newNP = nestedProperty(layout, key);
52459
52464
  newVal = newNP.get();
52465
+
52460
52466
  if(valsMatch(newVal, preGUIVal)) {
52461
- if(newVal === undefined && key.substr(key.length - 9) === 'autorange') {
52462
- bothInheritAutorange.push(key.substr(0, key.length - 10));
52467
+ if(newVal === undefined && tail === 'autorange') {
52468
+ bothInheritAutorange.push(head);
52463
52469
  }
52464
52470
  newNP.set(undefinedToNull(nestedProperty(oldFullLayout, key).get()));
52465
52471
  continue;
52472
+ } else if(tail === 'autorange' || tail.substr(0, 6) === 'range[') {
52473
+ // Special case for (auto)range since we push it back into the layout
52474
+ // so all null should be treated equivalently to autorange: true with any range
52475
+ var pre0 = layoutPreGUI[head + '.range[0]'];
52476
+ var pre1 = layoutPreGUI[head + '.range[1]'];
52477
+ var preAuto = layoutPreGUI[head + '.autorange'];
52478
+ if(preAuto || (preAuto === null && pre0 === null && pre1 === null)) {
52479
+ // Only read the input layout once and stash the result,
52480
+ // so we get it before we start modifying it
52481
+ if(!(head in newAutorangeIn)) {
52482
+ var newContainer = nestedProperty(layout, head).get();
52483
+ newAutorangeIn[head] = newContainer && (
52484
+ newContainer.autorange ||
52485
+ (newContainer.autorange !== false && (
52486
+ !newContainer.range || newContainer.range.length !== 2)
52487
+ )
52488
+ );
52489
+ }
52490
+ if(newAutorangeIn[head]) {
52491
+ newNP.set(undefinedToNull(nestedProperty(oldFullLayout, key).get()));
52492
+ continue;
52493
+ }
52494
+ }
52466
52495
  }
52467
52496
  }
52468
52497
  } else {
@@ -52473,12 +52502,12 @@ function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
52473
52502
  // so remove it from _preGUI for next time.
52474
52503
  delete layoutPreGUI[key];
52475
52504
 
52476
- if(key.substr(key.length - 8, 6) === 'range[') {
52477
- newRangeAccepted[key.substr(0, key.length - 9)] = 1;
52505
+ if(match && match.tail.substr(0, 6) === 'range[') {
52506
+ newRangeAccepted[match.head] = 1;
52478
52507
  }
52479
52508
  }
52480
52509
 
52481
- // Special logic for `autorange`, since it interacts with `range`:
52510
+ // More special logic for `autorange`, since it interacts with `range`:
52482
52511
  // If the new figure's matching `range` was kept, and `autorange`
52483
52512
  // wasn't supplied explicitly in either the original or the new figure,
52484
52513
  // we shouldn't alter that - but we may just have done that, so fix it.
@@ -76824,7 +76853,7 @@ function appendBarText(gd, plotinfo, bar, cd, i, x0, x1, y0, y1, opts, makeOnCom
76824
76853
  }
76825
76854
 
76826
76855
  transform.fontSize = font.size;
76827
- recordMinTextSize(trace.type, transform, fullLayout);
76856
+ recordMinTextSize(trace.type === 'histogram' ? 'bar' : trace.type, transform, fullLayout);
76828
76857
  calcBar.transform = transform;
76829
76858
 
76830
76859
  transition(textSelection, fullLayout, opts, makeOnCompleteCallback)
@@ -80068,6 +80097,8 @@ module.exports = function style(gd) {
80068
80097
  var barAttrs = _dereq_('../bar/attributes');
80069
80098
  var axisHoverFormat = _dereq_('../../plots/cartesian/axis_format_attributes').axisHoverFormat;
80070
80099
  var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;
80100
+ var texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;
80101
+ var fontAttrs = _dereq_('../../plots/font_attributes');
80071
80102
  var makeBinAttrs = _dereq_('./bin_attributes');
80072
80103
  var constants = _dereq_('./constants');
80073
80104
  var extendFlat = _dereq_('../../lib/extend').extendFlat;
@@ -80162,6 +80193,41 @@ module.exports = {
80162
80193
  keys: constants.eventDataKeys
80163
80194
  }),
80164
80195
 
80196
+ texttemplate: texttemplateAttrs({
80197
+ arrayOk: false,
80198
+ editType: 'plot'
80199
+ }, {
80200
+ keys: ['label', 'value']
80201
+ }),
80202
+
80203
+ textposition: extendFlat({}, barAttrs.textposition, {
80204
+ arrayOk: false
80205
+ }),
80206
+
80207
+ textfont: fontAttrs({
80208
+ arrayOk: false,
80209
+ editType: 'plot',
80210
+ colorEditType: 'style',
80211
+ }),
80212
+
80213
+ outsidetextfont: fontAttrs({
80214
+ arrayOk: false,
80215
+ editType: 'plot',
80216
+ colorEditType: 'style',
80217
+ }),
80218
+
80219
+ insidetextfont: fontAttrs({
80220
+ arrayOk: false,
80221
+ editType: 'plot',
80222
+ colorEditType: 'style',
80223
+ }),
80224
+
80225
+ insidetextanchor: barAttrs.insidetextanchor,
80226
+
80227
+ textangle: barAttrs.textangle,
80228
+ cliponaxis: barAttrs.cliponaxis,
80229
+ constraintext: barAttrs.constraintext,
80230
+
80165
80231
  marker: barAttrs.marker,
80166
80232
 
80167
80233
  offsetgroup: barAttrs.offsetgroup,
@@ -80175,7 +80241,7 @@ module.exports = {
80175
80241
  }
80176
80242
  };
80177
80243
 
80178
- },{"../../lib/extend":236,"../../plots/cartesian/axis_format_attributes":292,"../../plots/template_attributes":327,"../bar/attributes":338,"./bin_attributes":389,"./constants":393}],388:[function(_dereq_,module,exports){
80244
+ },{"../../lib/extend":236,"../../plots/cartesian/axis_format_attributes":292,"../../plots/font_attributes":320,"../../plots/template_attributes":327,"../bar/attributes":338,"./bin_attributes":389,"./constants":393}],388:[function(_dereq_,module,exports){
80179
80245
  'use strict';
80180
80246
 
80181
80247
 
@@ -81298,6 +81364,7 @@ var Registry = _dereq_('../../registry');
81298
81364
  var Lib = _dereq_('../../lib');
81299
81365
  var Color = _dereq_('../../components/color');
81300
81366
 
81367
+ var handleText = _dereq_('../bar/defaults').handleText;
81301
81368
  var handleStyleDefaults = _dereq_('../bar/style_defaults');
81302
81369
  var attributes = _dereq_('./attributes');
81303
81370
 
@@ -81316,6 +81383,16 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
81316
81383
  }
81317
81384
 
81318
81385
  coerce('text');
81386
+ var textposition = coerce('textposition');
81387
+ handleText(traceIn, traceOut, layout, coerce, textposition, {
81388
+ moduleHasSelected: true,
81389
+ moduleHasUnselected: true,
81390
+ moduleHasConstrain: true,
81391
+ moduleHasCliponaxis: true,
81392
+ moduleHasTextangle: true,
81393
+ moduleHasInsideanchor: true
81394
+ });
81395
+
81319
81396
  coerce('hovertext');
81320
81397
  coerce('hovertemplate');
81321
81398
  coerce('xhoverformat');
@@ -81359,7 +81436,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
81359
81436
  errorBarsSupplyDefaults(traceIn, traceOut, lineColor || Color.defaultLine, {axis: 'x', inherit: 'y'});
81360
81437
  };
81361
81438
 
81362
- },{"../../components/color":111,"../../lib":242,"../../registry":328,"../bar/style_defaults":353,"./attributes":387}],396:[function(_dereq_,module,exports){
81439
+ },{"../../components/color":111,"../../lib":242,"../../registry":328,"../bar/defaults":342,"../bar/style_defaults":353,"./attributes":387}],396:[function(_dereq_,module,exports){
81363
81440
  'use strict';
81364
81441
 
81365
81442
  module.exports = function eventData(out, pt, trace, cd, pointNumber) {
@@ -90229,7 +90306,7 @@ function getSortFunc(opts, d2c) {
90229
90306
  'use strict';
90230
90307
 
90231
90308
  // package version injected by `npm run preprocess`
90232
- exports.version = '2.6.4';
90309
+ exports.version = '2.7.0';
90233
90310
 
90234
90311
  },{}]},{},[12])(12)
90235
90312
  });