8000 make pie clean step more robust: · garyfeng/plotly.js@4e7318b · GitHub
[go: up one dir, main page]

Skip to content

Commit 4e7318b

Browse files
committed
make pie clean step more robust:
- so that it works even if layout._has isn't defined
1 parent 83ad80b commit 4e7318b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/traces/pie/base_plot.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ exports.plot = function(gd) {
2121
};
2222

2323
exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {
24-
if(oldFullLayout._has('pie') && !newFullLayout._has('pie')) {
24+
var hadPie = (oldFullLayout._has && oldFullLayout._has('pie'));
25+
var hasPie = (newFullLayout._has && newFullLayout._has('pie'));
26+
27+
if(hadPie && !hasPie) {
2528
oldFullLayout._pielayer.selectAll('g.trace').remove();
2629
}
2730
};

0 commit comments

Comments
 (0)
0