-
-
Notifications
You must be signed in to change notification settings - Fork 145
Conversation
} | ||
|
||
return PlotMethod(id, figure.data, figure.layout, config).then( | ||
return Plotly.react(id, figure.data, figure.layout, config).then( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you clarify this for me? Isn't Plotly.newPlot
needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, I just reverted this commit: ea4e66c#diff-b2faf9645a4fcca0badb59ef2fba58a3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For context, that change was made because there was a bug in Plotly. That bug was fixed in plotly/plotly.js#2561 but we never removed the fix from Dash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#170 I found this, this is why we call Plotly.react
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some more context:
newPlot
is needed for the first plot- Subsequent plots can be done with
Plotly.react
. It was intended to the be faster way to handle updates but in reality we don't get many of the improvements because we are always providing new copies of data. Context here: Plotly.react plotly.js#2341. If users added alayout.datarevision
, then they would get some performance improvements but I haven't tested this and it's not really documented. - So, while we don't get the main intended features of
Plotly.react
, we do get one very critical feature: the ability to repeatedly replot webgl plots: Repeatedly callingnewPlot
withscatter3d
causes graphs to disappear plotly.js#2423 - Now, there were a lot of bugs with
Plotly.react
when it first came out. One of the bugs was that candlestick and ohlc charts didn't work with it. So, I callednewPlot
just for those chart types - However, that bug has been fixed. So, we should standardize on all chart types using
Plotly.react
. It also might fix an issue that a community user was seeing in relayoutData fails with Candlestick plots dash#355 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, great! Thanks for clarifying!
CHANGELOG.md
Outdated
@@ -2,6 +2,10 @@ | |||
All notable changes to this project will be documented in this file. | |||
This project adheres to [Semantic Versioning](http://semver.org/). | |||
|
|||
## [0.28.1] | |||
### Fixed | |||
- Fix bug where front-end error was thrown when setting `Graph.figure = {}` (fixes [#260]). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a ### Changed
that mentions that "candlestick and OHLC charts are now plotted using the Plotly.react method instead of the Plotly.newPlot method."
CHANGELOG.md
Outdated
@@ -2,6 +2,10 @@ | |||
All notable changes to this project will be documented in this file. | |||
This project adheres to [Semantic Versioning](http://semver.org/). | |||
|
|||
## [0.28.1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also start adding dates here?
Could we add a quick integration test that displays this behaviour? i.e. a simple callback that updates a figure by returning |
Made all those changes |
Cool! 💃 |
💃 |
released at |
released at
dash-core-components==0.28.1