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 (strict) v2.8.2
3
- * Copyright 2012-2021, Plotly, Inc.
2
+ * plotly.js (strict) v2.10.0
3
+ * Copyright 2012-2022, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
6
6
  */
@@ -81040,7 +81040,15 @@ exports.readUInt32BE = function (data, offset) {
81040
81040
 
81041
81041
  function ProbeError(message, code, statusCode) {
81042
81042
  Error.call(this);
81043
- Error.captureStackTrace(this, this.constructor);
81043
+
81044
+ // Include stack trace in error object
81045
+ if (Error.captureStackTrace) {
81046
+ // Chrome and NodeJS
81047
+ Error.captureStackTrace(this, this.constructor);
81048
+ } else {
81049
+ // FF, IE 10+ and Safari 6+. Fallback for others
81050
+ this.stack = (new Error()).stack || '';
81051
+ }
81044
81052
 
81045
81053
  this.name = this.constructor.name;
81046
81054
 
@@ -96832,6 +96840,7 @@ module.exports = overrideAll({
96832
96840
  ticklen: axesAttrs.ticklen,
96833
96841
  tickwidth: axesAttrs.tickwidth,
96834
96842
  tickcolor: axesAttrs.tickcolor,
96843
+ ticklabelstep: axesAttrs.ticklabelstep,
96835
96844
  showticklabels: axesAttrs.showticklabels,
96836
96845
  tickfont: fontAttrs({
96837
96846
  }),
@@ -97922,6 +97931,7 @@ function mockColorBarAxis(gd, opts, zrange) {
97922
97931
  showticklabels: opts.showticklabels,
97923
97932
  ticklabelposition: opts.ticklabelposition,
97924
97933
  ticklabeloverflow: opts.ticklabeloverflow,
97934
+ ticklabelstep: opts.ticklabelstep,
97925
97935
  tickfont: opts.tickfont,
97926
97936
  tickangle: opts.tickangle,
97927
97937
  tickformat: opts.tickformat,
@@ -99660,24 +99670,42 @@ drawing.dashStyle = function(dash, lineWidth) {
99660
99670
  return dash;
99661
99671
  };
99662
99672
 
99673
+ function setFillStyle(sel, trace, gd) {
99674
+ var markerPattern = trace.fillpattern;
99675
+ var patternShape = markerPattern && drawing.getPatternAttr(markerPattern.shape, 0, '');
99676
+ if(patternShape) {
99677
+ var patternBGColor = drawing.getPatternAttr(markerPattern.bgcolor, 0, null);
99678
+ var patternFGColor = drawing.getPatternAttr(markerPattern.fgcolor, 0, null);
99679
+ var patternFGOpacity = markerPattern.fgopacity;
99680
+ var patternSize = drawing.getPatternAttr(markerPattern.size, 0, 8);
99681
+ var patternSolidity = drawing.getPatternAttr(markerPattern.solidity, 0, 0.3);
99682
+ var patternID = trace.uid;
99683
+ drawing.pattern(sel, 'point', gd, patternID,
99684
+ patternShape, patternSize, patternSolidity,
99685
+ undefined, markerPattern.fillmode,
99686
+ patternBGColor, patternFGColor, patternFGOpacity
99687
+ );
99688
+ } else if(trace.fillcolor) {
99689
+ sel.call(Color.fill, trace.fillcolor);
99690
+ }
99691
+ }
99692
+
99663
99693
  // Same as fillGroupStyle, except in this case the selection may be a transition
99664
- drawing.singleFillStyle = function(sel) {
99694
+ drawing.singleFillStyle = function(sel, gd) {
99665
99695
  var node = d3.select(sel.node());
99666
99696
  var data = node.data();
99667
- var fillcolor = (((data[0] || [])[0] || {}).trace || {}).fillcolor;
99668
- if(fillcolor) {
99669
- sel.call(Color.fill, fillcolor);
99670
- }
99697
+ var trace = ((data[0] || [])[0] || {}).trace || {};
99698
+ setFillStyle(sel, trace, gd);
99671
99699
  };
99672
99700
 
99673
- drawing.fillGroupStyle = function(s) {
99701
+ drawing.fillGroupStyle = function(s, gd) {
99674
99702
  s.style('stroke-width', 0)
99675
99703
  .each(function(d) {
99676
99704
  var shape = d3.select(this);
99677
99705
  // N.B. 'd' won't be a calcdata item when
99678
99706
  // fill !== 'none' on a segment-less and marker-less trace
99679
99707
  if(d[0].trace) {
99680
- shape.call(Color.fill, d[0].trace.fillcolor);
99708
+ setFillStyle(shape, d[0].trace, gd);
99681
99709
  }
99682
99710
  });
99683
99711
  };
@@ -99830,12 +99858,7 @@ drawing.gradient = function(sel, gd, gradientID, type, colorscale, prop) {
99830
99858
  sel.style(prop, getFullUrl(fullID, gd))
99831
99859
  .style(prop + '-opacity', null);
99832
99860
 
99833
- var className2query = function(s) {
99834
- return '.' + s.attr('class').replace(/\s/g, '.');
99835
- };
99836
- var k = className2query(d3.select(sel.node().parentNode)) +
99837
- '>' + className2query(sel);
99838
- fullLayout._gradientUrlQueryParts[k] = 1;
99861
+ sel.classed('gradient_filled', true);
99839
99862
  };
99840
99863
 
99841
99864
  /**
@@ -100042,11 +100065,6 @@ drawing.pattern = function(sel, calledBy, gd, patternID, shape, size, solidity,
100042
100065
  .style('fill-opacity', null);
100043
100066
 
100044
100067
  sel.classed('pattern_filled', true);
100045
- var className2query = function(s) {
100046
- return '.' + s.attr('class').replace(/\s/g, '.');
100047
- };
100048
- var k = className2query(d3.select(sel.node().parentNode)) + '>.pattern_filled';
100049
- fullLayout._patternUrlQueryParts[k] = 1;
100050
100068
  };
100051
100069
 
100052
100070
  /*
@@ -100062,9 +100080,7 @@ drawing.initGradients = function(gd) {
100062
100080
  var gradientsGroup = Lib.ensureSingle(fullLayout._defs, 'g', 'gradients');
100063
100081
  gradientsGroup.selectAll('linearGradient,radialGradient').remove();
100064
100082
 
100065
- // initialize stash of query parts filled in Drawing.gradient,
100066
- // used to fix URL strings during image exports
100067
- fullLayout._gradientUrlQueryParts = {};
100083
+ d3.select(gd).selectAll('.gradient_filled').classed('gradient_filled', false);
100068
100084
  };
100069
100085
 
100070
100086
  drawing.initPatterns = function(gd) {
@@ -100073,9 +100089,7 @@ drawing.initPatterns = function(gd) {
100073
100089
  var patternsGroup = Lib.ensureSingle(fullLayout._defs, 'g', 'patterns');
100074
100090
  patternsGroup.selectAll('pattern').remove();
100075
100091
 
100076
- // initialize stash of query parts filled in Drawing.pattern,
100077
- // used to fix URL strings during image exports
100078
- fullLayout._patternUrlQueryParts = {};
100092
+ d3.select(gd).selectAll('.pattern_filled').classed('pattern_filled', false);
100079
100093
  };
100080
100094
 
100081
100095
  drawing.getPatternAttr = function(mp, i, dflt) {
@@ -106728,7 +106742,6 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
106728
106742
  offsetY += h;
106729
106743
  maxWidthInGroup = Math.max(maxWidthInGroup, textGap + w);
106730
106744
  });
106731
- maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);
106732
106745
 
106733
106746
  var next = maxWidthInGroup + itemGap;
106734
106747
 
@@ -106744,6 +106757,8 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
106744
106757
  groupOffsetX = 0;
106745
106758
  groupOffsetY += maxGroupHeightInRow + traceGroupGap;
106746
106759
  maxGroupHeightInRow = offsetY;
106760
+ } else {
106761
+ maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);
106747
106762
  }
106748
106763
 
106749
106764
  Drawing.setTranslate(this, groupOffsetX, groupOffsetY);
@@ -107411,12 +107426,16 @@ module.exports = function style(s, gd, legend) {
107411
107426
  var colorscale = cOpts.colorscale;
107412
107427
  var reversescale = cOpts.reversescale;
107413
107428
 
107414
- var fillGradient = function(s) {
107429
+ var fillStyle = function(s) {
107415
107430
  if(s.size()) {
107416
- var gradientID = 'legendfill-' + trace.uid;
107417
- Drawing.gradient(s, gd, gradientID,
107418
- getGradientDirection(reversescale),
107419
- colorscale, 'fill');
107431
+ if(showFill) {
107432
+ Drawing.fillGroupStyle(s, gd);
107433
+ } else {
107434
+ var gradientID = 'legendfill-' + trace.uid;
107435
+ Drawing.gradient(s, gd, gradientID,
107436
+ getGradientDirection(reversescale),
107437
+ colorscale, 'fill');
107438
+ }
107420
107439
  }
107421
107440
  };
107422
107441
 
@@ -107445,7 +107464,7 @@ module.exports = function style(s, gd, legend) {
107445
107464
  fill.enter().append('path').classed('js-fill', true);
107446
107465
  fill.exit().remove();
107447
107466
  fill.attr('d', pathStart + 'h' + itemWidth + 'v6h-' + itemWidth + 'z')
107448
- .call(showFill ? Drawing.fillGroupStyle : fillGradient);
107467
+ .call(fillStyle);
107449
107468
 
107450
107469
  if(showLine || showGradientLine) {
107451
107470
  var lw = boundLineWidth(undefined, trace.line, MAX_LINE_WIDTH, CST_LINE_WIDTH);
@@ -109226,6 +109245,8 @@ var isNumeric = _dereq_('fast-isnumeric');
109226
109245
 
109227
109246
  var Lib = _dereq_('../../lib');
109228
109247
  var Icons = _dereq_('../../fonts/ploticon');
109248
+ var version = _dereq_('../../version').version;
109249
+
109229
109250
  var Parser = new DOMParser();
109230
109251
 
109231
109252
  /**
@@ -109504,6 +109525,10 @@ proto.hasButtons = function(buttons) {
109504
109525
  return true;
109505
109526
  };
109506
109527
 
109528
+ function jsVersion(str) {
109529
+ return str + ' (v' + version + ')';
109530
+ }
109531
+
109507
109532
  /**
109508
109533
  * @return {HTMLDivElement} The logo image wrapped in a group
109509
109534
  */
@@ -109513,7 +109538,7 @@ proto.getLogo = function() {
109513
109538
 
109514
109539
  a.href = 'https://plotly.com/';
109515
109540
  a.target = '_blank';
109516
- a.setAttribute('data-title', Lib._(this.graphInfo, 'Produced with Plotly'));
109541
+ a.setAttribute('data-title', jsVersion(Lib._(this.graphInfo, 'Produced with Plotly.js')));
109517
109542
  a.className = 'modebar-btn plotlyjsicon modebar-btn--logo';
109518
109543
 
109519
109544
  a.appendChild(this.createIcon(Icons.newplotlylogo));
@@ -109555,7 +109580,7 @@ function createModeBar(gd, buttons) {
109555
109580
 
109556
109581
  module.exports = createModeBar;
109557
109582
 
109558
- },{"../../fonts/ploticon":350,"../../lib":371,"@plotly/d3":53,"fast-isnumeric":99}],300:[function(_dereq_,module,exports){
109583
+ },{"../../fonts/ploticon":350,"../../lib":371,"../../version":933,"@plotly/d3":53,"fast-isnumeric":99}],300:[function(_dereq_,module,exports){
109559
109584
  'use strict';
109560
109585
 
109561
109586
  var fontAttrs = _dereq_('../../plots/font_attributes');
@@ -122779,6 +122804,7 @@ exports.convertToTspans = function(_context, gd, _callback) {
122779
122804
  // Until we get tex integrated more fully (so it can be used along with non-tex)
122780
122805
  // allow some elements to prohibit it by attaching 'data-notex' to the original
122781
122806
  var tex = (!_context.attr('data-notex')) &&
122807
+ gd && gd._context.typesetMath &&
122782
122808
  (typeof MathJax !== 'undefined') &&
122783
122809
  str.match(FIND_TEX);
122784
122810
 
@@ -122933,70 +122959,154 @@ function cleanEscapesForTex(s) {
122933
122959
  .replace(GT_MATCH, '\\gt ');
122934
122960
  }
122935
122961
 
122962
+ var inlineMath = [['$', '$'], ['\\(', '\\)']];
122963
+
122936
122964
  function texToSVG(_texString, _config, _callback) {
122965
+ var MathJaxVersion = parseInt(
122966
+ (MathJax.version || '').split('.')[0]
122967
+ );
122968
+
122969
+ if(
122970
+ MathJaxVersion !== 2 &&
122971
+ MathJaxVersion !== 3
122972
+ ) {
122973
+ Lib.warn('No MathJax version:', MathJax.version);
122974
+ return;
122975
+ }
122976
+
122937
122977
  var originalRenderer,
122938
122978
  originalConfig,
122939
122979
  originalProcessSectionDelay,
122940
122980
  tmpDiv;
122941
122981
 
122942
- MathJax.Hub.Queue(
122943
- function() {
122982
+ var setConfig2 = function() {
122944
122983
  originalConfig = Lib.extendDeepAll({}, MathJax.Hub.config);
122945
122984
 
122946
122985
  originalProcessSectionDelay = MathJax.Hub.processSectionDelay;
122947
122986
  if(MathJax.Hub.processSectionDelay !== undefined) {
122948
- // MathJax 2.5+
122987
+ // MathJax 2.5+ but not 3+
122949
122988
  MathJax.Hub.processSectionDelay = 0;
122950
122989
  }
122951
122990
 
122952
122991
  return MathJax.Hub.Config({
122953
122992
  messageStyle: 'none',
122954
122993
  tex2jax: {
122955
- inlineMath: [['$', '$'], ['\\(', '\\)']]
122994
+ inlineMath: inlineMath
122956
122995
  },
122957
122996
  displayAlign: 'left',
122958
122997
  });
122959
- },
122960
- function() {
122961
- // Get original renderer
122998
+ };
122999
+
123000
+ var setConfig3 = function() {
123001
+ originalConfig = Lib.extendDeepAll({}, MathJax.config);
123002
+
123003
+ if(!MathJax.config.tex) {
123004
+ MathJax.config.tex = {};
123005
+ }
123006
+
123007
+ MathJax.config.tex.inlineMath = inlineMath;
123008
+ };
123009
+
123010
+ var setRenderer2 = function() {
122962
123011
  originalRenderer = MathJax.Hub.config.menuSettings.renderer;
122963
123012
  if(originalRenderer !== 'SVG') {
122964
123013
  return MathJax.Hub.setRenderer('SVG');
122965
123014
  }
122966
- },
122967
- function() {
123015
+ };
123016
+
123017
+ var setRenderer3 = function() {
123018
+ originalRenderer = MathJax.config.startup.output;
123019
+ if(originalRenderer !== 'svg') {
123020
+ MathJax.config.startup.output = 'svg';
123021
+ }
123022
+ };
123023
+
123024
+ var initiateMathJax = function() {
122968
123025
  var randomID = 'math-output-' + Lib.randstr({}, 64);
122969
123026
  tmpDiv = d3.select('body').append('div')
122970
123027
  .attr({id: randomID})
122971
- .style({visibility: 'hidden', position: 'absolute'})
122972
- .style({'font-size': _config.fontSize + 'px'})
123028
+ .style({
123029
+ visibility: 'hidden',
123030
+ position: 'absolute',
123031
+ 'font-size': _config.fontSize + 'px'
123032
+ })
122973
123033
  .text(cleanEscapesForTex(_texString));
122974
123034
 
122975
- return MathJax.Hub.Typeset(tmpDiv.node());
122976
- },
122977
- function() {
122978
- var glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');
123035
+ var tmpNode = tmpDiv.node();
123036
+
123037
+ return MathJaxVersion === 2 ?
123038
+ MathJax.Hub.Typeset(tmpNode) :
123039
+ MathJax.typeset([tmpNode]);
123040
+ };
122979
123041
 
122980
- if(tmpDiv.select('.MathJax_SVG').empty() || !tmpDiv.select('svg').node()) {
123042
+ var finalizeMathJax = function() {
123043
+ var sel = tmpDiv.select(
123044
+ MathJaxVersion === 2 ? '.MathJax_SVG' : '.MathJax'
123045
+ );
123046
+
123047
+ var node = !sel.empty() && tmpDiv.select('svg').node();
123048
+ if(!node) {
122981
123049
  Lib.log('There was an error in the tex syntax.', _texString);
122982
123050
  _callback();
122983
123051
  } else {
122984
- var svgBBox = tmpDiv.select('svg').node().getBoundingClientRect();
122985
- _callback(tmpDiv.select('.MathJax_SVG'), glyphDefs, svgBBox);
123052
+ var nodeBBox = node.getBoundingClientRect();
123053
+ var glyphDefs;
123054
+ if(MathJaxVersion === 2) {
123055
+ glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');
123056
+ } else {
123057
+ glyphDefs = sel.select('defs');
123058
+ }
123059
+ _callback(sel, glyphDefs, nodeBBox);
122986
123060
  }
122987
123061
 
122988
123062
  tmpDiv.remove();
123063
+ };
122989
123064
 
123065
+ var resetRenderer2 = function() {
122990
123066
  if(originalRenderer !== 'SVG') {
122991
123067
  return MathJax.Hub.setRenderer(originalRenderer);
122992
123068
  }
122993
- },
122994
- function() {
123069
+ };
123070
+
123071
+ var resetRenderer3 = function() {
123072
+ if(originalRenderer !== 'svg') {
123073
+ MathJax.config.startup.output = originalRenderer;
123074
+ }
123075
+ };
123076
+
123077
+ var resetConfig2 = function() {
122995
123078
  if(originalProcessSectionDelay !== undefined) {
122996
123079
  MathJax.Hub.processSectionDelay = originalProcessSectionDelay;
122997
123080
  }
122998
123081
  return MathJax.Hub.Config(originalConfig);
122999
- });
123082
+ };
123083
+
123084
+ var resetConfig3 = function() {
123085
+ MathJax.config = originalConfig;
123086
+ };
123087
+
123088
+ if(MathJaxVersion === 2) {
123089
+ MathJax.Hub.Queue(
123090
+ setConfig2,
123091
+ setRenderer2,
123092
+ initiateMathJax,
123093
+ finalizeMathJax,
123094
+ resetRenderer2,
123095
+ resetConfig2
123096
+ );
123097
+ } else if(MathJaxVersion === 3) {
123098
+ setConfig3();
123099
+ setRenderer3();
123100
+ MathJax.startup.defaultReady();
123101
+
123102
+ MathJax.startup.promise.then(function() {
123103
+ initiateMathJax();
123104
+ finalizeMathJax();
123105
+
123106
+ resetRenderer3();
123107
+ resetConfig3();
123108
+ });
123109
+ }
123000
123110
  }
123001
123111
 
123002
123112
  var TAG_STYLES = {
@@ -128842,6 +128952,11 @@ var configAttributes = {
128842
128952
  dflt: false,
128843
128953
  },
128844
128954
 
128955
+ typesetMath: {
128956
+ valType: 'boolean',
128957
+ dflt: true,
128958
+ },
128959
+
128845
128960
  plotlyServerURL: {
128846
128961
  valType: 'string',
128847
128962
  dflt: '',
@@ -133687,7 +133802,8 @@ axes.calcTicks = function calcTicks(ax, opts) {
133687
133802
  var minRange = Math.min(rng[0], rng[1]);
133688
133803
  var maxRange = Math.max(rng[0], rng[1]);
133689
133804
 
133690
- var isDLog = (ax.type === 'log') && !(isNumeric(ax.dtick) || ax.dtick.charAt(0) === 'L');
133805
+ var numDtick = isNumeric(ax.dtick);
133806
+ var isDLog = (ax.type === 'log') && !(numDtick || ax.dtick.charAt(0) === 'L');
133691
133807
  var isPeriod = ax.ticklabelmode === 'period';
133692
133808
 
133693
133809
  // find the first tick
@@ -133718,13 +133834,36 @@ axes.calcTicks = function calcTicks(ax, opts) {
133718
133834
  x = axes.tickIncrement(x, ax.dtick, !axrev, ax.calendar);
133719
133835
  }
133720
133836
 
133837
+ var ticklabelstep = ax.ticklabelstep;
133838
+
133721
133839
  var maxTicks = Math.max(1000, ax._length || 0);
133722
133840
  var tickVals = [];
133723
133841
  var xPrevious = null;
133842
+
133843
+ var dTick;
133844
+ if(numDtick) {
133845
+ dTick = ax.dtick;
133846
+ } else {
133847
+ if(ax.type === 'date') {
133848
+ if(typeof ax.dtick === 'string' && ax.dtick.charAt(0) === 'M') {
133849
+ dTick = ONEAVGMONTH * ax.dtick.substring(1);
133850
+ }
133851
+ } else {
133852
+ dTick = ax._roughDTick;
133853
+ }
133854
+ }
133855
+
133856
+ var id = Math.round((
133857
+ ax.r2l(x) -
133858
+ ax.r2l(ax.tick0)
133859
+ ) / dTick) - 1;
133860
+
133724
133861
  for(;
133725
133862
  (axrev) ? (x >= endTick) : (x <= endTick);
133726
133863
  x = axes.tickIncrement(x, ax.dtick, axrev, ax.calendar)
133727
133864
  ) {
133865
+ id++;
133866
+
133728
133867
  if(ax.rangebreaks) {
133729
133868
  if(!axrev) {
133730
133869
  if(x < startTick) continue;
@@ -133742,10 +133881,16 @@ axes.calcTicks = function calcTicks(ax, opts) {
133742
133881
  minor = true;
133743
133882
  }
133744
133883
 
133745
- tickVals.push({
133884
+ var obj = {
133746
133885
  minor: minor,
133747
133886
  value: x
133748
- });
133887
+ };
133888
+
133889
+ if(ticklabelstep > 1 && id % ticklabelstep) {
133890
+ obj.skipLabel = true;
133891
+ }
133892
+
133893
+ tickVals.push(obj);
133749
133894
  }
133750
133895
 
133751
133896
  if(isPeriod) positionPeriodTicks(tickVals, ax, ax._definedDelta);
@@ -133798,12 +133943,20 @@ axes.calcTicks = function calcTicks(ax, opts) {
133798
133943
  ax._prevDateHead = '';
133799
133944
  ax._inCalcTicks = true;
133800
133945
 
133946
+ var lastVisibleHead;
133947
+ var hideLabel = function(tick) {
133948
+ tick.text = ' '; // don't use an empty string here which can confuse automargin (issue 5132)
133949
+ ax._prevDateHead = lastVisibleHead;
133950
+ };
133951
+
133801
133952
  var ticksOut = [];
133802
133953
  var t, p;
133803
133954
  for(i = 0; i < tickVals.length; i++) {
133804
133955
  var _minor = tickVals[i].minor;
133805
133956
  var _value = tickVals[i].value;
133806
133957
 
133958
+ lastVisibleHead = ax._prevDateHead;
133959
+
133807
133960
  t = axes.tickText(
133808
133961
  ax,
133809
133962
  _value,
@@ -133818,11 +133971,14 @@ axes.calcTicks = function calcTicks(ax, opts) {
133818
133971
  if(p > maxRange) t.periodX = maxRange;
133819
133972
  if(p < minRange) t.periodX = minRange;
133820
133973
 
133821
- t.text = ' '; // don't use an empty string here which can confuse automargin (issue 5132)
133822
- ax._prevDateHead = '';
133974
+ hideLabel(t);
133823
133975
  }
133824
133976
  }
133825
133977
 
133978
+ if(tickVals[i].skipLabel) {
133979
+ hideLabel(t);
133980
+ }
133981
+
133826
133982
  ticksOut.push(t);
133827
133983
  }
133828
133984
 
@@ -135850,6 +136006,7 @@ axes.drawLabels = function(gd, ax, opts) {
135850
136006
  var axId = ax._id;
135851
136007
  var axLetter = axId.charAt(0);
135852
136008
  var cls = opts.cls || axId + 'tick';
136009
+
135853
136010
  var vals = opts.vals;
135854
136011
 
135855
136012
  var labelFns = opts.labelFns;
@@ -140706,6 +140863,12 @@ module.exports = {
140706
140863
  editType: 'ticks',
140707
140864
  impliedEdits: {tickmode: 'linear'},
140708
140865
  },
140866
+ ticklabelstep: {
140867
+ valType: 'integer',
140868
+ min: 1,
140869
+ dflt: 1,
140870
+ editType: 'ticks',
140871
+ },
140709
140872
  tickvals: {
140710
140873
  valType: 'data_array',
140711
140874
  editType: 'ticks',
@@ -143570,6 +143733,14 @@ module.exports = function handleTickLabelDefaults(containerIn, containerOut, coe
143570
143733
  color: dfltFontColor
143571
143734
  });
143572
143735
 
143736
+ if(
143737
+ !options.noTicklabelstep &&
143738
+ axType !== 'multicategory' &&
143739
+ axType !== 'log'
143740
+ ) {
143741
+ coerce('ticklabelstep');
143742
+ }
143743
+
143573
143744
  if(!options.noAng) coerce('tickangle');
143574
143745
 
143575
143746
  if(axType !== 'category') {
@@ -148478,6 +148649,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) {
148478
148649
  showGrid: true,
148479
148650
  noTickson: true,
148480
148651
  noTicklabelmode: true,
148652
+ noTicklabelstep: true,
148481
148653
  noTicklabelposition: true,
148482
148654
  noTicklabeloverflow: true,
148483
148655
  bgColor: options.bgColor,
@@ -156320,6 +156492,7 @@ var axisTickAttrs = overrideAll({
156320
156492
  ticklen: axesAttrs.ticklen,
156321
156493
  tickwidth: axesAttrs.tickwidth,
156322
156494
  tickcolor: axesAttrs.tickcolor,
156495
+ ticklabelstep: axesAttrs.ticklabelstep,
156323
156496
  showticklabels: axesAttrs.showticklabels,
156324
156497
  showtickprefix: axesAttrs.showtickprefix,
156325
156498
  tickprefix: axesAttrs.tickprefix,
@@ -158874,6 +159047,7 @@ var ternaryAxesAttrs = {
158874
159047
  ticklen: axesAttrs.ticklen,
158875
159048
  tickwidth: axesAttrs.tickwidth,
158876
159049
  tickcolor: axesAttrs.tickcolor,
159050
+ ticklabelstep: axesAttrs.ticklabelstep,
158877
159051
  showticklabels: axesAttrs.showticklabels,
158878
159052
  showtickprefix: axesAttrs.showtickprefix,
158879
159053
  tickprefix: axesAttrs.tickprefix,
@@ -160894,7 +161068,7 @@ module.exports = function toSVG(gd, format, scale) {
160894
161068
  var toppaper = fullLayout._toppaper;
160895
161069
  var width = fullLayout.width;
160896
161070
  var height = fullLayout.height;
160897
- var i, k;
161071
+ var i;
160898
161072
 
160899
161073
  // make background color a rect in the svg, then revert after scraping
160900
161074
  // all other alterations have been dealt with by properly preparing the svg
@@ -160967,32 +161141,21 @@ module.exports = function toSVG(gd, format, scale) {
160967
161141
  }
160968
161142
  });
160969
161143
 
160970
- var queryParts = [];
160971
- if(fullLayout._gradientUrlQueryParts) {
160972
- for(k in fullLayout._gradientUrlQueryParts) queryParts.push(k);
160973
- }
160974
-
160975
- if(fullLayout._patternUrlQueryParts) {
160976
- for(k in fullLayout._patternUrlQueryParts) queryParts.push(k);
160977
- }
160978
-
160979
- if(queryParts.length) {
160980
- svg.selectAll(queryParts.join(',')).each(function() {
160981
- var pt = d3.select(this);
161144
+ svg.selectAll('.gradient_filled,.pattern_filled').each(function() {
161145
+ var pt = d3.select(this);
160982
161146
 
160983
- // similar to font family styles above,
160984
- // we must remove " after the SVG DOM has been serialized
160985
- var fill = this.style.fill;
160986
- if(fill && fill.indexOf('url(') !== -1) {
160987
- pt.style('fill', fill.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
160988
- }
161147
+ // similar to font family styles above,
161148
+ // we must remove " after the SVG DOM has been serialized
161149
+ var fill = this.style.fill;
161150
+ if(fill && fill.indexOf('url(') !== -1) {
161151
+ pt.style('fill', fill.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
161152
+ }
160989
161153
 
160990
- var stroke = this.style.stroke;
160991
- if(stroke && stroke.indexOf('url(') !== -1) {
160992
- pt.style('stroke', stroke.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
160993
- }
160994
- });
160995
- }
161154
+ var stroke = this.style.stroke;
161155
+ if(stroke && stroke.indexOf('url(') !== -1) {
161156
+ pt.style('stroke', stroke.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));
161157
+ }
161158
+ });
160996
161159
 
160997
161160
  if(format === 'pdf' || format === 'eps') {
160998
161161
  // these formats make the extra line MathJax adds around symbols look super thick in some cases
@@ -163352,6 +163515,7 @@ function calcTexttemplate(fullLayout, cd, index, xa, ya) {
163352
163515
  var trace = cd[0].trace;
163353
163516
  var texttemplate = Lib.castOption(trace, index, 'texttemplate');
163354
163517
  if(!texttemplate) return '';
163518
+ var isHistogram = (trace.type === 'histogram');
163355
163519
  var isWaterfall = (trace.type === 'waterfall');
163356
163520
  var isFunnel = (trace.type === 'funnel');
163357
163521
  var isHorizontal = trace.orientation === 'h';
@@ -163393,10 +163557,10 @@ function calcTexttemplate(fullLayout, cd, index, xa, ya) {
163393
163557
  var pt = {};
163394
163558
  appendArrayPointValue(pt, trace, cdi.i);
163395
163559
 
163396
- if(pt.x === undefined) pt.x = isHorizontal ? obj.value : obj.label;
163397
- if(pt.y === undefined) pt.y = isHorizontal ? obj.label : obj.value;
163398
- if(pt.xLabel === undefined) pt.xLabel = isHorizontal ? obj.valueLabel : obj.labelLabel;
163399
- if(pt.yLabel === undefined) pt.yLabel = isHorizontal ? obj.labelLabel : obj.valueLabel;
163560
+ if(isHistogram || pt.x === undefined) pt.x = isHorizontal ? obj.value : obj.label;
163561
+ if(isHistogram || pt.y === undefined) pt.y = isHorizontal ? obj.label : obj.value;
163562
+ if(isHistogram || pt.xLabel === undefined) pt.xLabel = isHorizontal ? obj.valueLabel : obj.labelLabel;
163563
+ if(isHistogram || pt.yLabel === undefined) pt.yLabel = isHorizontal ? obj.labelLabel : obj.valueLabel;
163400
163564
 
163401
163565
  if(isWaterfall) {
163402
163566
  obj.delta = +cdi.rawS || cdi.s;
@@ -166654,6 +166818,7 @@ function mimickAxisDefaults(traceIn, traceOut, fullLayout, dfltColor) {
166654
166818
  var axOut = Template.newContainer(traceOut, axName);
166655
166819
 
166656
166820
  var defaultOptions = {
166821
+ noTicklabelstep: true,
166657
166822
  tickfont: 'x',
166658
166823
  id: axLetter + 'axis',
166659
166824
  letter: axLetter,
@@ -181174,6 +181339,7 @@ module.exports = {
181174
181339
  ticklen: axesAttrs.ticklen,
181175
181340
  tickwidth: axesAttrs.tickwidth,
181176
181341
  tickcolor: axesAttrs.tickcolor,
181342
+ ticklabelstep: axesAttrs.ticklabelstep,
181177
181343
  showticklabels: axesAttrs.showticklabels,
181178
181344
  tickfont: fontAttrs({
181179
181345
  }),
@@ -192243,6 +192409,7 @@ var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplat
192243
192409
  var colorScaleAttrs = _dereq_('../../components/colorscale/attributes');
192244
192410
  var fontAttrs = _dereq_('../../plots/font_attributes');
192245
192411
  var dash = _dereq_('../../components/drawing/attributes').dash;
192412
+ var pattern = _dereq_('../../components/drawing/attributes').pattern;
192246
192413
 
192247
192414
  var Drawing = _dereq_('../../components/drawing');
192248
192415
  var constants = _dereq_('./constants');
@@ -192430,6 +192597,7 @@ module.exports = {
192430
192597
  editType: 'style',
192431
192598
  anim: true,
192432
192599
  },
192600
+ fillpattern: pattern,
192433
192601
  marker: extendFlat({
192434
192602
  symbol: {
192435
192603
  valType: 'enumerated',
@@ -193166,6 +193334,7 @@ var handleLineDefaults = _dereq_('./line_defaults');
193166
193334
  var handleLineShapeDefaults = _dereq_('./line_shape_defaults');
193167
193335
  var handleTextDefaults = _dereq_('./text_defaults');
193168
193336
  var handleFillColorDefaults = _dereq_('./fillcolor_defaults');
193337
+ var coercePattern = _dereq_('../../lib').coercePattern;
193169
193338
 
193170
193339
  module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
193171
193340
  function coerce(attr, dflt) {
@@ -193219,6 +193388,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
193219
193388
  if(traceOut.fill !== 'none') {
193220
193389
  handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);
193221
193390
  if(!subTypes.hasLines(traceOut)) handleLineShapeDefaults(traceIn, traceOut, coerce);
193391
+ coercePattern(coerce, 'fillpattern', traceOut.fillcolor, false);
193222
193392
  }
193223
193393
 
193224
193394
  var lineColor = (traceOut.line || {}).color;
@@ -194601,11 +194771,11 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
194601
194771
  // the points on the axes are the first two points. Otherwise
194602
194772
  // animations get a little crazy if the number of points changes.
194603
194773
  transition(ownFillEl3).attr('d', 'M' + pt1 + 'L' + pt0 + 'L' + fullpath.substr(1))
194604
- .call(Drawing.singleFillStyle);
194774
+ .call(Drawing.singleFillStyle, gd);
194605
194775
  } else {
194606
194776
  // fill to self: just join the path to itself
194607
194777
  transition(ownFillEl3).attr('d', fullpath + 'Z')
194608
- .call(Drawing.singleFillStyle);
194778
+ .call(Drawing.singleFillStyle, gd);
194609
194779
  }
194610
194780
  }
194611
194781
  } else if(tonext) {
@@ -194617,7 +194787,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
194617
194787
  // This makes strange results if one path is *not* entirely
194618
194788
  // inside the other, but then that is a strange usage.
194619
194789
  transition(tonext).attr('d', fullpath + 'Z' + prevRevpath + 'Z')
194620
- .call(Drawing.singleFillStyle);
194790
+ .call(Drawing.singleFillStyle, gd);
194621
194791
  } else {
194622
194792
  // tonextx/y: for now just connect endpoints with lines. This is
194623
194793
  // the correct behavior if the endpoints are at the same value of
@@ -194625,7 +194795,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
194625
194795
  // things depending on whether the new endpoint projects onto the
194626
194796
  // existing curve or off the end of it
194627
194797
  transition(tonext).attr('d', fullpath + 'L' + prevRevpath.substr(1) + 'Z')
194628
- .call(Drawing.singleFillStyle);
194798
+ .call(Drawing.singleFillStyle, gd);
194629
194799
  }
194630
194800
  trace._polygons = trace._polygons.concat(prevPolygons);
194631
194801
  } else {
@@ -195018,7 +195188,7 @@ function style(gd) {
195018
195188
  .call(Drawing.lineGroupStyle);
195019
195189
 
195020
195190
  s.selectAll('g.trace path.js-fill')
195021
- .call(Drawing.fillGroupStyle);
195191
+ .call(Drawing.fillGroupStyle, gd);
195022
195192
 
195023
195193
  Registry.getComponentMethod('errorbars', 'style')(s);
195024
195194
  }
@@ -208366,7 +208536,7 @@ function getSortFunc(opts, d2c) {
208366
208536
  'use strict';
208367
208537
 
208368
208538
  // package version injected by `npm run preprocess`
208369
- exports.version = '2.8.2';
208539
+ exports.version = '2.10.0';
208370
208540
 
208371
208541
  },{}],934:[function(_dereq_,module,exports){
208372
208542
  (function (global){(function (){