You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It turned out the proposed approach would not work to dynamically update the widgets after that, one need to proceed as follows if they want to both to set parameters and dynamically link widgets after that:
# we do not assign this to an object # this sets the channel in the Echoshader objectds.eshader.echogram(channel=["38kHz"])
ds.eshader.Sv_range_slider(["38kHz"])
# pass the functions to panel: this allows for dynamic updatespanel.row(ds.eshader.echogram, ds.eshader.Sv_range_slider)
If we just run as discussed
echogram_widget=ds.eshader.echogram(channel=["38kHz"])
Sv_range_slider_widget=ds.eshader.Sv_range_slider(["38kHz"])
# pass the functions to panel: this allows for dynamic updatespanel.row(echogram_widget, Sv_range_slider_widget)
one would not be able to update the plots dynamically, as the widgets are static objects.
With the first scenario, we worry that even if we write in the documentation that they should pass the function, they will set the function call to an object and will pass it to panel and will be puzzled why it is not updating.
An alternative to mitigate this problem is to actually make echogram return a function instead of the holoviews object. To the user that might be a bit invisible.
# echogram_widget is a functionechogram_widget=ds.eshader.echogram(channel=["38kHz"])
# the function then can be passed to panelpanel.row(echogram_widget)
panel will accept the function and the echogram will plot.
The function can be created by some pseudo code like that
Of course, if the user just runs echogram_widget in a cell it will show that this is a function. To display the plot, one needs to run echogram_widget().
Yet another alternative is that they always create a changing widget if they want to change a value of the parameters, but this will result in too many widgets that we may not want to update.
It turned out the proposed approach would not work to dynamically update the widgets after that, one need to proceed as follows if they want to both to set parameters and dynamically link widgets after that:
If we just run as discussed
one would not be able to update the plots dynamically, as the widgets are static objects.
With the first scenario, we worry that even if we write in the documentation that they should pass the function, they will set the function call to an object and will pass it to panel and will be puzzled why it is not updating.
An alternative to mitigate this problem is to actually make
echogram
return a function instead of the holoviews object. To the user that might be a bit invisible.panel
will accept the function and the echogram will plot.The function can be created by some pseudo code like that
Of course, if the user just runs
echogram_widget
in a cell it will show that this is a function. To display the plot, one needs to runechogram_widget()
.Yet another alternative is that they always create a changing widget if they want to change a value of the parameters, but this will result in too many widgets that we may not want to update.
Originally posted by @valentina-s in #107 (comment)
The text was updated successfully, but these errors were encountered: