Support for communicating with trame when embedded in an <iframe /> #234
jourdain
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Trame let you create a full and complex application in plain python while skipping JavaScript all together.
But sometime, existing infrastructure, portal or website needs to expose/nest trame applications.
And for that using an <iframe /> tend to be the easiest way. But how to communicate between your trame Python application and your JavaScript front-end? Can you drive state from the outside or call Python methods?
Well now it is possible thanks to trame-iframe widget library. We have several examples illustrating various usage and configuration (JS/Trame, Trame/Trame, Trame/JS).
Q: How to make use of it?
A: First install the widget by calling
pip install trame-iframe
. Then you can do the following.Then in your JavaScript
Q: Can I have bidirectional communication?
A: Yes and you should look at that example for some ideas.
Enjoy!
Beta Was this translation helpful? Give feedback.
All reactions