plotly.js 2.12.0 → 2.12.1

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 (strict) v2.12.0
2
+ * plotly.js (strict) v2.12.1
3
3
  * Copyright 2012-2022, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -51,10 +51,10 @@ var rules = {
51
51
  "X .modebar.vertical .modebar-group .modebar-btn": "display:block;text-align:center;",
52
52
  "X [data-title]:before,X [data-title]:after": "position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;",
53
53
  "X [data-title]:hover:before,X [data-title]:hover:after": "display:block;opacity:1;",
54
- "X [data-title]:before": "content:\"\";position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;",
54
+ "X [data-title]:before": "content:\"\";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;",
55
55
  "X [data-title]:after": "content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;",
56
56
  "X .vertical [data-title]:before,X .vertical [data-title]:after": "top:0%;right:200%;",
57
- "X .vertical [data-title]:before": "border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;",
57
+ "X .vertical [data-title]:before": "border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",
58
58
  "X .select-outline": "fill:none;stroke-width:1;shape-rendering:crispEdges;",
59
59
  "X .select-outline-1": "stroke:#fff;",
60
60
  "X .select-outline-2": "stroke:#000;stroke-dasharray:2px 2px;",
@@ -107348,7 +107348,7 @@ module.exports = function colorScaleAttrs(context, opts) {
107348
107348
  }
107349
107349
 
107350
107350
  var effectDesc = onlyIfNumerical ?
107351
- ' Has an effect only if ' + colorAttrFull + 'is set to a numerical array.' :
107351
+ ' Has an effect only if ' + colorAttrFull + ' is set to a numerical array.' :
107352
107352
  '';
107353
107353
 
107354
107354
  var auto = cLetter + 'auto';
@@ -118156,6 +118156,7 @@ var isUnifiedHover = _dereq_('../fx/helpers').isUnifiedHover;
118156
118156
  var createModeBar = _dereq_('./modebar');
118157
118157
  var modeBarButtons = _dereq_('./buttons');
118158
118158
  var DRAW_MODES = _dereq_('./constants').DRAW_MODES;
118159
+ var extendDeep = _dereq_('../../lib').extendDeep;
118159
118160
 
118160
118161
  /**
118161
118162
  * ModeBar wrapper around 'create' and 'update',
@@ -118478,7 +118479,9 @@ function appendButtonsToGroups(groups, buttons) {
118478
118479
  }
118479
118480
 
118480
118481
  // fill in custom buttons referring to default mode bar buttons
118481
- function fillCustomButton(customButtons) {
118482
+ function fillCustomButton(originalModeBarButtons) {
118483
+ var customButtons = extendDeep([], originalModeBarButtons);
118484
+
118482
118485
  for(var i = 0; i < customButtons.length; i++) {
118483
118486
  var buttonGroup = customButtons[i];
118484
118487
 
@@ -118501,7 +118504,7 @@ function fillCustomButton(customButtons) {
118501
118504
  return customButtons;
118502
118505
  }
118503
118506
 
118504
- },{"../../plots/cartesian/axis_ids":568,"../../registry":648,"../../traces/scatter/subtypes":964,"../fx/helpers":398,"./buttons":422,"./constants":423,"./modebar":427}],427:[function(_dereq_,module,exports){
118507
+ },{"../../lib":513,"../../plots/cartesian/axis_ids":568,"../../registry":648,"../../traces/scatter/subtypes":964,"../fx/helpers":398,"./buttons":422,"./constants":423,"./modebar":427}],427:[function(_dereq_,module,exports){
118505
118508
  'use strict';
118506
118509
 
118507
118510
  var d3 = _dereq_('@plotly/d3');
@@ -159535,7 +159538,9 @@ function _relayout(gd, aobj) {
159535
159538
  if(parentFull.autorange) flags.calc = true;
159536
159539
  else flags.plot = true;
159537
159540
  } else {
159538
- if((fullLayout._has('scatter-like') && fullLayout._has('regl')) &&
159541
+ if(ai === 'dragmode' && ((vi === false && vOld !== false) || (vi !== false && vOld === false))) {
159542
+ flags.plot = true;
159543
+ } else if((fullLayout._has('scatter-like') && fullLayout._has('regl')) &&
159539
159544
  (ai === 'dragmode' &&
159540
159545
  (vi === 'lasso' || vi === 'select') &&
159541
159546
  !(vOld === 'lasso' || vOld === 'select'))
@@ -177873,7 +177878,7 @@ proto.fetchTopojson = function() {
177873
177878
  if(err.status === 404) {
177874
177879
  return reject(new Error([
177875
177880
  'plotly.js could not find topojson file at',
177876
- topojsonPath, '.',
177881
+ topojsonPath + '.',
177877
177882
  'Make sure the *topojsonURL* plot config option',
177878
177883
  'is set properly.'
177879
177884
  ].join(' ')));
@@ -190471,7 +190476,7 @@ proto.updateHoverAndMainDrag = function(fullLayout) {
190471
190476
  var scaleX;
190472
190477
  var scaleY;
190473
190478
 
190474
- var mainDrag = dragBox.makeDragger(layers, 'path', 'maindrag', 'crosshair');
190479
+ var mainDrag = dragBox.makeDragger(layers, 'path', 'maindrag', fullLayout.dragmode === false ? 'none' : 'crosshair');
190475
190480
 
190476
190481
  d3.select(mainDrag)
190477
190482
  .attr('d', _this.pathSubplot())
@@ -190821,6 +190826,9 @@ proto.updateRadialDrag = function(fullLayout, polarLayout, rngIndex) {
190821
190826
 
190822
190827
  var radialDrag = dragBox.makeRectDragger(layers, className, 'crosshair', -bl2, -bl2, bl, bl);
190823
190828
  var dragOpts = {element: radialDrag, gd: gd};
190829
+ if(fullLayout.dragmode === false) {
190830
+ dragOpts.dragmode = false;
190831
+ }
190824
190832
 
190825
190833
  updateElement(d3.select(radialDrag), radialAxis.visible && innerRadius < radius, {
190826
190834
  transform: strTranslate(tx, ty)
@@ -190963,13 +190971,17 @@ proto.updateAngularDrag = function(fullLayout) {
190963
190971
  var cyy = _this.cyy;
190964
190972
  var dbs = constants.angularDragBoxSize;
190965
190973
 
190966
- var angularDrag = dragBox.makeDragger(layers, 'path', 'angulardrag', 'move');
190974
+ var angularDrag = dragBox.makeDragger(layers, 'path', 'angulardrag', fullLayout.dragmode === false ? 'none' : 'move');
190967
190975
  var dragOpts = {element: angularDrag, gd: gd};
190968
190976
 
190969
- d3.select(angularDrag)
190970
- .attr('d', _this.pathAnnulus(radius, radius + dbs))
190971
- .attr('transform', strTranslate(cx, cy))
190972
- .call(setCursor, 'move');
190977
+ if(fullLayout.dragmode === false) {
190978
+ dragOpts.dragmode = false;
190979
+ } else {
190980
+ d3.select(angularDrag)
190981
+ .attr('d', _this.pathAnnulus(radius, radius + dbs))
190982
+ .attr('transform', strTranslate(cx, cy))
190983
+ .call(setCursor, 'move');
190984
+ }
190973
190985
 
190974
190986
  function xy2a(x, y) {
190975
190987
  return Math.atan2(cyy + dbs - y, x - cxx - dbs);
@@ -193338,7 +193350,7 @@ function registerTraceModule(_module) {
193338
193350
  // add `PlotlyGeoAssets` global to stash references to all fetched
193339
193351
  // topojson / geojson data
193340
193352
  if((bpmName === 'geo' || bpmName === 'mapbox') &&
193341
- (typeof window !== undefined && window.PlotlyGeoAssets === undefined)
193353
+ (window.PlotlyGeoAssets === undefined)
193342
193354
  ) {
193343
193355
  window.PlotlyGeoAssets = {topojson: {}};
193344
193356
  }
@@ -247802,7 +247814,7 @@ function getSortFunc(opts, d2c) {
247802
247814
  'use strict';
247803
247815
 
247804
247816
  // package version injected by `npm run preprocess`
247805
- exports.version = '2.12.0';
247817
+ exports.version = '2.12.1';
247806
247818
 
247807
247819
  },{}],1142:[function(_dereq_,module,exports){
247808
247820
  (function (global){(function (){