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 (basic) v2.8.2
3
- * Copyright 2012-2021, Plotly, Inc.
2
+ * plotly.js (basic) v2.10.0
3
+ * Copyright 2012-2022, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
6
6
  */
@@ -21660,6 +21660,7 @@ module.exports = overrideAll({
21660
21660
  ticklen: axesAttrs.ticklen,
21661
21661
  tickwidth: axesAttrs.tickwidth,
21662
21662
  tickcolor: axesAttrs.tickcolor,
21663
+ ticklabelstep: axesAttrs.ticklabelstep,
21663
21664
  showticklabels: axesAttrs.showticklabels,
21664
21665
  tickfont: fontAttrs({
21665
21666
  }),
@@ -22750,6 +22751,7 @@ function mockColorBarAxis(gd, opts, zrange) {
22750
22751
  showticklabels: opts.showticklabels,
22751
22752
  ticklabelposition: opts.ticklabelposition,
22752
22753
  ticklabeloverflow: opts.ticklabeloverflow,
22754
+ ticklabelstep: opts.ticklabelstep,
22753
22755
  tickfont: opts.tickfont,
22754
22756
  tickangle: opts.tickangle,
22755
22757
  tickformat: opts.tickformat,
@@ -24488,24 +24490,42 @@ drawing.dashStyle = function(dash, lineWidth) {
24488
24490
  return dash;
24489
24491
  };
24490
24492
 
24493
+ function setFillStyle(sel, trace, gd) {
24494
+ var markerPattern = trace.fillpattern;
24495
+ var patternShape = markerPattern && drawing.getPatternAttr(markerPattern.shape, 0, '');
24496
+ if(patternShape) {
24497
+ var patternBGColor = drawing.getPatternAttr(markerPattern.bgcolor, 0, null);
24498
+ var patternFGColor = drawing.getPatternAttr(markerPattern.fgcolor, 0, null);
24499
+ var patternFGOpacity = markerPattern.fgopacity;
24500
+ var patternSize = drawing.getPatternAttr(markerPattern.size, 0, 8);
24501
+ var patternSolidity = drawing.getPatternAttr(markerPattern.solidity, 0, 0.3);
24502
+ var patternID = trace.uid;
24503
+ drawing.pattern(sel, 'point', gd, patternID,
24504
+ patternShape, patternSize, patternSolidity,
24505
+ undefined, markerPattern.fillmode,
24506
+ patternBGColor, patternFGColor, patternFGOpacity
24507
+ );
24508
+ } else if(trace.fillcolor) {
24509
+ sel.call(Color.fill, trace.fillcolor);
24510
+ }
24511
+ }
24512
+
24491
24513
  // Same as fillGroupStyle, except in this case the selection may be a transition
24492
- drawing.singleFillStyle = function(sel) {
24514
+ drawing.singleFillStyle = function(sel, gd) {
24493
24515
  var node = d3.select(sel.node());
24494
24516
  var data = node.data();
24495
- var fillcolor = (((data[0] || [])[0] || {}).trace || {}).fillcolor;
24496
- if(fillcolor) {
24497
- sel.call(Color.fill, fillcolor);
24498
- }
24517
+ var trace = ((data[0] || [])[0] || {}).trace || {};
24518
+ setFillStyle(sel, trace, gd);
24499
24519
  };
24500
24520
 
24501
- drawing.fillGroupStyle = function(s) {
24521
+ drawing.fillGroupStyle = function(s, gd) {
24502
24522
  s.style('stroke-width', 0)
24503
24523
  .each(function(d) {
24504
24524
  var shape = d3.select(this);
24505
24525
  // N.B. 'd' won't be a calcdata item when
24506
24526
  // fill !== 'none' on a segment-less and marker-less trace
24507
24527
  if(d[0].trace) {
24508
- shape.call(Color.fill, d[0].trace.fillcolor);
24528
+ setFillStyle(shape, d[0].trace, gd);
24509
24529
  }
24510
24530
  });
24511
24531
  };
@@ -24658,12 +24678,7 @@ drawing.gradient = function(sel, gd, gradientID, type, colorscale, prop) {
24658
24678
  sel.style(prop, getFullUrl(fullID, gd))
24659
24679
  .style(prop + '-opacity', null);
24660
24680
 
24661
- var className2query = function(s) {
24662
- return '.' + s.attr('class').replace(/\s/g, '.');
24663
- };
24664
- var k = className2query(d3.select(sel.node().parentNode)) +
24665
- '>' + className2query(sel);
24666
- fullLayout._gradientUrlQueryParts[k] = 1;
24681
+ sel.classed('gradient_filled', true);
24667
24682
  };
24668
24683
 
24669
24684
  /**
@@ -24870,11 +24885,6 @@ drawing.pattern = function(sel, calledBy, gd, patternID, shape, size, solidity,
24870
24885
  .style('fill-opacity', null);
24871
24886
 
24872
24887
  sel.classed('pattern_filled', true);
24873
- var className2query = function(s) {
24874
- return '.' + s.attr('class').replace(/\s/g, '.');
24875
- };
24876
- var k = className2query(d3.select(sel.node().parentNode)) + '>.pattern_filled';
24877
- fullLayout._patternUrlQueryParts[k] = 1;
24878
24888
  };
24879
24889
 
24880
24890
  /*
@@ -24890,9 +24900,7 @@ drawing.initGradients = function(gd) {
24890
24900
  var gradientsGroup = Lib.ensureSingle(fullLayout._defs, 'g', 'gradients');
24891
24901
  gradientsGroup.selectAll('linearGradient,radialGradient').remove();
24892
24902
 
24893
- // initialize stash of query parts filled in Drawing.gradient,
24894
- // used to fix URL strings during image exports
24895
- fullLayout._gradientUrlQueryParts = {};
24903
+ d3.select(gd).selectAll('.gradient_filled').classed('gradient_filled', false);
24896
24904
  };
24897
24905
 
24898
24906
  drawing.initPatterns = function(gd) {
@@ -24901,9 +24909,7 @@ drawing.initPatterns = function(gd) {
24901
24909
  var patternsGroup = Lib.ensureSingle(fullLayout._defs, 'g', 'patterns');
24902
24910
  patternsGroup.selectAll('pattern').remove();
24903
24911
 
24904
- // initialize stash of query parts filled in Drawing.pattern,
24905
- // used to fix URL strings during image exports
24906
- fullLayout._patternUrlQueryParts = {};
24912
+ d3.select(gd).selectAll('.pattern_filled').classed('pattern_filled', false);
24907
24913
  };
24908
24914
 
24909
24915
  drawing.getPatternAttr = function(mp, i, dflt) {
@@ -31556,7 +31562,6 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
31556
31562
  offsetY += h;
31557
31563
  maxWidthInGroup = Math.max(maxWidthInGroup, textGap + w);
31558
31564
  });
31559
- maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);
31560
31565
 
31561
31566
  var next = maxWidthInGroup + itemGap;
31562
31567
 
@@ -31572,6 +31577,8 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
31572
31577
  groupOffsetX = 0;
31573
31578
  groupOffsetY += maxGroupHeightInRow + traceGroupGap;
31574
31579
  maxGroupHeightInRow = offsetY;
31580
+ } else {
31581
+ maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);
31575
31582
  }
31576
31583
 
31577
31584
  Drawing.setTranslate(this, groupOffsetX, groupOffsetY);
@@ -32239,12 +32246,16 @@ module.exports = function style(s, gd, legend) {
32239
32246
  var colorscale = cOpts.colorscale;
32240
32247
  var reversescale = cOpts.reversescale;
32241
32248
 
32242
- var fillGradient = function(s) {
32249
+ var fillStyle = function(s) {
32243
32250
  if(s.size()) {
32244
- var gradientID = 'legendfill-' + trace.uid;
32245
- Drawing.gradient(s, gd, gradientID,
32246
- getGradientDirection(reversescale),
32247
- colorscale, 'fill');
32251
+ if(showFill) {
32252
+ Drawing.fillGroupStyle(s, gd);
32253
+ } else {
32254
+ var gradientID = 'legendfill-' + trace.uid;
32255
+ Drawing.gradient(s, gd, gradientID,
32256
+ getGradientDirection(reversescale),
32257
+ colorscale, 'fill');
32258
+ }
32248
32259
  }
32249
32260
  };
32250
32261
 
@@ -32273,7 +32284,7 @@ module.exports = function style(s, gd, legend) {
32273
32284
  fill.enter().append('path').classed('js-fill', true);
32274
32285
  fill.exit().remove();
32275
32286
  fill.attr('d', pathStart + 'h' + itemWidth + 'v6h-' + itemWidth + 'z')
32276
- .call(showFill ? Drawing.fillGroupStyle : fillGradient);
32287
+ .call(fillStyle);
32277
32288
 
32278
32289
  if(showLine || showGradientLine) {
32279
32290
  var lw = boundLineWidth(undefined, trace.line, MAX_LINE_WIDTH, CST_LINE_WIDTH);
@@ -34054,6 +34065,8 @@ var isNumeric = _dereq_('fast-isnumeric');
34054
34065
 
34055
34066
  var Lib = _dereq_('../../lib');
34056
34067
  var Icons = _dereq_('../../fonts/ploticon');
34068
+ var version = _dereq_('../../version').version;
34069
+
34057
34070
  var Parser = new DOMParser();
34058
34071
 
34059
34072
  /**
@@ -34332,6 +34345,10 @@ proto.hasButtons = function(buttons) {
34332
34345
  return true;
34333
34346
  };
34334
34347
 
34348
+ function jsVersion(str) {
34349
+ return str + ' (v' + version + ')';
34350
+ }
34351
+
34335
34352
  /**
34336
34353
  * @return {HTMLDivElement} The logo image wrapped in a group
34337
34354
  */
@@ -34341,7 +34358,7 @@ proto.getLogo = function() {
34341
34358
 
34342
34359
  a.href = 'https://plotly.com/';
34343
34360
  a.target = '_blank';
34344
- a.setAttribute('data-title', Lib._(this.graphInfo, 'Produced with Plotly'));
34361
+ a.setAttribute('data-title', jsVersion(Lib._(this.graphInfo, 'Produced with Plotly.js')));
34345
34362
  a.className = 'modebar-btn plotlyjsicon modebar-btn--logo';
34346
34363
 
34347
34364
  a.appendChild(this.createIcon(Icons.newplotlylogo));
@@ -34383,7 +34400,7 @@ function createModeBar(gd, buttons) {
34383
34400
 
34384
34401
  module.exports = createModeBar;
34385
34402
 
34386
- },{"../../fonts/ploticon":215,"../../lib":232,"@plotly/d3":11,"fast-isnumeric":17}],168:[function(_dereq_,module,exports){
34403
+ },{"../../fonts/ploticon":215,"../../lib":232,"../../version":391,"@plotly/d3":11,"fast-isnumeric":17}],168:[function(_dereq_,module,exports){
34387
34404
  'use strict';
34388
34405
 
34389
34406
  var fontAttrs = _dereq_('../../plots/font_attributes');
@@ -46894,6 +46911,7 @@ exports.convertToTspans = function(_context, gd, _callback) {
46894
46911
  // Until we get tex integrated more fully (so it can be used along with non-tex)
46895
46912
  // allow some elements to prohibit it by attaching 'data-notex' to the original
46896
46913
  var tex = (!_context.attr('data-notex')) &&
46914
+ gd && gd._context.typesetMath &&
46897
46915
  (typeof MathJax !== 'undefined') &&
46898
46916
  str.match(FIND_TEX);
46899
46917
 
@@ -47048,70 +47066,154 @@ function cleanEscapesForTex(s) {
47048
47066
  .replace(GT_MATCH, '\\gt ');
47049
47067
  }
47050
47068
 
47069
+ var inlineMath = [['$', '$'], ['\\(', '\\)']];
47070
+
47051
47071
  function texToSVG(_texString, _config, _callback) {
47072
+ var MathJaxVersion = parseInt(
47073
+ (MathJax.version || '').split('.')[0]
47074
+ );
47075
+
47076
+ if(
47077
+ MathJaxVersion !== 2 &&
47078
+ MathJaxVersion !== 3
47079
+ ) {
47080
+ Lib.warn('No MathJax version:', MathJax.version);
47081
+ return;
47082
+ }
47083
+
47052
47084
  var originalRenderer,
47053
47085
  originalConfig,
47054
47086
  originalProcessSectionDelay,
47055
47087
  tmpDiv;
47056
47088
 
47057
- MathJax.Hub.Queue(
47058
- function() {
47089
+ var setConfig2 = function() {
47059
47090
  originalConfig = Lib.extendDeepAll({}, MathJax.Hub.config);
47060
47091
 
47061
47092
  originalProcessSectionDelay = MathJax.Hub.processSectionDelay;
47062
47093
  if(MathJax.Hub.processSectionDelay !== undefined) {
47063
- // MathJax 2.5+
47094
+ // MathJax 2.5+ but not 3+
47064
47095
  MathJax.Hub.processSectionDelay = 0;
47065
47096
  }
47066
47097
 
47067
47098
  return MathJax.Hub.Config({
47068
47099
  messageStyle: 'none',
47069
47100
  tex2jax: {
47070
- inlineMath: [['$', '$'], ['\\(', '\\)']]
47101
+ inlineMath: inlineMath
47071
47102
  },
47072
47103
  displayAlign: 'left',
47073
47104
  });
47074
- },
47075
- function() {
47076
- // Get original renderer
47105
+ };
47106
+
47107
+ var setConfig3 = function() {
47108
+ originalConfig = Lib.extendDeepAll({}, MathJax.config);
47109
+
47110
+ if(!MathJax.config.tex) {
47111
+ MathJax.config.tex = {};
47112
+ }
47113
+
47114
+ MathJax.config.tex.inlineMath = inlineMath;
47115
+ };
47116
+
47117
+ var setRenderer2 = function() {
47077
47118
  originalRenderer = MathJax.Hub.config.menuSettings.renderer;
47078
47119
  if(originalRenderer !== 'SVG') {
47079
47120
  return MathJax.Hub.setRenderer('SVG');
47080
47121
  }
47081
- },
47082
- function() {
47122
+ };
47123
+
47124
+ var setRenderer3 = function() {
47125
+ originalRenderer = MathJax.config.startup.output;
47126
+ if(originalRenderer !== 'svg') {
47127
+ MathJax.config.startup.output = 'svg';
47128
+ }
47129
+ };
47130
+
47131
+ var initiateMathJax = function() {
47083
47132
  var randomID = 'math-output-' + Lib.randstr({}, 64);
47084
47133
  tmpDiv = d3.select('body').append('div')
47085
47134
  .attr({id: randomID})
47086
- .style({visibility: 'hidden', position: 'absolute'})
47087
- .style({'font-size': _config.fontSize + 'px'})
47135
+ .style({
47136
+ visibility: 'hidden',
47137
+ position: 'absolute',
47138
+ 'font-size': _config.fontSize + 'px'
47139
+ })
47088
47140
  .text(cleanEscapesForTex(_texString));
47089
47141
 
47090
- return MathJax.Hub.Typeset(tmpDiv.node());
47091
- },
47092
- function() {
47093
- var glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');
47142
+ var tmpNode = tmpDiv.node();
47094
47143
 
47095
- if(tmpDiv.select('.MathJax_SVG').empty() || !tmpDiv.select('svg').node()) {
47144
+ return MathJaxVersion === 2 ?
47145
+ MathJax.Hub.Typeset(tmpNode) :
47146
+ MathJax.typeset([tmpNode]);
47147
+ };
47148
+
47149
+ var finalizeMathJax = function() {
47150
+ var sel = tmpDiv.select(
47151
+ MathJaxVersion === 2 ? '.MathJax_SVG' : '.MathJax'
47152
+ );
47153
+
47154
+ var node = !sel.empty() && tmpDiv.select('svg').node();
47155
+ if(!node) {
47096
47156
  Lib.log('There was an error in the tex syntax.', _texString);
47097
47157
  _callback();
47098
47158
  } else {
47099
- var svgBBox = tmpDiv.select('svg').node().getBoundingClientRect();
47100
- _callback(tmpDiv.select('.MathJax_SVG'), glyphDefs, svgBBox);
47159
+ var nodeBBox = node.getBoundingClientRect();
47160
+ var glyphDefs;
47161
+ if(MathJaxVersion === 2) {
47162
+ glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');
47163
+ } else {
47164
+ glyphDefs = sel.select('defs');
47165
+ }
47166
+ _callback(sel, glyphDefs, nodeBBox);
47101
47167
  }
47102
47168
 
47103
47169
  tmpDiv.remove();
47170
+ };
47104
47171
 
47172
+ var resetRenderer2 = function() {
47105
47173
  if(originalRenderer !== 'SVG') {
47106
47174
  return MathJax.Hub.setRenderer(originalRenderer);
47107
47175
  }
47108
- },
47109
- function() {
47176
+ };
47177
+
47178
+ var resetRenderer3 = function() {
47179
+ if(originalRenderer !== 'svg') {
47180
+ MathJax.config.startup.output = originalRenderer;
47181
+ }
47182
+ };
47183
+
47184
+ var resetConfig2 = function() {
47110
47185
  if(originalProcessSectionDelay !== undefined) {
47111
47186
  MathJax.Hub.processSectionDelay = originalProcessSectionDelay;
47112
47187
  }
47113
47188
  return MathJax.Hub.Config(originalConfig);
47114
- });
47189
+ };
47190
+
47191
+ var resetConfig3 = function() {
47192
+ MathJax.config = originalConfig;
47193
+ };
47194
+
47195
+ if(MathJaxVersion === 2) {
47196
+ MathJax.Hub.Queue(
47197
+ setConfig2,
47198
+ setRenderer2,
47199
+ initiateMathJax,
47200
+ finalizeMathJax,
47201
+ resetRenderer2,
47202
+ resetConfig2
47203
+ );
47204
+ } else if(MathJaxVersion === 3) {
47205
+ setConfig3();
47206
+ setRenderer3();
47207
+ MathJax.startup.defaultReady();
47208
+
47209
+ MathJax.startup.promise.then(function() {
47210
+ initiateMathJax();
47211
+ finalizeMathJax();
47212
+
47213
+ resetRenderer3();
47214
+ resetConfig3();
47215
+ });
47216
+ }
47115
47217
  }
47116
47218
 
47117
47219
  var TAG_STYLES = {
@@ -52931,6 +53033,11 @@ var configAttributes = {
52931
53033
  dflt: false,
52932
53034
  },
52933
53035
 
53036
+ typesetMath: {
53037
+ valType: 'boolean',
53038
+ dflt: true,
53039
+ },
53040
+
52934
53041
  plotlyServerURL: {
52935
53042
  valType: 'string',
52936
53043
  dflt: '',
@@ -57776,7 +57883,8 @@ axes.calcTicks = function calcTicks(ax, opts) {
57776
57883
  var minRange = Math.min(rng[0], rng[1]);
57777
57884
  var maxRange = Math.max(rng[0], rng[1]);
57778
57885
 
57779
- var isDLog = (ax.type === 'log') && !(isNumeric(ax.dtick) || ax.dtick.charAt(0) === 'L');
57886
+ var numDtick = isNumeric(ax.dtick);
57887
+ var isDLog = (ax.type === 'log') && !(numDtick || ax.dtick.charAt(0) === 'L');
57780
57888
  var isPeriod = ax.ticklabelmode === 'period';
57781
57889
 
57782
57890
  // find the first tick
@@ -57807,13 +57915,36 @@ axes.calcTicks = function calcTicks(ax, opts) {
57807
57915
  x = axes.tickIncrement(x, ax.dtick, !axrev, ax.calendar);
57808
57916
  }
57809
57917
 
57918
+ var ticklabelstep = ax.ticklabelstep;
57919
+
57810
57920
  var maxTicks = Math.max(1000, ax._length || 0);
57811
57921
  var tickVals = [];
57812
57922
  var xPrevious = null;
57923
+
57924
+ var dTick;
57925
+ if(numDtick) {
57926
+ dTick = ax.dtick;
57927
+ } else {
57928
+ if(ax.type === 'date') {
57929
+ if(typeof ax.dtick === 'string' && ax.dtick.charAt(0) === 'M') {
57930
+ dTick = ONEAVGMONTH * ax.dtick.substring(1);
57931
+ }
57932
+ } else {
57933
+ dTick = ax._roughDTick;
57934
+ }
57935
+ }
57936
+
57937
+ var id = Math.round((
57938
+ ax.r2l(x) -
57939
+ ax.r2l(ax.tick0)
57940
+ ) / dTick) - 1;
57941
+
57813
57942
  for(;
57814
57943
  (axrev) ? (x >= endTick) : (x <= endTick);
57815
57944
  x = axes.tickIncrement(x, ax.dtick, axrev, ax.calendar)
57816
57945
  ) {
57946
+ id++;
57947
+
57817
57948
  if(ax.rangebreaks) {
57818
57949
  if(!axrev) {
57819
57950
  if(x < startTick) continue;
@@ -57831,10 +57962,16 @@ axes.calcTicks = function calcTicks(ax, opts) {
57831
57962
  minor = true;
57832
57963
  }
57833
57964
 
57834
- tickVals.push({
57965
+ var obj = {
57835
57966
  minor: minor,
57836
57967
  value: x
57837
- });
57968
+ };
57969
+
57970
+ if(ticklabelstep > 1 && id % ticklabelstep) {
57971
+ obj.skipLabel = true;
57972
+ }
57973
+
57974
+ tickVals.push(obj);
57838
57975
  }
57839
57976
 
57840
57977
  if(isPeriod) positionPeriodTicks(tickVals, ax, ax._definedDelta);
@@ -57887,12 +58024,20 @@ axes.calcTicks = function calcTicks(ax, opts) {
57887
58024
  ax._prevDateHead = '';
57888
58025
  ax._inCalcTicks = true;
57889
58026
 
58027
+ var lastVisibleHead;
58028
+ var hideLabel = function(tick) {
58029
+ tick.text = ' '; // don't use an empty string here which can confuse automargin (issue 5132)
58030
+ ax._prevDateHead = lastVisibleHead;
58031
+ };
58032
+
57890
58033
  var ticksOut = [];
57891
58034
  var t, p;
57892
58035
  for(i = 0; i < tickVals.length; i++) {
57893
58036
  var _minor = tickVals[i].minor;
57894
58037
  var _value = tickVals[i].value;
57895
58038
 
58039
+ lastVisibleHead = ax._prevDateHead;
58040
+
57896
58041
  t = axes.tickText(
57897
58042
  ax,
57898
58043
  _value,
@@ -57907,11 +58052,14 @@ axes.calcTicks = function calcTicks(ax, opts) {
57907
58052
  if(p > maxRange) t.periodX = maxRange;
57908
58053
  if(p < minRange) t.periodX = minRange;
57909
58054
 
57910
- t.text = ' '; // don't use an empty string here which can confuse automargin (issue 5132)
57911
- ax._prevDateHead = '';
58055
+ hideLabel(t);
57912
58056
  }
57913
58057
  }
57914
58058
 
58059
+ if(tickVals[i].skipLabel) {
58060
+ hideLabel(t);
58061
+ }
58062
+
57915
58063
  ticksOut.push(t);
57916
58064
  }
57917
58065
 
@@ -59939,6 +60087,7 @@ axes.drawLabels = function(gd, ax, opts) {
59939
60087
  var axId = ax._id;
59940
60088
  var axLetter = axId.charAt(0);
59941
60089
  var cls = opts.cls || axId + 'tick';
60090
+
59942
60091
  var vals = opts.vals;
59943
60092
 
59944
60093
  var labelFns = opts.labelFns;
@@ -64795,6 +64944,12 @@ module.exports = {
64795
64944
  editType: 'ticks',
64796
64945
  impliedEdits: {tickmode: 'linear'},
64797
64946
  },
64947
+ ticklabelstep: {
64948
+ valType: 'integer',
64949
+ min: 1,
64950
+ dflt: 1,
64951
+ editType: 'ticks',
64952
+ },
64798
64953
  tickvals: {
64799
64954
  valType: 'data_array',
64800
64955
  editType: 'ticks',
@@ -67659,6 +67814,14 @@ module.exports = function handleTickLabelDefaults(containerIn, containerOut, coe
67659
67814
  color: dfltFontColor
67660
67815
  });
67661
67816
 
67817
+ if(
67818
+ !options.noTicklabelstep &&
67819
+ axType !== 'multicategory' &&
67820
+ axType !== 'log'
67821
+ ) {
67822
+ coerce('ticklabelstep');
67823
+ }
67824
+
67662
67825
  if(!options.noAng) coerce('tickangle');
67663
67826
 
67664
67827
  if(axType !== 'category') {
@@ -73664,7 +73827,7 @@ module.exports = function toSVG(gd, format, scale) {
73664
73827
  var toppaper = fullLayout._toppaper;
73665
73828
  var width = fullLayout.width;
73666
73829
  var height = fullLayout.height;
73667
- var i, k;
73830
+ var i;
73668
73831
 
73669
73832
  // make background color a rect in the svg, then revert after scraping
73670
73833
  // all other alterations have been dealt with by properly preparing the svg
@@ -73737,32 +73900,21 @@ module.exports = function toSVG(gd, format, scale) {
73737
73900
  }
73738
73901
  });
73739
73902
 
73740
- var queryParts = [];
73741
- if(fullLayout._gradientUrlQueryParts) {
73742
- for(k in fullLayout._gradientUrlQueryParts) queryParts.push(k);
73743
- }
73744
-
73745
- if(fullLayout._patternUrlQueryParts) {
73746
- for(k in fullLayout._patternUrlQueryParts) queryParts.push(k);
73747
- }
73903
+ svg.selectAll('.gradient_filled,.pattern_filled').each(function() {
73904
+ var pt = d3.select(this);
73748
73905
 
73749
- if(queryParts.length) {
73750
- svg.selectAll(queryParts.join(',')).each(function() {
73751
- var pt = d3.select(this);
73752
-
73753
- // similar to font family styles above,
73754
- // we must remove " after the SVG DOM has been serialized
73755
- var fill = this.style.fill;
73756
- if(fill && fill.indexOf('url(') !== -1) {
73757
- pt.style('fill', fill.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
73758
- }
73906
+ // similar to font family styles above,
73907
+ // we must remove " after the SVG DOM has been serialized
73908
+ var fill = this.style.fill;
73909
+ if(fill && fill.indexOf('url(') !== -1) {
73910
+ pt.style('fill', fill.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
73911
+ }
73759
73912
 
73760
- var stroke = this.style.stroke;
73761
- if(stroke && stroke.indexOf('url(') !== -1) {
73762
- pt.style('stroke', stroke.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
73763
- }
73764
- });
73765
- }
73913
+ var stroke = this.style.stroke;
73914
+ if(stroke && stroke.indexOf('url(') !== -1) {
73915
+ pt.style('stroke', stroke.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
73916
+ }
73917
+ });
73766
73918
 
73767
73919
  if(format === 'pdf' || format === 'eps') {
73768
73920
  // these formats make the extra line MathJax adds around symbols look super thick in some cases
@@ -76122,6 +76274,7 @@ function calcTexttemplate(fullLayout, cd, index, xa, ya) {
76122
76274
  var trace = cd[0].trace;
76123
76275
  var texttemplate = Lib.castOption(trace, index, 'texttemplate');
76124
76276
  if(!texttemplate) return '';
76277
+ var isHistogram = (trace.type === 'histogram');
76125
76278
  var isWaterfall = (trace.type === 'waterfall');
76126
76279
  var isFunnel = (trace.type === 'funnel');
76127
76280
  var isHorizontal = trace.orientation === 'h';
@@ -76163,10 +76316,10 @@ function calcTexttemplate(fullLayout, cd, index, xa, ya) {
76163
76316
  var pt = {};
76164
76317
  appendArrayPointValue(pt, trace, cdi.i);
76165
76318
 
76166
- if(pt.x === undefined) pt.x = isHorizontal ? obj.value : obj.label;
76167
- if(pt.y === undefined) pt.y = isHorizontal ? obj.label : obj.value;
76168
- if(pt.xLabel === undefined) pt.xLabel = isHorizontal ? obj.valueLabel : obj.labelLabel;
76169
- if(pt.yLabel === undefined) pt.yLabel = isHorizontal ? obj.labelLabel : obj.valueLabel;
76319
+ if(isHistogram || pt.x === undefined) pt.x = isHorizontal ? obj.value : obj.label;
76320
+ if(isHistogram || pt.y === undefined) pt.y = isHorizontal ? obj.label : obj.value;
76321
+ if(isHistogram || pt.xLabel === undefined) pt.xLabel = isHorizontal ? obj.valueLabel : obj.labelLabel;
76322
+ if(isHistogram || pt.yLabel === undefined) pt.yLabel = isHorizontal ? obj.labelLabel : obj.valueLabel;
76170
76323
 
76171
76324
  if(isWaterfall) {
76172
76325
  obj.delta = +cdi.rawS || cdi.s;
@@ -78668,6 +78821,7 @@ var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplat
78668
78821
  var colorScaleAttrs = _dereq_('../../components/colorscale/attributes');
78669
78822
  var fontAttrs = _dereq_('../../plots/font_attributes');
78670
78823
  var dash = _dereq_('../../components/drawing/attributes').dash;
78824
+ var pattern = _dereq_('../../components/drawing/attributes').pattern;
78671
78825
 
78672
78826
  var Drawing = _dereq_('../../components/drawing');
78673
78827
  var constants = _dereq_('./constants');
@@ -78855,6 +79009,7 @@ module.exports = {
78855
79009
  editType: 'style',
78856
79010
  anim: true,
78857
79011
  },
79012
+ fillpattern: pattern,
78858
79013
  marker: extendFlat({
78859
79014
  symbol: {
78860
79015
  valType: 'enumerated',
@@ -79591,6 +79746,7 @@ var handleLineDefaults = _dereq_('./line_defaults');
79591
79746
  var handleLineShapeDefaults = _dereq_('./line_shape_defaults');
79592
79747
  var handleTextDefaults = _dereq_('./text_defaults');
79593
79748
  var handleFillColorDefaults = _dereq_('./fillcolor_defaults');
79749
+ var coercePattern = _dereq_('../../lib').coercePattern;
79594
79750
 
79595
79751
  module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
79596
79752
  function coerce(attr, dflt) {
@@ -79644,6 +79800,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
79644
79800
  if(traceOut.fill !== 'none') {
79645
79801
  handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);
79646
79802
  if(!subTypes.hasLines(traceOut)) handleLineShapeDefaults(traceIn, traceOut, coerce);
79803
+ coercePattern(coerce, 'fillpattern', traceOut.fillcolor, false);
79647
79804
  }
79648
79805
 
79649
79806
  var lineColor = (traceOut.line || {}).color;
@@ -81026,11 +81183,11 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
81026
81183
  // the points on the axes are the first two points. Otherwise
81027
81184
  // animations get a little crazy if the number of points changes.
81028
81185
  transition(ownFillEl3).attr('d', 'M' + pt1 + 'L' + pt0 + 'L' + fullpath.substr(1))
81029
- .call(Drawing.singleFillStyle);
81186
+ .call(Drawing.singleFillStyle, gd);
81030
81187
  } else {
81031
81188
  // fill to self: just join the path to itself
81032
81189
  transition(ownFillEl3).attr('d', fullpath + 'Z')
81033
- .call(Drawing.singleFillStyle);
81190
+ .call(Drawing.singleFillStyle, gd);
81034
81191
  }
81035
81192
  }
81036
81193
  } else if(tonext) {
@@ -81042,7 +81199,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
81042
81199
  // This makes strange results if one path is *not* entirely
81043
81200
  // inside the other, but then that is a strange usage.
81044
81201
  transition(tonext).attr('d', fullpath + 'Z' + prevRevpath + 'Z')
81045
- .call(Drawing.singleFillStyle);
81202
+ .call(Drawing.singleFillStyle, gd);
81046
81203
  } else {
81047
81204
  // tonextx/y: for now just connect endpoints with lines. This is
81048
81205
  // the correct behavior if the endpoints are at the same value of
@@ -81050,7 +81207,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
81050
81207
  // things depending on whether the new endpoint projects onto the
81051
81208
  // existing curve or off the end of it
81052
81209
  transition(tonext).attr('d', fullpath + 'L' + prevRevpath.substr(1) + 'Z')
81053
- .call(Drawing.singleFillStyle);
81210
+ .call(Drawing.singleFillStyle, gd);
81054
81211
  }
81055
81212
  trace._polygons = trace._polygons.concat(prevPolygons);
81056
81213
  } else {
@@ -81443,7 +81600,7 @@ function style(gd) {
81443
81600
  .call(Drawing.lineGroupStyle);
81444
81601
 
81445
81602
  s.selectAll('g.trace path.js-fill')
81446
- .call(Drawing.fillGroupStyle);
81603
+ .call(Drawing.fillGroupStyle, gd);
81447
81604
 
81448
81605
  Registry.getComponentMethod('errorbars', 'style')(s);
81449
81606
  }
@@ -82630,7 +82787,7 @@ function getSortFunc(opts, d2c) {
82630
82787
  'use strict';
82631
82788
 
82632
82789
  // package version injected by `npm run preprocess`
82633
- exports.version = '2.8.2';
82790
+ exports.version = '2.10.0';
82634
82791
 
82635
82792
  },{}]},{},[8])(8)
82636
82793
  });