Skip to content

Commit bb37e51

Browse files
committed
add sunburst jasmine suite + misc bug fixups
1 parent 27d0bda commit bb37e51

File tree

6 files changed

+1042
-10
lines changed

6 files changed

+1042
-10
lines changed

src/plot_api/plot_api.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3866,7 +3866,7 @@ function makePlotFramework(gd) {
38663866
fullLayout._pielayer = fullLayout._paper.append('g').classed('pielayer', true);
38673867

38683868
// single sunbursrt layer for the whole plot
3869-
fullLayout._sunburstlayer = fullLayout._paper.append('g').classed('sunbursrtlayer', true);
3869+
fullLayout._sunburstlayer = fullLayout._paper.append('g').classed('sunburstlayer', true);
38703870

38713871
// fill in image server scrape-svg
38723872
fullLayout._glimages = fullLayout._paper.append('g').classed('glimages', true);

src/traces/sunburst/attributes.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,15 @@ module.exports = {
136136
},
137137

138138
text: pieAtts.text,
139-
textinfo: extendFlat({}, pieAtts.textinfo, {editType: 'plot'}),
139+
textinfo: extendFlat({}, pieAtts.textinfo, {
140+
editType: 'plot',
141+
flags: ['label', 'text', 'value']
142+
}),
140143
textfont: pieAtts.textfont,
141144

142145
hovertext: pieAtts.hovertext,
143146
hoverinfo: extendFlat({}, plotAttrs.hoverinfo, {
144-
flags: ['label', 'text', 'value', 'name'],
145-
dflt: 'label+name'
147+
flags: ['label', 'text', 'value', 'name']
146148
}),
147149
hovertemplate: hovertemplateAttrs(),
148150

src/traces/sunburst/base_plot.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ var name = exports.name = 'sunburst';
1616
exports.plot = function(gd, traces, transitionOpts, makeOnCompleteCallback) {
1717
var _module = Registry.getModule(name);
1818
var cdmodule = getModuleCalcData(gd.calcdata, _module)[0];
19-
20-
if(cdmodule.length) {
21-
_module.plot(gd, cdmodule, transitionOpts, makeOnCompleteCallback);
22-
}
19+
_module.plot(gd, cdmodule, transitionOpts, makeOnCompleteCallback);
2320
};
2421

2522
exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {

src/traces/sunburst/calc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ exports.calc = function(gd, trace) {
152152
d.value = partialSum;
153153
return Lib.warn([
154154
'Total value for node', d.data.data.id,
155-
'is smaller than the sum of its childrens\'.'
155+
'is smaller than the sum of its children.'
156156
].join(' '));
157157
}
158158
}

src/traces/sunburst/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
2222
var labels = coerce('labels');
2323
var parents = coerce('parents');
2424

25-
if(!labels.length || !parents.length) {
25+
if(!labels || !labels.length || !parents || !parents.length) {
2626
traceOut.visible = false;
2727
return;
2828
}

0 commit comments

Comments
 (0)