plotly.js 2.7.0 → 2.8.3

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 (54) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +3 -3
  3. package/dist/README.md +26 -26
  4. package/dist/plot-schema.json +898 -407
  5. package/dist/plotly-basic.js +497 -186
  6. package/dist/plotly-basic.min.js +4 -4
  7. package/dist/plotly-cartesian.js +907 -329
  8. package/dist/plotly-cartesian.min.js +3 -3
  9. package/dist/plotly-finance.js +500 -188
  10. package/dist/plotly-finance.min.js +4 -4
  11. package/dist/plotly-geo-assets.js +2 -2
  12. package/dist/plotly-geo.js +486 -184
  13. package/dist/plotly-geo.min.js +4 -4
  14. package/dist/plotly-gl2d.js +505 -187
  15. package/dist/plotly-gl2d.min.js +2 -2
  16. package/dist/plotly-gl3d.js +486 -184
  17. package/dist/plotly-gl3d.min.js +2 -2
  18. package/dist/plotly-mapbox.js +486 -184
  19. package/dist/plotly-mapbox.min.js +2 -2
  20. package/dist/plotly-strict.js +1125 -547
  21. package/dist/plotly-strict.min.js +3 -3
  22. package/dist/plotly-with-meta.js +1214 -609
  23. package/dist/plotly.js +1179 -601
  24. package/dist/plotly.min.js +10 -10
  25. package/package.json +4 -4
  26. package/src/components/colorbar/attributes.js +29 -20
  27. package/src/components/colorbar/defaults.js +30 -8
  28. package/src/components/colorbar/draw.js +374 -128
  29. package/src/components/fx/hover.js +5 -2
  30. package/src/components/fx/hoverlabel_defaults.js +4 -2
  31. package/src/components/fx/layout_attributes.js +14 -4
  32. package/src/components/fx/layout_defaults.js +2 -0
  33. package/src/components/legend/attributes.js +7 -0
  34. package/src/components/legend/defaults.js +24 -7
  35. package/src/components/titles/index.js +8 -2
  36. package/src/plot_api/plot_api.js +1 -1
  37. package/src/plots/font_attributes.js +3 -0
  38. package/src/plots/layout_attributes.js +1 -0
  39. package/src/plots/plots.js +7 -15
  40. package/src/traces/bar/plot.js +8 -1
  41. package/src/traces/contour/attributes.js +12 -0
  42. package/src/traces/contour/defaults.js +9 -1
  43. package/src/traces/heatmap/attributes.js +16 -0
  44. package/src/traces/heatmap/defaults.js +2 -0
  45. package/src/traces/heatmap/label_defaults.js +13 -0
  46. package/src/traces/heatmap/plot.js +205 -4
  47. package/src/traces/histogram/calc.js +3 -2
  48. package/src/traces/histogram2d/attributes.js +8 -0
  49. package/src/traces/histogram2d/defaults.js +4 -0
  50. package/src/traces/histogram2dcontour/attributes.js +3 -1
  51. package/src/traces/histogram2dcontour/defaults.js +8 -1
  52. package/src/traces/pie/calc.js +3 -1
  53. package/src/version.js +1 -1
  54. package/tasks/test_mock.js +1 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * plotly.js (cartesian) v2.7.0
