Skip to content

Commit 2981ebb

Browse files
committed
rm explicit dependency on Pie in plot routine
1 parent 64ce076 commit 2981ebb

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/plot_api/plot_api.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ var Queue = require('../lib/queue');
2121
var Plots = require('../plots/plots');
2222
var Fx = require('../plots/cartesian/graph_interact');
2323

24-
var Pie = require('../traces/pie');
25-
2624
var Color = require('../components/color');
2725
var Drawing = require('../components/drawing');
2826
var ErrorBars = require('../components/errorbars');
@@ -333,10 +331,13 @@ Plotly.plot = function(gd, data, layout, config) {
333331
}
334332
}
335333

336-
// now draw stuff not on subplots (ie, pies)
337-
// TODO: gotta be a better way to handle this
338-
var cdPie = getCdModule(calcdata, Pie);
339-
if(cdPie.length) Pie.plot(gd, cdPie);
334+
// now draw stuff not on subplots (ie, only pies at the moment)
335+
if(fullLayout._hasPie) {
336+
var Pie = Plots.modules.pie._module;
337+
var cdPie = getCdModule(calcdata, Pie);
338+
339+
if(cdPie.length) Pie.plot(gd, cdPie);
340+
}
340341

341342
// styling separate from drawing
342343
Plots.style(gd);

0 commit comments

Comments
 (0)