Open charleyferrari opened 5 years ago
I can't see any reason why config wouldn't update like any other prop in dcc.Graph. This is how I've been testing it out, the dropdown should just remove the modebar by updating the config.
Looking at the code, we're just not handling the config
argument:
https://github.com/plotly/dash-core-components/blob/f9b2e93df60bc79aaf641459b1abb070229e72eb/src/components/Graph.react.js#L170-L191
@chriddyp I tried building this myself appending this below the figureChanged
logic:
const configChanged = this.props.figure !== nextProps.config;
if (configChanged) {
this.plot(nextProps);
}
and wasn't getting a modebar change working in a callback.
Do you know if there's something else needed?
@charleyferrari - Can you push up a PR? Then I can comment on your code directly.
In particular, this logic looks wrong:
const configChanged = this.props.figure !== nextProps.config;
it should be
const configChanged = this.props.config !== nextProps.config;
@chriddyp has there been done any fix on this since then?
cc @plotly/dash
This was uncovered in the dash community: https://community.plot.ly/t/remove-show-figure-modebar-programatically/12254
I can't see any reason why config wouldn't update like any other prop in
dcc.Graph
. This is how I've been testing it out, the dropdown should just remove the modebar by updating the config.The only thing I can think of is the
shape
of config not being matched, but it works fine when you hardcodeconfig
in thedcc.Graph