Skip to content

Commit 8ab9d0c

Browse files
committed
make Plotly.restyle support transforms:
- the 'traces' array of trace index is now based off gd.data - make all transforms restyle calls go through doCalcdata which is the worse case scenario (i.e. we take no chance!)
1 parent 06f2e6d commit 8ab9d0c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/plot_api/plot_api.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1565,7 +1565,7 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
15651565

15661566
if(isNumeric(traces)) traces = [traces];
15671567
else if(!Array.isArray(traces) || !traces.length) {
1568-
traces=gd._fullData.map(function(v,i) { return i; });
1568+
traces = gd.data.map(function(v, i) { return i; });
15691569
}
15701570

15711571
// recalcAttrs attributes need a full regeneration of calcdata
@@ -1733,6 +1733,9 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
17331733
continue;
17341734
}
17351735

1736+
// take no chances on transforms
1737+
if(ai.substr(0, 10) === 'transforms') docalc = true;
1738+
17361739
// set attribute in gd.data
17371740
undoit[ai] = a0();
17381741
for(i=0; i<traces.length; i++) {

0 commit comments

Comments
 (0)