vizro
vizro copied to clipboard
Is There a Way to Get the JavaScript Code for a Given Vizro app.py?
Question
Is There a Way to Get the JavaScript Code for a Given Vizro app.py? I would like to integrate a Vizro-Dash dashboard page into a React-based multi-page dashboard. Wondering if it's possible to implement this?
Code/Examples
No response
Other information
No response
Which package?
vizro
Package version
No response
Python version
3.12
OS
Windows
Code of Conduct
- [X] I agree to follow the Code of Conduct.
Hello @Layman-Bebop and thank you for your question! Vizro is built on top of Dash, and the answer here is the same as it would be for Dash: depending on exactly what you want to achieve this may or may not be possible. The answer is pretty well covered in the Dash documentation.
It's unfortunately not possible to directly convert a Dash dashboard into pure JS code. The options are:
- Embed as a React component - this is the best solution and probably what you want to do but requires Dash enterprise, which costs 💰
- Embed as an iframe - feels a bit hacky but in practice can actually work very well. I've seen people do this before successfully and you wouldn't even guess it was an iframe just from using the website. This is quite a new feature, not documented or fully worked out yet but It's also possible to pass information into Vizro using query parameters sent through the
iframe src, a bit like this