Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demand for "ref" prop support #209

Open
Sec-ant opened this issue Oct 21, 2020 · 1 comment
Open

Demand for "ref" prop support #209

Sec-ant opened this issue Oct 21, 2020 · 1 comment

Comments

@Sec-ant
Copy link

Sec-ant commented Oct 21, 2020

I've been trying to update a plotly graph rapidly and frequently to generate an animation in a react app using window.requestAnimationFrame API, according to this example. Right now, in my update function, I use setState to refresh my states (already bound to my <Plotly /> data prop) and thus trigger plotly to redraw. However, setState is an asynchronous function and it seems to consume too much execution time in between the frame interval. To solve this problem, I'm now trying to use DOM refs and Plotly.animate API to update the graph outside of the React logic. So is there any chance that react-plotly.js will support ref prop in the <Plotly /> component?

Thanks and have a nice day!

@JamesRamm
Copy link

@Sec-ant
Somewhat related to my suggestions here:
#242

As noted, a by-product of providing an API based on react hooks is that you can access the ref. Perhaps my examples can give you some inspiration - in my own experience, integrating plotly for specific use-cases can be quite simple and react-plotly can be overly large/inflexible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants