Skip to content

Commit 6a98087

Browse files
committed
hiddenslices -> hiddenlabels
1 parent 2965494 commit 6a98087

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

image_server/test/mocks/pie_scale_textpos_hideslices.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,6 @@
8484
"width": 600,
8585
"showlegend": true,
8686
"font": {"size": 20},
87-
"hiddenslices": ["x","y"]
87+
"hiddenlabels": ["x","y"]
8888
}
8989
}

shelly/plotlyjs/static/plotlyjs/src/graph_obj.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3101,7 +3101,7 @@ Plotly.relayout = function relayout (gd, astr, val) {
31013101
// 3d or geo at this point just needs to redraw.
31023102
if (p.parts[0].indexOf('scene') === 0) doplot = true;
31033103
else if (p.parts[0].indexOf('geo') === 0) doplot = true;
3104-
else if(ai === 'hiddenslices') docalc = true;
3104+
else if(ai === 'hiddenlabels') docalc = true;
31053105
else if(p.parts[0].indexOf('legend')!==-1) dolegend = true;
31063106
else if(ai.indexOf('title')!==-1) doticks = true;
31073107
else if(p.parts[0].indexOf('bgcolor')!==-1) dolayoutstyle = true;

shelly/plotlyjs/static/plotlyjs/src/legend.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ legend.draw = function(td, showlegend) {
457457

458458
var opts = fullLayout.legend,
459459
legendData = legend.getLegendData(td.calcdata, opts),
460-
hiddenSlices = fullLayout.hiddenslices || [];
460+
hiddenSlices = fullLayout.hiddenlabels || [];
461461

462462
if(!showlegend || !legendData.length) {
463463
fullLayout._infolayer.selectAll('.legend').remove();
@@ -537,7 +537,7 @@ legend.draw = function(td, showlegend) {
537537
if(thisLabelIndex === -1) newHiddenSlices.push(thisLabel);
538538
else newHiddenSlices.splice(thisLabelIndex, 1);
539539

540-
Plotly.relayout(td, 'hiddenslices', newHiddenSlices);
540+
Plotly.relayout(td, 'hiddenlabels', newHiddenSlices);
541541
} else {
542542
if(legendgroup === '') {
543543
traceIndicesInGroup = [trace.index];

shelly/plotlyjs/static/plotlyjs/src/pie.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pie.attributes = {
3838
dflt: ''
3939
},
4040

41-
// labels (legend is handled by plots.attributes.showlegend and layout.hiddenslices)
41+
// labels (legend is handled by plots.attributes.showlegend and layout.hiddenlabels)
4242
textinfo: {
4343
type: 'flaglist',
4444
flags: ['label', 'text', 'value', 'percent'],
@@ -230,18 +230,18 @@ pie.supplyDefaults = function(traceIn, traceOut, defaultColor, layout) {
230230

231231
pie.layoutAttributes = {
232232
/**
233-
* hiddenslices is the pie chart analog of visible:'legendonly'
233+
* hiddenlabels is the pie chart analog of visible:'legendonly'
234234
* but it can contain many labels, and can hide slices
235235
* from several pies simultaneously
236236
*/
237-
hiddenslices: {type: 'data_array'}
237+
hiddenlabels: {type: 'data_array'}
238238
};
239239

240240
pie.supplyLayoutDefaults = function(layoutIn, layoutOut) {
241241
function coerce(attr, dflt) {
242242
return Plotly.Lib.coerce(layoutIn, layoutOut, pie.layoutAttributes, attr, dflt);
243243
}
244-
coerce('hiddenslices');
244+
coerce('hiddenlabels');
245245
};
246246

247247
pie.calc = function(gd, trace) {
@@ -253,7 +253,7 @@ pie.calc = function(gd, trace) {
253253
allThisTraceLabels = {},
254254
needDefaults = false,
255255
vTotal = 0,
256-
hiddenSlices = fullLayout.hiddenslices || [],
256+
hiddenLabels = fullLayout.hiddenlabels || [],
257257
i,
258258
v,
259259
label,
@@ -297,7 +297,7 @@ pie.calc = function(gd, trace) {
297297
needDefaults = true;
298298
}
299299

300-
hidden = hiddenSlices.indexOf(label) !== -1;
300+
hidden = hiddenLabels.indexOf(label) !== -1;
301301

302302
if(!hidden) vTotal += v;
303303

0 commit comments

Comments
 (0)