plotly.js 2.8.2 → 2.10.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.
Files changed (88) hide show
  1. package/.circleci/config.yml +39 -1
  2. package/.circleci/env_image.sh +1 -1
  3. package/.circleci/test.sh +14 -1
  4. package/CHANGELOG.md +30 -1
  5. package/CONTRIBUTING.md +1 -1
  6. package/README.md +12 -4
  7. package/dist/README.md +26 -26
  8. package/dist/plot-schema.json +413 -0
  9. package/dist/plotly-basic.js +253 -96
  10. package/dist/plotly-basic.min.js +5 -5
  11. package/dist/plotly-cartesian.js +263 -97
  12. package/dist/plotly-cartesian.min.js +5 -5
  13. package/dist/plotly-finance.js +254 -96
  14. package/dist/plotly-finance.min.js +4 -4
  15. package/dist/plotly-geo-assets.js +3 -3
  16. package/dist/plotly-geo.js +248 -92
  17. package/dist/plotly-geo.min.js +4 -4
  18. package/dist/plotly-gl2d.js +248 -92
  19. package/dist/plotly-gl2d.min.js +7 -7
  20. package/dist/plotly-gl3d.js +249 -92
  21. package/dist/plotly-gl3d.min.js +3 -3
  22. package/dist/plotly-locale-cs.js +1 -1
  23. package/dist/plotly-locale-cy.js +1 -1
  24. package/dist/plotly-locale-de.js +1 -1
  25. package/dist/plotly-locale-es.js +1 -1
  26. package/dist/plotly-locale-fi.js +1 -1
  27. package/dist/plotly-locale-fr.js +1 -1
  28. package/dist/plotly-locale-it.js +1 -1
  29. package/dist/plotly-locale-ja.js +1 -1
  30. package/dist/plotly-locale-ko.js +1 -1
  31. package/dist/plotly-locale-pt-br.js +1 -1
  32. package/dist/plotly-locale-pt-pt.js +1 -1
  33. package/dist/plotly-locale-ru.js +1 -1
  34. package/dist/plotly-locale-sv.js +1 -1
  35. package/dist/plotly-locale-sw.js +1 -1
  36. package/dist/plotly-locale-uk.js +1 -1
  37. package/dist/plotly-locale-zh-cn.js +1 -1
  38. package/dist/plotly-mapbox.js +248 -92
  39. package/dist/plotly-mapbox.min.js +3 -3
  40. package/dist/plotly-strict.js +267 -97
  41. package/dist/plotly-strict.min.js +7 -7
  42. package/dist/plotly-with-meta.js +280 -97
  43. package/dist/plotly.js +268 -97
  44. package/dist/plotly.min.js +11 -11
  45. package/dist/translation-keys.txt +1 -1
  46. package/lib/locales/cs.js +1 -1
  47. package/lib/locales/cy.js +1 -1
  48. package/lib/locales/de.js +1 -1
  49. package/lib/locales/es.js +1 -1
  50. package/lib/locales/fi.js +1 -1
  51. package/lib/locales/fr.js +1 -1
  52. package/lib/locales/it.js +1 -1
  53. package/lib/locales/ja.js +1 -1
  54. package/lib/locales/ko.js +1 -1
  55. package/lib/locales/pt-br.js +1 -1
  56. package/lib/locales/pt-pt.js +1 -1
  57. package/lib/locales/ru.js +1 -1
  58. package/lib/locales/sv.js +1 -1
  59. package/lib/locales/sw.js +1 -1
  60. package/lib/locales/uk.js +1 -1
  61. package/lib/locales/zh-cn.js +1 -1
  62. package/package.json +15 -12
  63. package/src/components/colorbar/attributes.js +1 -0
  64. package/src/components/colorbar/draw.js +1 -0
  65. package/src/components/drawing/index.js +28 -24
  66. package/src/components/legend/draw.js +2 -1
  67. package/src/components/legend/style.js +10 -6
  68. package/src/components/modebar/modebar.js +7 -1
  69. package/src/lib/svg_text_utils.js +106 -21
  70. package/src/plot_api/plot_config.js +9 -0
  71. package/src/plots/cartesian/axes.js +47 -5
  72. package/src/plots/cartesian/layout_attributes.js +14 -0
  73. package/src/plots/cartesian/tick_label_defaults.js +8 -0
  74. package/src/plots/gl3d/layout/axis_defaults.js +1 -0
  75. package/src/plots/polar/layout_attributes.js +1 -0
  76. package/src/plots/smith/layout_defaults.js +1 -0
  77. package/src/plots/ternary/layout_attributes.js +1 -0
  78. package/src/snapshot/tosvg.js +14 -25
  79. package/src/traces/bar/plot.js +5 -4
  80. package/src/traces/carpet/ab_defaults.js +1 -0
  81. package/src/traces/indicator/attributes.js +1 -0
  82. package/src/traces/scatter/attributes.js +2 -0
  83. package/src/traces/scatter/defaults.js +2 -0
  84. package/src/traces/scatter/plot.js +4 -4
  85. package/src/traces/scatter/style.js +1 -1
  86. package/src/version.js +1 -1
  87. package/tasks/noci_test.sh +1 -1
  88. package/.vscode/launch.json +0 -0
@@ -1,6 +1,6 @@
1
1
  /**
2
- * plotly.js v2.8.2
3
- * Copyright 2012-2021, Plotly, Inc.
2
+ * plotly.js v2.10.0
3
+ * Copyright 2012-2022, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
6
6
  */
