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 (mapbox) v2.8.2
3
- * Copyright 2012-2021, Plotly, Inc.
2
+ * plotly.js (mapbox) v2.10.0
3
+ * Copyright 2012-2022, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
6
6
  */
@@ -68923,6 +68923,7 @@ module.exports = overrideAll({
68923
68923
  ticklen: axesAttrs.ticklen,
68924
68924
  tickwidth: axesAttrs.tickwidth,
68925
68925
  tickcolor: axesAttrs.tickcolor,
68926
+ ticklabelstep: axesAttrs.ticklabelstep,
68926
68927
  showticklabels: axesAttrs.showticklabels,
68927
68928
  tickfont: fontAttrs({
68928
68929
  }),
@@ -70013,6 +70014,7 @@ function mockColorBarAxis(gd, opts, zrange) {
70013
70014
  showticklabels: opts.showticklabels,
70014
70015
  ticklabelposition: opts.ticklabelposition,
70015
70016
  ticklabeloverflow: opts.ticklabeloverflow,
70017
+ ticklabelstep: opts.ticklabelstep,
70016
70018
  tickfont: opts.tickfont,
70017
70019
  tickangle: opts.tickangle,
70018
70020
  tickformat: opts.tickformat,
@@ -71751,24 +71753,42 @@ drawing.dashStyle = function(dash, lineWidth) {
71751
71753
  return dash;
71752
71754
  };
71753
71755
 
71756
+ function setFillStyle(sel, trace, gd) {
71757
+ var markerPattern = trace.fillpattern;
71758
+ var patternShape = markerPattern && drawing.getPatternAttr(markerPattern.shape, 0, '');
71759
+ if(patternShape) {
71760
+ var patternBGColor = drawing.getPatternAttr(markerPattern.bgcolor, 0, null);
71761
+ var patternFGColor = drawing.getPatternAttr(markerPattern.fgcolor, 0, null);
71762
+ var patternFGOpacity = markerPattern.fgopacity;
71763
+ var patternSize = drawing.getPatternAttr(markerPattern.size, 0, 8);
71764
+ var patternSolidity = drawing.getPatternAttr(markerPattern.solidity, 0, 0.3);
71765
+ var patternID = trace.uid;
71766
+ drawing.pattern(sel, 'point', gd, patternID,
71767
+ patternShape, patternSize, patternSolidity,
71768
+ undefined, markerPattern.fillmode,
71769
+ patternBGColor, patternFGColor, patternFGOpacity
71770
+ );
71771
+ } else if(trace.fillcolor) {
71772
+ sel.call(Color.fill, trace.fillcolor);
71773
+ }
71774
+ }
71775
+
71754
71776
  // Same as fillGroupStyle, except in this case the selection may be a transition
71755
- drawing.singleFillStyle = function(sel) {
71777
+ drawing.singleFillStyle = function(sel, gd) {
71756
71778
  var node = d3.select(sel.node());
71757
71779
  var data = node.data();
71758
- var fillcolor = (((data[0] || [])[0] || {}).trace || {}).fillcolor;
71759
- if(fillcolor) {
71760
- sel.call(Color.fill, fillcolor);
71761
- }
71780
+ var trace = ((data[0] || [])[0] || {}).trace || {};
71781
+ setFillStyle(sel, trace, gd);
71762
71782
  };
71763
71783
 
71764
- drawing.fillGroupStyle = function(s) {
71784
+ drawing.fillGroupStyle = function(s, gd) {
71765
71785
  s.style('stroke-width', 0)
71766
71786
  .each(function(d) {
71767
71787
  var shape = d3.select(this);
71768
71788
  // N.B. 'd' won't be a calcdata item when
71769
71789
  // fill !== 'none' on a segment-less and marker-less trace
71770
71790
  if(d[0].trace) {
71771
- shape.call(Color.fill, d[0].trace.fillcolor);
71791
+ setFillStyle(shape, d[0].trace, gd);
71772
71792
  }
71773
71793
  });
71774
71794
  };
@@ -71921,12 +71941,7 @@ drawing.gradient = function(sel, gd, gradientID, type, colorscale, prop) {
71921
71941
  sel.style(prop, getFullUrl(fullID, gd))
71922
71942
  .style(prop + '-opacity', null);
71923
71943
 
71924
- var className2query = function(s) {
71925
- return '.' + s.attr('class').replace(/\s/g, '.');
71926
- };
71927
- var k = className2query(d3.select(sel.node().parentNode)) +
71928
- '>' + className2query(sel);
71929
- fullLayout._gradientUrlQueryParts[k] = 1;
71944
+ sel.classed('gradient_filled', true);
71930
71945
  };
71931
71946
 
71932
71947
  /**
@@ -72133,11 +72148,6 @@ drawing.pattern = function(sel, calledBy, gd, patternID, shape, size, solidity,
72133
72148
  .style('fill-opacity', null);
72134
72149
 
72135
72150
  sel.classed('pattern_filled', true);
72136
- var className2query = function(s) {
72137
- return '.' + s.attr('class').replace(/\s/g, '.');
72138
- };
72139
- var k = className2query(d3.select(sel.node().parentNode)) + '>.pattern_filled';
72140
- fullLayout._patternUrlQueryParts[k] = 1;
72141
72151
  };
72142
72152
 
72143
72153
  /*
@@ -72153,9 +72163,7 @@ drawing.initGradients = function(gd) {
72153
72163
  var gradientsGroup = Lib.ensureSingle(fullLayout._defs, 'g', 'gradients');
72154
72164
  gradientsGroup.selectAll('linearGradient,radialGradient').remove();
72155
72165
 
72156
- // initialize stash of query parts filled in Drawing.gradient,
72157
- // used to fix URL strings during image exports
72158
- fullLayout._gradientUrlQueryParts = {};
72166
+ d3.select(gd).selectAll('.gradient_filled').classed('gradient_filled', false);
72159
72167
  };
72160
72168
 
72161
72169
  drawing.initPatterns = function(gd) {
@@ -72164,9 +72172,7 @@ drawing.initPatterns = function(gd) {
72164
72172
  var patternsGroup = Lib.ensureSingle(fullLayout._defs, 'g', 'patterns');
72165
72173
  patternsGroup.selectAll('pattern').remove();
72166
72174
 
72167
- // initialize stash of query parts filled in Drawing.pattern,
72168
- // used to fix URL strings during image exports
72169
- fullLayout._patternUrlQueryParts = {};
72175
+ d3.select(gd).selectAll('.pattern_filled').classed('pattern_filled', false);
72170
72176
  };
72171
72177
 
72172
72178
  drawing.getPatternAttr = function(mp, i, dflt) {
@@ -78819,7 +78825,6 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
78819
78825
  offsetY += h;
78820
78826
  maxWidthInGroup = Math.max(maxWidthInGroup, textGap + w);
78821
78827
  });
78822
- maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);
78823
78828
 
78824
78829
  var next = maxWidthInGroup + itemGap;
78825
78830
 
@@ -78835,6 +78840,8 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
78835
78840
  groupOffsetX = 0;
78836
78841
  groupOffsetY += maxGroupHeightInRow + traceGroupGap;
78837
78842
  maxGroupHeightInRow = offsetY;
78843
+ } else {
78844
+ maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);
78838
78845
  }
78839
78846
 
78840
78847
  Drawing.setTranslate(this, groupOffsetX, groupOffsetY);
@@ -79502,12 +79509,16 @@ module.exports = function style(s, gd, legend) {
79502
79509
  var colorscale = cOpts.colorscale;
79503
79510
  var reversescale = cOpts.reversescale;
79504
79511
 
79505
- var fillGradient = function(s) {
79512
+ var fillStyle = function(s) {
79506
79513
  if(s.size()) {
79507
- var gradientID = 'legendfill-' + trace.uid;
79508
- Drawing.gradient(s, gd, gradientID,
79509
- getGradientDirection(reversescale),
79510
- colorscale, 'fill');
79514
+ if(showFill) {
79515
+ Drawing.fillGroupStyle(s, gd);
79516
+ } else {
79517
+ var gradientID = 'legendfill-' + trace.uid;
79518
+ Drawing.gradient(s, gd, gradientID,
79519
+ getGradientDirection(reversescale),
79520
+ colorscale, 'fill');
79521
+ }
79511
79522
  }
79512
79523
  };
79513
79524
 
@@ -79536,7 +79547,7 @@ module.exports = function style(s, gd, legend) {
79536
79547
  fill.enter().append('path').classed('js-fill', true);
79537
79548
  fill.exit().remove();
79538
79549
  fill.attr('d', pathStart + 'h' + itemWidth + 'v6h-' + itemWidth + 'z')
79539
- .call(showFill ? Drawing.fillGroupStyle : fillGradient);
79550
+ .call(fillStyle);
79540
79551
 
79541
79552
  if(showLine || showGradientLine) {
79542
79553
  var lw = boundLineWidth(undefined, trace.line, MAX_LINE_WIDTH, CST_LINE_WIDTH);
@@ -81317,6 +81328,8 @@ var isNumeric = _dereq_('fast-isnumeric');
81317
81328
 
81318
81329
  var Lib = _dereq_('../../lib');
81319
81330
  var Icons = _dereq_('../../fonts/ploticon');
81331
+ var version = _dereq_('../../version').version;
81332
+
81320
81333
  var Parser = new DOMParser();
81321
81334
 
81322
81335
  /**
@@ -81595,6 +81608,10 @@ proto.hasButtons = function(buttons) {
81595
81608
  return true;
81596
81609
  };
81597
81610
 
81611
+ function jsVersion(str) {
81612
+ return str + ' (v' + version + ')';
81613
+ }
81614
+
81598
81615
  /**
81599
81616
  * @return {HTMLDivElement} The logo image wrapped in a group
81600
81617
  */
@@ -81604,7 +81621,7 @@ proto.getLogo = function() {
81604
81621
 
81605
81622
  a.href = 'https://plotly.com/';
81606
81623
  a.target = '_blank';
81607
- a.setAttribute('data-title', Lib._(this.graphInfo, 'Produced with Plotly'));
81624
+ a.setAttribute('data-title', jsVersion(Lib._(this.graphInfo, 'Produced with Plotly.js')));
81608
81625
  a.className = 'modebar-btn plotlyjsicon modebar-btn--logo';
81609
81626
 
81610
81627
  a.appendChild(this.createIcon(Icons.newplotlylogo));
@@ -81646,7 +81663,7 @@ function createModeBar(gd, buttons) {
81646
81663
 
81647
81664
  module.exports = createModeBar;
81648
81665
 
81649
- },{"../../fonts/ploticon":227,"../../lib":246,"@plotly/d3":12,"fast-isnumeric":28}],180:[function(_dereq_,module,exports){
81666
+ },{"../../fonts/ploticon":227,"../../lib":246,"../../version":415,"@plotly/d3":12,"fast-isnumeric":28}],180:[function(_dereq_,module,exports){
81650
81667
  'use strict';
81651
81668
 
81652
81669
  var fontAttrs = _dereq_('../../plots/font_attributes');
@@ -94642,6 +94659,7 @@ exports.convertToTspans = function(_context, gd, _callback) {
94642
94659
  // Until we get tex integrated more fully (so it can be used along with non-tex)
94643
94660
  // allow some elements to prohibit it by attaching 'data-notex' to the original
94644
94661
  var tex = (!_context.attr('data-notex')) &&
94662
+ gd && gd._context.typesetMath &&
94645
94663
  (typeof MathJax !== 'undefined') &&
94646
94664
  str.match(FIND_TEX);
94647
94665
 
@@ -94796,70 +94814,154 @@ function cleanEscapesForTex(s) {
94796
94814
  .replace(GT_MATCH, '\\gt ');
94797
94815
  }
94798
94816
 
94817
+ var inlineMath = [['$', '$'], ['\\(', '\\)']];
94818
+
94799
94819
  function texToSVG(_texString, _config, _callback) {
94820
+ var MathJaxVersion = parseInt(
94821
+ (MathJax.version || '').split('.')[0]
94822
+ );
94823
+
94824
+ if(
94825
+ MathJaxVersion !== 2 &&
94826
+ MathJaxVersion !== 3
94827
+ ) {
94828
+ Lib.warn('No MathJax version:', MathJax.version);
94829
+ return;
94830
+ }
94831
+
94800
94832
  var originalRenderer,
94801
94833
  originalConfig,
94802
94834
  originalProcessSectionDelay,
94803
94835
  tmpDiv;
94804
94836
 
94805
- MathJax.Hub.Queue(
94806
- function() {
94837
+ var setConfig2 = function() {
94807
94838
  originalConfig = Lib.extendDeepAll({}, MathJax.Hub.config);
94808
94839
 
94809
94840
  originalProcessSectionDelay = MathJax.Hub.processSectionDelay;
94810
94841
  if(MathJax.Hub.processSectionDelay !== undefined) {
94811
- // MathJax 2.5+
94842
+ // MathJax 2.5+ but not 3+
94812
94843
  MathJax.Hub.processSectionDelay = 0;
94813
94844
  }
94814
94845
 
94815
94846
  return MathJax.Hub.Config({
94816
94847
  messageStyle: 'none',
94817
94848
  tex2jax: {
94818
- inlineMath: [['$', '$'], ['\\(', '\\)']]
94849
+ inlineMath: inlineMath
94819
94850
  },
94820
94851
  displayAlign: 'left',
94821
94852
  });
94822
- },
94823
- function() {
94824
- // Get original renderer
94853
+ };
94854
+
94855
+ var setConfig3 = function() {
94856
+ originalConfig = Lib.extendDeepAll({}, MathJax.config);
94857
+
94858
+ if(!MathJax.config.tex) {
94859
+ MathJax.config.tex = {};
94860
+ }
94861
+
94862
+ MathJax.config.tex.inlineMath = inlineMath;
94863
+ };
94864
+
94865
+ var setRenderer2 = function() {
94825
94866
  originalRenderer = MathJax.Hub.config.menuSettings.renderer;
94826
94867
  if(originalRenderer !== 'SVG') {
94827
94868
  return MathJax.Hub.setRenderer('SVG');
94828
94869
  }
94829
- },
94830
- function() {
94870
+ };
94871
+
94872
+ var setRenderer3 = function() {
94873
+ originalRenderer = MathJax.config.startup.output;
94874
+ if(originalRenderer !== 'svg') {
94875
+ MathJax.config.startup.output = 'svg';
94876
+ }
94877
+ };
94878
+
94879
+ var initiateMathJax = function() {
94831
94880
  var randomID = 'math-output-' + Lib.randstr({}, 64);
94832
94881
  tmpDiv = d3.select('body').append('div')
94833
94882
  .attr({id: randomID})
94834
- .style({visibility: 'hidden', position: 'absolute'})
94835
- .style({'font-size': _config.fontSize + 'px'})
94883
+ .style({
94884
+ visibility: 'hidden',
94885
+ position: 'absolute',
94886
+ 'font-size': _config.fontSize + 'px'
94887
+ })
94836
94888
  .text(cleanEscapesForTex(_texString));
94837
94889
 
94838
- return MathJax.Hub.Typeset(tmpDiv.node());
94839
- },
94840
- function() {
94841
- var glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');
94890
+ var tmpNode = tmpDiv.node();
94842
94891
 
94843
- if(tmpDiv.select('.MathJax_SVG').empty() || !tmpDiv.select('svg').node()) {
94892
+ return MathJaxVersion === 2 ?
94893
+ MathJax.Hub.Typeset(tmpNode) :
94894
+ MathJax.typeset([tmpNode]);
94895
+ };
94896
+
94897
+ var finalizeMathJax = function() {
94898
+ var sel = tmpDiv.select(
94899
+ MathJaxVersion === 2 ? '.MathJax_SVG' : '.MathJax'
94900
+ );
94901
+
94902
+ var node = !sel.empty() && tmpDiv.select('svg').node();
94903
+ if(!node) {
94844
94904
  Lib.log('There was an error in the tex syntax.', _texString);
94845
94905
  _callback();
94846
94906
  } else {
94847
- var svgBBox = tmpDiv.select('svg').node().getBoundingClientRect();
94848
- _callback(tmpDiv.select('.MathJax_SVG'), glyphDefs, svgBBox);
94907
+ var nodeBBox = node.getBoundingClientRect();
94908
+ var glyphDefs;
94909
+ if(MathJaxVersion === 2) {
94910
+ glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');
94911
+ } else {
94912
+ glyphDefs = sel.select('defs');
94913
+ }
94914
+ _callback(sel, glyphDefs, nodeBBox);
94849
94915
  }
94850
94916
 
94851
94917
  tmpDiv.remove();
94918
+ };
94852
94919
 
94920
+ var resetRenderer2 = function() {
94853
94921
  if(originalRenderer !== 'SVG') {
94854
94922
  return MathJax.Hub.setRenderer(originalRenderer);
94855
94923
  }
94856
- },
94857
- function() {
94924
+ };
94925
+
94926
+ var resetRenderer3 = function() {
94927
+ if(originalRenderer !== 'svg') {
94928
+ MathJax.config.startup.output = originalRenderer;
94929
+ }
94930
+ };
94931
+
94932
+ var resetConfig2 = function() {
94858
94933
  if(originalProcessSectionDelay !== undefined) {
94859
94934
  MathJax.Hub.processSectionDelay = originalProcessSectionDelay;
94860
94935
  }
94861
94936
  return MathJax.Hub.Config(originalConfig);
94862
- });
94937
+ };
94938
+
94939
+ var resetConfig3 = function() {
94940
+ MathJax.config = originalConfig;
94941
+ };
94942
+
94943
+ if(MathJaxVersion === 2) {
94944
+ MathJax.Hub.Queue(
94945
+ setConfig2,
94946
+ setRenderer2,
94947
+ initiateMathJax,
94948
+ finalizeMathJax,
94949
+ resetRenderer2,
94950
+ resetConfig2
94951
+ );
94952
+ } else if(MathJaxVersion === 3) {
94953
+ setConfig3();
94954
+ setRenderer3();
94955
+ MathJax.startup.defaultReady();
94956
+
94957
+ MathJax.startup.promise.then(function() {
94958
+ initiateMathJax();
94959
+ finalizeMathJax();
94960
+
94961
+ resetRenderer3();
94962
+ resetConfig3();
94963
+ });
94964
+ }
94863
94965
  }
94864
94966
 
94865
94967
  var TAG_STYLES = {
@@ -100679,6 +100781,11 @@ var configAttributes = {
100679
100781
  dflt: false,
100680
100782
  },
100681
100783
 
100784
+ typesetMath: {
100785
+ valType: 'boolean',
100786
+ dflt: true,
100787
+ },
100788
+
100682
100789
  plotlyServerURL: {
100683
100790
  valType: 'string',
100684
100791
  dflt: '',
@@ -105524,7 +105631,8 @@ axes.calcTicks = function calcTicks(ax, opts) {
105524
105631
  var minRange = Math.min(rng[0], rng[1]);
105525
105632
  var maxRange = Math.max(rng[0], rng[1]);
105526
105633
 
105527
- var isDLog = (ax.type === 'log') && !(isNumeric(ax.dtick) || ax.dtick.charAt(0) === 'L');
105634
+ var numDtick = isNumeric(ax.dtick);
105635
+ var isDLog = (ax.type === 'log') && !(numDtick || ax.dtick.charAt(0) === 'L');
105528
105636
  var isPeriod = ax.ticklabelmode === 'period';
105529
105637
 
105530
105638
  // find the first tick
@@ -105555,13 +105663,36 @@ axes.calcTicks = function calcTicks(ax, opts) {
105555
105663
  x = axes.tickIncrement(x, ax.dtick, !axrev, ax.calendar);
105556
105664
  }
105557
105665
 
105666
+ var ticklabelstep = ax.ticklabelstep;
105667
+
105558
105668
  var maxTicks = Math.max(1000, ax._length || 0);
105559
105669
  var tickVals = [];
105560
105670
  var xPrevious = null;
105671
+
105672
+ var dTick;
105673
+ if(numDtick) {
105674
+ dTick = ax.dtick;
105675
+ } else {
105676
+ if(ax.type === 'date') {
105677
+ if(typeof ax.dtick === 'string' && ax.dtick.charAt(0) === 'M') {
105678
+ dTick = ONEAVGMONTH * ax.dtick.substring(1);
105679
+ }
105680
+ } else {
105681
+ dTick = ax._roughDTick;
105682
+ }
105683
+ }
105684
+
105685
+ var id = Math.round((
105686
+ ax.r2l(x) -
105687
+ ax.r2l(ax.tick0)
105688
+ ) / dTick) - 1;
105689
+
105561
105690
  for(;
105562
105691
  (axrev) ? (x >= endTick) : (x <= endTick);
105563
105692
  x = axes.tickIncrement(x, ax.dtick, axrev, ax.calendar)
105564
105693
  ) {
105694
+ id++;
105695
+
105565
105696
  if(ax.rangebreaks) {
105566
105697
  if(!axrev) {
105567
105698
  if(x < startTick) continue;
@@ -105579,10 +105710,16 @@ axes.calcTicks = function calcTicks(ax, opts) {
105579
105710
  minor = true;
105580
105711
  }
105581
105712
 
105582
- tickVals.push({
105713
+ var obj = {
105583
105714
  minor: minor,
105584
105715
  value: x
105585
- });
105716
+ };
105717
+
105718
+ if(ticklabelstep > 1 && id % ticklabelstep) {
105719
+ obj.skipLabel = true;
105720
+ }
105721
+
105722
+ tickVals.push(obj);
105586
105723
  }
105587
105724
 
105588
105725
  if(isPeriod) positionPeriodTicks(tickVals, ax, ax._definedDelta);
@@ -105635,12 +105772,20 @@ axes.calcTicks = function calcTicks(ax, opts) {
105635
105772
  ax._prevDateHead = '';
105636
105773
  ax._inCalcTicks = true;
105637
105774
 
105775
+ var lastVisibleHead;
105776
+ var hideLabel = function(tick) {
105777
+ tick.text = ' '; // don't use an empty string here which can confuse automargin (issue 5132)
105778
+ ax._prevDateHead = lastVisibleHead;
105779
+ };
105780
+
105638
105781
  var ticksOut = [];
105639
105782
  var t, p;
105640
105783
  for(i = 0; i < tickVals.length; i++) {
105641
105784
  var _minor = tickVals[i].minor;
105642
105785
  var _value = tickVals[i].value;
105643
105786
 
105787
+ lastVisibleHead = ax._prevDateHead;
105788
+
105644
105789
  t = axes.tickText(
105645
105790
  ax,
105646
105791
  _value,
@@ -105655,11 +105800,14 @@ axes.calcTicks = function calcTicks(ax, opts) {
105655
105800
  if(p > maxRange) t.periodX = maxRange;
105656
105801
  if(p < minRange) t.periodX = minRange;
105657
105802
 
105658
- t.text = ' '; // don't use an empty string here which can confuse automargin (issue 5132)
105659
- ax._prevDateHead = '';
105803
+ hideLabel(t);
105660
105804
  }
105661
105805
  }
105662
105806
 
105807
+ if(tickVals[i].skipLabel) {
105808
+ hideLabel(t);
105809
+ }
105810
+
105663
105811
  ticksOut.push(t);
105664
105812
  }
105665
105813
 
@@ -107687,6 +107835,7 @@ axes.drawLabels = function(gd, ax, opts) {
107687
107835
  var axId = ax._id;
107688
107836
  var axLetter = axId.charAt(0);
107689
107837
  var cls = opts.cls || axId + 'tick';
107838
+
107690
107839
  var vals = opts.vals;
107691
107840
 
107692
107841
  var labelFns = opts.labelFns;
@@ -112543,6 +112692,12 @@ module.exports = {
112543
112692
  editType: 'ticks',
112544
112693
  impliedEdits: {tickmode: 'linear'},
112545
112694
  },
112695
+ ticklabelstep: {
112696
+ valType: 'integer',
112697
+ min: 1,
112698
+ dflt: 1,
112699
+ editType: 'ticks',
112700
+ },
112546
112701
  tickvals: {
112547
112702
  valType: 'data_array',
112548
112703
  editType: 'ticks',
@@ -115407,6 +115562,14 @@ module.exports = function handleTickLabelDefaults(containerIn, containerOut, coe
115407
115562
  color: dfltFontColor
115408
115563
  });
115409
115564
 
115565
+ if(
115566
+ !options.noTicklabelstep &&
115567
+ axType !== 'multicategory' &&
115568
+ axType !== 'log'
115569
+ ) {
115570
+ coerce('ticklabelstep');
115571
+ }
115572
+
115410
115573
  if(!options.noAng) coerce('tickangle');
115411
115574
 
115412
115575
  if(axType !== 'category') {
@@ -123454,7 +123617,7 @@ module.exports = function toSVG(gd, format, scale) {
123454
123617
  var toppaper = fullLayout._toppaper;
123455
123618
  var width = fullLayout.width;
123456
123619
  var height = fullLayout.height;
123457
- var i, k;
123620
+ var i;
123458
123621
 
123459
123622
  // make background color a rect in the svg, then revert after scraping
123460
123623
  // all other alterations have been dealt with by properly preparing the svg
@@ -123527,32 +123690,21 @@ module.exports = function toSVG(gd, format, scale) {
123527
123690
  }
123528
123691
  });
123529
123692
 
123530
- var queryParts = [];
123531
- if(fullLayout._gradientUrlQueryParts) {
123532
- for(k in fullLayout._gradientUrlQueryParts) queryParts.push(k);
123533
- }
123534
-
123535
- if(fullLayout._patternUrlQueryParts) {
123536
- for(k in fullLayout._patternUrlQueryParts) queryParts.push(k);
123537
- }
123538
-
123539
- if(queryParts.length) {
123540
- svg.selectAll(queryParts.join(',')).each(function() {
123541
- var pt = d3.select(this);
123693
+ svg.selectAll('.gradient_filled,.pattern_filled').each(function() {
123694
+ var pt = d3.select(this);
123542
123695
 
123543
- // similar to font family styles above,
123544
- // we must remove " after the SVG DOM has been serialized
123545
- var fill = this.style.fill;
123546
- if(fill && fill.indexOf('url(') !== -1) {
123547
- pt.style('fill', fill.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
123548
- }
123696
+ // similar to font family styles above,
123697
+ // we must remove " after the SVG DOM has been serialized
123698
+ var fill = this.style.fill;
123699
+ if(fill && fill.indexOf('url(') !== -1) {
123700
+ pt.style('fill', fill.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
123701
+ }
123549
123702
 
123550
- var stroke = this.style.stroke;
123551
- if(stroke && stroke.indexOf('url(') !== -1) {
123552
- pt.style('stroke', stroke.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
123553
- }
123554
- });
123555
- }
123703
+ var stroke = this.style.stroke;
123704
+ if(stroke && stroke.indexOf('url(') !== -1) {
123705
+ pt.style('stroke', stroke.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
123706
+ }
123707
+ });
123556
123708
 
123557
123709
  if(format === 'pdf' || format === 'eps') {
123558
123710
  // these formats make the extra line MathJax adds around symbols look super thick in some cases
@@ -124891,6 +125043,7 @@ var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplat
124891
125043
  var colorScaleAttrs = _dereq_('../../components/colorscale/attributes');
124892
125044
  var fontAttrs = _dereq_('../../plots/font_attributes');
124893
125045
  var dash = _dereq_('../../components/drawing/attributes').dash;
125046
+ var pattern = _dereq_('../../components/drawing/attributes').pattern;
124894
125047
 
124895
125048
  var Drawing = _dereq_('../../components/drawing');
124896
125049
  var constants = _dereq_('./constants');
@@ -125078,6 +125231,7 @@ module.exports = {
125078
125231
  editType: 'style',
125079
125232
  anim: true,
125080
125233
  },
125234
+ fillpattern: pattern,
125081
125235
  marker: extendFlat({
125082
125236
  symbol: {
125083
125237
  valType: 'enumerated',
@@ -125814,6 +125968,7 @@ var handleLineDefaults = _dereq_('./line_defaults');
125814
125968
  var handleLineShapeDefaults = _dereq_('./line_shape_defaults');
125815
125969
  var handleTextDefaults = _dereq_('./text_defaults');
125816
125970
  var handleFillColorDefaults = _dereq_('./fillcolor_defaults');
125971
+ var coercePattern = _dereq_('../../lib').coercePattern;
125817
125972
 
125818
125973
  module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
125819
125974
  function coerce(attr, dflt) {
@@ -125867,6 +126022,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
125867
126022
  if(traceOut.fill !== 'none') {
125868
126023
  handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);
125869
126024
  if(!subTypes.hasLines(traceOut)) handleLineShapeDefaults(traceIn, traceOut, coerce);
126025
+ coercePattern(coerce, 'fillpattern', traceOut.fillcolor, false);
125870
126026
  }
125871
126027
 
125872
126028
  var lineColor = (traceOut.line || {}).color;
@@ -127249,11 +127405,11 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
127249
127405
  // the points on the axes are the first two points. Otherwise
127250
127406
  // animations get a little crazy if the number of points changes.
127251
127407
  transition(ownFillEl3).attr('d', 'M' + pt1 + 'L' + pt0 + 'L' + fullpath.substr(1))
127252
- .call(Drawing.singleFillStyle);
127408
+ .call(Drawing.singleFillStyle, gd);
127253
127409
  } else {
127254
127410
  // fill to self: just join the path to itself
127255
127411
  transition(ownFillEl3).attr('d', fullpath + 'Z')
127256
- .call(Drawing.singleFillStyle);
127412
+ .call(Drawing.singleFillStyle, gd);
127257
127413
  }
127258
127414
  }
127259
127415
  } else if(tonext) {
@@ -127265,7 +127421,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
127265
127421
  // This makes strange results if one path is *not* entirely
127266
127422
  // inside the other, but then that is a strange usage.
127267
127423
  transition(tonext).attr('d', fullpath + 'Z' + prevRevpath + 'Z')
127268
- .call(Drawing.singleFillStyle);
127424
+ .call(Drawing.singleFillStyle, gd);
127269
127425
  } else {
127270
127426
  // tonextx/y: for now just connect endpoints with lines. This is
127271
127427
  // the correct behavior if the endpoints are at the same value of
@@ -127273,7 +127429,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
127273
127429
  // things depending on whether the new endpoint projects onto the
127274
127430
  // existing curve or off the end of it
127275
127431
  transition(tonext).attr('d', fullpath + 'L' + prevRevpath.substr(1) + 'Z')
127276
- .call(Drawing.singleFillStyle);
127432
+ .call(Drawing.singleFillStyle, gd);
127277
127433
  }
127278
127434
  trace._polygons = trace._polygons.concat(prevPolygons);
127279
127435
  } else {
@@ -127666,7 +127822,7 @@ function style(gd) {
127666
127822
  .call(Drawing.lineGroupStyle);
127667
127823
 
127668
127824
  s.selectAll('g.trace path.js-fill')
127669
- .call(Drawing.fillGroupStyle);
127825
+ .call(Drawing.fillGroupStyle, gd);
127670
127826
 
127671
127827
  Registry.getComponentMethod('errorbars', 'style')(s);
127672
127828
  }
@@ -129839,7 +129995,7 @@ function getSortFunc(opts, d2c) {
129839
129995
  'use strict';
129840
129996
 
129841
129997
  // package version injected by `npm run preprocess`
129842
- exports.version = '2.8.2';
129998
+ exports.version = '2.10.0';
129843
129999
 
129844
130000
  },{}]},{},[9])(9)
129845
130001
  });