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 (gl3d) v2.8.2
3
- * Copyright 2012-2021, Plotly, Inc.
2
+ * plotly.js (gl3d) v2.10.0
3
+ * Copyright 2012-2022, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
6
6
  */
@@ -22350,6 +22350,7 @@ module.exports = overrideAll({
22350
22350
  ticklen: axesAttrs.ticklen,
22351
22351
  tickwidth: axesAttrs.tickwidth,
22352
22352
  tickcolor: axesAttrs.tickcolor,
22353
+ ticklabelstep: axesAttrs.ticklabelstep,
22353
22354
  showticklabels: axesAttrs.showticklabels,
22354
22355
  tickfont: fontAttrs({
22355
22356
  }),
@@ -23440,6 +23441,7 @@ function mockColorBarAxis(gd, opts, zrange) {
23440
23441
  showticklabels: opts.showticklabels,
23441
23442
  ticklabelposition: opts.ticklabelposition,
23442
23443
  ticklabeloverflow: opts.ticklabeloverflow,
23444
+ ticklabelstep: opts.ticklabelstep,
23443
23445
  tickfont: opts.tickfont,
23444
23446
  tickangle: opts.tickangle,
23445
23447
  tickformat: opts.tickformat,
@@ -25178,24 +25180,42 @@ drawing.dashStyle = function(dash, lineWidth) {
25178
25180
  return dash;
25179
25181
  };
25180
25182
 
25183
+ function setFillStyle(sel, trace, gd) {
25184
+ var markerPattern = trace.fillpattern;
25185
+ var patternShape = markerPattern && drawing.getPatternAttr(markerPattern.shape, 0, '');
25186
+ if(patternShape) {
25187
+ var patternBGColor = drawing.getPatternAttr(markerPattern.bgcolor, 0, null);
25188
+ var patternFGColor = drawing.getPatternAttr(markerPattern.fgcolor, 0, null);
25189
+ var patternFGOpacity = markerPattern.fgopacity;
25190
+ var patternSize = drawing.getPatternAttr(markerPattern.size, 0, 8);
25191
+ var patternSolidity = drawing.getPatternAttr(markerPattern.solidity, 0, 0.3);
25192
+ var patternID = trace.uid;
25193
+ drawing.pattern(sel, 'point', gd, patternID,
25194
+ patternShape, patternSize, patternSolidity,
25195
+ undefined, markerPattern.fillmode,
25196
+ patternBGColor, patternFGColor, patternFGOpacity
25197
+ );
25198
+ } else if(trace.fillcolor) {
25199
+ sel.call(Color.fill, trace.fillcolor);
25200
+ }
25201
+ }
25202
+
25181
25203
  // Same as fillGroupStyle, except in this case the selection may be a transition
25182
- drawing.singleFillStyle = function(sel) {
25204
+ drawing.singleFillStyle = function(sel, gd) {
25183
25205
  var node = d3.select(sel.node());
25184
25206
  var data = node.data();
25185
- var fillcolor = (((data[0] || [])[0] || {}).trace || {}).fillcolor;
25186
- if(fillcolor) {
25187
- sel.call(Color.fill, fillcolor);
25188
- }
25207
+ var trace = ((data[0] || [])[0] || {}).trace || {};
25208
+ setFillStyle(sel, trace, gd);
25189
25209
  };
25190
25210
 
25191
- drawing.fillGroupStyle = function(s) {
25211
+ drawing.fillGroupStyle = function(s, gd) {
25192
25212
  s.style('stroke-width', 0)
25193
25213
  .each(function(d) {
25194
25214
  var shape = d3.select(this);
25195
25215
  // N.B. 'd' won't be a calcdata item when
25196
25216
  // fill !== 'none' on a segment-less and marker-less trace
25197
25217
  if(d[0].trace) {
25198
- shape.call(Color.fill, d[0].trace.fillcolor);
25218
+ setFillStyle(shape, d[0].trace, gd);
25199
25219
  }
25200
25220
  });
25201
25221
  };
@@ -25348,12 +25368,7 @@ drawing.gradient = function(sel, gd, gradientID, type, colorscale, prop) {
25348
25368
  sel.style(prop, getFullUrl(fullID, gd))
25349
25369
  .style(prop + '-opacity', null);
25350
25370
 
25351
- var className2query = function(s) {
25352
- return '.' + s.attr('class').replace(/\s/g, '.');
25353
- };
25354
- var k = className2query(d3.select(sel.node().parentNode)) +
25355
- '>' + className2query(sel);
25356
- fullLayout._gradientUrlQueryParts[k] = 1;
25371
+ sel.classed('gradient_filled', true);
25357
25372
  };
25358
25373
 
25359
25374
  /**
@@ -25560,11 +25575,6 @@ drawing.pattern = function(sel, calledBy, gd, patternID, shape, size, solidity,
25560
25575
  .style('fill-opacity', null);
25561
25576
 
25562
25577
  sel.classed('pattern_filled', true);
25563
- var className2query = function(s) {
25564
- return '.' + s.attr('class').replace(/\s/g, '.');
25565
- };
25566
- var k = className2query(d3.select(sel.node().parentNode)) + '>.pattern_filled';
25567
- fullLayout._patternUrlQueryParts[k] = 1;
25568
25578
  };
25569
25579
 
25570
25580
  /*
@@ -25580,9 +25590,7 @@ drawing.initGradients = function(gd) {
25580
25590
  var gradientsGroup = Lib.ensureSingle(fullLayout._defs, 'g', 'gradients');
25581
25591
  gradientsGroup.selectAll('linearGradient,radialGradient').remove();
25582
25592
 
25583
- // initialize stash of query parts filled in Drawing.gradient,
25584
- // used to fix URL strings during image exports
25585
- fullLayout._gradientUrlQueryParts = {};
25593
+ d3.select(gd).selectAll('.gradient_filled').classed('gradient_filled', false);
25586
25594
  };
25587
25595
 
25588
25596
  drawing.initPatterns = function(gd) {
@@ -25591,9 +25599,7 @@ drawing.initPatterns = function(gd) {
25591
25599
  var patternsGroup = Lib.ensureSingle(fullLayout._defs, 'g', 'patterns');
25592
25600
  patternsGroup.selectAll('pattern').remove();
25593
25601
 
25594
- // initialize stash of query parts filled in Drawing.pattern,
25595
- // used to fix URL strings during image exports
25596
- fullLayout._patternUrlQueryParts = {};
25602
+ d3.select(gd).selectAll('.pattern_filled').classed('pattern_filled', false);
25597
25603
  };
25598
25604
 
25599
25605
  drawing.getPatternAttr = function(mp, i, dflt) {
@@ -32246,7 +32252,6 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
32246
32252
  offsetY += h;
32247
32253
  maxWidthInGroup = Math.max(maxWidthInGroup, textGap + w);
32248
32254
  });
32249
- maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);
32250
32255
 
32251
32256
  var next = maxWidthInGroup + itemGap;
32252
32257
 
@@ -32262,6 +32267,8 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
32262
32267
  groupOffsetX = 0;
32263
32268
  groupOffsetY += maxGroupHeightInRow + traceGroupGap;
32264
32269
  maxGroupHeightInRow = offsetY;
32270
+ } else {
32271
+ maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);
32265
32272
  }
32266
32273
 
32267
32274
  Drawing.setTranslate(this, groupOffsetX, groupOffsetY);
@@ -32929,12 +32936,16 @@ module.exports = function style(s, gd, legend) {
32929
32936
  var colorscale = cOpts.colorscale;
32930
32937
  var reversescale = cOpts.reversescale;
32931
32938
 
32932
- var fillGradient = function(s) {
32939
+ var fillStyle = function(s) {
32933
32940
  if(s.size()) {
32934
- var gradientID = 'legendfill-' + trace.uid;
32935
- Drawing.gradient(s, gd, gradientID,
32936
- getGradientDirection(reversescale),
32937
- colorscale, 'fill');
32941
+ if(showFill) {
32942
+ Drawing.fillGroupStyle(s, gd);
32943
+ } else {
32944
+ var gradientID = 'legendfill-' + trace.uid;
32945
+ Drawing.gradient(s, gd, gradientID,
32946
+ getGradientDirection(reversescale),
32947
+ colorscale, 'fill');
32948
+ }
32938
32949
  }
32939
32950
  };
32940
32951
 
@@ -32963,7 +32974,7 @@ module.exports = function style(s, gd, legend) {
32963
32974
  fill.enter().append('path').classed('js-fill', true);
32964
32975
  fill.exit().remove();
32965
32976
  fill.attr('d', pathStart + 'h' + itemWidth + 'v6h-' + itemWidth + 'z')
32966
- .call(showFill ? Drawing.fillGroupStyle : fillGradient);
32977
+ .call(fillStyle);
32967
32978
 
32968
32979
  if(showLine || showGradientLine) {
32969
32980
  var lw = boundLineWidth(undefined, trace.line, MAX_LINE_WIDTH, CST_LINE_WIDTH);
@@ -34744,6 +34755,8 @@ var isNumeric = _dereq_('fast-isnumeric');
34744
34755
 
34745
34756
  var Lib = _dereq_('../../lib');
34746
34757
  var Icons = _dereq_('../../fonts/ploticon');
34758
+ var version = _dereq_('../../version').version;
34759
+
34747
34760
  var Parser = new DOMParser();
34748
34761
 
34749
34762
  /**
@@ -35022,6 +35035,10 @@ proto.hasButtons = function(buttons) {
35022
35035
  return true;
35023
35036
  };
35024
35037
 
35038
+ function jsVersion(str) {
35039
+ return str + ' (v' + version + ')';
35040
+ }
35041
+
35025
35042
  /**
35026
35043
  * @return {HTMLDivElement} The logo image wrapped in a group
35027
35044
  */
@@ -35031,7 +35048,7 @@ proto.getLogo = function() {
35031
35048
 
35032
35049
  a.href = 'https://plotly.com/';
35033
35050
  a.target = '_blank';
35034
- a.setAttribute('data-title', Lib._(this.graphInfo, 'Produced with Plotly'));
35051
+ a.setAttribute('data-title', jsVersion(Lib._(this.graphInfo, 'Produced with Plotly.js')));
35035
35052
  a.className = 'modebar-btn plotlyjsicon modebar-btn--logo';
35036
35053
 
35037
35054
  a.appendChild(this.createIcon(Icons.newplotlylogo));
@@ -35073,7 +35090,7 @@ function createModeBar(gd, buttons) {
35073
35090
 
35074
35091
  module.exports = createModeBar;
35075
35092
 
35076
- },{"../../fonts/ploticon":234,"../../lib":252,"@plotly/d3":16,"fast-isnumeric":31}],185:[function(_dereq_,module,exports){
35093
+ },{"../../fonts/ploticon":234,"../../lib":252,"../../version":434,"@plotly/d3":16,"fast-isnumeric":31}],185:[function(_dereq_,module,exports){
35077
35094
  'use strict';
35078
35095
 
35079
35096
  var fontAttrs = _dereq_('../../plots/font_attributes');
@@ -47770,6 +47787,7 @@ exports.convertToTspans = function(_context, gd, _callback) {
47770
47787
  // Until we get tex integrated more fully (so it can be used along with non-tex)
47771
47788
  // allow some elements to prohibit it by attaching 'data-notex' to the original
47772
47789
  var tex = (!_context.attr('data-notex')) &&
47790
+ gd && gd._context.typesetMath &&
47773
47791
  (typeof MathJax !== 'undefined') &&
47774
47792
  str.match(FIND_TEX);
47775
47793
 
@@ -47924,70 +47942,154 @@ function cleanEscapesForTex(s) {
47924
47942
  .replace(GT_MATCH, '\\gt ');
47925
47943
  }
47926
47944
 
47945
+ var inlineMath = [['$', '$'], ['\\(', '\\)']];
47946
+
47927
47947
  function texToSVG(_texString, _config, _callback) {
47948
+ var MathJaxVersion = parseInt(
47949
+ (MathJax.version || '').split('.')[0]
47950
+ );
47951
+
47952
+ if(
47953
+ MathJaxVersion !== 2 &&
47954
+ MathJaxVersion !== 3
47955
+ ) {
47956
+ Lib.warn('No MathJax version:', MathJax.version);
47957
+ return;
47958
+ }
47959
+
47928
47960
  var originalRenderer,
47929
47961
  originalConfig,
47930
47962
  originalProcessSectionDelay,
47931
47963
  tmpDiv;
47932
47964
 
47933
- MathJax.Hub.Queue(
47934
- function() {
47965
+ var setConfig2 = function() {
47935
47966
  originalConfig = Lib.extendDeepAll({}, MathJax.Hub.config);
47936
47967
 
47937
47968
  originalProcessSectionDelay = MathJax.Hub.processSectionDelay;
47938
47969
  if(MathJax.Hub.processSectionDelay !== undefined) {
47939
- // MathJax 2.5+
47970
+ // MathJax 2.5+ but not 3+
47940
47971
  MathJax.Hub.processSectionDelay = 0;
47941
47972
  }
47942
47973
 
47943
47974
  return MathJax.Hub.Config({
47944
47975
  messageStyle: 'none',
47945
47976
  tex2jax: {
47946
- inlineMath: [['$', '$'], ['\\(', '\\)']]
47977
+ inlineMath: inlineMath
47947
47978
  },
47948
47979
  displayAlign: 'left',
47949
47980
  });
47950
- },
47951
- function() {
47952
- // Get original renderer
47981
+ };
47982
+
47983
+ var setConfig3 = function() {
47984
+ originalConfig = Lib.extendDeepAll({}, MathJax.config);
47985
+
47986
+ if(!MathJax.config.tex) {
47987
+ MathJax.config.tex = {};
47988
+ }
47989
+
47990
+ MathJax.config.tex.inlineMath = inlineMath;
47991
+ };
47992
+
47993
+ var setRenderer2 = function() {
47953
47994
  originalRenderer = MathJax.Hub.config.menuSettings.renderer;
47954
47995
  if(originalRenderer !== 'SVG') {
47955
47996
  return MathJax.Hub.setRenderer('SVG');
47956
47997
  }
47957
- },
47958
- function() {
47998
+ };
47999
+
48000
+ var setRenderer3 = function() {
48001
+ originalRenderer = MathJax.config.startup.output;
48002
+ if(originalRenderer !== 'svg') {
48003
+ MathJax.config.startup.output = 'svg';
48004
+ }
48005
+ };
48006
+
48007
+ var initiateMathJax = function() {
47959
48008
  var randomID = 'math-output-' + Lib.randstr({}, 64);
47960
48009
  tmpDiv = d3.select('body').append('div')
47961
48010
  .attr({id: randomID})
47962
- .style({visibility: 'hidden', position: 'absolute'})
47963
- .style({'font-size': _config.fontSize + 'px'})
48011
+ .style({
48012
+ visibility: 'hidden',
48013
+ position: 'absolute',
48014
+ 'font-size': _config.fontSize + 'px'
48015
+ })
47964
48016
  .text(cleanEscapesForTex(_texString));
47965
48017
 
47966
- return MathJax.Hub.Typeset(tmpDiv.node());
47967
- },
47968
- function() {
47969
- var glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');
48018
+ var tmpNode = tmpDiv.node();
47970
48019
 
47971
- if(tmpDiv.select('.MathJax_SVG').empty() || !tmpDiv.select('svg').node()) {
48020
+ return MathJaxVersion === 2 ?
48021
+ MathJax.Hub.Typeset(tmpNode) :
48022
+ MathJax.typeset([tmpNode]);
48023
+ };
48024
+
48025
+ var finalizeMathJax = function() {
48026
+ var sel = tmpDiv.select(
48027
+ MathJaxVersion === 2 ? '.MathJax_SVG' : '.MathJax'
48028
+ );
48029
+
48030
+ var node = !sel.empty() && tmpDiv.select('svg').node();
48031
+ if(!node) {
47972
48032
  Lib.log('There was an error in the tex syntax.', _texString);
47973
48033
  _callback();
47974
48034
  } else {
47975
- var svgBBox = tmpDiv.select('svg').node().getBoundingClientRect();
47976
- _callback(tmpDiv.select('.MathJax_SVG'), glyphDefs, svgBBox);
48035
+ var nodeBBox = node.getBoundingClientRect();
48036
+ var glyphDefs;
48037
+ if(MathJaxVersion === 2) {
48038
+ glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');
48039
+ } else {
48040
+ glyphDefs = sel.select('defs');
48041
+ }
48042
+ _callback(sel, glyphDefs, nodeBBox);
47977
48043
  }
47978
48044
 
47979
48045
  tmpDiv.remove();
48046
+ };
47980
48047
 
48048
+ var resetRenderer2 = function() {
47981
48049
  if(originalRenderer !== 'SVG') {
47982
48050
  return MathJax.Hub.setRenderer(originalRenderer);
47983
48051
  }
47984
- },
47985
- function() {
48052
+ };
48053
+
48054
+ var resetRenderer3 = function() {
48055
+ if(originalRenderer !== 'svg') {
48056
+ MathJax.config.startup.output = originalRenderer;
48057
+ }
48058
+ };
48059
+
48060
+ var resetConfig2 = function() {
47986
48061
  if(originalProcessSectionDelay !== undefined) {
47987
48062
  MathJax.Hub.processSectionDelay = originalProcessSectionDelay;
47988
48063
  }
47989
48064
  return MathJax.Hub.Config(originalConfig);
47990
- });
48065
+ };
48066
+
48067
+ var resetConfig3 = function() {
48068
+ MathJax.config = originalConfig;
48069
+ };
48070
+
48071
+ if(MathJaxVersion === 2) {
48072
+ MathJax.Hub.Queue(
48073
+ setConfig2,
48074
+ setRenderer2,
48075
+ initiateMathJax,
48076
+ finalizeMathJax,
48077
+ resetRenderer2,
48078
+ resetConfig2
48079
+ );
48080
+ } else if(MathJaxVersion === 3) {
48081
+ setConfig3();
48082
+ setRenderer3();
48083
+ MathJax.startup.defaultReady();
48084
+
48085
+ MathJax.startup.promise.then(function() {
48086
+ initiateMathJax();
48087
+ finalizeMathJax();
48088
+
48089
+ resetRenderer3();
48090
+ resetConfig3();
48091
+ });
48092
+ }
47991
48093
  }
47992
48094
 
47993
48095
  var TAG_STYLES = {
@@ -53807,6 +53909,11 @@ var configAttributes = {
53807
53909
  dflt: false,
53808
53910
  },
53809
53911
 
53912
+ typesetMath: {
53913
+ valType: 'boolean',
53914
+ dflt: true,
53915
+ },
53916
+
53810
53917
  plotlyServerURL: {
53811
53918
  valType: 'string',
53812
53919
  dflt: '',
@@ -58652,7 +58759,8 @@ axes.calcTicks = function calcTicks(ax, opts) {
58652
58759
  var minRange = Math.min(rng[0], rng[1]);
58653
58760
  var maxRange = Math.max(rng[0], rng[1]);
58654
58761
 
58655
- var isDLog = (ax.type === 'log') && !(isNumeric(ax.dtick) || ax.dtick.charAt(0) === 'L');
58762
+ var numDtick = isNumeric(ax.dtick);
58763
+ var isDLog = (ax.type === 'log') && !(numDtick || ax.dtick.charAt(0) === 'L');
58656
58764
  var isPeriod = ax.ticklabelmode === 'period';
58657
58765
 
58658
58766
  // find the first tick
@@ -58683,13 +58791,36 @@ axes.calcTicks = function calcTicks(ax, opts) {
58683
58791
  x = axes.tickIncrement(x, ax.dtick, !axrev, ax.calendar);
58684
58792
  }
58685
58793
 
58794
+ var ticklabelstep = ax.ticklabelstep;
58795
+
58686
58796
  var maxTicks = Math.max(1000, ax._length || 0);
58687
58797
  var tickVals = [];
58688
58798
  var xPrevious = null;
58799
+
58800
+ var dTick;
58801
+ if(numDtick) {
58802
+ dTick = ax.dtick;
58803
+ } else {
58804
+ if(ax.type === 'date') {
58805
+ if(typeof ax.dtick === 'string' && ax.dtick.charAt(0) === 'M') {
58806
+ dTick = ONEAVGMONTH * ax.dtick.substring(1);
58807
+ }
58808
+ } else {
58809
+ dTick = ax._roughDTick;
58810
+ }
58811
+ }
58812
+
58813
+ var id = Math.round((
58814
+ ax.r2l(x) -
58815
+ ax.r2l(ax.tick0)
58816
+ ) / dTick) - 1;
58817
+
58689
58818
  for(;
58690
58819
  (axrev) ? (x >= endTick) : (x <= endTick);
58691
58820
  x = axes.tickIncrement(x, ax.dtick, axrev, ax.calendar)
58692
58821
  ) {
58822
+ id++;
58823
+
58693
58824
  if(ax.rangebreaks) {
58694
58825
  if(!axrev) {
58695
58826
  if(x < startTick) continue;
@@ -58707,10 +58838,16 @@ axes.calcTicks = function calcTicks(ax, opts) {
58707
58838
  minor = true;
58708
58839
  }
58709
58840
 
58710
- tickVals.push({
58841
+ var obj = {
58711
58842
  minor: minor,
58712
58843
  value: x
58713
- });
58844
+ };
58845
+
58846
+ if(ticklabelstep > 1 && id % ticklabelstep) {
58847
+ obj.skipLabel = true;
58848
+ }
58849
+
58850
+ tickVals.push(obj);
58714
58851
  }
58715
58852
 
58716
58853
  if(isPeriod) positionPeriodTicks(tickVals, ax, ax._definedDelta);
@@ -58763,12 +58900,20 @@ axes.calcTicks = function calcTicks(ax, opts) {
58763
58900
  ax._prevDateHead = '';
58764
58901
  ax._inCalcTicks = true;
58765
58902
 
58903
+ var lastVisibleHead;
58904
+ var hideLabel = function(tick) {
58905
+ tick.text = ' '; // don't use an empty string here which can confuse automargin (issue 5132)
58906
+ ax._prevDateHead = lastVisibleHead;
58907
+ };
58908
+
58766
58909
  var ticksOut = [];
58767
58910
  var t, p;
58768
58911
  for(i = 0; i < tickVals.length; i++) {
58769
58912
  var _minor = tickVals[i].minor;
58770
58913
  var _value = tickVals[i].value;
58771
58914
 
58915
+ lastVisibleHead = ax._prevDateHead;
58916
+
58772
58917
  t = axes.tickText(
58773
58918
  ax,
58774
58919
  _value,
@@ -58783,11 +58928,14 @@ axes.calcTicks = function calcTicks(ax, opts) {
58783
58928
  if(p > maxRange) t.periodX = maxRange;
58784
58929
  if(p < minRange) t.periodX = minRange;
58785
58930
 
58786
- t.text = ' '; // don't use an empty string here which can confuse automargin (issue 5132)
58787
- ax._prevDateHead = '';
58931
+ hideLabel(t);
58788
58932
  }
58789
58933
  }
58790
58934
 
58935
+ if(tickVals[i].skipLabel) {
58936
+ hideLabel(t);
58937
+ }
58938
+
58791
58939
  ticksOut.push(t);
58792
58940
  }
58793
58941
 
@@ -60815,6 +60963,7 @@ axes.drawLabels = function(gd, ax, opts) {
60815
60963
  var axId = ax._id;
60816
60964
  var axLetter = axId.charAt(0);
60817
60965
  var cls = opts.cls || axId + 'tick';
60966
+
60818
60967
  var vals = opts.vals;
60819
60968
 
60820
60969
  var labelFns = opts.labelFns;
@@ -65671,6 +65820,12 @@ module.exports = {
65671
65820
  editType: 'ticks',
65672
65821
  impliedEdits: {tickmode: 'linear'},
65673
65822
  },
65823
+ ticklabelstep: {
65824
+ valType: 'integer',
65825
+ min: 1,
65826
+ dflt: 1,
65827
+ editType: 'ticks',
65828
+ },
65674
65829
  tickvals: {
65675
65830
  valType: 'data_array',
65676
65831
  editType: 'ticks',
@@ -68535,6 +68690,14 @@ module.exports = function handleTickLabelDefaults(containerIn, containerOut, coe
68535
68690
  color: dfltFontColor
68536
68691
  });
68537
68692
 
68693
+ if(
68694
+ !options.noTicklabelstep &&
68695
+ axType !== 'multicategory' &&
68696
+ axType !== 'log'
68697
+ ) {
68698
+ coerce('ticklabelstep');
68699
+ }
68700
+
68538
68701
  if(!options.noAng) coerce('tickangle');
68539
68702
 
68540
68703
  if(axType !== 'category') {
@@ -70000,6 +70163,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) {
70000
70163
  showGrid: true,
70001
70164
  noTickson: true,
70002
70165
  noTicklabelmode: true,
70166
+ noTicklabelstep: true,
70003
70167
  noTicklabelposition: true,
70004
70168
  noTicklabeloverflow: true,
70005
70169
  bgColor: options.bgColor,
@@ -76647,7 +76811,7 @@ module.exports = function toSVG(gd, format, scale) {
76647
76811
  var toppaper = fullLayout._toppaper;
76648
76812
  var width = fullLayout.width;
76649
76813
  var height = fullLayout.height;
76650
- var i, k;
76814
+ var i;
76651
76815
 
76652
76816
  // make background color a rect in the svg, then revert after scraping
76653
76817
  // all other alterations have been dealt with by properly preparing the svg
@@ -76720,32 +76884,21 @@ module.exports = function toSVG(gd, format, scale) {
76720
76884
  }
76721
76885
  });
76722
76886
 
76723
- var queryParts = [];
76724
- if(fullLayout._gradientUrlQueryParts) {
76725
- for(k in fullLayout._gradientUrlQueryParts) queryParts.push(k);
76726
- }
76727
-
76728
- if(fullLayout._patternUrlQueryParts) {
76729
- for(k in fullLayout._patternUrlQueryParts) queryParts.push(k);
76730
- }
76731
-
76732
- if(queryParts.length) {
76733
- svg.selectAll(queryParts.join(',')).each(function() {
76734
- var pt = d3.select(this);
76887
+ svg.selectAll('.gradient_filled,.pattern_filled').each(function() {
76888
+ var pt = d3.select(this);
76735
76889
 
76736
- // similar to font family styles above,
76737
- // we must remove " after the SVG DOM has been serialized
76738
- var fill = this.style.fill;
76739
- if(fill && fill.indexOf('url(') !== -1) {
76740
- pt.style('fill', fill.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
76741
- }
76890
+ // similar to font family styles above,
76891
+ // we must remove " after the SVG DOM has been serialized
76892
+ var fill = this.style.fill;
76893
+ if(fill && fill.indexOf('url(') !== -1) {
76894
+ pt.style('fill', fill.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
76895
+ }
76742
76896
 
76743
- var stroke = this.style.stroke;
76744
- if(stroke && stroke.indexOf('url(') !== -1) {
76745
- pt.style('stroke', stroke.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
76746
- }
76747
- });
76748
- }
76897
+ var stroke = this.style.stroke;
76898
+ if(stroke && stroke.indexOf('url(') !== -1) {
76899
+ pt.style('stroke', stroke.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
76900
+ }
76901
+ });
76749
76902
 
76750
76903
  if(format === 'pdf' || format === 'eps') {
76751
76904
  // these formats make the extra line MathJax adds around symbols look super thick in some cases
@@ -79387,6 +79540,7 @@ var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplat
79387
79540
  var colorScaleAttrs = _dereq_('../../components/colorscale/attributes');
79388
79541
  var fontAttrs = _dereq_('../../plots/font_attributes');
79389
79542
  var dash = _dereq_('../../components/drawing/attributes').dash;
79543
+ var pattern = _dereq_('../../components/drawing/attributes').pattern;
79390
79544
 
79391
79545
  var Drawing = _dereq_('../../components/drawing');
79392
79546
  var constants = _dereq_('./constants');
@@ -79574,6 +79728,7 @@ module.exports = {
79574
79728
  editType: 'style',
79575
79729
  anim: true,
79576
79730
  },
79731
+ fillpattern: pattern,
79577
79732
  marker: extendFlat({
79578
79733
  symbol: {
79579
79734
  valType: 'enumerated',
@@ -80310,6 +80465,7 @@ var handleLineDefaults = _dereq_('./line_defaults');
80310
80465
  var handleLineShapeDefaults = _dereq_('./line_shape_defaults');
80311
80466
  var handleTextDefaults = _dereq_('./text_defaults');
80312
80467
  var handleFillColorDefaults = _dereq_('./fillcolor_defaults');
80468
+ var coercePattern = _dereq_('../../lib').coercePattern;
80313
80469
 
80314
80470
  module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
80315
80471
  function coerce(attr, dflt) {
@@ -80363,6 +80519,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
80363
80519
  if(traceOut.fill !== 'none') {
80364
80520
  handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);
80365
80521
  if(!subTypes.hasLines(traceOut)) handleLineShapeDefaults(traceIn, traceOut, coerce);
80522
+ coercePattern(coerce, 'fillpattern', traceOut.fillcolor, false);
80366
80523
  }
80367
80524
 
80368
80525
  var lineColor = (traceOut.line || {}).color;
@@ -81745,11 +81902,11 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
81745
81902
  // the points on the axes are the first two points. Otherwise
81746
81903
  // animations get a little crazy if the number of points changes.
81747
81904
  transition(ownFillEl3).attr('d', 'M' + pt1 + 'L' + pt0 + 'L' + fullpath.substr(1))
81748
- .call(Drawing.singleFillStyle);
81905
+ .call(Drawing.singleFillStyle, gd);
81749
81906
  } else {
81750
81907
  // fill to self: just join the path to itself
81751
81908
  transition(ownFillEl3).attr('d', fullpath + 'Z')
81752
- .call(Drawing.singleFillStyle);
81909
+ .call(Drawing.singleFillStyle, gd);
81753
81910
  }
81754
81911
  }
81755
81912
  } else if(tonext) {
@@ -81761,7 +81918,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
81761
81918
  // This makes strange results if one path is *not* entirely
81762
81919
  // inside the other, but then that is a strange usage.
81763
81920
  transition(tonext).attr('d', fullpath + 'Z' + prevRevpath + 'Z')
81764
- .call(Drawing.singleFillStyle);
81921
+ .call(Drawing.singleFillStyle, gd);
81765
81922
  } else {
81766
81923
  // tonextx/y: for now just connect endpoints with lines. This is
81767
81924
  // the correct behavior if the endpoints are at the same value of
@@ -81769,7 +81926,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
81769
81926
  // things depending on whether the new endpoint projects onto the
81770
81927
  // existing curve or off the end of it
81771
81928
  transition(tonext).attr('d', fullpath + 'L' + prevRevpath.substr(1) + 'Z')
81772
- .call(Drawing.singleFillStyle);
81929
+ .call(Drawing.singleFillStyle, gd);
81773
81930
  }
81774
81931
  trace._polygons = trace._polygons.concat(prevPolygons);
81775
81932
  } else {
@@ -82162,7 +82319,7 @@ function style(gd) {
82162
82319
  .call(Drawing.lineGroupStyle);
82163
82320
 
82164
82321
  s.selectAll('g.trace path.js-fill')
82165
- .call(Drawing.fillGroupStyle);
82322
+ .call(Drawing.fillGroupStyle, gd);
82166
82323
 
82167
82324
  Registry.getComponentMethod('errorbars', 'style')(s);
82168
82325
  }
@@ -86285,7 +86442,7 @@ function getSortFunc(opts, d2c) {
86285
86442
  'use strict';
86286
86443
 
86287
86444
  // package version injected by `npm run preprocess`
86288
- exports.version = '2.8.2';
86445
+ exports.version = '2.10.0';
86289
86446
 
86290
86447
  },{}],435:[function(_dereq_,module,exports){
86291
86448
  (function (global){(function (){