@@ -86336,7 +86336,15 @@ exports.readUInt32BE = function (data, offset) {
86336
86336
 
86337
86337
  function ProbeError(message, code, statusCode) {
86338
86338
  Error.call(this);
86339
- Error.captureStackTrace(this, this.constructor);
86339
+
86340
+ // Include stack trace in error object
86341
+ if (Error.captureStackTrace) {
86342
+ // Chrome and NodeJS
86343
+ Error.captureStackTrace(this, this.constructor);
86344
+ } else {
86345
+ // FF, IE 10+ and Safari 6+. Fallback for others
86346
+ this.stack = (new Error()).stack || '';
86347
+ }
86340
86348
 
86341
86349
  this.name = this.constructor.name;
86342
86350
 
@@ -106402,6 +106410,7 @@ module.exports = overrideAll({
106402
106410
  ticklen: axesAttrs.ticklen,
106403
106411
  tickwidth: axesAttrs.tickwidth,
106404
106412
  tickcolor: axesAttrs.tickcolor,
106413
+ ticklabelstep: axesAttrs.ticklabelstep,
106405
106414
  showticklabels: axesAttrs.showticklabels,
106406
106415
  tickfont: fontAttrs({
106407
106416
  description: 'Sets the color bar\'s tick label font'
@@ -107519,6 +107528,7 @@ function mockColorBarAxis(gd, opts, zrange) {
107519
107528
  showticklabels: opts.showticklabels,
107520
107529
  ticklabelposition: opts.ticklabelposition,
107521
107530
  ticklabeloverflow: opts.ticklabeloverflow,
107531
+ ticklabelstep: opts.ticklabelstep,
107522
107532
  tickfont: opts.tickfont,
107523
107533
  tickangle: opts.tickangle,
107524
107534
  tickformat: opts.tickformat,
@@ -109386,24 +109396,42 @@ drawing.dashStyle = function(dash, lineWidth) {
109386
109396
  return dash;
109387
109397
  };
109388
109398
 
109399
+ function setFillStyle(sel, trace, gd) {
109400
+ var markerPattern = trace.fillpattern;
109401
+ var patternShape = markerPattern && drawing.getPatternAttr(markerPattern.shape, 0, '');
109402
+ if(patternShape) {
109403
+ var patternBGColor = drawing.getPatternAttr(markerPattern.bgcolor, 0, null);
109404
+ var patternFGColor = drawing.getPatternAttr(markerPattern.fgcolor, 0, null);
109405
+ var patternFGOpacity = markerPattern.fgopacity;
109406
+ var patternSize = drawing.getPatternAttr(markerPattern.size, 0, 8);
109407
+ var patternSolidity = drawing.getPatternAttr(markerPattern.solidity, 0, 0.3);
109408
+ var patternID = trace.uid;
109409
+ drawing.pattern(sel, 'point', gd, patternID,
109410
+ patternShape, patternSize, patternSolidity,
109411
+ undefined, markerPattern.fillmode,
109412
+ patternBGColor, patternFGColor, patternFGOpacity
109413
+ );
109414
+ } else if(trace.fillcolor) {
109415
+ sel.call(Color.fill, trace.fillcolor);
109416
+ }
109417
+ }
109418
+
109389
109419
  // Same as fillGroupStyle, except in this case the selection may be a transition
109390
- drawing.singleFillStyle = function(sel) {
109420
+ drawing.singleFillStyle = function(sel, gd) {
109391
109421
  var node = d3.select(sel.node());
109392
109422
  var data = node.data();
109393
- var fillcolor = (((data[0] || [])[0] || {}).trace || {}).fillcolor;
109394
- if(fillcolor) {
109395
- sel.call(Color.fill, fillcolor);
109396
- }
109423
+ var trace = ((data[0] || [])[0] || {}).trace || {};
109424
+ setFillStyle(sel, trace, gd);
109397
109425
  };
109398
109426
 
109399
- drawing.fillGroupStyle = function(s) {
109427
+ drawing.fillGroupStyle = function(s, gd) {
109400
109428
  s.style('stroke-width', 0)
109401
109429
  .each(function(d) {
109402
109430
  var shape = d3.select(this);
109403
109431
  // N.B. 'd' won't be a calcdata item when
109404
109432
  // fill !== 'none' on a segment-less and marker-less trace
109405
109433
  if(d[0].trace) {
109406
- shape.call(Color.fill, d[0].trace.fillcolor);
109434
+ setFillStyle(shape, d[0].trace, gd);
109407
109435
  }
109408
109436
  });
109409
109437
  };
@@ -109556,12 +109584,7 @@ drawing.gradient = function(sel, gd, gradientID, type, colorscale, prop) {
109556
109584
  sel.style(prop, getFullUrl(fullID, gd))
109557
109585
  .style(prop + '-opacity', null);
109558
109586
 
109559
- var className2query = function(s) {
109560
- return '.' + s.attr('class').replace(/\s/g, '.');
109561
- };
109562
- var k = className2query(d3.select(sel.node().parentNode)) +
109563
- '>' + className2query(sel);
109564
- fullLayout._gradientUrlQueryParts[k] = 1;
109587
+ sel.classed('gradient_filled', true);
109565
109588
  };
109566
109589
 
109567
109590
  /**
@@ -109768,11 +109791,6 @@ drawing.pattern = function(sel, calledBy, gd, patternID, shape, size, solidity,
109768
109791
  .style('fill-opacity', null);
109769
109792
 
109770
109793
  sel.classed('pattern_filled', true);
109771
- var className2query = function(s) {
109772
- return '.' + s.attr('class').replace(/\s/g, '.');
109773
- };
109774
- var k = className2query(d3.select(sel.node().parentNode)) + '>.pattern_filled';
109775
- fullLayout._patternUrlQueryParts[k] = 1;
109776
109794
  };
109777
109795
 
109778
109796
  /*
@@ -109788,9 +109806,7 @@ drawing.initGradients = function(gd) {
109788
109806
  var gradientsGroup = Lib.ensureSingle(fullLayout._defs, 'g', 'gradients');
109789
109807
  gradientsGroup.selectAll('linearGradient,radialGradient').remove();
109790
109808
 
109791
- // initialize stash of query parts filled in Drawing.gradient,
109792
- // used to fix URL strings during image exports
109793
- fullLayout._gradientUrlQueryParts = {};
109809
+ d3.select(gd).selectAll('.gradient_filled').classed('gradient_filled', false);
109794
109810
  };
109795
109811
 
109796
109812
  drawing.initPatterns = function(gd) {
@@ -109799,9 +109815,7 @@ drawing.initPatterns = function(gd) {
109799
109815
  var patternsGroup = Lib.ensureSingle(fullLayout._defs, 'g', 'patterns');
109800
109816
  patternsGroup.selectAll('pattern').remove();
109801
109817
 
109802
- // initialize stash of query parts filled in Drawing.pattern,
109803
- // used to fix URL strings during image exports
109804
- fullLayout._patternUrlQueryParts = {};
109818
+ d3.select(gd).selectAll('.pattern_filled').classed('pattern_filled', false);
109805
109819
  };
109806
109820
 
109807
109821
  drawing.getPatternAttr = function(mp, i, dflt) {
@@ -116815,7 +116829,6 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
116815
116829
  offsetY += h;
116816
116830
  maxWidthInGroup = Math.max(maxWidthInGroup, textGap + w);
116817
116831
  });
116818
- maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);
116819
116832
 
116820
116833
  var next = maxWidthInGroup + itemGap;
116821
116834
 
@@ -116831,6 +116844,8 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
116831
116844
  groupOffsetX = 0;
116832
116845
  groupOffsetY += maxGroupHeightInRow + traceGroupGap;
116833
116846
  maxGroupHeightInRow = offsetY;
116847
+ } else {
116848
+ maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);
116834
116849
  }
116835
116850
 
116836
116851
  Drawing.setTranslate(this, groupOffsetX, groupOffsetY);
@@ -117498,12 +117513,16 @@ module.exports = function style(s, gd, legend) {
117498
117513
  var colorscale = cOpts.colorscale;
117499
117514
  var reversescale = cOpts.reversescale;
117500
117515
 
117501
- var fillGradient = function(s) {
117516
+ var fillStyle = function(s) {
117502
117517
  if(s.size()) {
117503
- var gradientID = 'legendfill-' + trace.uid;
117504
- Drawing.gradient(s, gd, gradientID,
117505
- getGradientDirection(reversescale),
117506
- colorscale, 'fill');
117518
+ if(showFill) {
117519
+ Drawing.fillGroupStyle(s, gd);
117520
+ } else {
117521
+ var gradientID = 'legendfill-' + trace.uid;
117522
+ Drawing.gradient(s, gd, gradientID,
117523
+ getGradientDirection(reversescale),
117524
+ colorscale, 'fill');
117525
+ }
117507
117526
  }
117508
117527
  };
117509
117528
 
@@ -117532,7 +117551,7 @@ module.exports = function style(s, gd, legend) {
117532
117551
  fill.enter().append('path').classed('js-fill', true);
117533
117552
  fill.exit().remove();
117534
117553
  fill.attr('d', pathStart + 'h' + itemWidth + 'v6h-' + itemWidth + 'z')
117535
- .call(showFill ? Drawing.fillGroupStyle : fillGradient);
117554
+ .call(fillStyle);
117536
117555
 
117537
117556
  if(showLine || showGradientLine) {
117538
117557
  var lw = boundLineWidth(undefined, trace.line, MAX_LINE_WIDTH, CST_LINE_WIDTH);
@@ -119334,6 +119353,8 @@ var isNumeric = _dereq_('fast-isnumeric');
119334
119353
 
119335
119354
  var Lib = _dereq_('../../lib');
119336
119355
  var Icons = _dereq_('../../fonts/ploticon');
119356
+ var version = _dereq_('../../version').version;
119357
+
119337
119358
  var Parser = new DOMParser();
119338
119359
 
119339
119360
  /**
@@ -119612,6 +119633,10 @@ proto.hasButtons = function(buttons) {
119612
119633
  return true;
119613
119634
  };
119614
119635
 
119636
+ function jsVersion(str) {
119637
+ return str + ' (v' + version + ')';
119638
+ }
119639
+
119615
119640
  /**
119616
119641
  * @return {HTMLDivElement} The logo image wrapped in a group
119617
119642
  */
@@ -119621,7 +119646,7 @@ proto.getLogo = function() {
119621
119646
 
119622
119647
  a.href = 'https://plotly.com/';
119623
119648
  a.target = '_blank';
119624
- a.setAttribute('data-title', Lib._(this.graphInfo, 'Produced with Plotly'));
119649
+ a.setAttribute('data-title', jsVersion(Lib._(this.graphInfo, 'Produced with Plotly.js')));
119625
119650
  a.className = 'modebar-btn plotlyjsicon modebar-btn--logo';
119626
119651
 
119627
119652
  a.appendChild(this.createIcon(Icons.newplotlylogo));
@@ -119663,7 +119688,7 @@ function createModeBar(gd, buttons) {
119663
119688
 
119664
119689
  module.exports = createModeBar;
119665
119690
 
119666
- },{"../../fonts/ploticon":482,"../../lib":503,"@plotly/d3":58,"fast-isnumeric":190}],432:[function(_dereq_,module,exports){
119691
+ },{"../../fonts/ploticon":482,"../../lib":503,"../../version":1119,"@plotly/d3":58,"fast-isnumeric":190}],432:[function(_dereq_,module,exports){
119667
119692
  'use strict';
119668
119693
 
119669
119694
  var fontAttrs = _dereq_('../../plots/font_attributes');
@@ -133433,6 +133458,7 @@ exports.convertToTspans = function(_context, gd, _callback) {
133433
133458
  // Until we get tex integrated more fully (so it can be used along with non-tex)
133434
133459
  // allow some elements to prohibit it by attaching 'data-notex' to the original
133435
133460
  var tex = (!_context.attr('data-notex')) &&
133461
+ gd && gd._context.typesetMath &&
133436
133462
  (typeof MathJax !== 'undefined') &&
133437
133463
  str.match(FIND_TEX);
133438
133464
 
@@ -133587,70 +133613,154 @@ function cleanEscapesForTex(s) {
133587
133613
  .replace(GT_MATCH, '\\gt ');
133588
133614
  }
133589
133615
 
133616
+ var inlineMath = [['$', '$'], ['\\(', '\\)']];
133617
+
133590
133618
  function texToSVG(_texString, _config, _callback) {
133619
+ var MathJaxVersion = parseInt(
133620
+ (MathJax.version || '').split('.')[0]
133621
+ );
133622
+
133623
+ if(
133624
+ MathJaxVersion !== 2 &&
133625
+ MathJaxVersion !== 3
133626
+ ) {
133627
+ Lib.warn('No MathJax version:', MathJax.version);
133628
+ return;
133629
+ }
133630
+
133591
133631
  var originalRenderer,
133592
133632
  originalConfig,
133593
133633
  originalProcessSectionDelay,
133594
133634
  tmpDiv;
133595
133635
 
133596
- MathJax.Hub.Queue(
133597
- function() {
133636
+ var setConfig2 = function() {
133598
133637
  originalConfig = Lib.extendDeepAll({}, MathJax.Hub.config);
133599
133638
 
133600
133639
  originalProcessSectionDelay = MathJax.Hub.processSectionDelay;
133601
133640
  if(MathJax.Hub.processSectionDelay !== undefined) {
133602
- // MathJax 2.5+
133641
+ // MathJax 2.5+ but not 3+
133603
133642
  MathJax.Hub.processSectionDelay = 0;
133604
133643
  }
133605
133644
 
133606
133645
  return MathJax.Hub.Config({
133607
133646
  messageStyle: 'none',
133608
133647
  tex2jax: {
133609
- inlineMath: [['$', '$'], ['\\(', '\\)']]
133648
+ inlineMath: inlineMath
133610
133649
  },
133611
133650
  displayAlign: 'left',
133612
133651
  });
133613
- },
133614
- function() {
133615
- // Get original renderer
133652
+ };
133653
+
133654
+ var setConfig3 = function() {
133655
+ originalConfig = Lib.extendDeepAll({}, MathJax.config);
133656
+
133657
+ if(!MathJax.config.tex) {
133658
+ MathJax.config.tex = {};
133659
+ }
133660
+
133661
+ MathJax.config.tex.inlineMath = inlineMath;
133662
+ };
133663
+
133664
+ var setRenderer2 = function() {
133616
133665
  originalRenderer = MathJax.Hub.config.menuSettings.renderer;
133617
133666
  if(originalRenderer !== 'SVG') {
133618
133667
  return MathJax.Hub.setRenderer('SVG');
133619
133668
  }
133620
- },
133621
- function() {
133669
+ };
133670
+
133671
+ var setRenderer3 = function() {
133672
+ originalRenderer = MathJax.config.startup.output;
133673
+ if(originalRenderer !== 'svg') {
133674
+ MathJax.config.startup.output = 'svg';
133675
+ }
133676
+ };
133677
+
133678
+ var initiateMathJax = function() {
133622
133679
  var randomID = 'math-output-' + Lib.randstr({}, 64);
133623
133680
  tmpDiv = d3.select('body').append('div')
133624
133681
  .attr({id: randomID})
133625
- .style({visibility: 'hidden', position: 'absolute'})
133626
- .style({'font-size': _config.fontSize + 'px'})
133682
+ .style({
133683
+ visibility: 'hidden',
133684
+ position: 'absolute',
133685
+ 'font-size': _config.fontSize + 'px'
133686
+ })
133627
133687
  .text(cleanEscapesForTex(_texString));
133628
133688
 
133629
- return MathJax.Hub.Typeset(tmpDiv.node());
133630
- },
133631
- function() {
133632
- var glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');
133689
+ var tmpNode = tmpDiv.node();
133633
133690
 
133634
- if(tmpDiv.select('.MathJax_SVG').empty() || !tmpDiv.select('svg').node()) {
133691
+ return MathJaxVersion === 2 ?
133692
+ MathJax.Hub.Typeset(tmpNode) :
133693
+ MathJax.typeset([tmpNode]);
133694
+ };
133695
+
133696
+ var finalizeMathJax = function() {
133697
+ var sel = tmpDiv.select(
133698
+ MathJaxVersion === 2 ? '.MathJax_SVG' : '.MathJax'
133699
+ );
133700
+
133701
+ var node = !sel.empty() && tmpDiv.select('svg').node();
133702
+ if(!node) {
133635
133703
  Lib.log('There was an error in the tex syntax.', _texString);
133636
133704
  _callback();
133637
133705
  } else {
133638
- var svgBBox = tmpDiv.select('svg').node().getBoundingClientRect();
133639
- _callback(tmpDiv.select('.MathJax_SVG'), glyphDefs, svgBBox);
133706
+ var nodeBBox = node.getBoundingClientRect();
133707
+ var glyphDefs;
133708
+ if(MathJaxVersion === 2) {
133709
+ glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');
133710
+ } else {
133711
+ glyphDefs = sel.select('defs');
133712
+ }
133713
+ _callback(sel, glyphDefs, nodeBBox);
133640
133714
  }
133641
133715
 
133642
133716
  tmpDiv.remove();
133717
+ };
133643
133718
 
133719
+ var resetRenderer2 = function() {
133644
133720
  if(originalRenderer !== 'SVG') {
133645
133721
  return MathJax.Hub.setRenderer(originalRenderer);
133646
133722
  }
133647
- },
133648
- function() {
133723
+ };
133724
+
133725
+ var resetRenderer3 = function() {
133726
+ if(originalRenderer !== 'svg') {
133727
+ MathJax.config.startup.output = originalRenderer;
133728
+ }
133729
+ };
133730
+
133731
+ var resetConfig2 = function() {
133649
133732
  if(originalProcessSectionDelay !== undefined) {
133650
133733
  MathJax.Hub.processSectionDelay = originalProcessSectionDelay;
133651
133734
  }
133652
133735
  return MathJax.Hub.Config(originalConfig);
133653
- });
133736
+ };
133737
+
133738
+ var resetConfig3 = function() {
133739
+ MathJax.config = originalConfig;
133740
+ };
133741
+
133742
+ if(MathJaxVersion === 2) {
133743
+ MathJax.Hub.Queue(
133744
+ setConfig2,
133745
+ setRenderer2,
133746
+ initiateMathJax,
133747
+ finalizeMathJax,
133748
+ resetRenderer2,
133749
+ resetConfig2
133750
+ );
133751
+ } else if(MathJaxVersion === 3) {
133752
+ setConfig3();
133753
+ setRenderer3();
133754
+ MathJax.startup.defaultReady();
133755
+
133756
+ MathJax.startup.promise.then(function() {
133757
+ initiateMathJax();
133758
+ finalizeMathJax();
133759
+
133760
+ resetRenderer3();
133761
+ resetConfig3();
133762
+ });
133763
+ }
133654
133764
  }
133655
133765
 
133656
133766
  var TAG_STYLES = {
@@ -139527,6 +139637,15 @@ var configAttributes = {
139527
139637
  ].join(' ')
139528
139638
  },
139529
139639
 
139640
+ typesetMath: {
139641
+ valType: 'boolean',
139642
+ dflt: true,
139643
+ description: [
139644
+ 'Determines whether math should be typeset or not,',
139645
+ 'when MathJax (either v2 or v3) is present on the page.'
139646
+ ].join(' ')
139647
+ },
139648
+
139530
139649
  plotlyServerURL: {
139531
139650
  valType: 'string',
139532
139651
  dflt: '',
@@ -144809,7 +144928,8 @@ axes.calcTicks = function calcTicks(ax, opts) {
144809
144928
  var minRange = Math.min(rng[0], rng[1]);
144810
144929
  var maxRange = Math.max(rng[0], rng[1]);
144811
144930
 
144812
- var isDLog = (ax.type === 'log') && !(isNumeric(ax.dtick) || ax.dtick.charAt(0) === 'L');
144931
+ var numDtick = isNumeric(ax.dtick);
144932
+ var isDLog = (ax.type === 'log') && !(numDtick || ax.dtick.charAt(0) === 'L');
144813
144933
  var isPeriod = ax.ticklabelmode === 'period';
144814
144934
 
144815
144935
  // find the first tick
@@ -144840,13 +144960,36 @@ axes.calcTicks = function calcTicks(ax, opts) {
144840
144960
  x = axes.tickIncrement(x, ax.dtick, !axrev, ax.calendar);
144841
144961
  }
144842
144962
 
144963
+ var ticklabelstep = ax.ticklabelstep;
144964
+
144843
144965
  var maxTicks = Math.max(1000, ax._length || 0);
144844
144966
  var tickVals = [];
144845
144967
  var xPrevious = null;
144968
+
144969
+ var dTick;
144970
+ if(numDtick) {
144971
+ dTick = ax.dtick;
144972
+ } else {
144973
+ if(ax.type === 'date') {
144974
+ if(typeof ax.dtick === 'string' && ax.dtick.charAt(0) === 'M') {
144975
+ dTick = ONEAVGMONTH * ax.dtick.substring(1);
144976
+ }
144977
+ } else {
144978
+ dTick = ax._roughDTick;
144979
+ }
144980
+ }
144981
+
144982
+ var id = Math.round((
144983
+ ax.r2l(x) -
144984
+ ax.r2l(ax.tick0)
144985
+ ) / dTick) - 1;
144986
+
144846
144987
  for(;
144847
144988
  (axrev) ? (x >= endTick) : (x <= endTick);
144848
144989
  x = axes.tickIncrement(x, ax.dtick, axrev, ax.calendar)
144849
144990
  ) {
144991
+ id++;
144992
+
144850
144993
  if(ax.rangebreaks) {
144851
144994
  if(!axrev) {
144852
144995
  if(x < startTick) continue;
@@ -144864,10 +145007,16 @@ axes.calcTicks = function calcTicks(ax, opts) {
144864
145007
  minor = true;
144865
145008
  }
144866
145009
 
144867
- tickVals.push({
145010
+ var obj = {
144868
145011
  minor: minor,
144869
145012
  value: x
144870
- });
145013
+ };
145014
+
145015
+ if(ticklabelstep > 1 && id % ticklabelstep) {
145016
+ obj.skipLabel = true;
145017
+ }
145018
+
145019
+ tickVals.push(obj);
144871
145020
  }
144872
145021
 
144873
145022
  if(isPeriod) positionPeriodTicks(tickVals, ax, ax._definedDelta);
@@ -144920,12 +145069,20 @@ axes.calcTicks = function calcTicks(ax, opts) {
144920
145069
  ax._prevDateHead = '';
144921
145070
  ax._inCalcTicks = true;
144922
145071
 
145072
+ var lastVisibleHead;
145073
+ var hideLabel = function(tick) {
145074
+ tick.text = ' '; // don't use an empty string here which can confuse automargin (issue 5132)
145075
+ ax._prevDateHead = lastVisibleHead;
145076
+ };
145077
+
144923
145078
  var ticksOut = [];
144924
145079
  var t, p;
144925
145080
  for(i = 0; i < tickVals.length; i++) {
144926
145081
  var _minor = tickVals[i].minor;
144927
145082
  var _value = tickVals[i].value;
144928
145083
 
145084
+ lastVisibleHead = ax._prevDateHead;
145085
+
144929
145086
  t = axes.tickText(
144930
145087
  ax,
144931
145088
  _value,
@@ -144940,11 +145097,14 @@ axes.calcTicks = function calcTicks(ax, opts) {
144940
145097
  if(p > maxRange) t.periodX = maxRange;
144941
145098
  if(p < minRange) t.periodX = minRange;
144942
145099
 
144943
- t.text = ' '; // don't use an empty string here which can confuse automargin (issue 5132)
144944
- ax._prevDateHead = '';
145100
+ hideLabel(t);
144945
145101
  }
144946
145102
  }
144947
145103
 
145104
+ if(tickVals[i].skipLabel) {
145105
+ hideLabel(t);
145106
+ }
145107
+
144948
145108
  ticksOut.push(t);
144949
145109
  }
144950
145110
 
@@ -146972,6 +147132,7 @@ axes.drawLabels = function(gd, ax, opts) {
146972
147132
  var axId = ax._id;
146973
147133
  var axLetter = axId.charAt(0);
146974
147134
  var cls = opts.cls || axId + 'tick';
147135
+
146975
147136
  var vals = opts.vals;
146976
147137
 
146977
147138
  var labelFns = opts.labelFns;
@@ -152033,6 +152194,20 @@ module.exports = {
152033
152194
  'To set ticks every 4 years, set `dtick` to *M48*'
152034
152195
  ].join(' ')
152035
152196
  },
152197
+ ticklabelstep: {
152198
+ valType: 'integer',
152199
+ min: 1,
152200
+ dflt: 1,
152201
+ editType: 'ticks',
152202
+ description: [
152203
+ 'Sets the spacing between tick labels as compared to the spacing between ticks.',
152204
+ 'A value of 1 (default) means each tick gets a label.',
152205
+ 'A value of 2 means shows every 2nd label.',
152206
+ 'A larger value n means only every nth tick is labeled.',
152207
+ '`tick0` determines which labels are shown.',
152208
+ 'Not implemented for axes with `type` *log* or *multicategory*, or when `tickmode` is *array*.'
152209
+ ].join(' ')
152210
+ },
152036
152211
  tickvals: {
152037
152212
  valType: 'data_array',
152038
152213
  editType: 'ticks',
@@ -155130,6 +155305,14 @@ module.exports = function handleTickLabelDefaults(containerIn, containerOut, coe
155130
155305
  color: dfltFontColor
155131
155306
  });
155132
155307
 
155308
+ if(
155309
+ !options.noTicklabelstep &&
155310
+ axType !== 'multicategory' &&
155311
+ axType !== 'log'
155312
+ ) {
155313
+ coerce('ticklabelstep');
155314
+ }
155315
+
155133
155316
  if(!options.noAng) coerce('tickangle');
155134
155317
 
155135
155318
  if(axType !== 'category') {
@@ -160256,6 +160439,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) {
160256
160439
  showGrid: true,
160257
160440
  noTickson: true,
160258
160441
  noTicklabelmode: true,
160442
+ noTicklabelstep: true,
160259
160443
  noTicklabelposition: true,
160260
160444
  noTicklabeloverflow: true,
160261
160445
  bgColor: options.bgColor,
@@ -168522,6 +168706,7 @@ var axisTickAttrs = overrideAll({
168522
168706
  ticklen: axesAttrs.ticklen,
168523
168707
  tickwidth: axesAttrs.tickwidth,
168524
168708
  tickcolor: axesAttrs.tickcolor,
168709
+ ticklabelstep: axesAttrs.ticklabelstep,
168525
168710
  showticklabels: axesAttrs.showticklabels,
168526
168711
  showtickprefix: axesAttrs.showtickprefix,
168527
168712
  tickprefix: axesAttrs.tickprefix,
@@ -171175,6 +171360,7 @@ function handleDefaults(contIn, contOut, coerce, opts) {
171175
171360
  }
171176
171361
 
171177
171362
  handleTickLabelDefaults(axIn, axOut, coerceAxis, axOut.type, {
171363
+ noTicklabelstep: true,
171178
171364
  noAng: !isRealAxis,
171179
171365
  noExp: true,
171180
171366
  font: {
@@ -171519,6 +171705,7 @@ var ternaryAxesAttrs = {
171519
171705
  ticklen: axesAttrs.ticklen,
171520
171706
  tickwidth: axesAttrs.tickwidth,
171521
171707
  tickcolor: axesAttrs.tickcolor,
171708
+ ticklabelstep: axesAttrs.ticklabelstep,
171522
171709
  showticklabels: axesAttrs.showticklabels,
171523
171710
  showtickprefix: axesAttrs.showtickprefix,
171524
171711
  tickprefix: axesAttrs.tickprefix,
@@ -173560,7 +173747,7 @@ module.exports = function toSVG(gd, format, scale) {
173560
173747
  var toppaper = fullLayout._toppaper;
173561
173748
  var width = fullLayout.width;
173562
173749
  var height = fullLayout.height;
173563
- var i, k;
173750
+ var i;
173564
173751
 
173565
173752
  // make background color a rect in the svg, then revert after scraping
173566
173753
  // all other alterations have been dealt with by properly preparing the svg
@@ -173633,32 +173820,21 @@ module.exports = function toSVG(gd, format, scale) {
173633
173820
  }
173634
173821
  });
173635
173822
 
173636
- var queryParts = [];
173637
- if(fullLayout._gradientUrlQueryParts) {
173638
- for(k in fullLayout._gradientUrlQueryParts) queryParts.push(k);
173639
- }
173640
-
173641
- if(fullLayout._patternUrlQueryParts) {
173642
- for(k in fullLayout._patternUrlQueryParts) queryParts.push(k);
173643
- }
173644
-
173645
- if(queryParts.length) {
173646
- svg.selectAll(queryParts.join(',')).each(function() {
173647
- var pt = d3.select(this);
173823
+ svg.selectAll('.gradient_filled,.pattern_filled').each(function() {
173824
+ var pt = d3.select(this);
173648
173825
 
173649
- // similar to font family styles above,
173650
- // we must remove " after the SVG DOM has been serialized
173651
- var fill = this.style.fill;
173652
- if(fill && fill.indexOf('url(') !== -1) {
173653
- pt.style('fill', fill.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
173654
- }
173826
+ // similar to font family styles above,
173827
+ // we must remove " after the SVG DOM has been serialized
173828
+ var fill = this.style.fill;
173829
+ if(fill && fill.indexOf('url(') !== -1) {
173830
+ pt.style('fill', fill.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
173831
+ }
173655
173832
 
173656
- var stroke = this.style.stroke;
173657
- if(stroke && stroke.indexOf('url(') !== -1) {
173658
- pt.style('stroke', stroke.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
173659
- }
173660
- });
173661
- }
173833
+ var stroke = this.style.stroke;
173834
+ if(stroke && stroke.indexOf('url(') !== -1) {
173835
+ pt.style('stroke', stroke.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
173836
+ }
173837
+ });
173662
173838
 
173663
173839
  if(format === 'pdf' || format === 'eps') {
173664
173840
  // these formats make the extra line MathJax adds around symbols look super thick in some cases
@@ -176118,6 +176294,7 @@ function calcTexttemplate(fullLayout, cd, index, xa, ya) {
176118
176294
  var trace = cd[0].trace;
176119
176295
  var texttemplate = Lib.castOption(trace, index, 'texttemplate');
176120
176296
  if(!texttemplate) return '';
176297
+ var isHistogram = (trace.type === 'histogram');
176121
176298
  var isWaterfall = (trace.type === 'waterfall');
176122
176299
  var isFunnel = (trace.type === 'funnel');
176123
176300
  var isHorizontal = trace.orientation === 'h';
@@ -176159,10 +176336,10 @@ function calcTexttemplate(fullLayout, cd, index, xa, ya) {
176159
176336
  var pt = {};
176160
176337
  appendArrayPointValue(pt, trace, cdi.i);
176161
176338
 
176162
- if(pt.x === undefined) pt.x = isHorizontal ? obj.value : obj.label;
176163
- if(pt.y === undefined) pt.y = isHorizontal ? obj.label : obj.value;
176164
- if(pt.xLabel === undefined) pt.xLabel = isHorizontal ? obj.valueLabel : obj.labelLabel;
176165
- if(pt.yLabel === undefined) pt.yLabel = isHorizontal ? obj.labelLabel : obj.valueLabel;
176339
+ if(isHistogram || pt.x === undefined) pt.x = isHorizontal ? obj.value : obj.label;
176340
+ if(isHistogram || pt.y === undefined) pt.y = isHorizontal ? obj.label : obj.value;
176341
+ if(isHistogram || pt.xLabel === undefined) pt.xLabel = isHorizontal ? obj.valueLabel : obj.labelLabel;
176342
+ if(isHistogram || pt.yLabel === undefined) pt.yLabel = isHorizontal ? obj.labelLabel : obj.valueLabel;
176166
176343
 
176167
176344
  if(isWaterfall) {
176168
176345
  obj.delta = +cdi.rawS || cdi.s;
@@ -179712,6 +179889,7 @@ function mimickAxisDefaults(traceIn, traceOut, fullLayout, dfltColor) {
179712
179889
  var axOut = Template.newContainer(traceOut, axName);
179713
179890
 
179714
179891
  var defaultOptions = {
179892
+ noTicklabelstep: true,
179715
179893
  tickfont: 'x',
179716
179894
  id: axLetter + 'axis',
179717
179895
  letter: axLetter,
@@ -195233,6 +195411,7 @@ module.exports = {
195233
195411
  ticklen: axesAttrs.ticklen,
195234
195412
  tickwidth: axesAttrs.tickwidth,
195235
195413
  tickcolor: axesAttrs.tickcolor,
195414
+ ticklabelstep: axesAttrs.ticklabelstep,
195236
195415
  showticklabels: axesAttrs.showticklabels,
195237
195416
  tickfont: fontAttrs({
195238
195417
  description: 'Sets the color bar\'s tick label font'
@@ -209361,6 +209540,7 @@ var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplat
209361
209540
  var colorScaleAttrs = _dereq_('../../components/colorscale/attributes');
209362
209541
  var fontAttrs = _dereq_('../../plots/font_attributes');
209363
209542
  var dash = _dereq_('../../components/drawing/attributes').dash;
209543
+ var pattern = _dereq_('../../components/drawing/attributes').pattern;
209364
209544
 
209365
209545
  var Drawing = _dereq_('../../components/drawing');
209366
209546
  var constants = _dereq_('./constants');
@@ -209718,6 +209898,7 @@ module.exports = {
209718
209898
  'marker color, or marker line color, whichever is available.'
209719
209899
  ].join(' ')
209720
209900
  },
209901
+ fillpattern: pattern,
209721
209902
  marker: extendFlat({
209722
209903
  symbol: {
209723
209904
  valType: 'enumerated',
@@ -210503,6 +210684,7 @@ var handleLineDefaults = _dereq_('./line_defaults');
210503
210684
  var handleLineShapeDefaults = _dereq_('./line_shape_defaults');
210504
210685
  var handleTextDefaults = _dereq_('./text_defaults');
210505
210686
  var handleFillColorDefaults = _dereq_('./fillcolor_defaults');
210687
+ var coercePattern = _dereq_('../../lib').coercePattern;
210506
210688
 
210507
210689
  module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
210508
210690
  function coerce(attr, dflt) {
@@ -210556,6 +210738,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
210556
210738
  if(traceOut.fill !== 'none') {
210557
210739
  handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);
210558
210740
  if(!subTypes.hasLines(traceOut)) handleLineShapeDefaults(traceIn, traceOut, coerce);
210741
+ coercePattern(coerce, 'fillpattern', traceOut.fillcolor, false);
210559
210742
  }
210560
210743
 
210561
210744
  var lineColor = (traceOut.line || {}).color;
@@ -211945,11 +212128,11 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
211945
212128
  // the points on the axes are the first two points. Otherwise
211946
212129
  // animations get a little crazy if the number of points changes.
211947
212130
  transition(ownFillEl3).attr('d', 'M' + pt1 + 'L' + pt0 + 'L' + fullpath.substr(1))
211948
- .call(Drawing.singleFillStyle);
212131
+ .call(Drawing.singleFillStyle, gd);
211949
212132
  } else {
211950
212133
  // fill to self: just join the path to itself
211951
212134
  transition(ownFillEl3).attr('d', fullpath + 'Z')
211952
- .call(Drawing.singleFillStyle);
212135
+ .call(Drawing.singleFillStyle, gd);
211953
212136
  }
211954
212137
  }
211955
212138
  } else if(tonext) {
@@ -211961,7 +212144,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
211961
212144
  // This makes strange results if one path is *not* entirely
211962
212145
  // inside the other, but then that is a strange usage.
211963
212146
  transition(tonext).attr('d', fullpath + 'Z' + prevRevpath + 'Z')
211964
- .call(Drawing.singleFillStyle);
212147
+ .call(Drawing.singleFillStyle, gd);
211965
212148
  } else {
211966
212149
  // tonextx/y: for now just connect endpoints with lines. This is
211967
212150
  // the correct behavior if the endpoints are at the same value of
@@ -211969,7 +212152,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
211969
212152
  // things depending on whether the new endpoint projects onto the
211970
212153
  // existing curve or off the end of it
211971
212154
  transition(tonext).attr('d', fullpath + 'L' + prevRevpath.substr(1) + 'Z')
211972
- .call(Drawing.singleFillStyle);
212155
+ .call(Drawing.singleFillStyle, gd);
211973
212156
  }
211974
212157
  trace._polygons = trace._polygons.concat(prevPolygons);
211975
212158
  } else {
@@ -212362,7 +212545,7 @@ function style(gd) {
212362
212545
  .call(Drawing.lineGroupStyle);
212363
212546
 
212364
212547
  s.selectAll('g.trace path.js-fill')
212365
- .call(Drawing.fillGroupStyle);
212548
+ .call(Drawing.fillGroupStyle, gd);
212366
212549
 
212367
212550
  Registry.getComponentMethod('errorbars', 'style')(s);
212368
212551
  }
@@ -230519,7 +230702,7 @@ function getSortFunc(opts, d2c) {
230519
230702
  'use strict';
230520
230703
 
230521
230704
  // package version injected by `npm run preprocess`
230522
- exports.version = '2.8.2';
230705
+ exports.version = '2.10.0';
230523
230706
 
230524
230707
  },{}],1120:[function(_dereq_,module,exports){
230525
230708
  (function (global){(function (){