Skip to content

Commit 2b51a0e

Browse files
committed
Do not layout colorbar if no global or per trace colorbar are enabled
1 parent dea285c commit 2b51a0e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/plot_api/plot_api.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var Polar = require('../plots/polar');
2525

2626
var Drawing = require('../components/drawing');
2727
var ErrorBars = require('../components/errorbars');
28+
var Colorbar = require('../components/colorbar');
2829
var xmlnsNamespaces = require('../constants/xmlns_namespaces');
2930
var svgTextUtils = require('../lib/svg_text_utils');
3031

@@ -205,7 +206,9 @@ Plotly.plot = function(gd, data, layout, config) {
205206
if(trace.visible !== true || !trace._module.colorbar) {
206207
Plots.autoMargin(gd, 'cb' + trace.uid);
207208
}
208-
else trace._module.colorbar(gd, cd);
209+
else if(Plots.traceIs(trace, 'markerColorscale') && Colorbar.hasColorbar(trace)) {
210+
trace._module.colorbar(gd, cd);
211+
}
209212
}
210213

211214
Plots.doAutoMargin(gd);

0 commit comments

Comments
 (0)