Plotly.js: react() and plot_bgcolor

Created on 4 May 2020  路  7Comments  路  Source: plotly/plotly.js

This is a CodePen https://codepen.io/nicolaskruchten/pen/pojdmaX?editors=0010 that illustrates the issue outlined in https://community.plotly.com/t/changing-the-background-colour-of-a-graph/29246/8 and logged in Dash as https://github.com/plotly/dash/issues/1107

Edit: the newPlot behaviour is correct and the react behaviour is not.

bug

Most helpful comment

OK, so the newPlot behaviour is correct and the react behaviour is not.

All 7 comments

@alexcjohnson is it intended that in the second figure straight off of newPlot that plot_bgcolor: "red" does nothing?

plot_bgcolor only applies to cartesian subplots AFAIK. All the other subplot types have their own subplot container objects (in this case scene) with their own bgcolor attributes. Might have been a good idea for these to inherit from plot_bgcolor but I think that ship has sailed.

If you add scene: {bgcolor: "green", domain: {x: [0,0.7]}} to the second layout you'll see both green and blue after react-ing from 0 to 1

OK re cartesian subplots... Does this make the current behaviour "correct" or do we agree that the blue should be cleared when I react from scatter to scatter3d ?

Oh definitely a bug

So what do you think the correct behaviour should be? on newPlot2 should there be a red background, or should the background go to white on react2?

There鈥檚 no Cartesian subplot so there should be no red, just white.

OK, so the newPlot behaviour is correct and the react behaviour is not.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

boleslawmaliszewski picture boleslawmaliszewski  路  3Comments

chriddyp picture chriddyp  路  3Comments

nicolaskruchten picture nicolaskruchten  路  3Comments

tim-sauchuk picture tim-sauchuk  路  3Comments

pynklu picture pynklu  路  3Comments