-
Notifications
You must be signed in to change notification settings - Fork 7
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
clarification on new Event structure #8
Comments
def update_data(widget, event, data):
...
row1 = v.Row(.... )
row1.on_event('change', update_data)
...
rowN = v.Row(...)
rowN.on_event('change', update_data)
I want to point out that since you already use vue template syntax in the front-end, you may want to use this in the notebook/python too. This is not very well document yet, but I think you can get a long way with the examples: https://github.com/mariobuikhuizen/ipyvuetify/blob/master/examples/Examples%20template.ipynb. This is also being used in https://github.com/spacetelescope/jdaviz and https://github.com/glue-viz/glue-jupyter. The events work differently in this mode, so if you decide to use it we have to think about question 1 again. |
Thanks for the clarification! This is helpful. Yeah your example makes sense if you need to access the model multiple times from multiple places. And good to know there's no downside to where you place the I think you're right and we'll end up using the template syntax. Since our plan is to ultimately utilize |
Good to hear, and looking forward to feedback on how that works out. Slightly related, In vaex, i started to put the templates in separate files, e.g.: This makes is possible to use a .vue file in both a Python widget and vue (although not everything is supported in the widget case). And it also gives you syntax highlighting. |
Thanks Maarten! That's really interesting and a good example to pull from of how these things can sync up! This is helpful! |
I had some questions on the new
Event
demos from the recent PR #3. 1. Is it strictly necessary to create a subclass of a Vuetify object just to add a simple event accessible to front-end components? My case involves a singlev.Row
component containing threebqplot
components I need updated on a drop-down select change. Inside my notebook, I subclassedv.Row
to include my on-change event function.with my
update_data
function defined asHowever if I need to attach my event to multiple components, I'd have to subclass every single one. Is it possible to expand event function definitions so they could be linked to one or multiple components, without subclassing every component you need to attach to it? Something like
requestWidget
call inside Vue'screated
block? My front-end looks likewith the
update_data
method defined asIs this reasonable or does this cause unnecessary network calls?
The text was updated successfully, but these errors were encountered: