plotly.js 2.8.3 → 2.9.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 (74) hide show
  1. package/.circleci/env_image.sh +1 -1
  2. package/CHANGELOG.md +13 -0
  3. package/README.md +3 -3
  4. package/dist/README.md +26 -26
  5. package/dist/plot-schema.json +315 -0
  6. package/dist/plotly-basic.js +76 -11
  7. package/dist/plotly-basic.min.js +5 -5
  8. package/dist/plotly-cartesian.js +86 -12
  9. package/dist/plotly-cartesian.min.js +3 -3
  10. package/dist/plotly-finance.js +77 -11
  11. package/dist/plotly-finance.min.js +3 -3
  12. package/dist/plotly-geo-assets.js +3 -3
  13. package/dist/plotly-geo.js +76 -11
  14. package/dist/plotly-geo.min.js +3 -3
  15. package/dist/plotly-gl2d.js +76 -11
  16. package/dist/plotly-gl2d.min.js +3 -3
  17. package/dist/plotly-gl3d.js +77 -11
  18. package/dist/plotly-gl3d.min.js +9 -9
  19. package/dist/plotly-locale-cs.js +1 -1
  20. package/dist/plotly-locale-cy.js +1 -1
  21. package/dist/plotly-locale-de.js +1 -1
  22. package/dist/plotly-locale-es.js +1 -1
  23. package/dist/plotly-locale-fi.js +1 -1
  24. package/dist/plotly-locale-fr.js +1 -1
  25. package/dist/plotly-locale-it.js +1 -1
  26. package/dist/plotly-locale-ja.js +1 -1
  27. package/dist/plotly-locale-ko.js +1 -1
  28. package/dist/plotly-locale-pt-br.js +1 -1
  29. package/dist/plotly-locale-pt-pt.js +1 -1
  30. package/dist/plotly-locale-ru.js +1 -1
  31. package/dist/plotly-locale-sv.js +1 -1
  32. package/dist/plotly-locale-sw.js +1 -1
  33. package/dist/plotly-locale-uk.js +1 -1
  34. package/dist/plotly-locale-zh-cn.js +1 -1
  35. package/dist/plotly-mapbox.js +76 -11
  36. package/dist/plotly-mapbox.min.js +3 -3
  37. package/dist/plotly-strict.js +90 -12
  38. package/dist/plotly-strict.min.js +3 -3
  39. package/dist/plotly-with-meta.js +99 -12
  40. package/dist/plotly.js +91 -12
  41. package/dist/plotly.min.js +11 -11
  42. package/dist/translation-keys.txt +1 -1
  43. package/lib/locales/cs.js +1 -1
  44. package/lib/locales/cy.js +1 -1
  45. package/lib/locales/de.js +1 -1
  46. package/lib/locales/es.js +1 -1
  47. package/lib/locales/fi.js +1 -1
  48. package/lib/locales/fr.js +1 -1
  49. package/lib/locales/it.js +1 -1
  50. package/lib/locales/ja.js +1 -1
  51. package/lib/locales/ko.js +1 -1
  52. package/lib/locales/pt-br.js +1 -1
  53. package/lib/locales/pt-pt.js +1 -1
  54. package/lib/locales/ru.js +1 -1
  55. package/lib/locales/sv.js +1 -1
  56. package/lib/locales/sw.js +1 -1
  57. package/lib/locales/uk.js +1 -1
  58. package/lib/locales/zh-cn.js +1 -1
  59. package/package.json +11 -11
  60. package/src/components/colorbar/attributes.js +1 -0
  61. package/src/components/colorbar/draw.js +1 -0
  62. package/src/components/legend/draw.js +2 -1
  63. package/src/components/modebar/modebar.js +7 -1
  64. package/src/plots/cartesian/axes.js +47 -5
  65. package/src/plots/cartesian/layout_attributes.js +14 -0
  66. package/src/plots/cartesian/tick_label_defaults.js +8 -0
  67. package/src/plots/gl3d/layout/axis_defaults.js +1 -0
  68. package/src/plots/polar/layout_attributes.js +1 -0
  69. package/src/plots/smith/layout_defaults.js +1 -0
  70. package/src/plots/ternary/layout_attributes.js +1 -0
  71. package/src/traces/carpet/ab_defaults.js +1 -0
  72. package/src/traces/indicator/attributes.js +1 -0
  73. package/src/version.js +1 -1
  74. package/.vscode/launch.json +0 -0
@@ -1,6 +1,6 @@
1
1
  /**
2
- * plotly.js v2.8.3
3
- * Copyright 2012-2021, Plotly, Inc.
2
+ * plotly.js v2.9.0
3
+ * Copyright 2012-2022, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
6
6
  */
@@ -86336,7 +86336,15 @@ exports.readUInt32BE = function (data, offset) {
86336
86336
 
86337
86337
  function ProbeError(message, code, statusCode) {
86338
86338
  Error.call(this);
86339
- Error.captureStackTrace(this, this.constructor);
86339
+
86340
+ // Include stack trace in error object
86341
+ if (Error.captureStackTrace) {
86342
+ // Chrome and NodeJS
86343
+ Error.captureStackTrace(this, this.constructor);
86344
+ } else {
86345
+ // FF, IE 10+ and Safari 6+. Fallback for others
86346
+ this.stack = (new Error()).stack || '';
86347
+ }
86340
86348
 
86341
86349
  this.name = this.constructor.name;
86342
86350
 
@@ -106402,6 +106410,7 @@ module.exports = overrideAll({
106402
106410
  ticklen: axesAttrs.ticklen,
106403
106411
  tickwidth: axesAttrs.tickwidth,
106404
106412
  tickcolor: axesAttrs.tickcolor,
106413
+ ticklabelstep: axesAttrs.ticklabelstep,
106405
106414
  showticklabels: axesAttrs.showticklabels,
106406
106415
  tickfont: fontAttrs({
106407
106416
  description: 'Sets the color bar\'s tick label font'
@@ -107519,6 +107528,7 @@ function mockColorBarAxis(gd, opts, zrange) {
107519
107528
  showticklabels: opts.showticklabels,
107520
107529
  ticklabelposition: opts.ticklabelposition,
107521
107530
  ticklabeloverflow: opts.ticklabeloverflow,
107531
+ ticklabelstep: opts.ticklabelstep,
107522
107532
  tickfont: opts.tickfont,
107523
107533
  tickangle: opts.tickangle,
107524
107534
  tickformat: opts.tickformat,
@@ -116815,7 +116825,6 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
116815
116825
  offsetY += h;
116816
116826
  maxWidthInGroup = Math.max(maxWidthInGroup, textGap + w);
116817
116827
  });
116818
- maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);
116819
116828
 
116820
116829
  var next = maxWidthInGroup + itemGap;
116821
116830
 
@@ -116831,6 +116840,8 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
116831
116840
  groupOffsetX = 0;
116832
116841
  groupOffsetY += maxGroupHeightInRow + traceGroupGap;
116833
116842
  maxGroupHeightInRow = offsetY;
116843
+ } else {
116844
+ maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);
116834
116845
  }
116835
116846
 
116836
116847
  Drawing.setTranslate(this, groupOffsetX, groupOffsetY);
@@ -119334,6 +119345,8 @@ var isNumeric = _dereq_('fast-isnumeric');
119334
119345
 
119335
119346
  var Lib = _dereq_('../../lib');
119336
119347
  var Icons = _dereq_('../../fonts/ploticon');
119348
+ var version = _dereq_('../../version').version;
119349
+
119337
119350
  var Parser = new DOMParser();
119338
119351
 
119339
119352
  /**
@@ -119612,6 +119625,10 @@ proto.hasButtons = function(buttons) {
119612
119625
  return true;
119613
119626
  };
119614
119627
 
119628
+ function jsVersion(str) {
119629
+ return str + ' (v' + version + ')';
119630
+ }
119631
+
119615
119632
  /**
119616
119633
  * @return {HTMLDivElement} The logo image wrapped in a group
119617
119634
  */
@@ -119621,7 +119638,7 @@ proto.getLogo = function() {
119621
119638
 
119622
119639
  a.href = 'https://plotly.com/';
119623
119640
  a.target = '_blank';
119624
- a.setAttribute('data-title', Lib._(this.graphInfo, 'Produced with Plotly'));
119641
+ a.setAttribute('data-title', jsVersion(Lib._(this.graphInfo, 'Produced with Plotly.js')));
119625
119642
  a.className = 'modebar-btn plotlyjsicon modebar-btn--logo';
119626
119643
 
119627
119644
  a.appendChild(this.createIcon(Icons.newplotlylogo));
@@ -119663,7 +119680,7 @@ function createModeBar(gd, buttons) {
119663
119680
 
119664
119681
  module.exports = createModeBar;
119665
119682
 
119666
- },{"../../fonts/ploticon":482,"../../lib":503,"@plotly/d3":58,"fast-isnumeric":190}],432:[function(_dereq_,module,exports){
119683
+ },{"../../fonts/ploticon":482,"../../lib":503,"../../version":1119,"@plotly/d3":58,"fast-isnumeric":190}],432:[function(_dereq_,module,exports){
119667
119684
  'use strict';
119668
119685
 
119669
119686
  var fontAttrs = _dereq_('../../plots/font_attributes');
@@ -144809,7 +144826,8 @@ axes.calcTicks = function calcTicks(ax, opts) {
144809
144826
  var minRange = Math.min(rng[0], rng[1]);
144810
144827
  var maxRange = Math.max(rng[0], rng[1]);
144811
144828
 
144812
- var isDLog = (ax.type === 'log') && !(isNumeric(ax.dtick) || ax.dtick.charAt(0) === 'L');
144829
+ var numDtick = isNumeric(ax.dtick);
144830
+ var isDLog = (ax.type === 'log') && !(numDtick || ax.dtick.charAt(0) === 'L');
144813
144831
  var isPeriod = ax.ticklabelmode === 'period';
144814
144832
 
144815
144833
  // find the first tick
@@ -144840,13 +144858,36 @@ axes.calcTicks = function calcTicks(ax, opts) {
144840
144858
  x = axes.tickIncrement(x, ax.dtick, !axrev, ax.calendar);
144841
144859
  }
144842
144860
 
144861
+ var ticklabelstep = ax.ticklabelstep;
144862
+
144843
144863
  var maxTicks = Math.max(1000, ax._length || 0);
144844
144864
  var tickVals = [];
144845
144865
  var xPrevious = null;
144866
+
144867
+ var dTick;
144868
+ if(numDtick) {
144869
+ dTick = ax.dtick;
144870
+ } else {
144871
+ if(ax.type === 'date') {
144872
+ if(typeof ax.dtick === 'string' && ax.dtick.charAt(0) === 'M') {
144873
+ dTick = ONEAVGMONTH * ax.dtick.substring(1);
144874
+ }
144875
+ } else {
144876
+ dTick = ax._roughDTick;
144877
+ }
144878
+ }
144879
+
144880
+ var id = Math.round((
144881
+ ax.r2l(x) -
144882
+ ax.r2l(ax.tick0)
144883
+ ) / dTick) - 1;
144884
+
144846
144885
  for(;
144847
144886
  (axrev) ? (x >= endTick) : (x <= endTick);
144848
144887
  x = axes.tickIncrement(x, ax.dtick, axrev, ax.calendar)
144849
144888
  ) {
144889
+ id++;
144890
+
144850
144891
  if(ax.rangebreaks) {
144851
144892
  if(!axrev) {
144852
144893
  if(x < startTick) continue;
@@ -144864,10 +144905,16 @@ axes.calcTicks = function calcTicks(ax, opts) {
144864
144905
  minor = true;
144865
144906
  }
144866
144907
 
144867
- tickVals.push({
144908
+ var obj = {
144868
144909
  minor: minor,
144869
144910
  value: x
144870
- });
144911
+ };
144912
+
144913
+ if(ticklabelstep > 1 && id % ticklabelstep) {
144914
+ obj.skipLabel = true;
144915
+ }
144916
+
144917
+ tickVals.push(obj);
144871
144918
  }
144872
144919
 
144873
144920
  if(isPeriod) positionPeriodTicks(tickVals, ax, ax._definedDelta);
@@ -144920,12 +144967,20 @@ axes.calcTicks = function calcTicks(ax, opts) {
144920
144967
  ax._prevDateHead = '';
144921
144968
  ax._inCalcTicks = true;
144922
144969
 
144970
+ var lastVisibleHead;
144971
+ var hideLabel = function(tick) {
144972
+ tick.text = ' '; // don't use an empty string here which can confuse automargin (issue 5132)
144973
+ ax._prevDateHead = lastVisibleHead;
144974
+ };
144975
+
144923
144976
  var ticksOut = [];
144924
144977
  var t, p;
144925
144978
  for(i = 0; i < tickVals.length; i++) {
144926
144979
  var _minor = tickVals[i].minor;
144927
144980
  var _value = tickVals[i].value;
144928
144981
 
144982
+ lastVisibleHead = ax._prevDateHead;
144983
+
144929
144984
  t = axes.tickText(
144930
144985
  ax,
144931
144986
  _value,
@@ -144940,11 +144995,14 @@ axes.calcTicks = function calcTicks(ax, opts) {
144940
144995
  if(p > maxRange) t.periodX = maxRange;
144941
144996
  if(p < minRange) t.periodX = minRange;
144942
144997
 
144943
- t.text = ' '; // don't use an empty string here which can confuse automargin (issue 5132)
144944
- ax._prevDateHead = '';
144998
+ hideLabel(t);
144945
144999
  }
144946
145000
  }
144947
145001
 
145002
+ if(tickVals[i].skipLabel) {
145003
+ hideLabel(t);
145004
+ }
145005
+
144948
145006
  ticksOut.push(t);
144949
145007
  }
144950
145008
 
@@ -146972,6 +147030,7 @@ axes.drawLabels = function(gd, ax, opts) {
146972
147030
  var axId = ax._id;
146973
147031
  var axLetter = axId.charAt(0);
146974
147032
  var cls = opts.cls || axId + 'tick';
147033
+
146975
147034
  var vals = opts.vals;
146976
147035
 
146977
147036
  var labelFns = opts.labelFns;
@@ -152033,6 +152092,20 @@ module.exports = {
152033
152092
  'To set ticks every 4 years, set `dtick` to *M48*'
152034
152093
  ].join(' ')
152035
152094
  },
152095
+ ticklabelstep: {
152096
+ valType: 'integer',
152097
+ min: 1,
152098
+ dflt: 1,
152099
+ editType: 'ticks',
152100
+ description: [
152101
+ 'Sets the spacing between tick labels as compared to the spacing between ticks.',
152102
+ 'A value of 1 (default) means each tick gets a label.',
152103
+ 'A value of 2 means shows every 2nd label.',
152104
+ 'A larger value n means only every nth tick is labeled.',
152105
+ '`tick0` determines which labels are shown.',
152106
+ 'Not implemented for axes with `type` *log* or *multicategory*, or when `tickmode` is *array*.'
152107
+ ].join(' ')
152108
+ },
152036
152109
  tickvals: {
152037
152110
  valType: 'data_array',
152038
152111
  editType: 'ticks',
@@ -155130,6 +155203,14 @@ module.exports = function handleTickLabelDefaults(containerIn, containerOut, coe
155130
155203
  color: dfltFontColor
155131
155204
  });
155132
155205
 
155206
+ if(
155207
+ !options.noTicklabelstep &&
155208
+ axType !== 'multicategory' &&
155209
+ axType !== 'log'
155210
+ ) {
155211
+ coerce('ticklabelstep');
155212
+ }
155213
+
155133
155214
  if(!options.noAng) coerce('tickangle');
155134
155215
 
155135
155216
  if(axType !== 'category') {
@@ -160256,6 +160337,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) {
160256
160337
  showGrid: true,
160257
160338
  noTickson: true,
160258
160339
  noTicklabelmode: true,
160340
+ noTicklabelstep: true,
160259
160341
  noTicklabelposition: true,
160260
160342
  noTicklabeloverflow: true,
160261
160343
  bgColor: options.bgColor,
@@ -168522,6 +168604,7 @@ var axisTickAttrs = overrideAll({
168522
168604
  ticklen: axesAttrs.ticklen,
168523
168605
  tickwidth: axesAttrs.tickwidth,
168524
168606
  tickcolor: axesAttrs.tickcolor,
168607
+ ticklabelstep: axesAttrs.ticklabelstep,
168525
168608
  showticklabels: axesAttrs.showticklabels,
168526
168609
  showtickprefix: axesAttrs.showtickprefix,
168527
168610
  tickprefix: axesAttrs.tickprefix,
@@ -171175,6 +171258,7 @@ function handleDefaults(contIn, contOut, coerce, opts) {
171175
171258
  }
171176
171259
 
171177
171260
  handleTickLabelDefaults(axIn, axOut, coerceAxis, axOut.type, {
171261
+ noTicklabelstep: true,
171178
171262
  noAng: !isRealAxis,
171179
171263
  noExp: true,
171180
171264
  font: {
@@ -171519,6 +171603,7 @@ var ternaryAxesAttrs = {
171519
171603
  ticklen: axesAttrs.ticklen,
171520
171604
  tickwidth: axesAttrs.tickwidth,
171521
171605
  tickcolor: axesAttrs.tickcolor,
171606
+ ticklabelstep: axesAttrs.ticklabelstep,
171522
171607
  showticklabels: axesAttrs.showticklabels,
171523
171608
  showtickprefix: axesAttrs.showtickprefix,
171524
171609
  tickprefix: axesAttrs.tickprefix,
@@ -179713,6 +179798,7 @@ function mimickAxisDefaults(traceIn, traceOut, fullLayout, dfltColor) {
179713
179798
  var axOut = Template.newContainer(traceOut, axName);
179714
179799
 
179715
179800
  var defaultOptions = {
179801
+ noTicklabelstep: true,
179716
179802
  tickfont: 'x',
179717
179803
  id: axLetter + 'axis',
179718
179804
  letter: axLetter,
@@ -195234,6 +195320,7 @@ module.exports = {
195234
195320
  ticklen: axesAttrs.ticklen,
195235
195321
  tickwidth: axesAttrs.tickwidth,
195236
195322
  tickcolor: axesAttrs.tickcolor,
195323
+ ticklabelstep: axesAttrs.ticklabelstep,
195237
195324
  showticklabels: axesAttrs.showticklabels,
195238
195325
  tickfont: fontAttrs({
195239
195326
  description: 'Sets the color bar\'s tick label font'
@@ -230520,7 +230607,7 @@ function getSortFunc(opts, d2c) {
230520
230607
  'use strict';
230521
230608
 
230522
230609
  // package version injected by `npm run preprocess`
230523
- exports.version = '2.8.3';
230610
+ exports.version = '2.9.0';
230524
230611
 
230525
230612
  },{}],1120:[function(_dereq_,module,exports){
230526
230613
  (function (global){(function (){
package/dist/plotly.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * plotly.js v2.8.3
3
- * Copyright 2012-2021, Plotly, Inc.
2
+ * plotly.js v2.9.0
3
+ * Copyright 2012-2022, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
6
6
  */
@@ -86336,7 +86336,15 @@ exports.readUInt32BE = function (data, offset) {
86336
86336
 
86337
86337
  function ProbeError(message, code, statusCode) {
86338
86338
  Error.call(this);
86339
- Error.captureStackTrace(this, this.constructor);
86339
+
86340
+ // Include stack trace in error object
86341
+ if (Error.captureStackTrace) {
86342
+ // Chrome and NodeJS
86343
+ Error.captureStackTrace(this, this.constructor);
86344
+ } else {
86345
+ // FF, IE 10+ and Safari 6+. Fallback for others
86346
+ this.stack = (new Error()).stack || '';
86347
+ }
86340
86348
 
86341
86349
  this.name = this.constructor.name;
86342
86350
 
@@ -106110,6 +106118,7 @@ module.exports = overrideAll({
106110
106118
  ticklen: axesAttrs.ticklen,
106111
106119
  tickwidth: axesAttrs.tickwidth,
106112
106120
  tickcolor: axesAttrs.tickcolor,
106121
+ ticklabelstep: axesAttrs.ticklabelstep,
106113
106122
  showticklabels: axesAttrs.showticklabels,
106114
106123
  tickfont: fontAttrs({
106115
106124
  }),
@@ -107200,6 +107209,7 @@ function mockColorBarAxis(gd, opts, zrange) {
107200
107209
  showticklabels: opts.showticklabels,
107201
107210
  ticklabelposition: opts.ticklabelposition,
107202
107211
  ticklabeloverflow: opts.ticklabeloverflow,
107212
+ ticklabelstep: opts.ticklabelstep,
107203
107213
  tickfont: opts.tickfont,
107204
107214
  tickangle: opts.tickangle,
107205
107215
  tickformat: opts.tickformat,
@@ -116006,7 +116016,6 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
116006
116016
  offsetY += h;
116007
116017
  maxWidthInGroup = Math.max(maxWidthInGroup, textGap + w);
116008
116018
  });
116009
- maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);
116010
116019
 
116011
116020
  var next = maxWidthInGroup + itemGap;
116012
116021
 
@@ -116022,6 +116031,8 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
116022
116031
  groupOffsetX = 0;
116023
116032
  groupOffsetY += maxGroupHeightInRow + traceGroupGap;
116024
116033
  maxGroupHeightInRow = offsetY;
116034
+ } else {
116035
+ maxGroupHeightInRow = Math.max(maxGroupHeightInRow, offsetY);
116025
116036
  }
116026
116037
 
116027
116038
  Drawing.setTranslate(this, groupOffsetX, groupOffsetY);
@@ -118504,6 +118515,8 @@ var isNumeric = _dereq_('fast-isnumeric');
118504
118515
 
118505
118516
  var Lib = _dereq_('../../lib');
118506
118517
  var Icons = _dereq_('../../fonts/ploticon');
118518
+ var version = _dereq_('../../version').version;
118519
+
118507
118520
  var Parser = new DOMParser();
118508
118521
 
118509
118522
  /**
@@ -118782,6 +118795,10 @@ proto.hasButtons = function(buttons) {
118782
118795
  return true;
118783
118796
  };
118784
118797
 
118798
+ function jsVersion(str) {
118799
+ return str + ' (v' + version + ')';
118800
+ }
118801
+
118785
118802
  /**
118786
118803
  * @return {HTMLDivElement} The logo image wrapped in a group
118787
118804
  */
@@ -118791,7 +118808,7 @@ proto.getLogo = function() {
118791
118808
 
118792
118809
  a.href = 'https://plotly.com/';
118793
118810
  a.target = '_blank';
118794
- a.setAttribute('data-title', Lib._(this.graphInfo, 'Produced with Plotly'));
118811
+ a.setAttribute('data-title', jsVersion(Lib._(this.graphInfo, 'Produced with Plotly.js')));
118795
118812
  a.className = 'modebar-btn plotlyjsicon modebar-btn--logo';
118796
118813
 
118797
118814
  a.appendChild(this.createIcon(Icons.newplotlylogo));
@@ -118833,7 +118850,7 @@ function createModeBar(gd, buttons) {
118833
118850
 
118834
118851
  module.exports = createModeBar;
118835
118852
 
118836
- },{"../../fonts/ploticon":482,"../../lib":503,"@plotly/d3":58,"fast-isnumeric":190}],432:[function(_dereq_,module,exports){
118853
+ },{"../../fonts/ploticon":482,"../../lib":503,"../../version":1119,"@plotly/d3":58,"fast-isnumeric":190}],432:[function(_dereq_,module,exports){
118837
118854
  'use strict';
118838
118855
 
118839
118856
  var fontAttrs = _dereq_('../../plots/font_attributes');
@@ -143031,7 +143048,8 @@ axes.calcTicks = function calcTicks(ax, opts) {
143031
143048
  var minRange = Math.min(rng[0], rng[1]);
143032
143049
  var maxRange = Math.max(rng[0], rng[1]);
143033
143050
 
143034
- var isDLog = (ax.type === 'log') && !(isNumeric(ax.dtick) || ax.dtick.charAt(0) === 'L');
143051
+ var numDtick = isNumeric(ax.dtick);
143052
+ var isDLog = (ax.type === 'log') && !(numDtick || ax.dtick.charAt(0) === 'L');
143035
143053
  var isPeriod = ax.ticklabelmode === 'period';
143036
143054
 
143037
143055
  // find the first tick
@@ -143062,13 +143080,36 @@ axes.calcTicks = function calcTicks(ax, opts) {
143062
143080
  x = axes.tickIncrement(x, ax.dtick, !axrev, ax.calendar);
143063
143081
  }
143064
143082
 
143083
+ var ticklabelstep = ax.ticklabelstep;
143084
+
143065
143085
  var maxTicks = Math.max(1000, ax._length || 0);
143066
143086
  var tickVals = [];
143067
143087
  var xPrevious = null;
143088
+
143089
+ var dTick;
143090
+ if(numDtick) {
143091
+ dTick = ax.dtick;
143092
+ } else {
143093
+ if(ax.type === 'date') {
143094
+ if(typeof ax.dtick === 'string' && ax.dtick.charAt(0) === 'M') {
143095
+ dTick = ONEAVGMONTH * ax.dtick.substring(1);
143096
+ }
143097
+ } else {
143098
+ dTick = ax._roughDTick;
143099
+ }
143100
+ }
143101
+
143102
+ var id = Math.round((
143103
+ ax.r2l(x) -
143104
+ ax.r2l(ax.tick0)
143105
+ ) / dTick) - 1;
143106
+
143068
143107
  for(;
143069
143108
  (axrev) ? (x >= endTick) : (x <= endTick);
143070
143109
  x = axes.tickIncrement(x, ax.dtick, axrev, ax.calendar)
143071
143110
  ) {
143111
+ id++;
143112
+
143072
143113
  if(ax.rangebreaks) {
143073
143114
  if(!axrev) {
143074
143115
  if(x < startTick) continue;
@@ -143086,10 +143127,16 @@ axes.calcTicks = function calcTicks(ax, opts) {
143086
143127
  minor = true;
143087
143128
  }
143088
143129
 
143089
- tickVals.push({
143130
+ var obj = {
143090
143131
  minor: minor,
143091
143132
  value: x
143092
- });
143133
+ };
143134
+
143135
+ if(ticklabelstep > 1 && id % ticklabelstep) {
143136
+ obj.skipLabel = true;
143137
+ }
143138
+
143139
+ tickVals.push(obj);
143093
143140
  }
143094
143141
 
143095
143142
  if(isPeriod) positionPeriodTicks(tickVals, ax, ax._definedDelta);
@@ -143142,12 +143189,20 @@ axes.calcTicks = function calcTicks(ax, opts) {
143142
143189
  ax._prevDateHead = '';
143143
143190
  ax._inCalcTicks = true;
143144
143191
 
143192
+ var lastVisibleHead;
143193
+ var hideLabel = function(tick) {
143194
+ tick.text = ' '; // don't use an empty string here which can confuse automargin (issue 5132)
143195
+ ax._prevDateHead = lastVisibleHead;
143196
+ };
143197
+
143145
143198
  var ticksOut = [];
143146
143199
  var t, p;
143147
143200
  for(i = 0; i < tickVals.length; i++) {
143148
143201
  var _minor = tickVals[i].minor;
143149
143202
  var _value = tickVals[i].value;
143150
143203
 
143204
+ lastVisibleHead = ax._prevDateHead;
143205
+
143151
143206
  t = axes.tickText(
143152
143207
  ax,
143153
143208
  _value,
@@ -143162,11 +143217,14 @@ axes.calcTicks = function calcTicks(ax, opts) {
143162
143217
  if(p > maxRange) t.periodX = maxRange;
143163
143218
  if(p < minRange) t.periodX = minRange;
143164
143219
 
143165
- t.text = ' '; // don't use an empty string here which can confuse automargin (issue 5132)
143166
- ax._prevDateHead = '';
143220
+ hideLabel(t);
143167
143221
  }
143168
143222
  }
143169
143223
 
143224
+ if(tickVals[i].skipLabel) {
143225
+ hideLabel(t);
143226
+ }
143227
+
143170
143228
  ticksOut.push(t);
143171
143229
  }
143172
143230
 
@@ -145194,6 +145252,7 @@ axes.drawLabels = function(gd, ax, opts) {
145194
145252
  var axId = ax._id;
145195
145253
  var axLetter = axId.charAt(0);
145196
145254
  var cls = opts.cls || axId + 'tick';
145255
+
145197
145256
  var vals = opts.vals;
145198
145257
 
145199
145258
  var labelFns = opts.labelFns;
@@ -150050,6 +150109,12 @@ module.exports = {
150050
150109
  editType: 'ticks',
150051
150110
  impliedEdits: {tickmode: 'linear'},
150052
150111
  },
150112
+ ticklabelstep: {
150113
+ valType: 'integer',
150114
+ min: 1,
150115
+ dflt: 1,
150116
+ editType: 'ticks',
150117
+ },
150053
150118
  tickvals: {
150054
150119
  valType: 'data_array',
150055
150120
  editType: 'ticks',
@@ -152914,6 +152979,14 @@ module.exports = function handleTickLabelDefaults(containerIn, containerOut, coe
152914
152979
  color: dfltFontColor
152915
152980
  });
152916
152981
 
152982
+ if(
152983
+ !options.noTicklabelstep &&
152984
+ axType !== 'multicategory' &&
152985
+ axType !== 'log'
152986
+ ) {
152987
+ coerce('ticklabelstep');
152988
+ }
152989
+
152917
152990
  if(!options.noAng) coerce('tickangle');
152918
152991
 
152919
152992
  if(axType !== 'category') {
@@ -157822,6 +157895,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) {
157822
157895
  showGrid: true,
157823
157896
  noTickson: true,
157824
157897
  noTicklabelmode: true,
157898
+ noTicklabelstep: true,
157825
157899
  noTicklabelposition: true,
157826
157900
  noTicklabeloverflow: true,
157827
157901
  bgColor: options.bgColor,
@@ -165664,6 +165738,7 @@ var axisTickAttrs = overrideAll({
165664
165738
  ticklen: axesAttrs.ticklen,
165665
165739
  tickwidth: axesAttrs.tickwidth,
165666
165740
  tickcolor: axesAttrs.tickcolor,
165741
+ ticklabelstep: axesAttrs.ticklabelstep,
165667
165742
  showticklabels: axesAttrs.showticklabels,
165668
165743
  showtickprefix: axesAttrs.showtickprefix,
165669
165744
  tickprefix: axesAttrs.tickprefix,
@@ -168222,6 +168297,7 @@ function handleDefaults(contIn, contOut, coerce, opts) {
168222
168297
  }
168223
168298
 
168224
168299
  handleTickLabelDefaults(axIn, axOut, coerceAxis, axOut.type, {
168300
+ noTicklabelstep: true,
168225
168301
  noAng: !isRealAxis,
168226
168302
  noExp: true,
168227
168303
  font: {
@@ -168543,6 +168619,7 @@ var ternaryAxesAttrs = {
168543
168619
  ticklen: axesAttrs.ticklen,
168544
168620
  tickwidth: axesAttrs.tickwidth,
168545
168621
  tickcolor: axesAttrs.tickcolor,
168622
+ ticklabelstep: axesAttrs.ticklabelstep,
168546
168623
  showticklabels: axesAttrs.showticklabels,
168547
168624
  showtickprefix: axesAttrs.showtickprefix,
168548
168625
  tickprefix: axesAttrs.tickprefix,
@@ -176324,6 +176401,7 @@ function mimickAxisDefaults(traceIn, traceOut, fullLayout, dfltColor) {
176324
176401
  var axOut = Template.newContainer(traceOut, axName);
176325
176402
 
176326
176403
  var defaultOptions = {
176404
+ noTicklabelstep: true,
176327
176405
  tickfont: 'x',
176328
176406
  id: axLetter + 'axis',
176329
176407
  letter: axLetter,
@@ -190844,6 +190922,7 @@ module.exports = {
190844
190922
  ticklen: axesAttrs.ticklen,
190845
190923
  tickwidth: axesAttrs.tickwidth,
190846
190924
  tickcolor: axesAttrs.tickcolor,
190925
+ ticklabelstep: axesAttrs.ticklabelstep,
190847
190926
  showticklabels: axesAttrs.showticklabels,
190848
190927
  tickfont: fontAttrs({
190849
190928
  }),
@@ -224091,7 +224170,7 @@ function getSortFunc(opts, d2c) {
224091
224170
  'use strict';
224092
224171
 
224093
224172
  // package version injected by `npm run preprocess`
224094
- exports.version = '2.8.3';
224173
+ exports.version = '2.9.0';
224095
224174
 
224096
224175
  },{}],1120:[function(_dereq_,module,exports){
224097
224176
  (function (global){(function (){