I have been trying to put a dash app together that is plotting a scatter plot. And the plot keeps updating as data changes in the database. One thing I couldn’t figure out is if a point of the plot is clicked and the plot updates due to updated data, how can I retain the clicked point after the plot updates? When I return the figure dictionary, the whole plot re-renders. Any thoughts?
Thank you @Emmanuelle, I should have clarified that I needed the clicked data to be retained and reflected on the plot after the plot updates.
@Emil - that’s a great suggestion but I couldn’t figure out activating uirevision based on multiple inputs - I have a data update callback that should retain the plot state but with other callback inputs it should update. Any help to figure that out is greatly appreciated.
@cknatarajan - As i understand, the uirevision property work in a such way that the graph is “reset” (zoom etc.) only when the UI revision changes. Hence if you have inputs [a,b,c,d] and the graph should only be reset when a or b changes, you should set the uirevision based on (a,b), e.g. to something like hash(a,b) or json.dumps(dict(a=a, b=b)).