2
+ * plotly.js (cartesian) v2.8.3
3
3
  * Copyright 2012-2021, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -77,7 +77,7 @@ for(var selector in rules) {
77
77
 
78
78
  module.exports = _dereq_('../src/transforms/aggregate');
79
79
 
80
- },{"../src/transforms/aggregate":546}],3:[function(_dereq_,module,exports){
80
+ },{"../src/transforms/aggregate":547}],3:[function(_dereq_,module,exports){
81
81
  'use strict';
82
82
 
83
83
  module.exports = _dereq_('../src/traces/bar');
@@ -107,12 +107,12 @@ module.exports = _dereq_('../src/core');
107
107
 
108
108
  module.exports = _dereq_('../src/transforms/filter');
109
109
 
110
- },{"../src/transforms/filter":547}],9:[function(_dereq_,module,exports){
110
+ },{"../src/transforms/filter":548}],9:[function(_dereq_,module,exports){
111
111
  'use strict';
112
112
 
113
113
  module.exports = _dereq_('../src/transforms/groupby');
114
114
 
115
- },{"../src/transforms/groupby":548}],10:[function(_dereq_,module,exports){
115
+ },{"../src/transforms/groupby":549}],10:[function(_dereq_,module,exports){
116
116
  'use strict';
117
117
 
118
118
  module.exports = _dereq_('../src/traces/heatmap');
@@ -122,22 +122,22 @@ module.exports = _dereq_('../src/traces/heatmap');
122
122
 
123
123
  module.exports = _dereq_('../src/traces/histogram');
124
124
 
125
- },{"../src/traces/histogram":465}],12:[function(_dereq_,module,exports){
125
+ },{"../src/traces/histogram":466}],12:[function(_dereq_,module,exports){
126
126
  'use strict';
127
127
 
128
128
  module.exports = _dereq_('../src/traces/histogram2d');
129
129
 
130
- },{"../src/traces/histogram2d":471}],13:[function(_dereq_,module,exports){
130
+ },{"../src/traces/histogram2d":472}],13:[function(_dereq_,module,exports){
131
131
  'use strict';
132
132
 
133
133
  module.exports = _dereq_('../src/traces/histogram2dcontour');
134
134
 
135
- },{"../src/traces/histogram2dcontour":475}],14:[function(_dereq_,module,exports){
135
+ },{"../src/traces/histogram2dcontour":476}],14:[function(_dereq_,module,exports){
136
136
  'use strict';
137
137
 
138
138
  module.exports = _dereq_('../src/traces/image');
139
139
 
140
- },{"../src/traces/image":483}],15:[function(_dereq_,module,exports){
140
+ },{"../src/traces/image":484}],15:[function(_dereq_,module,exports){
141
141
  'use strict';
142
142
 
143
143
  var Plotly = _dereq_('./core');
@@ -173,22 +173,22 @@ module.exports = Plotly;
173
173
 
174
174
  module.exports = _dereq_('../src/traces/pie');
175
175
 
176
- },{"../src/traces/pie":492}],17:[function(_dereq_,module,exports){
176
+ },{"../src/traces/pie":493}],17:[function(_dereq_,module,exports){
177
177
  'use strict';
178
178
 
179
179
  module.exports = _dereq_('../src/traces/scatterternary');
180
180
 
181
- },{"../src/traces/scatterternary":533}],18:[function(_dereq_,module,exports){
181
+ },{"../src/traces/scatterternary":534}],18:[function(_dereq_,module,exports){
182
182
  'use strict';
183
183
 
184
184
  module.exports = _dereq_('../src/transforms/sort');
185
185
 
186
- },{"../src/transforms/sort":550}],19:[function(_dereq_,module,exports){
186
+ },{"../src/transforms/sort":551}],19:[function(_dereq_,module,exports){
187
187
  'use strict';
188
188
 
189
189
  module.exports = _dereq_('../src/traces/violin');
190
190
 
191
- },{"../src/traces/violin":541}],20:[function(_dereq_,module,exports){
191
+ },{"../src/traces/violin":542}],20:[function(_dereq_,module,exports){
192
192
  !function() {
193
193
  var d3 = {
194
194
  version: "3.8.0"
@@ -30726,13 +30726,11 @@ var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;
30726
30726
 
30727
30727
 
30728
30728
  module.exports = overrideAll({
30729
- // TODO: only right is supported currently
30730
- // orient: {
30731
- // valType: 'enumerated',
30732
- // values: ['left', 'right', 'top', 'bottom'],
30733
- // dflt: 'right',
30734
- //
30735
- // },
30729
+ orientation: {
30730
+ valType: 'enumerated',
30731
+ values: ['h', 'v'],
30732
+ dflt: 'v',
30733
+ },
30736
30734
  thicknessmode: {
30737
30735
  valType: 'enumerated',
30738
30736
  values: ['fraction', 'pixels'],
@@ -30755,14 +30753,12 @@ module.exports = overrideAll({
30755
30753
  },
30756
30754
  x: {
30757
30755
  valType: 'number',
30758
- dflt: 1.02,
30759
30756
  min: -2,
30760
30757
  max: 3,
30761
30758
  },
30762
30759
  xanchor: {
30763
30760
  valType: 'enumerated',
30764
30761
  values: ['left', 'center', 'right'],
30765
- dflt: 'left',
30766
30762
  },
30767
30763
  xpad: {
30768
30764
  valType: 'number',
@@ -30771,14 +30767,12 @@ module.exports = overrideAll({
30771
30767
  },
30772
30768
  y: {
30773
30769
  valType: 'number',
30774
- dflt: 0.5,
30775
30770
  min: -2,
30776
30771
  max: 3,
30777
30772
  },
30778
30773
  yanchor: {
30779
30774
  valType: 'enumerated',
30780
30775
  values: ['top', 'middle', 'bottom'],
30781
- dflt: 'middle',
30782
30776
  },
30783
30777
  ypad: {
30784
30778
  valType: 'number',
@@ -30810,15 +30804,21 @@ module.exports = overrideAll({
30810
30804
  ticks: extendFlat({}, axesAttrs.ticks, {dflt: ''}),
30811
30805
  ticklabeloverflow: extendFlat({}, axesAttrs.ticklabeloverflow, {
30812
30806
  }),
30807
+
30808
+ // ticklabelposition: not used directly, as values depend on orientation
30809
+ // left/right options are for x axes, and top/bottom options are for y axes
30813
30810
  ticklabelposition: {
30814
30811
  valType: 'enumerated',
30815
30812
  values: [
30816
30813
  'outside', 'inside',
30817
30814
  'outside top', 'inside top',
30815
+ 'outside left', 'inside left',
30816
+ 'outside right', 'inside right',
30818
30817
  'outside bottom', 'inside bottom'
30819
30818
  ],
30820
30819
  dflt: 'outside',
30821
30820
  },
30821
+
30822
30822
  ticklen: axesAttrs.ticklen,
30823
30823
  tickwidth: axesAttrs.tickwidth,
30824
30824
  tickcolor: axesAttrs.tickcolor,
@@ -30845,7 +30845,6 @@ module.exports = overrideAll({
30845
30845
  side: {
30846
30846
  valType: 'enumerated',
30847
30847
  values: ['right', 'top', 'bottom'],
30848
- dflt: 'top',
30849
30848
  }
30850
30849
  },
30851
30850
 
@@ -30904,23 +30903,30 @@ module.exports = function colorbarDefaults(containerIn, containerOut, layout) {
30904
30903
  return Lib.coerce(colorbarIn, colorbarOut, attributes, attr, dflt);
30905
30904
  }
30906
30905
 
30906
+ var margin = layout.margin || {t: 0, b: 0, l: 0, r: 0};
30907
+ var w = layout.width - margin.l - margin.r;
30908
+ var h = layout.height - margin.t - margin.b;
30909
+
30910
+ var orientation = coerce('orientation');
30911
+ var isVertical = orientation === 'v';
30912
+
30907
30913
  var thicknessmode = coerce('thicknessmode');
30908
30914
  coerce('thickness', (thicknessmode === 'fraction') ?
30909
- 30 / (layout.width - layout.margin.l - layout.margin.r) :
30915
+ 30 / (isVertical ? w : h) :
30910
30916
  30
30911
30917
  );
30912
30918
 
30913
30919
  var lenmode = coerce('lenmode');
30914
30920
  coerce('len', (lenmode === 'fraction') ?
30915
30921
  1 :
30916
- layout.height - layout.margin.t - layout.margin.b
30922
+ isVertical ? h : w
30917
30923
  );
30918
30924
 
30919
- coerce('x');
30920
- coerce('xanchor');
30925
+ coerce('x', isVertical ? 1.02 : 0.5);
30926
+ coerce('xanchor', isVertical ? 'left' : 'center');
30921
30927
  coerce('xpad');
30922
- coerce('y');
30923
- coerce('yanchor');
30928
+ coerce('y', isVertical ? 0.5 : 1.02);
30929
+ coerce('yanchor', isVertical ? 'middle' : 'bottom');
30924
30930
  coerce('ypad');
30925
30931
  Lib.noneOrAll(colorbarIn, colorbarOut, ['x', 'y']);
30926
30932
 
@@ -30930,7 +30936,22 @@ module.exports = function colorbarDefaults(containerIn, containerOut, layout) {
30930
30936
  coerce('borderwidth');
30931
30937
  coerce('bgcolor');
30932
30938
 
30933
- var ticklabelposition = coerce('ticklabelposition');
30939
+ var ticklabelposition = Lib.coerce(colorbarIn, colorbarOut, {
30940
+ ticklabelposition: {
30941
+ valType: 'enumerated',
30942
+ dflt: 'outside',
30943
+ values: isVertical ? [
30944
+ 'outside', 'inside',
30945
+ 'outside top', 'inside top',
30946
+ 'outside bottom', 'inside bottom'
30947
+ ] : [
30948
+ 'outside', 'inside',
30949
+ 'outside left', 'inside left',
30950
+ 'outside right', 'inside right'
30951
+ ]
30952
+ }
30953
+ }, 'ticklabelposition');
30954
+
30934
30955
  coerce('ticklabeloverflow', ticklabelposition.indexOf('inside') !== -1 ? 'hide past domain' : 'hide past div');
30935
30956
 
30936
30957
  handleTickValueDefaults(colorbarIn, colorbarOut, coerce, 'linear');
@@ -30952,7 +30973,7 @@ module.exports = function colorbarDefaults(containerIn, containerOut, layout) {
30952
30973
  size: Lib.bigFont(tickFont.size)
30953
30974
  });
30954
30975
  Lib.coerceFont(coerce, 'title.font', dfltTitleFont);
30955
- coerce('title.side');
30976
+ coerce('title.side', isVertical ? 'top' : 'right');
30956
30977
  };
30957
30978
 
30958
30979
  },{"../../lib":287,"../../plot_api/plot_template":323,"../../plots/cartesian/prefix_suffix_defaults":353,"../../plots/cartesian/tick_label_defaults":358,"../../plots/cartesian/tick_mark_defaults":359,"../../plots/cartesian/tick_value_defaults":360,"./attributes":158}],161:[function(_dereq_,module,exports){
@@ -31125,18 +31146,20 @@ function makeColorBarData(gd) {
31125
31146
  }
31126
31147
 
31127
31148
  function drawColorBar(g, opts, gd) {
31149
+ var isVertical = opts.orientation === 'v';
31128
31150
  var len = opts.len;
31129
31151
  var lenmode = opts.lenmode;
31130
31152
  var thickness = opts.thickness;
31131
31153
  var thicknessmode = opts.thicknessmode;
31132
31154
  var outlinewidth = opts.outlinewidth;
31133
31155
  var borderwidth = opts.borderwidth;
31156
+ var bgcolor = opts.bgcolor;
31134
31157
  var xanchor = opts.xanchor;
31135
31158
  var yanchor = opts.yanchor;
31136
31159
  var xpad = opts.xpad;
31137
31160
  var ypad = opts.ypad;
31138
31161
  var optsX = opts.x;
31139
- var optsY = opts.y;
31162
+ var optsY = isVertical ? opts.y : 1 - opts.y;
31140
31163
 
31141
31164
  var fullLayout = gd._fullLayout;
31142
31165
  var gs = fullLayout._size;
@@ -31167,23 +31190,35 @@ function drawColorBar(g, opts, gd) {
31167
31190
  // when the colorbar itself is pushing the margins.
31168
31191
  // but then the fractional size is calculated based on the
31169
31192
  // actual graph size, so that the axes will size correctly.
31170
- var thickPx = Math.round(thickness * (thicknessmode === 'fraction' ? gs.w : 1));
31171
- var thickFrac = thickPx / gs.w;
31172
- var lenPx = Math.round(len * (lenmode === 'fraction' ? gs.h : 1));
31173
- var lenFrac = lenPx / gs.h;
31174
- var xpadFrac = xpad / gs.w;
31175
- var yExtraPx = (borderwidth + outlinewidth) / 2;
31176
- var ypadFrac = ypad / gs.h;
31193
+ var thickPx = Math.round(thickness * (thicknessmode === 'fraction' ? (isVertical ? gs.w : gs.h) : 1));
31194
+ var thickFrac = thickPx / (isVertical ? gs.w : gs.h);
31195
+ var lenPx = Math.round(len * (lenmode === 'fraction' ? (isVertical ? gs.h : gs.w) : 1));
31196
+ var lenFrac = lenPx / (isVertical ? gs.h : gs.w);
31177
31197
 
31178
31198
  // x positioning: do it initially just for left anchor,
31179
31199
  // then fix at the end (since we don't know the width yet)
31180
- var uPx = Math.round(optsX * gs.w + xpad);
31181
- // for dragging... this is getting a little muddled...
31182
- var uFrac = optsX - thickFrac * ({center: 0.5, right: 1}[xanchor] || 0);
31200
+ var uPx = Math.round(isVertical ?
31201
+ optsX * gs.w + xpad :
31202
+ optsY * gs.h + ypad
31203
+ );
31183
31204
 
31184
- // y positioning we can do correctly from the start
31185
- var vFrac = optsY + lenFrac * (({top: -0.5, bottom: 0.5}[yanchor] || 0) - 0.5);
31186
- var vPx = Math.round(gs.h * (1 - vFrac));
31205
+ var xRatio = {center: 0.5, right: 1}[xanchor] || 0;
31206
+ var yRatio = {top: 1, middle: 0.5}[yanchor] || 0;
31207
+
31208
+ // for dragging... this is getting a little muddled...
31209
+ var uFrac = isVertical ?
31210
+ optsX - xRatio * thickFrac :
31211
+ optsY - yRatio * thickFrac;
31212
+
31213
+ // y/x positioning (for v/h) we can do correctly from the start
31214
+ var vFrac = isVertical ?
31215
+ optsY - yRatio * lenFrac :
31216
+ optsX - xRatio * lenFrac;
31217
+
31218
+ var vPx = Math.round(isVertical ?
31219
+ gs.h * (1 - vFrac) :
31220
+ gs.w * vFrac
31221
+ );
31187
31222
 
31188
31223
  // stash a few things for makeEditable
31189
31224
  opts._lenFrac = lenFrac;
@@ -31196,12 +31231,23 @@ function drawColorBar(g, opts, gd) {
31196
31231
 
31197
31232
  // position can't go in through supplyDefaults
31198
31233
  // because that restricts it to [0,1]
31199
- ax.position = optsX + xpadFrac + thickFrac;
31234
+ ax.position = thickFrac + (isVertical ?
31235
+ optsX + xpad / gs.w :
31236
+ optsY + ypad / gs.h
31237
+ );
31238
+
31239
+ var topOrBottom = ['top', 'bottom'].indexOf(titleSide) !== -1;
31200
31240
 
31201
- if(['top', 'bottom'].indexOf(titleSide) !== -1) {
31241
+ if(isVertical && topOrBottom) {
31202
31242
  ax.title.side = titleSide;
31203
- ax.titlex = optsX + xpadFrac;
31204
- ax.titley = vFrac + (title.side === 'top' ? lenFrac - ypadFrac : ypadFrac);
31243
+ ax.titlex = optsX + xpad / gs.w;
31244
+ ax.titley = vFrac + (title.side === 'top' ? lenFrac - ypad / gs.h : ypad / gs.h);
31245
+ }
31246
+
31247
+ if(!isVertical && !topOrBottom) {
31248
+ ax.title.side = titleSide;
31249
+ ax.titley = optsY + ypad / gs.h;
31250
+ ax.titlex = vFrac + xpad / gs.w; // right side
31205
31251
  }
31206
31252
 
31207
31253
  if(line.color && opts.tickmode === 'auto') {
@@ -31226,9 +31272,12 @@ function drawColorBar(g, opts, gd) {
31226
31272
 
31227
31273
  // set domain after init, because we may want to
31228
31274
  // allow it outside [0,1]
31229
- ax.domain = [
31230
- vFrac + ypadFrac,
31231
- vFrac + lenFrac - ypadFrac
31275
+ ax.domain = isVertical ? [
31276
+ vFrac + ypad / gs.h,
31277
+ vFrac + lenFrac - ypad / gs.h
31278
+ ] : [
31279
+ vFrac + xpad / gs.w,
31280
+ vFrac + lenFrac - xpad / gs.w
31232
31281
  ];
31233
31282
 
31234
31283
  ax.setScale();
@@ -31238,9 +31287,13 @@ function drawColorBar(g, opts, gd) {
31238
31287
  var titleCont = g.select('.' + cn.cbtitleunshift)
31239
31288
  .attr('transform', strTranslate(-Math.round(gs.l), -Math.round(gs.t)));
31240
31289
 
31290
+ var ticklabelposition = ax.ticklabelposition;
31291
+ var titleFontSize = ax.title.font.size;
31292
+
31241
31293
  var axLayer = g.select('.' + cn.cbaxis);
31242
31294
  var titleEl;
31243
31295
  var titleHeight = 0;
31296
+ var titleWidth = 0;
31244
31297
 
31245
31298
  function drawTitle(titleClass, titleOpts) {
31246
31299
  var dfltTitleOpts = {
@@ -31265,54 +31318,98 @@ function drawColorBar(g, opts, gd) {
31265
31318
  }
31266
31319
 
31267
31320
  function drawDummyTitle() {
31268
- if(['top', 'bottom'].indexOf(titleSide) !== -1) {
31269
- // draw the title so we know how much room it needs
31270
- // when we squish the axis. This one only applies to
31271
- // top or bottom titles, not right side.
31272
- var x = gs.l + (optsX + xpadFrac) * gs.w;
31273
- var fontSize = ax.title.font.size;
31274
- var y;
31321
+ // draw the title so we know how much room it needs
31322
+ // when we squish the axis.
31323
+ // On vertical colorbars this only applies to top or bottom titles, not right side.
31324
+ // On horizontal colorbars this only applies to right, etc.
31325
+
31326
+ if(
31327
+ (isVertical && topOrBottom) ||
31328
+ (!isVertical && !topOrBottom)
31329
+ ) {
31330
+ var x, y;
31275
31331
 
31276
31332
  if(titleSide === 'top') {
31277
- y = (1 - (vFrac + lenFrac - ypadFrac)) * gs.h +
31278
- gs.t + 3 + fontSize * 0.75;
31279
- } else {
31280
- y = (1 - (vFrac + ypadFrac)) * gs.h +
31281
- gs.t - 3 - fontSize * 0.25;
31333
+ x = xpad + gs.l + gs.w * optsX;
31334
+ y = ypad + gs.t + gs.h * (1 - vFrac - lenFrac) + 3 + titleFontSize * 0.75;
31282
31335
  }
31336
+
31337
+ if(titleSide === 'bottom') {
31338
+ x = xpad + gs.l + gs.w * optsX;
31339
+ y = ypad + gs.t + gs.h * (1 - vFrac) - 3 - titleFontSize * 0.25;
31340
+ }
31341
+
31342
+ if(titleSide === 'right') {
31343
+ y = ypad + gs.t + gs.h * optsY + 3 + titleFontSize * 0.75;
31344
+ x = xpad + gs.l + gs.w * vFrac;
31345
+ }
31346
+
31283
31347
  drawTitle(ax._id + 'title', {
31284
- attributes: {x: x, y: y, 'text-anchor': 'start'}
31348
+ attributes: {x: x, y: y, 'text-anchor': isVertical ? 'start' : 'middle'}
31285
31349
  });
31286
31350
  }
31287
31351
  }
31288
31352
 
31289
31353
  function drawCbTitle() {
31290
- if(['top', 'bottom'].indexOf(titleSide) === -1) {
31291
- var fontSize = ax.title.font.size;
31292
- var y = ax._offset + ax._length / 2;
31293
- var x = gs.l + (ax.position || 0) * gs.w + ((ax.side === 'right') ?
31294
- 10 + fontSize * ((ax.showticklabels ? 1 : 0.5)) :
31295
- -10 - fontSize * ((ax.showticklabels ? 0.5 : 0)));
31296
-
31297
- // the 'h' + is a hack to get around the fact that
31298
- // convertToTspans rotates any 'y...' class by 90 degrees.
31299
- // TODO: find a better way to control this.
31300
- drawTitle('h' + ax._id + 'title', {
31354
+ if(
31355
+ (isVertical && !topOrBottom) ||
31356
+ (!isVertical && topOrBottom)
31357
+ ) {
31358
+ var pos = ax.position || 0;
31359
+ var mid = ax._offset + ax._length / 2;
31360
+ var x, y;
31361
+
31362
+ if(titleSide === 'right') {
31363
+ y = mid;
31364
+ x = gs.l + gs.w * pos + 10 + titleFontSize * (
31365
+ ax.showticklabels ? 1 : 0.5
31366
+ );
31367
+ } else {
31368
+ x = mid;
31369
+
31370
+ if(titleSide === 'bottom') {
31371
+ y = gs.t + gs.h * pos + 10 + (
31372
+ ticklabelposition.indexOf('inside') === -1 ?
31373
+ ax.tickfont.size :
31374
+ 0
31375
+ ) + (
31376
+ ax.ticks !== 'intside' ?
31377
+ opts.ticklen || 0 :
31378
+ 0
31379
+ );
31380
+ }
31381
+
31382
+ if(titleSide === 'top') {
31383
+ var nlines = title.text.split('<br>').length;
31384
+ y = gs.t + gs.h * pos + 10 - thickPx - LINE_SPACING * titleFontSize * nlines;
31385
+ }
31386
+ }
31387
+
31388
+ drawTitle((isVertical ?
31389
+ // the 'h' + is a hack to get around the fact that
31390
+ // convertToTspans rotates any 'y...' class by 90 degrees.
31391
+ // TODO: find a better way to control this.
31392
+ 'h' :
31393
+ 'v'
31394
+ ) + ax._id + 'title', {
31301
31395
  avoid: {
31302
31396
  selection: d3.select(gd).selectAll('g.' + ax._id + 'tick'),
31303
31397
  side: titleSide,
31304
- offsetLeft: gs.l,
31305
- offsetTop: 0,
31306
- maxShift: fullLayout.width
31398
+ offsetTop: isVertical ? 0 : gs.t,
31399
+ offsetLeft: isVertical ? gs.l : 0,
31400
+ maxShift: isVertical ? fullLayout.width : fullLayout.height
31307
31401
  },
31308
31402
  attributes: {x: x, y: y, 'text-anchor': 'middle'},
31309
- transform: {rotate: '-90', offset: 0}
31403
+ transform: {rotate: isVertical ? -90 : 0, offset: 0}
31310
31404
  });
31311
31405
  }
31312
31406
  }
31313
31407
 
31314
31408
  function drawAxis() {
31315
- if(['top', 'bottom'].indexOf(titleSide) !== -1) {
31409
+ if(
31410
+ (!isVertical && !topOrBottom) ||
31411
+ (isVertical && topOrBottom)
31412
+ ) {
31316
31413
  // squish the axis top to make room for the title
31317
31414
  var titleGroup = g.select('.' + cn.cbtitle);
31318
31415
  var titleText = titleGroup.select('text');
@@ -31324,39 +31421,63 @@ function drawColorBar(g, opts, gd) {
31324
31421
  if(titleText.node()) {
31325
31422
  lineSize = parseInt(titleText.node().style.fontSize, 10) * LINE_SPACING;
31326
31423
  }
31424
+
31425
+ var bb;
31327
31426
  if(mathJaxNode) {
31328
- titleHeight = Drawing.bBox(mathJaxNode).height;
31427
+ bb = Drawing.bBox(mathJaxNode);
31428
+ titleWidth = bb.width;
31429
+ titleHeight = bb.height;
31329
31430
  if(titleHeight > lineSize) {
31330
31431
  // not entirely sure how mathjax is doing
31331
31432
  // vertical alignment, but this seems to work.
31332
31433
  titleTrans[1] -= (titleHeight - lineSize) / 2;
31333
31434
  }
31334
31435
  } else if(titleText.node() && !titleText.classed(cn.jsPlaceholder)) {
31335
- titleHeight = Drawing.bBox(titleText.node()).height;
31436
+ bb = Drawing.bBox(titleText.node());
31437
+ titleWidth = bb.width;
31438
+ titleHeight = bb.height;
31336
31439
  }
31337
- if(titleHeight) {
31338
- // buffer btwn colorbar and title
31339
- // TODO: configurable
31340
- titleHeight += 5;
31341
31440
 
31342
- if(titleSide === 'top') {
31343
- ax.domain[1] -= titleHeight / gs.h;
31344
- titleTrans[1] *= -1;
31345
- } else {
31346
- ax.domain[0] += titleHeight / gs.h;
31347
- var nlines = svgTextUtils.lineCount(titleText);
31348
- titleTrans[1] += (1 - nlines) * lineSize;
31441
+ if(isVertical) {
31442
+ if(titleHeight) {
31443
+ // buffer btwn colorbar and title
31444
+ // TODO: configurable
31445
+ titleHeight += 5;
31446
+
31447
+ if(titleSide === 'top') {
31448
+ ax.domain[1] -= titleHeight / gs.h;
31449
+ titleTrans[1] *= -1;
31450
+ } else {
31451
+ ax.domain[0] += titleHeight / gs.h;
31452
+ var nlines = svgTextUtils.lineCount(titleText);
31453
+ titleTrans[1] += (1 - nlines) * lineSize;
31454
+ }
31455
+
31456
+ titleGroup.attr('transform', strTranslate(titleTrans[0], titleTrans[1]));
31457
+ ax.setScale();
31349
31458
  }
31459
+ } else { // horizontal colorbars
31460
+ if(titleWidth) {
31461
+ if(titleSide === 'right') {
31462
+ ax.domain[0] += (titleWidth + titleFontSize / 2) / gs.w;
31463
+ }
31350
31464
 
31351
- titleGroup.attr('transform', strTranslate(titleTrans[0], titleTrans[1]));
31352
- ax.setScale();
31465
+ titleGroup.attr('transform', strTranslate(titleTrans[0], titleTrans[1]));
31466
+ ax.setScale();
31467
+ }
31353
31468
  }
31354
31469
  }
31355
31470
 
31356
31471
  g.selectAll('.' + cn.cbfills + ',.' + cn.cblines)
31357
- .attr('transform', strTranslate(0, Math.round(gs.h * (1 - ax.domain[1]))));
31472
+ .attr('transform', isVertical ?
31473
+ strTranslate(0, Math.round(gs.h * (1 - ax.domain[1]))) :
31474
+ strTranslate(Math.round(gs.w * ax.domain[0]), 0)
31475
+ );
31358
31476
 
31359
- axLayer.attr('transform', strTranslate(0, Math.round(-gs.t)));
31477
+ axLayer.attr('transform', isVertical ?
31478
+ strTranslate(0, Math.round(-gs.t)) :
31479
+ strTranslate(Math.round(-gs.l), 0)
31480
+ );
31360
31481
 
31361
31482
  var fills = g.select('.' + cn.cbfills)
31362
31483
  .selectAll('rect.' + cn.cbfill)
@@ -31382,20 +31503,22 @@ function drawColorBar(g, opts, gd) {
31382
31503
 
31383
31504
  // offset the side adjoining the next rectangle so they
31384
31505
  // overlap, to prevent antialiasing gaps
31385
- z[1] = Lib.constrain(z[1] + (z[1] > z[0]) ? 1 : -1, zBounds[0], zBounds[1]);
31386
-
31506
+ if(isVertical) {
31507
+ z[1] = Lib.constrain(z[1] + (z[1] > z[0]) ? 1 : -1, zBounds[0], zBounds[1]);
31508
+ } /* else {
31509
+ // TODO: horizontal case
31510
+ } */
31387
31511
 
31388
31512
  // Colorbar cannot currently support opacities so we
31389
31513
  // use an opaque fill even when alpha channels present
31390
- var fillEl = d3.select(this).attr({
31391
- x: uPx,
31392
- width: Math.max(thickPx, 2),
31393
- y: d3.min(z),
31394
- height: Math.max(d3.max(z) - d3.min(z), 2),
31395
- });
31514
+ var fillEl = d3.select(this)
31515
+ .attr(isVertical ? 'x' : 'y', uPx)
31516
+ .attr(isVertical ? 'y' : 'x', d3.min(z))
31517
+ .attr(isVertical ? 'width' : 'height', Math.max(thickPx, 2))
31518
+ .attr(isVertical ? 'height' : 'width', Math.max(d3.max(z) - d3.min(z), 2));
31396
31519
 
31397
31520
  if(opts._fillgradient) {
31398
- Drawing.gradient(fillEl, gd, opts._id, 'vertical', opts._fillgradient, 'fill');
31521
+ Drawing.gradient(fillEl, gd, opts._id, isVertical ? 'vertical' : 'horizontalreversed', opts._fillgradient, 'fill');
31399
31522
  } else {
31400
31523
  // tinycolor can't handle exponents and
31401
31524
  // at this scale, removing it makes no difference.
@@ -31411,9 +31534,15 @@ function drawColorBar(g, opts, gd) {
31411
31534
  .classed(cn.cbline, true);
31412
31535
  lines.exit().remove();
31413
31536
  lines.each(function(d) {
31537
+ var a = uPx;
31538
+ var b = (Math.round(ax.c2p(d)) + (line.width / 2) % 1);
31539
+
31414
31540
  d3.select(this)
31415
- .attr('d', 'M' + uPx + ',' +
31416
- (Math.round(ax.c2p(d)) + (line.width / 2) % 1) + 'h' + thickPx)
31541
+ .attr('d', 'M' +
31542
+ (isVertical ? a + ',' + b : b + ',' + a) +
31543
+ (isVertical ? 'h' : 'v') +
31544
+ thickPx
31545
+ )
31417
31546
  .call(Drawing.lineGroupStyle, line.width, lineColormap(d), line.dash);
31418
31547
  });
31419
31548
 
@@ -31446,82 +31575,211 @@ function drawColorBar(g, opts, gd) {
31446
31575
  // TODO: why are we redrawing multiple times now with this?
31447
31576
  // I guess autoMargin doesn't like being post-promise?
31448
31577
  function positionCB() {
31578
+ var bb;
31449
31579
  var innerThickness = thickPx + outlinewidth / 2;
31450
- if(ax.ticklabelposition.indexOf('inside') === -1) {
31451
- innerThickness += Drawing.bBox(axLayer.node()).width;
31580
+ if(ticklabelposition.indexOf('inside') === -1) {
31581
+ bb = Drawing.bBox(axLayer.node());
31582
+ innerThickness += isVertical ? bb.width : bb.height;
31452
31583
  }
31453
31584
 
31454
31585
  titleEl = titleCont.select('text');
31455
31586
 
31587
+ var titleWidth = 0;
31588
+
31589
+ var topSideVertical = isVertical && titleSide === 'top';
31590
+ var rightSideHorizontal = !isVertical && titleSide === 'right';
31591
+
31592
+ var moveY = 0;
31593
+
31456
31594
  if(titleEl.node() && !titleEl.classed(cn.jsPlaceholder)) {
31595
+ var _titleHeight;
31596
+
31457
31597
  var mathJaxNode = titleCont.select('.h' + ax._id + 'title-math-group').node();
31458
- var titleWidth;
31459
- if(mathJaxNode && ['top', 'bottom'].indexOf(titleSide) !== -1) {
31460
- titleWidth = Drawing.bBox(mathJaxNode).width;
31598
+ if(mathJaxNode && (
31599
+ (isVertical && topOrBottom) ||
31600
+ (!isVertical && !topOrBottom)
31601
+ )) {
31602
+ bb = Drawing.bBox(mathJaxNode);
31603
+ titleWidth = bb.width;
31604
+ _titleHeight = bb.height;
31461
31605
  } else {
31462
31606
  // note: the formula below works for all title sides,
31463
31607
  // (except for top/bottom mathjax, above)
31464
31608
  // but the weird gs.l is because the titleunshift
31465
31609
  // transform gets removed by Drawing.bBox
31466
- titleWidth = Drawing.bBox(titleCont.node()).right - uPx - gs.l;
31610
+ bb = Drawing.bBox(titleCont.node());
31611
+ titleWidth = bb.right - gs.l - (isVertical ? uPx : vPx);
31612
+ _titleHeight = bb.bottom - gs.t - (isVertical ? vPx : uPx);
31613
+
31614
+ if(
31615
+ !isVertical && titleSide === 'top'
31616
+ ) {
31617
+ innerThickness += bb.height;
31618
+ moveY = bb.height;
31619
+ }
31467
31620
  }
31468
- innerThickness = Math.max(innerThickness, titleWidth);
31621
+
31622
+ if(rightSideHorizontal) {
31623
+ titleEl.attr('transform', strTranslate(titleWidth / 2 + titleFontSize / 2, 0));
31624
+
31625
+ titleWidth *= 2;
31626
+ }
31627
+
31628
+ innerThickness = Math.max(innerThickness,
31629
+ isVertical ? titleWidth : _titleHeight
31630
+ );
31469
31631
  }
31470
31632
 
31471
- var outerThickness = 2 * xpad + innerThickness + borderwidth + outlinewidth / 2;
31633
+ var outerThickness = (isVertical ?
31634
+ xpad :
31635
+ ypad
31636
+ ) * 2 + innerThickness + borderwidth + outlinewidth / 2;
31472
31637
 
31473
- g.select('.' + cn.cbbg).attr({
31474
- x: uPx - xpad - (borderwidth + outlinewidth) / 2,
31475
- y: vPx - lenPx - yExtraPx,
31476
- width: Math.max(outerThickness, 2),
31477
- height: Math.max(lenPx + 2 * yExtraPx, 2)
31478
- })
31479
- .call(Color.fill, opts.bgcolor)
31638
+ var hColorbarMoveTitle = 0;
31639
+ if(!isVertical && title.text && yanchor === 'bottom' && optsY <= 0) {
31640
+ hColorbarMoveTitle = outerThickness / 2;
31641
+
31642
+ outerThickness += hColorbarMoveTitle;
31643
+ moveY += hColorbarMoveTitle;
31644
+ }
31645
+ fullLayout._hColorbarMoveTitle = hColorbarMoveTitle;
31646
+ fullLayout._hColorbarMoveCBTitle = moveY;
31647
+
31648
+ var extraW = borderwidth + outlinewidth;
31649
+
31650
+ g.select('.' + cn.cbbg)
31651
+ .attr('x', (isVertical ? uPx : vPx) - extraW / 2 - (isVertical ? xpad : 0))
31652
+ .attr('y', (isVertical ? vPx : uPx) - (isVertical ? lenPx : ypad + moveY - hColorbarMoveTitle))
31653
+ .attr(isVertical ? 'width' : 'height', Math.max(outerThickness - hColorbarMoveTitle, 2))
31654
+ .attr(isVertical ? 'height' : 'width', Math.max(lenPx + extraW, 2))
31655
+ .call(Color.fill, bgcolor)
31480
31656
  .call(Color.stroke, opts.bordercolor)
31481
31657
  .style('stroke-width', borderwidth);
31482
31658
 
31483
- g.selectAll('.' + cn.cboutline).attr({
31484
- x: uPx,
31485
- y: vPx - lenPx + ypad + (titleSide === 'top' ? titleHeight : 0),
31486
- width: Math.max(thickPx, 2),
31487
- height: Math.max(lenPx - 2 * ypad - titleHeight, 2)
31488
- })
31659
+ var moveX = rightSideHorizontal ? Math.max(titleWidth - 10, 0) : 0;
31660
+
31661
+ g.selectAll('.' + cn.cboutline)
31662
+ .attr('x', (isVertical ? uPx : vPx + xpad) + moveX)
31663
+ .attr('y', (isVertical ? vPx + ypad - lenPx : uPx) + (topSideVertical ? titleHeight : 0))
31664
+ .attr(isVertical ? 'width' : 'height', Math.max(thickPx, 2))
31665
+ .attr(isVertical ? 'height' : 'width', Math.max(lenPx - (isVertical ?
31666
+ 2 * ypad + titleHeight :
31667
+ 2 * xpad + moveX
31668
+ ), 2))
31489
31669
  .call(Color.stroke, opts.outlinecolor)
31490
31670
  .style({
31491
31671
  fill: 'none',
31492
31672
  'stroke-width': outlinewidth
31493
31673
  });
31494
31674
 
31495
- // fix positioning for xanchor!='left'
31496
- var xoffset = ({center: 0.5, right: 1}[xanchor] || 0) * outerThickness;
31497
- g.attr('transform', strTranslate(gs.l - xoffset, gs.t));
31675
+ g.attr('transform', strTranslate(
31676
+ gs.l - (isVertical ? xRatio * outerThickness : 0),
31677
+ gs.t - (isVertical ? 0 : (1 - yRatio) * outerThickness - moveY)
31678
+ ));
31679
+
31680
+ if(!isVertical && (
31681
+ borderwidth || (
31682
+ tinycolor(bgcolor).getAlpha() &&
31683
+ !tinycolor.equals(fullLayout.paper_bgcolor, bgcolor)
31684
+ )
31685
+ )) {
31686
+ // for horizontal colorbars when there is a border line or having different background color
31687
+ // hide/adjust x positioning for the first/last tick labels if they go outside the border
31688
+ var tickLabels = axLayer.selectAll('text');
31689
+ var numTicks = tickLabels[0].length;
31690
+
31691
+ var border = g.select('.' + cn.cbbg).node();
31692
+ var oBb = Drawing.bBox(border);
31693
+ var oTr = Drawing.getTranslate(g);
31694
+
31695
+ var TEXTPAD = 2;
31696
+
31697
+ tickLabels.each(function(d, i) {
31698
+ var first = 0;
31699
+ var last = numTicks - 1;
31700
+ if(i === first || i === last) {
31701
+ var iBb = Drawing.bBox(this);
31702
+ var iTr = Drawing.getTranslate(this);
31703
+ var deltaX;
31704
+
31705
+ if(i === last) {
31706
+ var iRight = iBb.right + iTr.x;
31707
+ var oRight = oBb.right + oTr.x + vPx - borderwidth - TEXTPAD + optsX;
31708
+
31709
+ deltaX = oRight - iRight;
31710
+ if(deltaX > 0) deltaX = 0;
31711
+ } else if(i === first) {
31712
+ var iLeft = iBb.left + iTr.x;
31713
+ var oLeft = oBb.left + oTr.x + vPx + borderwidth + TEXTPAD;
31714
+
31715
+ deltaX = oLeft - iLeft;
31716
+ if(deltaX < 0) deltaX = 0;
31717
+ }
31718
+
31719
+ if(deltaX) {
31720
+ if(numTicks < 3) { // adjust position
31721
+ this.setAttribute('transform',
31722
+ 'translate(' + deltaX + ',0) ' +
31723
+ this.getAttribute('transform')
31724
+ );
31725
+ } else { // hide
31726
+ this.setAttribute('visibility', 'hidden');
31727
+ }
31728
+ }
31729
+ }
31730
+ });
31731
+ }
31498
31732
 
31499
31733
  // auto margin adjustment
31500
31734
  var marginOpts = {};
31735
+ var lFrac = FROM_TL[xanchor];
31736
+ var rFrac = FROM_BR[xanchor];
31501
31737
  var tFrac = FROM_TL[yanchor];
31502
31738
  var bFrac = FROM_BR[yanchor];
31503
- if(lenmode === 'pixels') {
31504
- marginOpts.y = optsY;
31505
- marginOpts.t = lenPx * tFrac;
31506
- marginOpts.b = lenPx * bFrac;
31507
- } else {
31508
- marginOpts.t = marginOpts.b = 0;
31509
- marginOpts.yt = optsY + len * tFrac;
31510
- marginOpts.yb = optsY - len * bFrac;
31511
- }
31512
31739
 
31513
- var lFrac = FROM_TL[xanchor];
31514
- var rFrac = FROM_BR[xanchor];
31515
- if(thicknessmode === 'pixels') {
31516
- marginOpts.x = optsX;
31517
- marginOpts.l = outerThickness * lFrac;
31518
- marginOpts.r = outerThickness * rFrac;
31519
- } else {
31520
- var extraThickness = outerThickness - thickPx;
31521
- marginOpts.l = extraThickness * lFrac;
31522
- marginOpts.r = extraThickness * rFrac;
31523
- marginOpts.xl = optsX - thickness * lFrac;
31524
- marginOpts.xr = optsX + thickness * rFrac;
31740
+ var extraThickness = outerThickness - thickPx;
31741
+ if(isVertical) {
31742
+ if(lenmode === 'pixels') {
31743
+ marginOpts.y = optsY;
31744
+ marginOpts.t = lenPx * tFrac;
31745
+ marginOpts.b = lenPx * bFrac;
31746
+ } else {
31747
+ marginOpts.t = marginOpts.b = 0;
31748
+ marginOpts.yt = optsY + len * tFrac;
31749
+ marginOpts.yb = optsY - len * bFrac;
31750
+ }
31751
+
31752
+ if(thicknessmode === 'pixels') {
31753
+ marginOpts.x = optsX;
31754
+ marginOpts.l = outerThickness * lFrac;
31755
+ marginOpts.r = outerThickness * rFrac;
31756
+ } else {
31757
+ marginOpts.l = extraThickness * lFrac;
31758
+ marginOpts.r = extraThickness * rFrac;
31759
+ marginOpts.xl = optsX - thickness * lFrac;
31760
+ marginOpts.xr = optsX + thickness * rFrac;
31761
+ }
31762
+ } else { // horizontal colorbars
31763
+ if(lenmode === 'pixels') {
31764
+ marginOpts.x = optsX;
31765
+ marginOpts.l = lenPx * lFrac;
31766
+ marginOpts.r = lenPx * rFrac;
31767
+ } else {
31768
+ marginOpts.l = marginOpts.r = 0;
31769
+ marginOpts.xl = optsX + len * lFrac;
31770
+ marginOpts.xr = optsX - len * rFrac;
31771
+ }
31772
+
31773
+ if(thicknessmode === 'pixels') {
31774
+ marginOpts.y = 1 - optsY;
31775
+ marginOpts.t = outerThickness * tFrac;
31776
+ marginOpts.b = outerThickness * bFrac;
31777
+ } else {
31778
+ marginOpts.t = extraThickness * tFrac;
31779
+ marginOpts.b = extraThickness * bFrac;
31780
+ marginOpts.yt = optsY - thickness * tFrac;
31781
+ marginOpts.yb = optsY + thickness * bFrac;
31782
+ }
31525
31783
  }
31526
31784
 
31527
31785
  Plots.autoMargin(gd, opts._id, marginOpts);
@@ -31538,6 +31796,7 @@ function drawColorBar(g, opts, gd) {
31538
31796
  }
31539
31797
 
31540
31798
  function makeEditable(g, opts, gd) {
31799
+ var isVertical = opts.orientation === 'v';
31541
31800
  var fullLayout = gd._fullLayout;
31542
31801
  var gs = fullLayout._size;
31543
31802
  var t0, xf, yf;
@@ -31552,9 +31811,13 @@ function makeEditable(g, opts, gd) {
31552
31811
  moveFn: function(dx, dy) {
31553
31812
  g.attr('transform', t0 + strTranslate(dx, dy));
31554
31813
 
31555
- xf = dragElement.align(opts._uFrac + (dx / gs.w), opts._thickFrac,
31814
+ xf = dragElement.align(
31815
+ (isVertical ? opts._uFrac : opts._vFrac) + (dx / gs.w),
31816
+ isVertical ? opts._thickFrac : opts._lenFrac,
31556
31817
  0, 1, opts.xanchor);
31557
- yf = dragElement.align(opts._vFrac - (dy / gs.h), opts._lenFrac,
31818
+ yf = dragElement.align(
31819
+ (isVertical ? opts._vFrac : (1 - opts._uFrac)) - (dy / gs.h),
31820
+ isVertical ? opts._lenFrac : opts._thickFrac,
31558
31821
  0, 1, opts.yanchor);
31559
31822
 
31560
31823
  var csr = dragElement.getCursor(xf, yf, opts.xanchor, opts.yanchor);
@@ -31631,6 +31894,8 @@ function calcLevels(gd, opts, zrange) {
31631
31894
  function mockColorBarAxis(gd, opts, zrange) {
31632
31895
  var fullLayout = gd._fullLayout;
31633
31896
 
31897
+ var isVertical = opts.orientation === 'v';
31898
+
31634
31899
  var cbAxisIn = {
31635
31900
  type: 'linear',
31636
31901
  range: zrange,
@@ -31661,17 +31926,19 @@ function mockColorBarAxis(gd, opts, zrange) {
31661
31926
  title: opts.title,
31662
31927
  showline: true,
31663
31928
  anchor: 'free',
31664
- side: 'right',
31929
+ side: isVertical ? 'right' : 'bottom',
31665
31930
  position: 1
31666
31931
  };
31667
31932
 
31933
+ var letter = isVertical ? 'y' : 'x';
31934
+
31668
31935
  var cbAxisOut = {
31669
31936
  type: 'linear',
31670
- _id: 'y' + opts._id
31937
+ _id: letter + opts._id
31671
31938
  };
31672
31939
 
31673
31940
  var axisOptions = {
31674
- letter: 'y',
31941
+ letter: letter,
31675
31942
  font: fullLayout.font,
31676
31943
  noHover: true,
31677
31944
  noTickson: true,
@@ -34650,7 +34917,7 @@ drawing.setTextPointsScale = function(selection, xScale, yScale) {
34650
34917
  });
34651
34918
  };
34652
34919
 
34653
- },{"../../components/fx/helpers":193,"../../constants/alignment":262,"../../constants/interactions":266,"../../constants/xmlns_namespaces":268,"../../lib":287,"../../lib/svg_text_utils":310,"../../registry":378,"../../traces/scatter/make_bubble_size_func":516,"../../traces/scatter/subtypes":524,"../color":157,"../colorscale":169,"./symbol_defs":180,"@plotly/d3":20,"fast-isnumeric":33,"tinycolor2":121}],180:[function(_dereq_,module,exports){
34920
+ },{"../../components/fx/helpers":193,"../../constants/alignment":262,"../../constants/interactions":266,"../../constants/xmlns_namespaces":268,"../../lib":287,"../../lib/svg_text_utils":310,"../../registry":378,"../../traces/scatter/make_bubble_size_func":517,"../../traces/scatter/subtypes":525,"../color":157,"../colorscale":169,"./symbol_defs":180,"@plotly/d3":20,"fast-isnumeric":33,"tinycolor2":121}],180:[function(_dereq_,module,exports){
34654
34921
  'use strict';
34655
34922
 
34656
34923
  var d3 = _dereq_('@plotly/d3');
@@ -35749,7 +36016,7 @@ function errorCoords(d, xa, ya) {
35749
36016
  return out;
35750
36017
  }
35751
36018
 
35752
- },{"../../traces/scatter/subtypes":524,"../drawing":179,"@plotly/d3":20,"fast-isnumeric":33}],187:[function(_dereq_,module,exports){
36019
+ },{"../../traces/scatter/subtypes":525,"../drawing":179,"@plotly/d3":20,"fast-isnumeric":33}],187:[function(_dereq_,module,exports){
35753
36020
  'use strict';
35754
36021
 
35755
36022
  var d3 = _dereq_('@plotly/d3');
@@ -37284,7 +37551,9 @@ function createHoverText(hoverData, opts) {
37284
37551
  orientation: 'v'
37285
37552
  }
37286
37553
  };
37287
- var mockLayoutOut = {};
37554
+ var mockLayoutOut = {
37555
+ font: font
37556
+ };
37288
37557
  legendSupplyDefaults(mockLayoutIn, mockLayoutOut, gd._fullData);
37289
37558
  var mockLegend = mockLayoutOut.legend;
37290
37559
 
@@ -37325,7 +37594,8 @@ function createHoverText(hoverData, opts) {
37325
37594
 
37326
37595
  // Draw unified hover label
37327
37596
  mockLegend._inHover = true;
37328
- mockLegend._groupTitleFont = font;
37597
+ mockLegend._groupTitleFont = hoverlabel.grouptitlefont;
37598
+
37329
37599
  legendDraw(gd, mockLegend);
37330
37600
 
37331
37601
  // Position the hover
@@ -38327,9 +38597,11 @@ var isUnifiedHover = _dereq_('./helpers').isUnifiedHover;
38327
38597
  module.exports = function handleHoverLabelDefaults(contIn, contOut, coerce, opts) {
38328
38598
  opts = opts || {};
38329
38599
 
38600
+ var hasLegend = contOut.legend;
38601
+
38330
38602
  function inheritFontAttr(attr) {
38331
38603
  if(!opts.font[attr]) {
38332
- opts.font[attr] = contOut.legend ? contOut.legend.font[attr] : contOut.font[attr];
38604
+ opts.font[attr] = hasLegend ? contOut.legend.font[attr] : contOut.font[attr];
38333
38605
  }
38334
38606
  }
38335
38607
 
@@ -38340,7 +38612,7 @@ module.exports = function handleHoverLabelDefaults(contIn, contOut, coerce, opts
38340
38612
  inheritFontAttr('family');
38341
38613
  inheritFontAttr('color');
38342
38614
 
38343
- if(contOut.legend) {
38615
+ if(hasLegend) {
38344
38616
  if(!opts.bgcolor) opts.bgcolor = Color.combine(contOut.legend.bgcolor, contOut.paper_bgcolor);
38345
38617
  if(!opts.bordercolor) opts.bordercolor = contOut.legend.bordercolor;
38346
38618
  } else {
@@ -38449,11 +38721,13 @@ function castHoverinfo(trace, fullLayout, ptNumber) {
38449
38721
 
38450
38722
  var constants = _dereq_('./constants');
38451
38723
 
38452
- var fontAttrs = _dereq_('../../plots/font_attributes')({
38724
+ var fontAttrs = _dereq_('../../plots/font_attributes');
38725
+
38726
+ var font = fontAttrs({
38453
38727
  editType: 'none',
38454
38728
  });
38455
- fontAttrs.family.dflt = constants.HOVERFONT;
38456
- fontAttrs.size.dflt = constants.HOVERFONTSIZE;
38729
+ font.family.dflt = constants.HOVERFONT;
38730
+ font.size.dflt = constants.HOVERFONTSIZE;
38457
38731
 
38458
38732
  module.exports = {
38459
38733
  clickmode: {
@@ -38509,7 +38783,10 @@ module.exports = {
38509
38783
  valType: 'color',
38510
38784
  editType: 'none',
38511
38785
  },
38512
- font: fontAttrs,
38786
+ font: font,
38787
+ grouptitlefont: fontAttrs({
38788
+ editType: 'none',
38789
+ }),
38513
38790
  align: {
38514
38791
  valType: 'enumerated',
38515
38792
  values: ['left', 'right', 'auto'],
@@ -38522,6 +38799,7 @@ module.exports = {
38522
38799
  dflt: 15,
38523
38800
  editType: 'none',
38524
38801
  },
38802
+
38525
38803
  editType: 'none'
38526
38804
  },
38527
38805
  selectdirection: {
@@ -38569,6 +38847,8 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {
38569
38847
  }
38570
38848
 
38571
38849
  handleHoverLabelDefaults(layoutIn, layoutOut, coerce);
38850
+
38851
+ Lib.coerceFont(coerce, 'hoverlabel.grouptitlefont', layoutOut.hoverlabel.font);
38572
38852
  };
38573
38853
 
38574
38854
  },{"../../lib":287,"./hoverlabel_defaults":195,"./hovermode_defaults":196,"./layout_attributes":198}],200:[function(_dereq_,module,exports){
@@ -39452,6 +39732,9 @@ module.exports = {
39452
39732
  font: fontAttrs({
39453
39733
  editType: 'legend',
39454
39734
  }),
39735
+ grouptitlefont: fontAttrs({
39736
+ editType: 'legend',
39737
+ }),
39455
39738
  orientation: {
39456
39739
  valType: 'enumerated',
39457
39740
  values: ['v', 'h'],
@@ -39575,6 +39858,7 @@ var Registry = _dereq_('../../registry');
39575
39858
  var Lib = _dereq_('../../lib');
39576
39859
  var Template = _dereq_('../../plot_api/plot_template');
39577
39860
 
39861
+ var plotsAttrs = _dereq_('../../plots/attributes');
39578
39862
  var attributes = _dereq_('./attributes');
39579
39863
  var basePlotLayoutAttributes = _dereq_('../../plots/layout_attributes');
39580
39864
  var helpers = _dereq_('./helpers');
@@ -39582,13 +39866,30 @@ var helpers = _dereq_('./helpers');
39582
39866
 
39583
39867
  module.exports = function legendDefaults(layoutIn, layoutOut, fullData) {
39584
39868
  var containerIn = layoutIn.legend || {};
39869
+ var containerOut = Template.newContainer(layoutOut, 'legend');
39870
+
39871
+ function coerce(attr, dflt) {
39872
+ return Lib.coerce(containerIn, containerOut, attributes, attr, dflt);
39873
+ }
39874
+
39875
+ var trace;
39876
+ var traceCoerce = function(attr, dflt) {
39877
+ var traceIn = trace._input;
39878
+ var traceOut = trace;
39879
+ return Lib.coerce(traceIn, traceOut, plotsAttrs, attr, dflt);
39880
+ };
39881
+
39882
+ var globalFont = layoutOut.font || {};
39883
+ var grouptitlefont = Lib.coerceFont(coerce, 'grouptitlefont', Lib.extendFlat({}, globalFont, {
39884
+ size: Math.round(globalFont.size * 1.1)
39885
+ }));
39585
39886
 
39586
39887
  var legendTraceCount = 0;
39587
39888
  var legendReallyHasATrace = false;
39588
39889
  var defaultOrder = 'normal';
39589
39890
 
39590
39891
  for(var i = 0; i < fullData.length; i++) {
39591
- var trace = fullData[i];
39892
+ trace = fullData[i];
39592
39893
 
39593
39894
  if(!trace.visible) continue;
39594
39895
 
@@ -39615,6 +39916,8 @@ module.exports = function legendDefaults(layoutIn, layoutOut, fullData) {
39615
39916
  legendTraceCount++;
39616
39917
  }
39617
39918
  }
39919
+
39920
+ Lib.coerceFont(traceCoerce, 'legendgrouptitle.font', grouptitlefont);
39618
39921
  }
39619
39922
 
39620
39923
  if((Registry.traceIs(trace, 'bar') && layoutOut.barmode === 'stack') ||
@@ -39633,13 +39936,10 @@ module.exports = function legendDefaults(layoutIn, layoutOut, fullData) {
39633
39936
  basePlotLayoutAttributes, 'showlegend',
39634
39937
  legendReallyHasATrace && legendTraceCount > 1);
39635
39938
 
39636
- if(showLegend === false && !containerIn.uirevision) return;
39637
-
39638
- var containerOut = Template.newContainer(layoutOut, 'legend');
39939
+ // delete legend
39940
+ if(showLegend === false) layoutOut.legend = undefined;
39639
39941
 
39640
- function coerce(attr, dflt) {
39641
- return Lib.coerce(containerIn, containerOut, attributes, attr, dflt);
39642
- }
39942
+ if(showLegend === false && !containerIn.uirevision) return;
39643
39943
 
39644
39944
  coerce('uirevision', layoutOut.uirevision);
39645
39945
 
@@ -39701,7 +40001,7 @@ module.exports = function legendDefaults(layoutIn, layoutOut, fullData) {
39701
40001
  }
39702
40002
  };
39703
40003
 
39704
- },{"../../lib":287,"../../plot_api/plot_template":323,"../../plots/layout_attributes":369,"../../registry":378,"./attributes":207,"./helpers":213}],210:[function(_dereq_,module,exports){
40004
+ },{"../../lib":287,"../../plot_api/plot_template":323,"../../plots/attributes":330,"../../plots/layout_attributes":369,"../../registry":378,"./attributes":207,"./helpers":213}],210:[function(_dereq_,module,exports){
39705
40005
  'use strict';
39706
40006
 
39707
40007
  var d3 = _dereq_('@plotly/d3');
@@ -41674,7 +41974,7 @@ function dimAttr(v, dflt, max) {
41674
41974
  return v;
41675
41975
  }
41676
41976
 
41677
- },{"../../lib":287,"../../registry":378,"../../traces/pie/helpers":491,"../../traces/pie/style_one":497,"../../traces/scatter/subtypes":524,"../color":157,"../colorscale/helpers":168,"../drawing":179,"./constants":208,"@plotly/d3":20}],216:[function(_dereq_,module,exports){
41977
+ },{"../../lib":287,"../../registry":378,"../../traces/pie/helpers":492,"../../traces/pie/style_one":498,"../../traces/scatter/subtypes":525,"../color":157,"../colorscale/helpers":168,"../drawing":179,"./constants":208,"@plotly/d3":20}],216:[function(_dereq_,module,exports){
41678
41978
  'use strict';
41679
41979
 
41680
41980
  var constants = _dereq_('./constants');
@@ -42908,7 +43208,7 @@ function fillCustomButton(customButtons) {
42908
43208
  return customButtons;
42909
43209
  }
42910
43210
 
42911
- },{"../../plots/cartesian/axis_ids":338,"../../registry":378,"../../traces/scatter/subtypes":524,"../fx/helpers":193,"./buttons":217,"./constants":218,"./modebar":222}],222:[function(_dereq_,module,exports){
43211
+ },{"../../plots/cartesian/axis_ids":338,"../../registry":378,"../../traces/scatter/subtypes":525,"../fx/helpers":193,"./buttons":217,"./constants":218,"./modebar":222}],222:[function(_dereq_,module,exports){
42912
43212
  'use strict';
42913
43213
 
42914
43214
  var d3 = _dereq_('@plotly/d3');
@@ -44837,7 +45137,7 @@ module.exports = templatedArray('shape', {
44837
45137
  editType: 'arraydraw'
44838
45138
  });
44839
45139
 
44840
- },{"../../constants/axis_placeable_objects":263,"../../lib/extend":281,"../../plot_api/plot_template":323,"../../traces/scatter/attributes":499,"../annotations/attributes":140,"../drawing/attributes":178}],238:[function(_dereq_,module,exports){
45140
+ },{"../../constants/axis_placeable_objects":263,"../../lib/extend":281,"../../plot_api/plot_template":323,"../../traces/scatter/attributes":500,"../annotations/attributes":140,"../drawing/attributes":178}],238:[function(_dereq_,module,exports){
44841
45141
  'use strict';
44842
45142
 
44843
45143
  var Lib = _dereq_('../../lib');
@@ -48153,8 +48453,10 @@ function draw(gd, titleClass, options) {
48153
48453
 
48154
48454
  var elShouldExist = txt || editable;
48155
48455
 
48456
+ var hColorbarMoveTitle;
48156
48457
  if(!group) {
48157
48458
  group = Lib.ensureSingle(fullLayout._infolayer, 'g', 'g-' + titleClass);
48459
+ hColorbarMoveTitle = fullLayout._hColorbarMoveTitle;
48158
48460
  }
48159
48461
 
48160
48462
  var el = group.selectAll('text')
@@ -48178,13 +48480,17 @@ function draw(gd, titleClass, options) {
48178
48480
  function drawTitle(titleEl) {
48179
48481
  var transformVal;
48180
48482
 
48483
+ if(!transform && hColorbarMoveTitle) {
48484
+ transform = {};
48485
+ }
48486
+
48181
48487
  if(transform) {
48182
48488
  transformVal = '';
48183
48489
  if(transform.rotate) {
48184
48490
  transformVal += 'rotate(' + [transform.rotate, attributes.x, attributes.y] + ')';
48185
48491
  }
48186
- if(transform.offset) {
48187
- transformVal += strTranslate(0, transform.offset);
48492
+ if(transform.offset || hColorbarMoveTitle) {
48493
+ transformVal += strTranslate(0, (transform.offset || 0) - (hColorbarMoveTitle || 0));
48188
48494
  }
48189
48495
  } else {
48190
48496
  transformVal = null;
@@ -49981,7 +50287,7 @@ exports.Fx = {
49981
50287
  exports.Snapshot = _dereq_('./snapshot');
49982
50288
  exports.PlotSchema = _dereq_('./plot_api/plot_schema');
49983
50289
 
49984
- },{"../build/plotcss":1,"./components/annotations":148,"./components/annotations3d":153,"./components/colorbar":163,"./components/colorscale":169,"./components/errorbars":185,"./components/fx":197,"./components/grid":201,"./components/images":206,"./components/legend":214,"./components/modebar":220,"./components/rangeselector":228,"./components/rangeslider":235,"./components/shapes":249,"./components/sliders":254,"./components/updatemenus":260,"./fonts/ploticon":270,"./locale-en":314,"./locale-en-us":313,"./plot_api":318,"./plot_api/plot_schema":322,"./plots/plots":371,"./registry":378,"./snapshot":383,"./traces/scatter":511,"./version":551,"native-promise-only":72}],270:[function(_dereq_,module,exports){
50290
+ },{"../build/plotcss":1,"./components/annotations":148,"./components/annotations3d":153,"./components/colorbar":163,"./components/colorscale":169,"./components/errorbars":185,"./components/fx":197,"./components/grid":201,"./components/images":206,"./components/legend":214,"./components/modebar":220,"./components/rangeselector":228,"./components/rangeslider":235,"./components/shapes":249,"./components/sliders":254,"./components/updatemenus":260,"./fonts/ploticon":270,"./locale-en":314,"./locale-en-us":313,"./plot_api":318,"./plot_api/plot_schema":322,"./plots/plots":371,"./registry":378,"./snapshot":383,"./traces/scatter":512,"./version":552,"native-promise-only":72}],270:[function(_dereq_,module,exports){
49985
50291
  'use strict';
49986
50292
 
49987
50293
  module.exports = {
@@ -59642,7 +59948,7 @@ function cleanDeprecatedAttributeKeys(aobj) {
59642
59948
  if((key === 'title' || oldAxisTitleRegex.test(key) || colorbarRegex.test(key)) &&
59643
59949
  (typeof value === 'string' || typeof value === 'number')) {
59644
59950
  replace(key, key.replace('title', 'title.text'));
59645
- } else if(key.indexOf('titlefont') > -1) {
59951
+ } else if(key.indexOf('titlefont') > -1 && key.indexOf('grouptitlefont') === -1) {
59646
59952
  replace(key, key.replace('titlefont', 'title.font'));
59647
59953
  } else if(key.indexOf('titleposition') > -1) {
59648
59954
  replace(key, key.replace('titleposition', 'title.position'));
@@ -64367,7 +64673,7 @@ function toImage(gd, opts) {
64367
64673
 
64368
64674
  module.exports = toImage;
64369
64675
 
64370
- },{"../lib":287,"../plots/plots":371,"../snapshot/helpers":382,"../snapshot/svgtoimg":384,"../snapshot/tosvg":386,"../version":551,"./plot_api":320,"fast-isnumeric":33}],327:[function(_dereq_,module,exports){
64676
+ },{"../lib":287,"../plots/plots":371,"../snapshot/helpers":382,"../snapshot/svgtoimg":384,"../snapshot/tosvg":386,"../version":552,"./plot_api":320,"fast-isnumeric":33}],327:[function(_dereq_,module,exports){
64371
64677
  'use strict';
64372
64678
 
64373
64679
  var Lib = _dereq_('../lib');
@@ -77510,6 +77816,9 @@ module.exports = function(opts) {
77510
77816
  // TODO - that's uber hacky... better solution?
77511
77817
  };
77512
77818
 
77819
+ if(opts.autoSize) attrs.size.dflt = 'auto';
77820
+ if(opts.autoColor) attrs.color.dflt = 'auto';
77821
+
77513
77822
  if(opts.arrayOk) {
77514
77823
  attrs.family.arrayOk = true;
77515
77824
  attrs.size.arrayOk = true;
@@ -77869,6 +78178,7 @@ module.exports = {
77869
78178
  valType: 'boolean',
77870
78179
  editType: 'legend',
77871
78180
  },
78181
+
77872
78182
  colorway: {
77873
78183
  valType: 'colorlist',
77874
78184
  dflt: colorAttrs.defaults,
@@ -79281,13 +79591,7 @@ plots.supplyTraceDefaults = function(traceIn, traceOut, colorIndex, layout, trac
79281
79591
  );
79282
79592
 
79283
79593
  coerce('legendgroup');
79284
- var titleText = coerce('legendgrouptitle.text');
79285
- if(titleText) {
79286
- Lib.coerceFont(coerce, 'legendgrouptitle.font', Lib.extendFlat({}, layout.font, {
79287
- size: Math.round(layout.font.size * 1.1) // default to larger font size
79288
- }));
79289
- }
79290
-
79594
+ coerce('legendgrouptitle.text');
79291
79595
  coerce('legendrank');
79292
79596
 
79293
79597
  traceOut._dfltShowLegend = true;
@@ -79435,16 +79739,14 @@ plots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut, formatObj) {
79435
79739
 
79436
79740
  coerce('autotypenumbers');
79437
79741
 
79438
- var globalFont = Lib.coerceFont(coerce, 'font');
79439
-
79440
- coerce('title.text', layoutOut._dfltTitle.plot);
79742
+ var font = Lib.coerceFont(coerce, 'font');
79743
+ var fontSize = font.size;
79441
79744
 
79442
- Lib.coerceFont(coerce, 'title.font', {
79443
- family: globalFont.family,
79444
- size: Math.round(globalFont.size * 1.4),
79445
- color: globalFont.color
79446
- });
79745
+ Lib.coerceFont(coerce, 'title.font', Lib.extendFlat({}, font, {
79746
+ size: Math.round(fontSize * 1.4)
79747
+ }));
79447
79748
 
79749
+ coerce('title.text', layoutOut._dfltTitle.plot);
79448
79750
  coerce('title.xref');
79449
79751
  coerce('title.yref');
79450
79752
  coerce('title.x');
@@ -84012,7 +84314,7 @@ module.exports = {
84012
84314
  }
84013
84315
  };
84014
84316
 
84015
- },{"../../components/colorscale/attributes":164,"../../components/drawing/attributes":178,"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../../plots/font_attributes":365,"../../plots/template_attributes":373,"../scatter/attributes":499,"./constants":390}],389:[function(_dereq_,module,exports){
84317
+ },{"../../components/colorscale/attributes":164,"../../components/drawing/attributes":178,"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../../plots/font_attributes":365,"../../plots/template_attributes":373,"../scatter/attributes":500,"./constants":390}],389:[function(_dereq_,module,exports){
84016
84318
  'use strict';
84017
84319
 
84018
84320
  var Axes = _dereq_('../../plots/cartesian/axes');
@@ -84087,7 +84389,7 @@ module.exports = function calc(gd, trace) {
84087
84389
  return cd;
84088
84390
  };
84089
84391
 
84090
- },{"../../components/colorscale/calc":165,"../../components/colorscale/helpers":168,"../../plots/cartesian/align_period":331,"../../plots/cartesian/axes":334,"../scatter/calc_selection":501,"./arrays_to_calcdata":387}],390:[function(_dereq_,module,exports){
84392
+ },{"../../components/colorscale/calc":165,"../../components/colorscale/helpers":168,"../../plots/cartesian/align_period":331,"../../plots/cartesian/axes":334,"../scatter/calc_selection":502,"./arrays_to_calcdata":387}],390:[function(_dereq_,module,exports){
84091
84393
  'use strict';
84092
84394
 
84093
84395
  module.exports = {
@@ -85054,7 +85356,7 @@ module.exports = {
85054
85356
  handleText: handleText
85055
85357
  };
85056
85358
 
85057
- },{"../../components/color":157,"../../lib":287,"../../plots/cartesian/constraints":342,"../../registry":378,"../scatter/period_defaults":519,"../scatter/xy_defaults":526,"./attributes":388,"./style_defaults":403}],393:[function(_dereq_,module,exports){
85359
+ },{"../../components/color":157,"../../lib":287,"../../plots/cartesian/constraints":342,"../../registry":378,"../scatter/period_defaults":520,"../scatter/xy_defaults":527,"./attributes":388,"./style_defaults":403}],393:[function(_dereq_,module,exports){
85058
85360
  'use strict';
85059
85361
 
85060
85362
  module.exports = function eventData(out, pt, trace) {
@@ -85399,7 +85701,7 @@ module.exports = {
85399
85701
  }
85400
85702
  };
85401
85703
 
85402
- },{"../../plots/cartesian":348,"../scatter/marker_colorbar":517,"./arrays_to_calcdata":387,"./attributes":388,"./calc":389,"./cross_trace_calc":391,"./defaults":392,"./event_data":393,"./hover":395,"./layout_attributes":397,"./layout_defaults":398,"./plot":399,"./select":400,"./style":402}],397:[function(_dereq_,module,exports){
85704
+ },{"../../plots/cartesian":348,"../scatter/marker_colorbar":518,"./arrays_to_calcdata":387,"./attributes":388,"./calc":389,"./cross_trace_calc":391,"./defaults":392,"./event_data":393,"./hover":395,"./layout_attributes":397,"./layout_defaults":398,"./plot":399,"./select":400,"./style":402}],397:[function(_dereq_,module,exports){
85403
85705
  'use strict';
85404
85706
 
85405
85707
 
@@ -86115,12 +86417,14 @@ function calcTexttemplate(fullLayout, cd, index, xa, ya) {
86115
86417
  var trace = cd[0].trace;
86116
86418
  var texttemplate = Lib.castOption(trace, index, 'texttemplate');
86117
86419
  if(!texttemplate) return '';
86420
+ var isHistogram = (trace.type === 'histogram');
86118
86421
  var isWaterfall = (trace.type === 'waterfall');
86119
86422
  var isFunnel = (trace.type === 'funnel');
86423
+ var isHorizontal = trace.orientation === 'h';
86120
86424
 
86121
86425
  var pLetter, pAxis;
86122
86426
  var vLetter, vAxis;
86123
- if(trace.orientation === 'h') {
86427
+ if(isHorizontal) {
86124
86428
  pLetter = 'y';
86125
86429
  pAxis = ya;
86126
86430
  vLetter = 'x';
@@ -86155,6 +86459,11 @@ function calcTexttemplate(fullLayout, cd, index, xa, ya) {
86155
86459
  var pt = {};
86156
86460
  appendArrayPointValue(pt, trace, cdi.i);
86157
86461
 
86462
+ if(isHistogram || pt.x === undefined) pt.x = isHorizontal ? obj.value : obj.label;
86463
+ if(isHistogram || pt.y === undefined) pt.y = isHorizontal ? obj.label : obj.value;
86464
+ if(isHistogram || pt.xLabel === undefined) pt.xLabel = isHorizontal ? obj.valueLabel : obj.labelLabel;
86465
+ if(isHistogram || pt.yLabel === undefined) pt.yLabel = isHorizontal ? obj.labelLabel : obj.valueLabel;
86466
+
86158
86467
  if(isWaterfall) {
86159
86468
  obj.delta = +cdi.rawS || cdi.s;
86160
86469
  obj.deltaLabel = formatNumber(obj.delta);
@@ -86945,7 +87254,7 @@ module.exports = {
86945
87254
  }
86946
87255
  };
86947
87256
 
86948
- },{"../../components/color/attributes":156,"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../../plots/template_attributes":373,"../bar/attributes":388,"../scatter/attributes":499}],406:[function(_dereq_,module,exports){
87257
+ },{"../../components/color/attributes":156,"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../../plots/template_attributes":373,"../bar/attributes":388,"../scatter/attributes":500}],406:[function(_dereq_,module,exports){
86949
87258
  'use strict';
86950
87259
 
86951
87260
  var isNumeric = _dereq_('fast-isnumeric');
@@ -87926,7 +88235,7 @@ module.exports = {
87926
88235
  handlePointsDefaults: handlePointsDefaults
87927
88236
  };
87928
88237
 
87929
- },{"../../components/color":157,"../../lib":287,"../../plots/cartesian/axis_autotype":335,"../../registry":378,"../bar/defaults":392,"../scatter/period_defaults":519,"./attributes":405}],409:[function(_dereq_,module,exports){
88238
+ },{"../../components/color":157,"../../lib":287,"../../plots/cartesian/axis_autotype":335,"../../registry":378,"../bar/defaults":392,"../scatter/period_defaults":520,"./attributes":405}],409:[function(_dereq_,module,exports){
87930
88239
  'use strict';
87931
88240
 
87932
88241
  module.exports = function eventData(out, pt) {
@@ -88807,6 +89116,10 @@ module.exports = extendFlat({
88807
89116
  yhoverformat: axisHoverFormat('y'),
88808
89117
  zhoverformat: axisHoverFormat('z', 1),
88809
89118
  hovertemplate: heatmapAttrs.hovertemplate,
89119
+ texttemplate: extendFlat({}, heatmapAttrs.texttemplate, {
89120
+ }),
89121
+ textfont: extendFlat({}, heatmapAttrs.textfont, {
89122
+ }),
88810
89123
  hoverongaps: heatmapAttrs.hoverongaps,
88811
89124
  connectgaps: extendFlat({}, heatmapAttrs.connectgaps, {
88812
89125
  }),
@@ -88922,7 +89235,7 @@ module.exports = extendFlat({
88922
89235
  })
88923
89236
  );
88924
89237
 
88925
- },{"../../components/colorscale/attributes":164,"../../components/drawing/attributes":178,"../../constants/filter_ops":265,"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../../plots/font_attributes":365,"../heatmap/attributes":439,"../scatter/attributes":499}],418:[function(_dereq_,module,exports){
89238
+ },{"../../components/colorscale/attributes":164,"../../components/drawing/attributes":178,"../../constants/filter_ops":265,"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../../plots/font_attributes":365,"../heatmap/attributes":439,"../scatter/attributes":500}],418:[function(_dereq_,module,exports){
88926
89239
  'use strict';
88927
89240
 
88928
89241
  var Colorscale = _dereq_('../../components/colorscale');
@@ -89441,6 +89754,7 @@ var handlePeriodDefaults = _dereq_('../scatter/period_defaults');
89441
89754
  var handleConstraintDefaults = _dereq_('./constraint_defaults');
89442
89755
  var handleContoursDefaults = _dereq_('./contours_defaults');
89443
89756
  var handleStyleDefaults = _dereq_('./style_defaults');
89757
+ var handleHeatmapLabelDefaults = _dereq_('../heatmap/label_defaults');
89444
89758
  var attributes = _dereq_('./attributes');
89445
89759
 
89446
89760
 
@@ -89465,8 +89779,8 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
89465
89779
 
89466
89780
  coerce('text');
89467
89781
  coerce('hovertext');
89468
- coerce('hovertemplate');
89469
89782
  coerce('hoverongaps');
89783
+ coerce('hovertemplate');
89470
89784
 
89471
89785
  var isConstraint = (coerce('contours.type') === 'constraint');
89472
89786
  coerce('connectgaps', Lib.isArray1D(traceOut.z));
@@ -89477,9 +89791,16 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
89477
89791
  handleContoursDefaults(traceIn, traceOut, coerce, coerce2);
89478
89792
  handleStyleDefaults(traceIn, traceOut, coerce, layout);
89479
89793
  }
89794
+
89795
+ if(
89796
+ traceOut.contours &&
89797
+ traceOut.contours.coloring === 'heatmap'
89798
+ ) {
89799
+ handleHeatmapLabelDefaults(coerce, layout);
89800
+ }
89480
89801
  };
89481
89802
 
89482
- },{"../../lib":287,"../heatmap/xyz_defaults":453,"../scatter/period_defaults":519,"./attributes":417,"./constraint_defaults":422,"./contours_defaults":424,"./style_defaults":438}],427:[function(_dereq_,module,exports){
89803
+ },{"../../lib":287,"../heatmap/label_defaults":449,"../heatmap/xyz_defaults":454,"../scatter/period_defaults":520,"./attributes":417,"./constraint_defaults":422,"./contours_defaults":424,"./style_defaults":438}],427:[function(_dereq_,module,exports){
89483
89804
  'use strict';
89484
89805
 
89485
89806
  var Lib = _dereq_('../../lib');
@@ -90753,7 +91074,7 @@ function makeClipMask(cd0) {
90753
91074
  return z;
90754
91075
  }
90755
91076
 
90756
- },{"../../components/colorscale":169,"../../components/drawing":179,"../../lib":287,"../../lib/svg_text_utils":310,"../../plots/cartesian/axes":334,"../../plots/cartesian/set_convert":356,"../heatmap/plot":450,"./close_boundaries":419,"./constants":421,"./convert_to_constraints":425,"./empty_pathinfo":427,"./find_all_paths":429,"./make_crossings":434,"@plotly/d3":20}],436:[function(_dereq_,module,exports){
91077
+ },{"../../components/colorscale":169,"../../components/drawing":179,"../../lib":287,"../../lib/svg_text_utils":310,"../../plots/cartesian/axes":334,"../../plots/cartesian/set_convert":356,"../heatmap/plot":451,"./close_boundaries":419,"./constants":421,"./convert_to_constraints":425,"./empty_pathinfo":427,"./find_all_paths":429,"./make_crossings":434,"@plotly/d3":20}],436:[function(_dereq_,module,exports){
90757
91078
  'use strict';
90758
91079
 
90759
91080
  var Axes = _dereq_('../../plots/cartesian/axes');
@@ -90921,7 +91242,7 @@ module.exports = function style(gd) {
90921
91242
  heatmapStyle(gd);
90922
91243
  };
90923
91244
 
90924
- },{"../../components/drawing":179,"../heatmap/style":451,"./make_color_map":433,"@plotly/d3":20}],438:[function(_dereq_,module,exports){
91245
+ },{"../../components/drawing":179,"../heatmap/style":452,"./make_color_map":433,"@plotly/d3":20}],438:[function(_dereq_,module,exports){
90925
91246
  'use strict';
90926
91247
 
90927
91248
  var colorscaleDefaults = _dereq_('../../components/colorscale/defaults');
@@ -90962,8 +91283,10 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce, layout,
90962
91283
 
90963
91284
  var scatterAttrs = _dereq_('../scatter/attributes');
90964
91285
  var baseAttrs = _dereq_('../../plots/attributes');
91286
+ var fontAttrs = _dereq_('../../plots/font_attributes');
90965
91287
  var axisHoverFormat = _dereq_('../../plots/cartesian/axis_format_attributes').axisHoverFormat;
90966
91288
  var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;
91289
+ var texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;
90967
91290
  var colorScaleAttrs = _dereq_('../../components/colorscale/attributes');
90968
91291
 
90969
91292
  var extendFlat = _dereq_('../../lib/extend').extendFlat;
@@ -91042,6 +91365,19 @@ module.exports = extendFlat({
91042
91365
  zhoverformat: axisHoverFormat('z', 1),
91043
91366
 
91044
91367
  hovertemplate: hovertemplateAttrs(),
91368
+ texttemplate: texttemplateAttrs({
91369
+ arrayOk: false,
91370
+ editType: 'plot'
91371
+ }, {
91372
+ keys: ['x', 'y', 'z', 'text']
91373
+ }),
91374
+ textfont: fontAttrs({
91375
+ editType: 'plot',
91376
+ autoSize: true,
91377
+ autoColor: true,
91378
+ colorEditType: 'style',
91379
+ }),
91380
+
91045
91381
  showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
91046
91382
  }, {
91047
91383
  transforms: undefined
@@ -91049,7 +91385,7 @@ module.exports = extendFlat({
91049
91385
  colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})
91050
91386
  );
91051
91387
 
91052
- },{"../../components/colorscale/attributes":164,"../../lib/extend":281,"../../plots/attributes":330,"../../plots/cartesian/axis_format_attributes":337,"../../plots/template_attributes":373,"../scatter/attributes":499}],440:[function(_dereq_,module,exports){
91388
+ },{"../../components/colorscale/attributes":164,"../../lib/extend":281,"../../plots/attributes":330,"../../plots/cartesian/axis_format_attributes":337,"../../plots/font_attributes":365,"../../plots/template_attributes":373,"../scatter/attributes":500}],440:[function(_dereq_,module,exports){
91053
91389
  'use strict';
91054
91390
 
91055
91391
  var Registry = _dereq_('../../registry');
@@ -91250,7 +91586,7 @@ function dropZonBreaks(x, y, z) {
91250
91586
  return newZ;
91251
91587
  }
91252
91588
 
91253
- },{"../../components/colorscale/calc":165,"../../constants/numerical":267,"../../lib":287,"../../plots/cartesian/align_period":331,"../../plots/cartesian/axes":334,"../../registry":378,"../histogram2d/calc":468,"./clean_2d_array":441,"./convert_column_xyz":443,"./find_empties":445,"./interp2d":448,"./make_bound_array":449}],441:[function(_dereq_,module,exports){
91589
+ },{"../../components/colorscale/calc":165,"../../constants/numerical":267,"../../lib":287,"../../plots/cartesian/align_period":331,"../../plots/cartesian/axes":334,"../../registry":378,"../histogram2d/calc":469,"./clean_2d_array":441,"./convert_column_xyz":443,"./find_empties":445,"./interp2d":448,"./make_bound_array":450}],441:[function(_dereq_,module,exports){
91254
91590
  'use strict';
91255
91591
 
91256
91592
  var isNumeric = _dereq_('fast-isnumeric');
@@ -91414,6 +91750,7 @@ module.exports = function convertColumnData(trace, ax1, ax2, var1Name, var2Name,
91414
91750
  var Lib = _dereq_('../../lib');
91415
91751
 
91416
91752
  var handleXYZDefaults = _dereq_('./xyz_defaults');
91753
+ var handleHeatmapLabelDefaults = _dereq_('./label_defaults');
91417
91754
  var handlePeriodDefaults = _dereq_('../scatter/period_defaults');
91418
91755
  var handleStyleDefaults = _dereq_('./style_defaults');
91419
91756
  var colorscaleDefaults = _dereq_('../../components/colorscale/defaults');
@@ -91439,6 +91776,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
91439
91776
  coerce('hovertext');
91440
91777
  coerce('hovertemplate');
91441
91778
 
91779
+ handleHeatmapLabelDefaults(coerce, layout);
91442
91780
  handleStyleDefaults(traceIn, traceOut, coerce, layout);
91443
91781
 
91444
91782
  coerce('hoverongaps');
@@ -91447,7 +91785,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
91447
91785
  colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
91448
91786
  };
91449
91787
 
91450
- },{"../../components/colorscale/defaults":167,"../../lib":287,"../scatter/period_defaults":519,"./attributes":439,"./style_defaults":452,"./xyz_defaults":453}],445:[function(_dereq_,module,exports){
91788
+ },{"../../components/colorscale/defaults":167,"../../lib":287,"../scatter/period_defaults":520,"./attributes":439,"./label_defaults":449,"./style_defaults":453,"./xyz_defaults":454}],445:[function(_dereq_,module,exports){
91451
91789
  'use strict';
91452
91790
 
91453
91791
  var maxRowLength = _dereq_('../../lib').maxRowLength;
@@ -91697,7 +92035,7 @@ module.exports = {
91697
92035
  }
91698
92036
  };
91699
92037
 
91700
- },{"../../plots/cartesian":348,"./attributes":439,"./calc":440,"./colorbar":442,"./defaults":444,"./hover":446,"./plot":450,"./style":451}],448:[function(_dereq_,module,exports){
92038
+ },{"../../plots/cartesian":348,"./attributes":439,"./calc":440,"./colorbar":442,"./defaults":444,"./hover":446,"./plot":451,"./style":452}],448:[function(_dereq_,module,exports){
91701
92039
  'use strict';
91702
92040
 
91703
92041
  var Lib = _dereq_('../../lib');
@@ -91825,6 +92163,21 @@ function iterateInterp2d(z, emptyPoints, overshoot) {
91825
92163
  },{"../../lib":287}],449:[function(_dereq_,module,exports){
91826
92164
  'use strict';
91827
92165
 
92166
+ var Lib = _dereq_('../../lib');
92167
+
92168
+ module.exports = function handleHeatmapLabelDefaults(coerce, layout) {
92169
+ coerce('texttemplate');
92170
+
92171
+ var fontDflt = Lib.extendFlat({}, layout.font, {
92172
+ color: 'auto',
92173
+ size: 'auto'
92174
+ });
92175
+ Lib.coerceFont(coerce, 'textfont', fontDflt);
92176
+ };
92177
+
92178
+ },{"../../lib":287}],450:[function(_dereq_,module,exports){
92179
+ 'use strict';
92180
+
91828
92181
  var Registry = _dereq_('../../registry');
91829
92182
  var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;
91830
92183
 
@@ -91902,16 +92255,34 @@ module.exports = function makeBoundArray(trace, arrayIn, v0In, dvIn, numbricks,
91902
92255
  return arrayOut;
91903
92256
  };
91904
92257
 
91905
- },{"../../lib":287,"../../registry":378}],450:[function(_dereq_,module,exports){
92258
+ },{"../../lib":287,"../../registry":378}],451:[function(_dereq_,module,exports){
91906
92259
  'use strict';
91907
92260
 
91908
92261
  var d3 = _dereq_('@plotly/d3');
91909
92262
  var tinycolor = _dereq_('tinycolor2');
91910
92263
 
91911
92264
  var Registry = _dereq_('../../registry');
92265
+ var Drawing = _dereq_('../../components/drawing');
92266
+ var Axes = _dereq_('../../plots/cartesian/axes');
91912
92267
  var Lib = _dereq_('../../lib');
92268
+ var svgTextUtils = _dereq_('../../lib/svg_text_utils');
92269
+ var formatLabels = _dereq_('../scatter/format_labels');
92270
+ var Color = _dereq_('../../components/color');
92271
+ var extractOpts = _dereq_('../../components/colorscale').extractOpts;
91913
92272
  var makeColorScaleFuncFromTrace = _dereq_('../../components/colorscale').makeColorScaleFuncFromTrace;
91914
92273
  var xmlnsNamespaces = _dereq_('../../constants/xmlns_namespaces');
92274
+ var alignmentConstants = _dereq_('../../constants/alignment');
92275
+ var LINE_SPACING = alignmentConstants.LINE_SPACING;
92276
+
92277
+ var labelClass = 'heatmap-label';
92278
+
92279
+ function selectLabels(plotGroup) {
92280
+ return plotGroup.selectAll('g.' + labelClass);
92281
+ }
92282
+
92283
+ function removeLabels(plotGroup) {
92284
+ selectLabels(plotGroup).remove();
92285
+ }
91915
92286
 
91916
92287
  module.exports = function(gd, plotinfo, cdheatmaps, heatmapLayer) {
91917
92288
  var xa = plotinfo.xaxis;
@@ -91921,6 +92292,8 @@ module.exports = function(gd, plotinfo, cdheatmaps, heatmapLayer) {
91921
92292
  var plotGroup = d3.select(this);
91922
92293
  var cd0 = cd[0];
91923
92294
  var trace = cd0.trace;
92295
+ var xGap = trace.xgap || 0;
92296
+ var yGap = trace.ygap || 0;
91924
92297
 
91925
92298
  var z = cd0.z;
91926
92299
  var x = cd0.x;
@@ -91936,7 +92309,7 @@ module.exports = function(gd, plotinfo, cdheatmaps, heatmapLayer) {
91936
92309
  var xrev = false;
91937
92310
  var yrev = false;
91938
92311
 
91939
- var left, right, temp, top, bottom, i;
92312
+ var left, right, temp, top, bottom, i, j, k;
91940
92313
 
91941
92314
  // TODO: if there are multiple overlapping categorical heatmaps,
91942
92315
  // or if we allow category sorting, then the categories may not be
@@ -92017,6 +92390,8 @@ module.exports = function(gd, plotinfo, cdheatmaps, heatmapLayer) {
92017
92390
  if(isOffScreen) {
92018
92391
  var noImage = plotGroup.selectAll('image').data([]);
92019
92392
  noImage.exit().remove();
92393
+
92394
+ removeLabels(plotGroup);
92020
92395
  return;
92021
92396
  }
92022
92397
 
@@ -92072,7 +92447,7 @@ module.exports = function(gd, plotinfo, cdheatmaps, heatmapLayer) {
92072
92447
  var gcount = 0;
92073
92448
  var bcount = 0;
92074
92449
 
92075
- var xb, j, xi, v, row, c;
92450
+ var xb, xi, v, row, c;
92076
92451
 
92077
92452
  function setColor(v, pixsize) {
92078
92453
  if(v !== undefined) {
@@ -92183,8 +92558,6 @@ module.exports = function(gd, plotinfo, cdheatmaps, heatmapLayer) {
92183
92558
  } else { // zsmooth = false -> filling potentially large bricks works fastest with fillRect
92184
92559
  // gaps do not need to be exact integers, but if they *are* we will get
92185
92560
  // cleaner edges by rounding at least one edge
92186
- var xGap = trace.xgap;
92187
- var yGap = trace.ygap;
92188
92561
  var xGapLeft = Math.floor(xGap / 2);
92189
92562
  var yGapTop = Math.floor(yGap / 2);
92190
92563
 
@@ -92237,6 +92610,187 @@ module.exports = function(gd, plotinfo, cdheatmaps, heatmapLayer) {
92237
92610
  y: top,
92238
92611
  'xlink:href': canvas.toDataURL('image/png')
92239
92612
  });
92613
+
92614
+ removeLabels(plotGroup);
92615
+
92616
+ var texttemplate = trace.texttemplate;
92617
+ if(texttemplate) {
92618
+ // dummy axis for formatting the z value
92619
+ var cOpts = extractOpts(trace);
92620
+ var dummyAx = {
92621
+ type: 'linear',
92622
+ range: [cOpts.min, cOpts.max],
92623
+ _separators: xa._separators,
92624
+ _numFormat: xa._numFormat
92625
+ };
92626
+
92627
+ var aHistogram2dContour = trace.type === 'histogram2dcontour';
92628
+ var aContour = trace.type === 'contour';
92629
+ var iStart = aContour ? 1 : 0;
92630
+ var iStop = aContour ? m - 1 : m;
92631
+ var jStart = aContour ? 1 : 0;
92632
+ var jStop = aContour ? n - 1 : n;
92633
+
92634
+ var textData = [];
92635
+ for(i = iStart; i < iStop; i++) {
92636
+ var yVal;
92637
+ if(aContour) {
92638
+ yVal = cd0.y[i];
92639
+ } else if(aHistogram2dContour) {
92640
+ if(i === 0 || i === m - 1) continue;
92641
+ yVal = cd0.y[i];
92642
+ } else if(cd0.yCenter) {
92643
+ yVal = cd0.yCenter[i];
92644
+ } else {
92645
+ if(i + 1 === m && cd0.y[i + 1] === undefined) continue;
92646
+ yVal = (cd0.y[i] + cd0.y[i + 1]) / 2;
92647
+ }
92648
+
92649
+ var _y = Math.round(ya.c2p(yVal));
92650
+ if(0 > _y || _y > ya._length) continue;
92651
+
92652
+ for(j = jStart; j < jStop; j++) {
92653
+ var xVal;
92654
+ if(aContour) {
92655
+ xVal = cd0.x[j];
92656
+ } else if(aHistogram2dContour) {
92657
+ if(j === 0 || j === n - 1) continue;
92658
+ xVal = cd0.x[j];
92659
+ } else if(cd0.xCenter) {
92660
+ xVal = cd0.xCenter[j];
92661
+ } else {
92662
+ if(j + 1 === n && cd0.x[j + 1] === undefined) continue;
92663
+ xVal = (cd0.x[j] + cd0.x[j + 1]) / 2;
92664
+ }
92665
+
92666
+ var _x = Math.round(xa.c2p(xVal));
92667
+ if(0 > _x || _x > xa._length) continue;
92668
+
92669
+ var obj = formatLabels({
92670
+ x: xVal,
92671
+ y: yVal
92672
+ }, trace, gd._fullLayout);
92673
+
92674
+ obj.x = xVal;
92675
+ obj.y = yVal;
92676
+
92677
+ var zVal = cd0.z[i][j];
92678
+ if(zVal === undefined) {
92679
+ obj.z = '';
92680
+ obj.zLabel = '';
92681
+ } else {
92682
+ obj.z = zVal;
92683
+ obj.zLabel = Axes.tickText(dummyAx, zVal, 'hover').text;
92684
+ }
92685
+
92686
+ var theText = cd0.text && cd0.text[i] && cd0.text[i][j];
92687
+ if(theText === undefined || theText === false) theText = '';
92688
+ obj.text = theText;
92689
+
92690
+ var _t = Lib.texttemplateString(texttemplate, obj, gd._fullLayout._d3locale, obj, trace._meta || {});
92691
+ if(!_t) continue;
92692
+
92693
+ var lines = _t.split('<br>');
92694
+ var nL = lines.length;
92695
+ var nC = 0;
92696
+ for(k = 0; k < nL; k++) {
92697
+ nC = Math.max(nC, lines[k].length);
92698
+ }
92699
+
92700
+ textData.push({
92701
+ l: nL, // number of lines
92702
+ c: nC, // maximum number of chars in a line
92703
+ t: _t, // text
92704
+ x: _x,
92705
+ y: _y,
92706
+ z: zVal
92707
+ });
92708
+ }
92709
+ }
92710
+
92711
+ var font = trace.textfont;
92712
+ var fontFamily = font.family;
92713
+ var fontSize = font.size;
92714
+ var globalFontSize = gd._fullLayout.font.size;
92715
+
92716
+ if(!fontSize || fontSize === 'auto') {
92717
+ var minW = Infinity;
92718
+ var minH = Infinity;
92719
+ var maxL = 0;
92720
+ var maxC = 0;
92721
+
92722
+ for(k = 0; k < textData.length; k++) {
92723
+ var d = textData[k];
92724
+ maxL = Math.max(maxL, d.l);
92725
+ maxC = Math.max(maxC, d.c);
92726
+
92727
+ if(k < textData.length - 1) {
92728
+ var nextD = textData[k + 1];
92729
+ var dx = Math.abs(nextD.x - d.x);
92730
+ var dy = Math.abs(nextD.y - d.y);
92731
+
92732
+ if(dx) minW = Math.min(minW, dx);
92733
+ if(dy) minH = Math.min(minH, dy);
92734
+ }
92735
+ }
92736
+
92737
+ if(
92738
+ !isFinite(minW) ||
92739
+ !isFinite(minH)
92740
+ ) {
92741
+ fontSize = globalFontSize;
92742
+ } else {
92743
+ minW -= xGap;
92744
+ minH -= yGap;
92745
+
92746
+ minW /= maxC;
92747
+ minH /= maxL;
92748
+
92749
+ minW /= LINE_SPACING / 2;
92750
+ minH /= LINE_SPACING;
92751
+
92752
+ fontSize = Math.min(
92753
+ Math.floor(minW),
92754
+ Math.floor(minH),
92755
+ globalFontSize
92756
+ );
92757
+ }
92758
+ }
92759
+ if(fontSize <= 0 || !isFinite(fontSize)) return;
92760
+
92761
+ var xFn = function(d) { return d.x; };
92762
+ var yFn = function(d) {
92763
+ return d.y - fontSize * ((d.l * LINE_SPACING) / 2 - 1);
92764
+ };
92765
+
92766
+ var labels = selectLabels(plotGroup).data(textData);
92767
+
92768
+ labels
92769
+ .enter()
92770
+ .append('g')
92771
+ .classed(labelClass, 1)
92772
+ .append('text')
92773
+ .attr('text-anchor', 'middle')
92774
+ .each(function(d) {
92775
+ var thisLabel = d3.select(this);
92776
+
92777
+ var fontColor = font.color;
92778
+ if(!fontColor || fontColor === 'auto') {
92779
+ fontColor = Color.contrast(
92780
+ 'rgba(' +
92781
+ sclFunc(d.z).join() +
92782
+ ')'
92783
+ );
92784
+ }
92785
+
92786
+ thisLabel
92787
+ .attr('data-notex', 1)
92788
+ .call(svgTextUtils.positionText, xFn(d), yFn(d))
92789
+ .call(Drawing.font, fontFamily, fontSize, fontColor)
92790
+ .text(d.t)
92791
+ .call(svgTextUtils.convertToTspans, gd);
92792
+ });
92793
+ }
92240
92794
  });
92241
92795
  };
92242
92796
 
@@ -92298,7 +92852,7 @@ function putColor(pixels, pxIndex, c) {
92298
92852
  pixels[pxIndex + 3] = Math.round(c[3] * 255);
92299
92853
  }
92300
92854
 
92301
- },{"../../components/colorscale":169,"../../constants/xmlns_namespaces":268,"../../lib":287,"../../registry":378,"@plotly/d3":20,"tinycolor2":121}],451:[function(_dereq_,module,exports){
92855
+ },{"../../components/color":157,"../../components/colorscale":169,"../../components/drawing":179,"../../constants/alignment":262,"../../constants/xmlns_namespaces":268,"../../lib":287,"../../lib/svg_text_utils":310,"../../plots/cartesian/axes":334,"../../registry":378,"../scatter/format_labels":509,"@plotly/d3":20,"tinycolor2":121}],452:[function(_dereq_,module,exports){
92302
92856
  'use strict';
92303
92857
 
92304
92858
  var d3 = _dereq_('@plotly/d3');
@@ -92310,7 +92864,7 @@ module.exports = function style(gd) {
92310
92864
  });
92311
92865
  };
92312
92866
 
92313
- },{"@plotly/d3":20}],452:[function(_dereq_,module,exports){
92867
+ },{"@plotly/d3":20}],453:[function(_dereq_,module,exports){
92314
92868
  'use strict';
92315
92869
 
92316
92870
  module.exports = function handleStyleDefaults(traceIn, traceOut, coerce) {
@@ -92324,7 +92878,7 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce) {
92324
92878
  coerce('zhoverformat');
92325
92879
  };
92326
92880
 
92327
- },{}],453:[function(_dereq_,module,exports){
92881
+ },{}],454:[function(_dereq_,module,exports){
92328
92882
  'use strict';
92329
92883
 
92330
92884
  var isNumeric = _dereq_('fast-isnumeric');
@@ -92415,7 +92969,7 @@ function isValidZ(z) {
92415
92969
  return (allRowsAreArrays && oneRowIsFilled && hasOneNumber);
92416
92970
  }
92417
92971
 
92418
- },{"../../lib":287,"../../registry":378,"fast-isnumeric":33}],454:[function(_dereq_,module,exports){
92972
+ },{"../../lib":287,"../../registry":378,"fast-isnumeric":33}],455:[function(_dereq_,module,exports){
92419
92973
  'use strict';
92420
92974
 
92421
92975
  var barAttrs = _dereq_('../bar/attributes');
@@ -92565,7 +93119,7 @@ module.exports = {
92565
93119
  }
92566
93120
  };
92567
93121
 
92568
- },{"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../../plots/font_attributes":365,"../../plots/template_attributes":373,"../bar/attributes":388,"./bin_attributes":456,"./constants":460}],455:[function(_dereq_,module,exports){
93122
+ },{"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../../plots/font_attributes":365,"../../plots/template_attributes":373,"../bar/attributes":388,"./bin_attributes":457,"./constants":461}],456:[function(_dereq_,module,exports){
92569
93123
  'use strict';
92570
93124
 
92571
93125
 
@@ -92581,7 +93135,7 @@ module.exports = function doAvg(size, counts) {
92581
93135
  return total;
92582
93136
  };
92583
93137
 
92584
- },{}],456:[function(_dereq_,module,exports){
93138
+ },{}],457:[function(_dereq_,module,exports){
92585
93139
  'use strict';
92586
93140
 
92587
93141
  module.exports = function makeBinAttrs(axLetter, match) {
@@ -92602,7 +93156,7 @@ module.exports = function makeBinAttrs(axLetter, match) {
92602
93156
  };
92603
93157
  };
92604
93158
 
92605
- },{}],457:[function(_dereq_,module,exports){
93159
+ },{}],458:[function(_dereq_,module,exports){
92606
93160
  'use strict';
92607
93161
 
92608
93162
  var isNumeric = _dereq_('fast-isnumeric');
@@ -92667,7 +93221,7 @@ module.exports = {
92667
93221
  }
92668
93222
  };
92669
93223
 
92670
- },{"fast-isnumeric":33}],458:[function(_dereq_,module,exports){
93224
+ },{"fast-isnumeric":33}],459:[function(_dereq_,module,exports){
92671
93225
  'use strict';
92672
93226
 
92673
93227
  var numConstants = _dereq_('../../constants/numerical');
@@ -92834,7 +93388,7 @@ function dateParts(v, pa, calendar) {
92834
93388
  return parts;
92835
93389
  }
92836
93390
 
92837
- },{"../../constants/numerical":267,"../../plots/cartesian/axes":334}],459:[function(_dereq_,module,exports){
93391
+ },{"../../constants/numerical":267,"../../plots/cartesian/axes":334}],460:[function(_dereq_,module,exports){
92838
93392
  'use strict';
92839
93393
 
92840
93394
  var isNumeric = _dereq_('fast-isnumeric');
@@ -92852,8 +93406,9 @@ var getBinSpanLabelRound = _dereq_('./bin_label_vals');
92852
93406
  function calc(gd, trace) {
92853
93407
  var pos = [];
92854
93408
  var size = [];
92855
- var pa = Axes.getFromId(gd, trace.orientation === 'h' ? trace.yaxis : trace.xaxis);
92856
- var mainData = trace.orientation === 'h' ? 'y' : 'x';
93409
+ var isHorizontal = trace.orientation === 'h';
93410
+ var pa = Axes.getFromId(gd, isHorizontal ? trace.yaxis : trace.xaxis);
93411
+ var mainData = isHorizontal ? 'y' : 'x';
92857
93412
  var counterData = {x: 'y', y: 'x'}[mainData];
92858
93413
  var calendar = trace[mainData + 'calendar'];
92859
93414
  var cumulativeSpec = trace.cumulative;
@@ -93405,14 +93960,14 @@ module.exports = {
93405
93960
  calcAllAutoBins: calcAllAutoBins
93406
93961
  };
93407
93962
 
93408
- },{"../../lib":287,"../../plots/cartesian/axes":334,"../../registry":378,"../bar/arrays_to_calcdata":387,"./average":455,"./bin_functions":457,"./bin_label_vals":458,"./norm_functions":466,"fast-isnumeric":33}],460:[function(_dereq_,module,exports){
93963
+ },{"../../lib":287,"../../plots/cartesian/axes":334,"../../registry":378,"../bar/arrays_to_calcdata":387,"./average":456,"./bin_functions":458,"./bin_label_vals":459,"./norm_functions":467,"fast-isnumeric":33}],461:[function(_dereq_,module,exports){
93409
93964
  'use strict';
93410
93965
 
93411
93966
  module.exports = {
93412
93967
  eventDataKeys: ['binNumber']
93413
93968
  };
93414
93969
 
93415
- },{}],461:[function(_dereq_,module,exports){
93970
+ },{}],462:[function(_dereq_,module,exports){
93416
93971
  'use strict';
93417
93972
 
93418
93973
  var Lib = _dereq_('../../lib');
@@ -93681,7 +94236,7 @@ module.exports = function crossTraceDefaults(fullData, fullLayout) {
93681
94236
  }
93682
94237
  };
93683
94238
 
93684
- },{"../../lib":287,"../../plots/cartesian/axis_ids":338,"../../plots/cartesian/constraints":342,"../../registry":378,"../bar/defaults":392}],462:[function(_dereq_,module,exports){
94239
+ },{"../../lib":287,"../../plots/cartesian/axis_ids":338,"../../plots/cartesian/constraints":342,"../../registry":378,"../bar/defaults":392}],463:[function(_dereq_,module,exports){
93685
94240
  'use strict';
93686
94241
 
93687
94242
  var Registry = _dereq_('../../registry');
@@ -93760,7 +94315,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
93760
94315
  errorBarsSupplyDefaults(traceIn, traceOut, lineColor || Color.defaultLine, {axis: 'x', inherit: 'y'});
93761
94316
  };
93762
94317
 
93763
- },{"../../components/color":157,"../../lib":287,"../../registry":378,"../bar/defaults":392,"../bar/style_defaults":403,"./attributes":454}],463:[function(_dereq_,module,exports){
94318
+ },{"../../components/color":157,"../../lib":287,"../../registry":378,"../bar/defaults":392,"../bar/style_defaults":403,"./attributes":455}],464:[function(_dereq_,module,exports){
93764
94319
  'use strict';
93765
94320
 
93766
94321
  module.exports = function eventData(out, pt, trace, cd, pointNumber) {
@@ -93801,7 +94356,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) {
93801
94356
  return out;
93802
94357
  };
93803
94358
 
93804
- },{}],464:[function(_dereq_,module,exports){
94359
+ },{}],465:[function(_dereq_,module,exports){
93805
94360
  'use strict';
93806
94361
 
93807
94362
  var barHover = _dereq_('../bar/hover').hoverPoints;
@@ -93825,7 +94380,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
93825
94380
  return pts;
93826
94381
  };
93827
94382
 
93828
- },{"../../plots/cartesian/axes":334,"../bar/hover":395}],465:[function(_dereq_,module,exports){
94383
+ },{"../../plots/cartesian/axes":334,"../bar/hover":395}],466:[function(_dereq_,module,exports){
93829
94384
  'use strict';
93830
94385
 
93831
94386
  /**
@@ -93866,7 +94421,7 @@ module.exports = {
93866
94421
  }
93867
94422
  };
93868
94423
 
93869
- },{"../../plots/cartesian":348,"../bar/cross_trace_calc":391,"../bar/layout_attributes":397,"../bar/layout_defaults":398,"../bar/plot":399,"../bar/select":400,"../bar/style":402,"../scatter/marker_colorbar":517,"./attributes":454,"./calc":459,"./cross_trace_defaults":461,"./defaults":462,"./event_data":463,"./hover":464}],466:[function(_dereq_,module,exports){
94424
+ },{"../../plots/cartesian":348,"../bar/cross_trace_calc":391,"../bar/layout_attributes":397,"../bar/layout_defaults":398,"../bar/plot":399,"../bar/select":400,"../bar/style":402,"../scatter/marker_colorbar":518,"./attributes":455,"./calc":460,"./cross_trace_defaults":462,"./defaults":463,"./event_data":464,"./hover":465}],467:[function(_dereq_,module,exports){
93870
94425
  'use strict';
93871
94426
 
93872
94427
 
@@ -93892,7 +94447,7 @@ module.exports = {
93892
94447
  }
93893
94448
  };
93894
94449
 
93895
- },{}],467:[function(_dereq_,module,exports){
94450
+ },{}],468:[function(_dereq_,module,exports){
93896
94451
  'use strict';
93897
94452
 
93898
94453
  var histogramAttrs = _dereq_('../histogram/attributes');
@@ -93901,6 +94456,7 @@ var heatmapAttrs = _dereq_('../heatmap/attributes');
93901
94456
  var baseAttrs = _dereq_('../../plots/attributes');
93902
94457
  var axisHoverFormat = _dereq_('../../plots/cartesian/axis_format_attributes').axisHoverFormat;
93903
94458
  var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;
94459
+ var texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;
93904
94460
  var colorScaleAttrs = _dereq_('../../components/colorscale/attributes');
93905
94461
 
93906
94462
  var extendFlat = _dereq_('../../lib/extend').extendFlat;
@@ -93945,12 +94501,19 @@ module.exports = extendFlat(
93945
94501
  yhoverformat: axisHoverFormat('y'),
93946
94502
  zhoverformat: axisHoverFormat('z', 1),
93947
94503
  hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),
94504
+ texttemplate: texttemplateAttrs({
94505
+ arrayOk: false,
94506
+ editType: 'plot'
94507
+ }, {
94508
+ keys: 'z'
94509
+ }),
94510
+ textfont: heatmapAttrs.textfont,
93948
94511
  showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
93949
94512
  },
93950
94513
  colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})
93951
94514
  );
93952
94515
 
93953
- },{"../../components/colorscale/attributes":164,"../../lib/extend":281,"../../plots/attributes":330,"../../plots/cartesian/axis_format_attributes":337,"../../plots/template_attributes":373,"../heatmap/attributes":439,"../histogram/attributes":454,"../histogram/bin_attributes":456}],468:[function(_dereq_,module,exports){
94516
+ },{"../../components/colorscale/attributes":164,"../../lib/extend":281,"../../plots/attributes":330,"../../plots/cartesian/axis_format_attributes":337,"../../plots/template_attributes":373,"../heatmap/attributes":439,"../histogram/attributes":455,"../histogram/bin_attributes":457}],469:[function(_dereq_,module,exports){
93954
94517
  'use strict';
93955
94518
 
93956
94519
  var Lib = _dereq_('../../lib');
@@ -94161,7 +94724,7 @@ function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) {
94161
94724
  return out;
94162
94725
  }
94163
94726
 
94164
- },{"../../lib":287,"../../plots/cartesian/axes":334,"../histogram/average":455,"../histogram/bin_functions":457,"../histogram/bin_label_vals":458,"../histogram/calc":459,"../histogram/norm_functions":466}],469:[function(_dereq_,module,exports){
94727
+ },{"../../lib":287,"../../plots/cartesian/axes":334,"../histogram/average":456,"../histogram/bin_functions":458,"../histogram/bin_label_vals":459,"../histogram/calc":460,"../histogram/norm_functions":467}],470:[function(_dereq_,module,exports){
94165
94728
  'use strict';
94166
94729
 
94167
94730
  var Lib = _dereq_('../../lib');
@@ -94169,6 +94732,7 @@ var Lib = _dereq_('../../lib');
94169
94732
  var handleSampleDefaults = _dereq_('./sample_defaults');
94170
94733
  var handleStyleDefaults = _dereq_('../heatmap/style_defaults');
94171
94734
  var colorscaleDefaults = _dereq_('../../components/colorscale/defaults');
94735
+ var handleHeatmapLabelDefaults = _dereq_('../heatmap/label_defaults');
94172
94736
  var attributes = _dereq_('./attributes');
94173
94737
 
94174
94738
 
@@ -94183,11 +94747,14 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
94183
94747
  handleStyleDefaults(traceIn, traceOut, coerce, layout);
94184
94748
  colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
94185
94749
  coerce('hovertemplate');
94750
+
94751
+ handleHeatmapLabelDefaults(coerce, layout);
94752
+
94186
94753
  coerce('xhoverformat');
94187
94754
  coerce('yhoverformat');
94188
94755
  };
94189
94756
 
94190
- },{"../../components/colorscale/defaults":167,"../../lib":287,"../heatmap/style_defaults":452,"./attributes":467,"./sample_defaults":472}],470:[function(_dereq_,module,exports){
94757
+ },{"../../components/colorscale/defaults":167,"../../lib":287,"../heatmap/label_defaults":449,"../heatmap/style_defaults":453,"./attributes":468,"./sample_defaults":473}],471:[function(_dereq_,module,exports){
94191
94758
  'use strict';
94192
94759
 
94193
94760
  var heatmapHover = _dereq_('../heatmap/hover');
@@ -94213,7 +94780,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
94213
94780
  return pts;
94214
94781
  };
94215
94782
 
94216
- },{"../../plots/cartesian/axes":334,"../heatmap/hover":446}],471:[function(_dereq_,module,exports){
94783
+ },{"../../plots/cartesian/axes":334,"../heatmap/hover":446}],472:[function(_dereq_,module,exports){
94217
94784
  'use strict';
94218
94785
 
94219
94786
  module.exports = {
@@ -94236,7 +94803,7 @@ module.exports = {
94236
94803
  }
94237
94804
  };
94238
94805
 
94239
- },{"../../plots/cartesian":348,"../heatmap/calc":440,"../heatmap/colorbar":442,"../heatmap/plot":450,"../heatmap/style":451,"../histogram/cross_trace_defaults":461,"../histogram/event_data":463,"./attributes":467,"./defaults":469,"./hover":470}],472:[function(_dereq_,module,exports){
94806
+ },{"../../plots/cartesian":348,"../heatmap/calc":440,"../heatmap/colorbar":442,"../heatmap/plot":451,"../heatmap/style":452,"../histogram/cross_trace_defaults":462,"../histogram/event_data":464,"./attributes":468,"./defaults":470,"./hover":471}],473:[function(_dereq_,module,exports){
94240
94807
  'use strict';
94241
94808
 
94242
94809
  var Registry = _dereq_('../../registry');
@@ -94273,7 +94840,7 @@ module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout
94273
94840
  coerce('autobiny');
94274
94841
  };
94275
94842
 
94276
- },{"../../lib":287,"../../registry":378}],473:[function(_dereq_,module,exports){
94843
+ },{"../../lib":287,"../../registry":378}],474:[function(_dereq_,module,exports){
94277
94844
  'use strict';
94278
94845
 
94279
94846
  var histogram2dAttrs = _dereq_('../histogram2d/attributes');
@@ -94317,7 +94884,9 @@ module.exports = extendFlat({
94317
94884
  xhoverformat: axisHoverFormat('x'),
94318
94885
  yhoverformat: axisHoverFormat('y'),
94319
94886
  zhoverformat: axisHoverFormat('z', 1),
94320
- hovertemplate: histogram2dAttrs.hovertemplate
94887
+ hovertemplate: histogram2dAttrs.hovertemplate,
94888
+ texttemplate: contourAttrs.texttemplate,
94889
+ textfont: contourAttrs.textfont
94321
94890
  },
94322
94891
  colorScaleAttrs('', {
94323
94892
  cLetter: 'z',
@@ -94325,7 +94894,7 @@ module.exports = extendFlat({
94325
94894
  })
94326
94895
  );
94327
94896
 
94328
- },{"../../components/colorscale/attributes":164,"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../contour/attributes":417,"../histogram2d/attributes":467}],474:[function(_dereq_,module,exports){
94897
+ },{"../../components/colorscale/attributes":164,"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../contour/attributes":417,"../histogram2d/attributes":468}],475:[function(_dereq_,module,exports){
94329
94898
  'use strict';
94330
94899
 
94331
94900
  var Lib = _dereq_('../../lib');
@@ -94333,6 +94902,7 @@ var Lib = _dereq_('../../lib');
94333
94902
  var handleSampleDefaults = _dereq_('../histogram2d/sample_defaults');
94334
94903
  var handleContoursDefaults = _dereq_('../contour/contours_defaults');
94335
94904
  var handleStyleDefaults = _dereq_('../contour/style_defaults');
94905
+ var handleHeatmapLabelDefaults = _dereq_('../heatmap/label_defaults');
94336
94906
  var attributes = _dereq_('./attributes');
94337
94907
 
94338
94908
 
@@ -94350,12 +94920,18 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
94350
94920
 
94351
94921
  handleContoursDefaults(traceIn, traceOut, coerce, coerce2);
94352
94922
  handleStyleDefaults(traceIn, traceOut, coerce, layout);
94353
- coerce('hovertemplate');
94354
94923
  coerce('xhoverformat');
94355
94924
  coerce('yhoverformat');
94925
+ coerce('hovertemplate');
94926
+ if(
94927
+ traceOut.contours &&
94928
+ traceOut.contours.coloring === 'heatmap'
94929
+ ) {
94930
+ handleHeatmapLabelDefaults(coerce, layout);
94931
+ }
94356
94932
  };
94357
94933
 
94358
- },{"../../lib":287,"../contour/contours_defaults":424,"../contour/style_defaults":438,"../histogram2d/sample_defaults":472,"./attributes":473}],475:[function(_dereq_,module,exports){
94934
+ },{"../../lib":287,"../contour/contours_defaults":424,"../contour/style_defaults":438,"../heatmap/label_defaults":449,"../histogram2d/sample_defaults":473,"./attributes":474}],476:[function(_dereq_,module,exports){
94359
94935
  'use strict';
94360
94936
 
94361
94937
  module.exports = {
@@ -94377,7 +94953,7 @@ module.exports = {
94377
94953
  }
94378
94954
  };
94379
94955
 
94380
- },{"../../plots/cartesian":348,"../contour/calc":418,"../contour/colorbar":420,"../contour/hover":430,"../contour/plot":435,"../contour/style":437,"../histogram/cross_trace_defaults":461,"./attributes":473,"./defaults":474}],476:[function(_dereq_,module,exports){
94956
+ },{"../../plots/cartesian":348,"../contour/calc":418,"../contour/colorbar":420,"../contour/hover":430,"../contour/plot":435,"../contour/style":437,"../histogram/cross_trace_defaults":462,"./attributes":474,"./defaults":475}],477:[function(_dereq_,module,exports){
94381
94957
  'use strict';
94382
94958
 
94383
94959
  var baseAttrs = _dereq_('../../plots/attributes');
@@ -94473,7 +95049,7 @@ module.exports = extendFlat({
94473
95049
  transforms: undefined
94474
95050
  });
94475
95051
 
94476
- },{"../../lib/extend":281,"../../plots/attributes":330,"../../plots/template_attributes":373,"./constants":478}],477:[function(_dereq_,module,exports){
95052
+ },{"../../lib/extend":281,"../../plots/attributes":330,"../../plots/template_attributes":373,"./constants":479}],478:[function(_dereq_,module,exports){
94477
95053
  'use strict';
94478
95054
 
94479
95055
  var Lib = _dereq_('../../lib');
@@ -94563,7 +95139,7 @@ function makeScaler(trace) {
94563
95139
  };
94564
95140
  }
94565
95141
 
94566
- },{"../../lib":287,"../../plots/cartesian/axes":334,"./constants":478,"./helpers":481,"fast-isnumeric":33}],478:[function(_dereq_,module,exports){
95142
+ },{"../../lib":287,"../../plots/cartesian/axes":334,"./constants":479,"./helpers":482,"fast-isnumeric":33}],479:[function(_dereq_,module,exports){
94567
95143
  'use strict';
94568
95144
 
94569
95145
  module.exports = {
@@ -94629,7 +95205,7 @@ module.exports = {
94629
95205
  ].join('; ')
94630
95206
  };
94631
95207
 
94632
- },{}],479:[function(_dereq_,module,exports){
95208
+ },{}],480:[function(_dereq_,module,exports){
94633
95209
  'use strict';
94634
95210
 
94635
95211
  var Lib = _dereq_('../../lib');
@@ -94679,7 +95255,7 @@ module.exports = function supplyDefaults(traceIn, traceOut) {
94679
95255
  traceOut._length = null;
94680
95256
  };
94681
95257
 
94682
- },{"../../lib":287,"../../snapshot/helpers":382,"./attributes":476,"./constants":478}],480:[function(_dereq_,module,exports){
95258
+ },{"../../lib":287,"../../snapshot/helpers":382,"./attributes":477,"./constants":479}],481:[function(_dereq_,module,exports){
94683
95259
  'use strict';
94684
95260
 
94685
95261
  module.exports = function eventData(out, pt) {
@@ -94693,7 +95269,7 @@ module.exports = function eventData(out, pt) {
94693
95269
  return out;
94694
95270
  };
94695
95271
 
94696
- },{}],481:[function(_dereq_,module,exports){
95272
+ },{}],482:[function(_dereq_,module,exports){
94697
95273
  'use strict';
94698
95274
 
94699
95275
  var probeSync = _dereq_('probe-image-size/sync');
@@ -94706,7 +95282,7 @@ exports.getImageSize = function(src) {
94706
95282
  return probeSync(buff);
94707
95283
  };
94708
95284
 
94709
- },{"../../snapshot/helpers":382,"buffer/":28,"probe-image-size/sync":97}],482:[function(_dereq_,module,exports){
95285
+ },{"../../snapshot/helpers":382,"buffer/":28,"probe-image-size/sync":97}],483:[function(_dereq_,module,exports){
94710
95286
  'use strict';
94711
95287
 
94712
95288
  var Fx = _dereq_('../../components/fx');
@@ -94798,7 +95374,7 @@ module.exports = function hoverPoints(pointData, xval, yval) {
94798
95374
  })];
94799
95375
  };
94800
95376
 
94801
- },{"../../components/fx":197,"../../lib":287,"./constants":478}],483:[function(_dereq_,module,exports){
95377
+ },{"../../components/fx":197,"../../lib":287,"./constants":479}],484:[function(_dereq_,module,exports){
94802
95378
  'use strict';
94803
95379
 
94804
95380
  module.exports = {
@@ -94819,7 +95395,7 @@ module.exports = {
94819
95395
  }
94820
95396
  };
94821
95397
 
94822
- },{"../../plots/cartesian":348,"./attributes":476,"./calc":477,"./defaults":479,"./event_data":480,"./hover":482,"./plot":484,"./style":485}],484:[function(_dereq_,module,exports){
95398
+ },{"../../plots/cartesian":348,"./attributes":477,"./calc":478,"./defaults":480,"./event_data":481,"./hover":483,"./plot":485,"./style":486}],485:[function(_dereq_,module,exports){
94823
95399
  'use strict';
94824
95400
 
94825
95401
  var d3 = _dereq_('@plotly/d3');
@@ -95042,7 +95618,7 @@ module.exports = function plot(gd, plotinfo, cdimage, imageLayer) {
95042
95618
  });
95043
95619
  };
95044
95620
 
95045
- },{"../../constants/xmlns_namespaces":268,"../../lib":287,"./constants":478,"@plotly/d3":20}],485:[function(_dereq_,module,exports){
95621
+ },{"../../constants/xmlns_namespaces":268,"../../lib":287,"./constants":479,"@plotly/d3":20}],486:[function(_dereq_,module,exports){
95046
95622
  'use strict';
95047
95623
 
95048
95624
  var d3 = _dereq_('@plotly/d3');
@@ -95054,7 +95630,7 @@ module.exports = function style(gd) {
95054
95630
  });
95055
95631
  };
95056
95632
 
95057
- },{"@plotly/d3":20}],486:[function(_dereq_,module,exports){
95633
+ },{"@plotly/d3":20}],487:[function(_dereq_,module,exports){
95058
95634
  'use strict';
95059
95635
 
95060
95636
  var baseAttrs = _dereq_('../../plots/attributes');
@@ -95269,7 +95845,7 @@ module.exports = {
95269
95845
  }
95270
95846
  };
95271
95847
 
95272
- },{"../../components/color/attributes":156,"../../lib/extend":281,"../../plots/attributes":330,"../../plots/domain":364,"../../plots/font_attributes":365,"../../plots/template_attributes":373}],487:[function(_dereq_,module,exports){
95848
+ },{"../../components/color/attributes":156,"../../lib/extend":281,"../../plots/attributes":330,"../../plots/domain":364,"../../plots/font_attributes":365,"../../plots/template_attributes":373}],488:[function(_dereq_,module,exports){
95273
95849
  'use strict';
95274
95850
 
95275
95851
  var plots = _dereq_('../../plots/plots');
@@ -95284,7 +95860,7 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout)
95284
95860
  plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout);
95285
95861
  };
95286
95862
 
95287
- },{"../../plots/plots":371}],488:[function(_dereq_,module,exports){
95863
+ },{"../../plots/plots":371}],489:[function(_dereq_,module,exports){
95288
95864
  'use strict';
95289
95865
 
95290
95866
  var isNumeric = _dereq_('fast-isnumeric');
@@ -95326,7 +95902,6 @@ function calc(gd, trace) {
95326
95902
  v = vals[i];
95327
95903
  if(!isNumeric(v)) continue;
95328
95904
  v = +v;
95329
- if(v < 0) continue;
95330
95905
  } else v = 1;
95331
95906
 
95332
95907
  label = labels[i];
@@ -95363,6 +95938,9 @@ function calc(gd, trace) {
95363
95938
  }
95364
95939
  }
95365
95940
 
95941
+ // Drop aggregate sums of value 0 or less
95942
+ cd = cd.filter(function(elem) { return elem.v >= 0; });
95943
+
95366
95944
  var shouldSort = (trace.type === 'funnelarea') ? isAggregated : trace.sort;
95367
95945
  if(shouldSort) cd.sort(function(a, b) { return b.v - a.v; });
95368
95946
 
@@ -95459,7 +96037,7 @@ module.exports = {
95459
96037
  generateExtendedColors: generateExtendedColors
95460
96038
  };
95461
96039
 
95462
- },{"../../components/color":157,"fast-isnumeric":33,"tinycolor2":121}],489:[function(_dereq_,module,exports){
96040
+ },{"../../components/color":157,"fast-isnumeric":33,"tinycolor2":121}],490:[function(_dereq_,module,exports){
95463
96041
  'use strict';
95464
96042
 
95465
96043
  var isNumeric = _dereq_('fast-isnumeric');
@@ -95582,7 +96160,7 @@ module.exports = {
95582
96160
  supplyDefaults: supplyDefaults
95583
96161
  };
95584
96162
 
95585
- },{"../../lib":287,"../../plots/domain":364,"../bar/defaults":392,"./attributes":486,"fast-isnumeric":33}],490:[function(_dereq_,module,exports){
96163
+ },{"../../lib":287,"../../plots/domain":364,"../bar/defaults":392,"./attributes":487,"fast-isnumeric":33}],491:[function(_dereq_,module,exports){
95586
96164
  'use strict';
95587
96165
 
95588
96166
  var appendArrayMultiPointValues = _dereq_('../../components/fx/helpers').appendArrayMultiPointValues;
@@ -95624,7 +96202,7 @@ module.exports = function eventData(pt, trace) {
95624
96202
  return out;
95625
96203
  };
95626
96204
 
95627
- },{"../../components/fx/helpers":193}],491:[function(_dereq_,module,exports){
96205
+ },{"../../components/fx/helpers":193}],492:[function(_dereq_,module,exports){
95628
96206
  'use strict';
95629
96207
 
95630
96208
  var Lib = _dereq_('../../lib');
@@ -95664,7 +96242,7 @@ exports.getRotationAngle = function(rotation) {
95664
96242
  return (rotation === 'auto' ? 0 : rotation) * Math.PI / 180;
95665
96243
  };
95666
96244
 
95667
- },{"../../lib":287}],492:[function(_dereq_,module,exports){
96245
+ },{"../../lib":287}],493:[function(_dereq_,module,exports){
95668
96246
  'use strict';
95669
96247
 
95670
96248
  module.exports = {
@@ -95688,7 +96266,7 @@ module.exports = {
95688
96266
  }
95689
96267
  };
95690
96268
 
95691
- },{"./attributes":486,"./base_plot":487,"./calc":488,"./defaults":489,"./layout_attributes":493,"./layout_defaults":494,"./plot":495,"./style":496,"./style_one":497}],493:[function(_dereq_,module,exports){
96269
+ },{"./attributes":487,"./base_plot":488,"./calc":489,"./defaults":490,"./layout_attributes":494,"./layout_defaults":495,"./plot":496,"./style":497,"./style_one":498}],494:[function(_dereq_,module,exports){
95692
96270
  'use strict';
95693
96271
 
95694
96272
  module.exports = {
@@ -95707,7 +96285,7 @@ module.exports = {
95707
96285
  }
95708
96286
  };
95709
96287
 
95710
- },{}],494:[function(_dereq_,module,exports){
96288
+ },{}],495:[function(_dereq_,module,exports){
95711
96289
  'use strict';
95712
96290
 
95713
96291
  var Lib = _dereq_('../../lib');
@@ -95724,7 +96302,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {
95724
96302
  coerce('extendpiecolors');
95725
96303
  };
95726
96304
 
95727
- },{"../../lib":287,"./layout_attributes":493}],495:[function(_dereq_,module,exports){
96305
+ },{"../../lib":287,"./layout_attributes":494}],496:[function(_dereq_,module,exports){
95728
96306
  'use strict';
95729
96307
 
95730
96308
  var d3 = _dereq_('@plotly/d3');
@@ -96904,7 +97482,7 @@ module.exports = {
96904
97482
  computeTransform: computeTransform
96905
97483
  };
96906
97484
 
96907
- },{"../../components/color":157,"../../components/drawing":179,"../../components/fx":197,"../../lib":287,"../../lib/svg_text_utils":310,"../../plots/plots":371,"../bar/constants":390,"../bar/uniform_text":404,"./event_data":490,"./helpers":491,"@plotly/d3":20}],496:[function(_dereq_,module,exports){
97485
+ },{"../../components/color":157,"../../components/drawing":179,"../../components/fx":197,"../../lib":287,"../../lib/svg_text_utils":310,"../../plots/plots":371,"../bar/constants":390,"../bar/uniform_text":404,"./event_data":491,"./helpers":492,"@plotly/d3":20}],497:[function(_dereq_,module,exports){
96908
97486
  'use strict';
96909
97487
 
96910
97488
  var d3 = _dereq_('@plotly/d3');
@@ -96929,7 +97507,7 @@ module.exports = function style(gd) {
96929
97507
  });
96930
97508
  };
96931
97509
 
96932
- },{"../bar/uniform_text":404,"./style_one":497,"@plotly/d3":20}],497:[function(_dereq_,module,exports){
97510
+ },{"../bar/uniform_text":404,"./style_one":498,"@plotly/d3":20}],498:[function(_dereq_,module,exports){
96933
97511
  'use strict';
96934
97512
 
96935
97513
  var Color = _dereq_('../../components/color');
@@ -96945,7 +97523,7 @@ module.exports = function styleOne(s, pt, trace) {
96945
97523
  .call(Color.stroke, lineColor);
96946
97524
  };
96947
97525
 
96948
- },{"../../components/color":157,"./helpers":491}],498:[function(_dereq_,module,exports){
97526
+ },{"../../components/color":157,"./helpers":492}],499:[function(_dereq_,module,exports){
96949
97527
  'use strict';
96950
97528
 
96951
97529
  var Lib = _dereq_('../../lib');
@@ -96988,7 +97566,7 @@ module.exports = function arraysToCalcdata(cd, trace) {
96988
97566
  }
96989
97567
  };
96990
97568
 
96991
- },{"../../lib":287}],499:[function(_dereq_,module,exports){
97569
+ },{"../../lib":287}],500:[function(_dereq_,module,exports){
96992
97570
  'use strict';
96993
97571
 
96994
97572
  var axisHoverFormat = _dereq_('../../plots/cartesian/axis_format_attributes').axisHoverFormat;
@@ -97338,7 +97916,7 @@ module.exports = {
97338
97916
  }),
97339
97917
  };
97340
97918
 
97341
- },{"../../components/colorscale/attributes":164,"../../components/drawing":179,"../../components/drawing/attributes":178,"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../../plots/font_attributes":365,"../../plots/template_attributes":373,"./constants":503}],500:[function(_dereq_,module,exports){
97919
+ },{"../../components/colorscale/attributes":164,"../../components/drawing":179,"../../components/drawing/attributes":178,"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../../plots/font_attributes":365,"../../plots/template_attributes":373,"./constants":504}],501:[function(_dereq_,module,exports){
97342
97920
  'use strict';
97343
97921
 
97344
97922
  var isNumeric = _dereq_('fast-isnumeric');
@@ -97635,7 +98213,7 @@ module.exports = {
97635
98213
  getStackOpts: getStackOpts
97636
98214
  };
97637
98215
 
97638
- },{"../../constants/numerical":267,"../../lib":287,"../../plots/cartesian/align_period":331,"../../plots/cartesian/axes":334,"./arrays_to_calcdata":498,"./calc_selection":501,"./colorscale_calc":502,"./subtypes":524,"fast-isnumeric":33}],501:[function(_dereq_,module,exports){
98216
+ },{"../../constants/numerical":267,"../../lib":287,"../../plots/cartesian/align_period":331,"../../plots/cartesian/axes":334,"./arrays_to_calcdata":499,"./calc_selection":502,"./colorscale_calc":503,"./subtypes":525,"fast-isnumeric":33}],502:[function(_dereq_,module,exports){
97639
98217
  'use strict';
97640
98218
 
97641
98219
  var Lib = _dereq_('../../lib');
@@ -97646,7 +98224,7 @@ module.exports = function calcSelection(cd, trace) {
97646
98224
  }
97647
98225
  };
97648
98226
 
97649
- },{"../../lib":287}],502:[function(_dereq_,module,exports){
98227
+ },{"../../lib":287}],503:[function(_dereq_,module,exports){
97650
98228
  'use strict';
97651
98229
 
97652
98230
  var hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale;
@@ -97681,7 +98259,7 @@ module.exports = function calcMarkerColorscale(gd, trace) {
97681
98259
  }
97682
98260
  };
97683
98261
 
97684
- },{"../../components/colorscale/calc":165,"../../components/colorscale/helpers":168,"./subtypes":524}],503:[function(_dereq_,module,exports){
98262
+ },{"../../components/colorscale/calc":165,"../../components/colorscale/helpers":168,"./subtypes":525}],504:[function(_dereq_,module,exports){
97685
98263
  'use strict';
97686
98264
 
97687
98265
  module.exports = {
@@ -97701,7 +98279,7 @@ module.exports = {
97701
98279
  eventDataKeys: []
97702
98280
  };
97703
98281
 
97704
- },{}],504:[function(_dereq_,module,exports){
98282
+ },{}],505:[function(_dereq_,module,exports){
97705
98283
  'use strict';
97706
98284
 
97707
98285
  var calc = _dereq_('./calc');
@@ -97873,7 +98451,7 @@ function getInterp(calcTrace, index, position, posAttr) {
97873
98451
  return pt0.s + (pt1.s - pt0.s) * (position - pt0[posAttr]) / (pt1[posAttr] - pt0[posAttr]);
97874
98452
  }
97875
98453
 
97876
- },{"./calc":500}],505:[function(_dereq_,module,exports){
98454
+ },{"./calc":501}],506:[function(_dereq_,module,exports){
97877
98455
  'use strict';
97878
98456
 
97879
98457
 
@@ -97903,7 +98481,7 @@ module.exports = function crossTraceDefaults(fullData) {
97903
98481
  }
97904
98482
  };
97905
98483
 
97906
- },{}],506:[function(_dereq_,module,exports){
98484
+ },{}],507:[function(_dereq_,module,exports){
97907
98485
  'use strict';
97908
98486
 
97909
98487
  var Lib = _dereq_('../../lib');
@@ -97990,7 +98568,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
97990
98568
  Lib.coerceSelectionMarkerOpacity(traceOut, coerce);
97991
98569
  };
97992
98570
 
97993
- },{"../../lib":287,"../../registry":378,"./attributes":499,"./constants":503,"./fillcolor_defaults":507,"./line_defaults":512,"./line_shape_defaults":514,"./marker_defaults":518,"./period_defaults":519,"./stack_defaults":522,"./subtypes":524,"./text_defaults":525,"./xy_defaults":526}],507:[function(_dereq_,module,exports){
98571
+ },{"../../lib":287,"../../registry":378,"./attributes":500,"./constants":504,"./fillcolor_defaults":508,"./line_defaults":513,"./line_shape_defaults":515,"./marker_defaults":519,"./period_defaults":520,"./stack_defaults":523,"./subtypes":525,"./text_defaults":526,"./xy_defaults":527}],508:[function(_dereq_,module,exports){
97994
98572
  'use strict';
97995
98573
 
97996
98574
  var Color = _dereq_('../../components/color');
@@ -98018,7 +98596,7 @@ module.exports = function fillColorDefaults(traceIn, traceOut, defaultColor, coe
98018
98596
  ));
98019
98597
  };
98020
98598
 
98021
- },{"../../components/color":157,"../../lib":287}],508:[function(_dereq_,module,exports){
98599
+ },{"../../components/color":157,"../../lib":287}],509:[function(_dereq_,module,exports){
98022
98600
  'use strict';
98023
98601
 
98024
98602
  var Axes = _dereq_('../../plots/cartesian/axes');
@@ -98036,7 +98614,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) {
98036
98614
  return labels;
98037
98615
  };
98038
98616
 
98039
- },{"../../plots/cartesian/axes":334}],509:[function(_dereq_,module,exports){
98617
+ },{"../../plots/cartesian/axes":334}],510:[function(_dereq_,module,exports){
98040
98618
  'use strict';
98041
98619
 
98042
98620
  var Color = _dereq_('../../components/color');
@@ -98076,7 +98654,7 @@ module.exports = function getTraceColor(trace, di) {
98076
98654
  }
98077
98655
  };
98078
98656
 
98079
- },{"../../components/color":157,"./subtypes":524}],510:[function(_dereq_,module,exports){
98657
+ },{"../../components/color":157,"./subtypes":525}],511:[function(_dereq_,module,exports){
98080
98658
  'use strict';
98081
98659
 
98082
98660
  var Lib = _dereq_('../../lib');
@@ -98287,7 +98865,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
98287
98865
  }
98288
98866
  };
98289
98867
 
98290
- },{"../../components/color":157,"../../components/fx":197,"../../lib":287,"../../registry":378,"./get_trace_color":509}],511:[function(_dereq_,module,exports){
98868
+ },{"../../components/color":157,"../../components/fx":197,"../../lib":287,"../../registry":378,"./get_trace_color":510}],512:[function(_dereq_,module,exports){
98291
98869
  'use strict';
98292
98870
 
98293
98871
  var subtypes = _dereq_('./subtypes');
@@ -98324,7 +98902,7 @@ module.exports = {
98324
98902
  }
98325
98903
  };
98326
98904
 
98327
- },{"../../plots/cartesian":348,"./arrays_to_calcdata":498,"./attributes":499,"./calc":500,"./cross_trace_calc":504,"./cross_trace_defaults":505,"./defaults":506,"./format_labels":508,"./hover":510,"./marker_colorbar":517,"./plot":520,"./select":521,"./style":523,"./subtypes":524}],512:[function(_dereq_,module,exports){
98905
+ },{"../../plots/cartesian":348,"./arrays_to_calcdata":499,"./attributes":500,"./calc":501,"./cross_trace_calc":505,"./cross_trace_defaults":506,"./defaults":507,"./format_labels":509,"./hover":511,"./marker_colorbar":518,"./plot":521,"./select":522,"./style":524,"./subtypes":525}],513:[function(_dereq_,module,exports){
98328
98906
  'use strict';
98329
98907
 
98330
98908
  var isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;
@@ -98347,7 +98925,7 @@ module.exports = function lineDefaults(traceIn, traceOut, defaultColor, layout,
98347
98925
  if(!(opts || {}).noDash) coerce('line.dash');
98348
98926
  };
98349
98927
 
98350
- },{"../../components/colorscale/defaults":167,"../../components/colorscale/helpers":168,"../../lib":287}],513:[function(_dereq_,module,exports){
98928
+ },{"../../components/colorscale/defaults":167,"../../components/colorscale/helpers":168,"../../lib":287}],514:[function(_dereq_,module,exports){
98351
98929
  'use strict';
98352
98930
 
98353
98931
  var numConstants = _dereq_('../../constants/numerical');
@@ -98799,7 +99377,7 @@ module.exports = function linePoints(d, opts) {
98799
99377
  return segments;
98800
99378
  };
98801
99379
 
98802
- },{"../../constants/numerical":267,"../../lib":287,"./constants":503}],514:[function(_dereq_,module,exports){
99380
+ },{"../../constants/numerical":267,"../../lib":287,"./constants":504}],515:[function(_dereq_,module,exports){
98803
99381
  'use strict';
98804
99382
 
98805
99383
 
@@ -98809,7 +99387,7 @@ module.exports = function handleLineShapeDefaults(traceIn, traceOut, coerce) {
98809
99387
  if(shape === 'spline') coerce('line.smoothing');
98810
99388
  };
98811
99389
 
98812
- },{}],515:[function(_dereq_,module,exports){
99390
+ },{}],516:[function(_dereq_,module,exports){
98813
99391
  'use strict';
98814
99392
 
98815
99393
  var LINKEDFILLS = {tonextx: 1, tonexty: 1, tonext: 1};
@@ -98891,7 +99469,7 @@ module.exports = function linkTraces(gd, plotinfo, cdscatter) {
98891
99469
  return cdscatterSorted;
98892
99470
  };
98893
99471
 
98894
- },{}],516:[function(_dereq_,module,exports){
99472
+ },{}],517:[function(_dereq_,module,exports){
98895
99473
  'use strict';
98896
99474
 
98897
99475
  var isNumeric = _dereq_('fast-isnumeric');
@@ -98927,7 +99505,7 @@ module.exports = function makeBubbleSizeFn(trace, factor) {
98927
99505
  };
98928
99506
  };
98929
99507
 
98930
- },{"fast-isnumeric":33}],517:[function(_dereq_,module,exports){
99508
+ },{"fast-isnumeric":33}],518:[function(_dereq_,module,exports){
98931
99509
  'use strict';
98932
99510
 
98933
99511
  module.exports = {
@@ -98936,7 +99514,7 @@ module.exports = {
98936
99514
  max: 'cmax'
98937
99515
  };
98938
99516
 
98939
- },{}],518:[function(_dereq_,module,exports){
99517
+ },{}],519:[function(_dereq_,module,exports){
98940
99518
  'use strict';
98941
99519
 
98942
99520
  var Color = _dereq_('../../components/color');
@@ -99009,7 +99587,7 @@ module.exports = function markerDefaults(traceIn, traceOut, defaultColor, layout
99009
99587
  }
99010
99588
  };
99011
99589
 
99012
- },{"../../components/color":157,"../../components/colorscale/defaults":167,"../../components/colorscale/helpers":168,"./subtypes":524}],519:[function(_dereq_,module,exports){
99590
+ },{"../../components/color":157,"../../components/colorscale/defaults":167,"../../components/colorscale/helpers":168,"./subtypes":525}],520:[function(_dereq_,module,exports){
99013
99591
  'use strict';
99014
99592
 
99015
99593
  var dateTick0 = _dereq_('../../lib').dateTick0;
@@ -99048,7 +99626,7 @@ module.exports = function handlePeriodDefaults(traceIn, traceOut, layout, coerce
99048
99626
  }
99049
99627
  };
99050
99628
 
99051
- },{"../../constants/numerical":267,"../../lib":287}],520:[function(_dereq_,module,exports){
99629
+ },{"../../constants/numerical":267,"../../lib":287}],521:[function(_dereq_,module,exports){
99052
99630
  'use strict';
99053
99631
 
99054
99632
  var d3 = _dereq_('@plotly/d3');
@@ -99600,7 +100178,7 @@ function selectMarkers(gd, idx, plotinfo, cdscatter, cdscatterAll) {
99600
100178
  });
99601
100179
  }
99602
100180
 
99603
- },{"../../components/drawing":179,"../../lib":287,"../../lib/polygon":299,"../../registry":378,"./line_points":513,"./link_traces":515,"./subtypes":524,"@plotly/d3":20}],521:[function(_dereq_,module,exports){
100181
+ },{"../../components/drawing":179,"../../lib":287,"../../lib/polygon":299,"../../registry":378,"./line_points":514,"./link_traces":516,"./subtypes":525,"@plotly/d3":20}],522:[function(_dereq_,module,exports){
99604
100182
  'use strict';
99605
100183
 
99606
100184
  var subtypes = _dereq_('./subtypes');
@@ -99645,7 +100223,7 @@ module.exports = function selectPoints(searchInfo, selectionTester) {
99645
100223
  return selection;
99646
100224
  };
99647
100225
 
99648
- },{"./subtypes":524}],522:[function(_dereq_,module,exports){
100226
+ },{"./subtypes":525}],523:[function(_dereq_,module,exports){
99649
100227
  'use strict';
99650
100228
 
99651
100229
  var perStackAttrs = ['orientation', 'groupnorm', 'stackgaps'];
@@ -99742,7 +100320,7 @@ module.exports = function handleStackDefaults(traceIn, traceOut, layout, coerce)
99742
100320
  }
99743
100321
  };
99744
100322
 
99745
- },{}],523:[function(_dereq_,module,exports){
100323
+ },{}],524:[function(_dereq_,module,exports){
99746
100324
  'use strict';
99747
100325
 
99748
100326
  var d3 = _dereq_('@plotly/d3');
@@ -99804,7 +100382,7 @@ module.exports = {
99804
100382
  styleOnSelect: styleOnSelect
99805
100383
  };
99806
100384
 
99807
- },{"../../components/drawing":179,"../../registry":378,"@plotly/d3":20}],524:[function(_dereq_,module,exports){
100385
+ },{"../../components/drawing":179,"../../registry":378,"@plotly/d3":20}],525:[function(_dereq_,module,exports){
99808
100386
  'use strict';
99809
100387
 
99810
100388
  var Lib = _dereq_('../../lib');
@@ -99834,7 +100412,7 @@ module.exports = {
99834
100412
  }
99835
100413
  };
99836
100414
 
99837
- },{"../../lib":287}],525:[function(_dereq_,module,exports){
100415
+ },{"../../lib":287}],526:[function(_dereq_,module,exports){
99838
100416
  'use strict';
99839
100417
 
99840
100418
  var Lib = _dereq_('../../lib');
@@ -99855,7 +100433,7 @@ module.exports = function(traceIn, traceOut, layout, coerce, opts) {
99855
100433
  }
99856
100434
  };
99857
100435
 
99858
- },{"../../lib":287}],526:[function(_dereq_,module,exports){
100436
+ },{"../../lib":287}],527:[function(_dereq_,module,exports){
99859
100437
  'use strict';
99860
100438
 
99861
100439
  var Lib = _dereq_('../../lib');
@@ -99891,7 +100469,7 @@ module.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) {
99891
100469
  return len;
99892
100470
  };
99893
100471
 
99894
- },{"../../lib":287,"../../registry":378}],527:[function(_dereq_,module,exports){
100472
+ },{"../../lib":287,"../../registry":378}],528:[function(_dereq_,module,exports){
99895
100473
  'use strict';
99896
100474
 
99897
100475
  var hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;
@@ -99983,7 +100561,7 @@ module.exports = {
99983
100561
  hovertemplate: hovertemplateAttrs(),
99984
100562
  };
99985
100563
 
99986
- },{"../../components/colorscale/attributes":164,"../../components/drawing/attributes":178,"../../lib/extend":281,"../../plots/attributes":330,"../../plots/template_attributes":373,"../scatter/attributes":499}],528:[function(_dereq_,module,exports){
100564
+ },{"../../components/colorscale/attributes":164,"../../components/drawing/attributes":178,"../../lib/extend":281,"../../plots/attributes":330,"../../plots/template_attributes":373,"../scatter/attributes":500}],529:[function(_dereq_,module,exports){
99987
100565
  'use strict';
99988
100566
 
99989
100567
  var isNumeric = _dereq_('fast-isnumeric');
@@ -100055,7 +100633,7 @@ module.exports = function calc(gd, trace) {
100055
100633
  return cd;
100056
100634
  };
100057
100635
 
100058
- },{"../scatter/arrays_to_calcdata":498,"../scatter/calc":500,"../scatter/calc_selection":501,"../scatter/colorscale_calc":502,"fast-isnumeric":33}],529:[function(_dereq_,module,exports){
100636
+ },{"../scatter/arrays_to_calcdata":499,"../scatter/calc":501,"../scatter/calc_selection":502,"../scatter/colorscale_calc":503,"fast-isnumeric":33}],530:[function(_dereq_,module,exports){
100059
100637
  'use strict';
100060
100638
 
100061
100639
  var Lib = _dereq_('../../lib');
@@ -100150,7 +100728,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
100150
100728
  Lib.coerceSelectionMarkerOpacity(traceOut, coerce);
100151
100729
  };
100152
100730
 
100153
- },{"../../lib":287,"../scatter/constants":503,"../scatter/fillcolor_defaults":507,"../scatter/line_defaults":512,"../scatter/line_shape_defaults":514,"../scatter/marker_defaults":518,"../scatter/subtypes":524,"../scatter/text_defaults":525,"./attributes":527}],530:[function(_dereq_,module,exports){
100731
+ },{"../../lib":287,"../scatter/constants":504,"../scatter/fillcolor_defaults":508,"../scatter/line_defaults":513,"../scatter/line_shape_defaults":515,"../scatter/marker_defaults":519,"../scatter/subtypes":525,"../scatter/text_defaults":526,"./attributes":528}],531:[function(_dereq_,module,exports){
100154
100732
  'use strict';
100155
100733
 
100156
100734
  module.exports = function eventData(out, pt, trace, cd, pointNumber) {
@@ -100174,7 +100752,7 @@ module.exports = function eventData(out, pt, trace, cd, pointNumber) {
100174
100752
  return out;
100175
100753
  };
100176
100754
 
100177
- },{}],531:[function(_dereq_,module,exports){
100755
+ },{}],532:[function(_dereq_,module,exports){
100178
100756
  'use strict';
100179
100757
 
100180
100758
  var Axes = _dereq_('../../plots/cartesian/axes');
@@ -100190,7 +100768,7 @@ module.exports = function formatLabels(cdi, trace, fullLayout) {
100190
100768
  return labels;
100191
100769
  };
100192
100770
 
100193
- },{"../../plots/cartesian/axes":334}],532:[function(_dereq_,module,exports){
100771
+ },{"../../plots/cartesian/axes":334}],533:[function(_dereq_,module,exports){
100194
100772
  'use strict';
100195
100773
 
100196
100774
  var scatterHover = _dereq_('../scatter/hover');
@@ -100256,7 +100834,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
100256
100834
  return scatterPointData;
100257
100835
  };
100258
100836
 
100259
- },{"../scatter/hover":510}],533:[function(_dereq_,module,exports){
100837
+ },{"../scatter/hover":511}],534:[function(_dereq_,module,exports){
100260
100838
  'use strict';
100261
100839
 
100262
100840
  module.exports = {
@@ -100280,7 +100858,7 @@ module.exports = {
100280
100858
  }
100281
100859
  };
100282
100860
 
100283
- },{"../../plots/ternary":374,"../scatter/marker_colorbar":517,"../scatter/select":521,"../scatter/style":523,"./attributes":527,"./calc":528,"./defaults":529,"./event_data":530,"./format_labels":531,"./hover":532,"./plot":534}],534:[function(_dereq_,module,exports){
100861
+ },{"../../plots/ternary":374,"../scatter/marker_colorbar":518,"../scatter/select":522,"../scatter/style":524,"./attributes":528,"./calc":529,"./defaults":530,"./event_data":531,"./format_labels":532,"./hover":533,"./plot":535}],535:[function(_dereq_,module,exports){
100284
100862
  'use strict';
100285
100863
 
100286
100864
  var scatterPlot = _dereq_('../scatter/plot');
@@ -100304,7 +100882,7 @@ module.exports = function plot(gd, ternary, moduleCalcData) {
100304
100882
  scatterPlot(gd, plotinfo, moduleCalcData, scatterLayer);
100305
100883
  };
100306
100884
 
100307
- },{"../scatter/plot":520}],535:[function(_dereq_,module,exports){
100885
+ },{"../scatter/plot":521}],536:[function(_dereq_,module,exports){
100308
100886
  'use strict';
100309
100887
 
100310
100888
  var boxAttrs = _dereq_('../box/attributes');
@@ -100460,7 +101038,7 @@ module.exports = {
100460
101038
  }
100461
101039
  };
100462
101040
 
100463
- },{"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../box/attributes":405}],536:[function(_dereq_,module,exports){
101041
+ },{"../../lib/extend":281,"../../plots/cartesian/axis_format_attributes":337,"../box/attributes":405}],537:[function(_dereq_,module,exports){
100464
101042
  'use strict';
100465
101043
 
100466
101044
  var Lib = _dereq_('../../lib');
@@ -100628,7 +101206,7 @@ function calcSpan(trace, cdi, valAxis, bandwidth) {
100628
101206
  return spanOut;
100629
101207
  }
100630
101208
 
100631
- },{"../../constants/numerical":267,"../../lib":287,"../../plots/cartesian/axes":334,"../box/calc":406,"./helpers":539}],537:[function(_dereq_,module,exports){
101209
+ },{"../../constants/numerical":267,"../../lib":287,"../../plots/cartesian/axes":334,"../box/calc":406,"./helpers":540}],538:[function(_dereq_,module,exports){
100632
101210
  'use strict';
100633
101211
 
100634
101212
  var setPositionOffset = _dereq_('../box/cross_trace_calc').setPositionOffset;
@@ -100663,7 +101241,7 @@ module.exports = function crossTraceCalc(gd, plotinfo) {
100663
101241
  }
100664
101242
  };
100665
101243
 
100666
- },{"../box/cross_trace_calc":407}],538:[function(_dereq_,module,exports){
101244
+ },{"../box/cross_trace_calc":407}],539:[function(_dereq_,module,exports){
100667
101245
  'use strict';
100668
101246
 
100669
101247
  var Lib = _dereq_('../../lib');
@@ -100716,7 +101294,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
100716
101294
  if(!meanLineVisible) traceOut.meanline = {visible: false};
100717
101295
  };
100718
101296
 
100719
- },{"../../components/color":157,"../../lib":287,"../box/defaults":408,"./attributes":535}],539:[function(_dereq_,module,exports){
101297
+ },{"../../components/color":157,"../../lib":287,"../box/defaults":408,"./attributes":536}],540:[function(_dereq_,module,exports){
100720
101298
  'use strict';
100721
101299
 
100722
101300
  var Lib = _dereq_('../../lib');
@@ -100781,7 +101359,7 @@ exports.getKdeValue = function(calcItem, trace, valueDist) {
100781
101359
 
100782
101360
  exports.extractVal = function(o) { return o.v; };
100783
101361
 
100784
- },{"../../lib":287}],540:[function(_dereq_,module,exports){
101362
+ },{"../../lib":287}],541:[function(_dereq_,module,exports){
100785
101363
  'use strict';
100786
101364
 
100787
101365
  var Lib = _dereq_('../../lib');
@@ -100888,7 +101466,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
100888
101466
  return closeData;
100889
101467
  };
100890
101468
 
100891
- },{"../../lib":287,"../../plots/cartesian/axes":334,"../box/hover":410,"./helpers":539}],541:[function(_dereq_,module,exports){
101469
+ },{"../../lib":287,"../../plots/cartesian/axes":334,"../box/hover":410,"./helpers":540}],542:[function(_dereq_,module,exports){
100892
101470
  'use strict';
100893
101471
 
100894
101472
  module.exports = {
@@ -100913,7 +101491,7 @@ module.exports = {
100913
101491
  }
100914
101492
  };
100915
101493
 
100916
- },{"../../plots/cartesian":348,"../box/defaults":408,"../box/select":415,"../scatter/style":523,"./attributes":535,"./calc":536,"./cross_trace_calc":537,"./defaults":538,"./hover":540,"./layout_attributes":542,"./layout_defaults":543,"./plot":544,"./style":545}],542:[function(_dereq_,module,exports){
101494
+ },{"../../plots/cartesian":348,"../box/defaults":408,"../box/select":415,"../scatter/style":524,"./attributes":536,"./calc":537,"./cross_trace_calc":538,"./defaults":539,"./hover":541,"./layout_attributes":543,"./layout_defaults":544,"./plot":545,"./style":546}],543:[function(_dereq_,module,exports){
100917
101495
  'use strict';
100918
101496
 
100919
101497
  var boxLayoutAttrs = _dereq_('../box/layout_attributes');
@@ -100928,7 +101506,7 @@ module.exports = {
100928
101506
  })
100929
101507
  };
100930
101508
 
100931
- },{"../../lib":287,"../box/layout_attributes":412}],543:[function(_dereq_,module,exports){
101509
+ },{"../../lib":287,"../box/layout_attributes":412}],544:[function(_dereq_,module,exports){
100932
101510
  'use strict';
100933
101511
 
100934
101512
  var Lib = _dereq_('../../lib');
@@ -100942,7 +101520,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
100942
101520
  boxLayoutDefaults._supply(layoutIn, layoutOut, fullData, coerce, 'violin');
100943
101521
  };
100944
101522
 
100945
- },{"../../lib":287,"../box/layout_defaults":413,"./layout_attributes":542}],544:[function(_dereq_,module,exports){
101523
+ },{"../../lib":287,"../box/layout_defaults":413,"./layout_attributes":543}],545:[function(_dereq_,module,exports){
100946
101524
  'use strict';
100947
101525
 
100948
101526
  var d3 = _dereq_('@plotly/d3');
@@ -101124,7 +101702,7 @@ module.exports = function plot(gd, plotinfo, cdViolins, violinLayer) {
101124
101702
  });
101125
101703
  };
101126
101704
 
101127
- },{"../../components/drawing":179,"../../lib":287,"../box/plot":414,"../scatter/line_points":513,"./helpers":539,"@plotly/d3":20}],545:[function(_dereq_,module,exports){
101705
+ },{"../../components/drawing":179,"../../lib":287,"../box/plot":414,"../scatter/line_points":514,"./helpers":540,"@plotly/d3":20}],546:[function(_dereq_,module,exports){
101128
101706
  'use strict';
101129
101707
 
101130
101708
  var d3 = _dereq_('@plotly/d3');
@@ -101171,7 +101749,7 @@ module.exports = function style(gd) {
101171
101749
  });
101172
101750
  };
101173
101751
 
101174
- },{"../../components/color":157,"../scatter/style":523,"@plotly/d3":20}],546:[function(_dereq_,module,exports){
101752
+ },{"../../components/color":157,"../scatter/style":524,"@plotly/d3":20}],547:[function(_dereq_,module,exports){
101175
101753
  'use strict';
101176
101754
 
101177
101755
  var Axes = _dereq_('../plots/cartesian/axes');
@@ -101575,7 +102153,7 @@ function last(array, indices) {
101575
102153
  return array[indices[indices.length - 1]];
101576
102154
  }
101577
102155
 
101578
- },{"../constants/numerical":267,"../lib":287,"../plot_api/plot_schema":322,"../plots/cartesian/axes":334,"./helpers":549}],547:[function(_dereq_,module,exports){
102156
+ },{"../constants/numerical":267,"../lib":287,"../plot_api/plot_schema":322,"../plots/cartesian/axes":334,"./helpers":550}],548:[function(_dereq_,module,exports){
101579
102157
  'use strict';
101580
102158
 
101581
102159
  var Lib = _dereq_('../lib');
@@ -101835,7 +102413,7 @@ function getFilterFunc(opts, d2c, targetCalendar) {
101835
102413
  }
101836
102414
  }
101837
102415
 
101838
- },{"../constants/filter_ops":265,"../lib":287,"../plots/cartesian/axes":334,"../registry":378,"./helpers":549}],548:[function(_dereq_,module,exports){
102416
+ },{"../constants/filter_ops":265,"../lib":287,"../plots/cartesian/axes":334,"../registry":378,"./helpers":550}],549:[function(_dereq_,module,exports){
101839
102417
  'use strict';
101840
102418
 
101841
102419
  var Lib = _dereq_('../lib');
@@ -102079,7 +102657,7 @@ function transformOne(trace, state) {
102079
102657
  return newData;
102080
102658
  }
102081
102659
 
102082
- },{"../lib":287,"../plot_api/plot_schema":322,"../plots/plots":371,"./helpers":549}],549:[function(_dereq_,module,exports){
102660
+ },{"../lib":287,"../plot_api/plot_schema":322,"../plots/plots":371,"./helpers":550}],550:[function(_dereq_,module,exports){
102083
102661
  'use strict';
102084
102662
 
102085
102663
  exports.pointsAccessorFunction = function(transforms, opts) {
@@ -102097,7 +102675,7 @@ exports.pointsAccessorFunction = function(transforms, opts) {
102097
102675
  return originalPointsAccessor;
102098
102676
  };
102099
102677
 
102100
- },{}],550:[function(_dereq_,module,exports){
102678
+ },{}],551:[function(_dereq_,module,exports){
102101
102679
  'use strict';
102102
102680
 
102103
102681
  var Lib = _dereq_('../lib');
@@ -102235,11 +102813,11 @@ function getSortFunc(opts, d2c) {
102235
102813
  }
102236
102814
  }
102237
102815
 
102238
- },{"../constants/numerical":267,"../lib":287,"../plots/cartesian/axes":334,"./helpers":549}],551:[function(_dereq_,module,exports){
102816
+ },{"../constants/numerical":267,"../lib":287,"../plots/cartesian/axes":334,"./helpers":550}],552:[function(_dereq_,module,exports){
102239
102817
  'use strict';
102240
102818
 
102241
102819
  // package version injected by `npm run preprocess`
102242
- exports.version = '2.7.0';
102820
+ exports.version = '2.8.3';
102243
102821
 
102244
102822
  },{}]},{},[15])(15)
102245
102823
  });