-
Notifications
You must be signed in to change notification settings - Fork 43
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
Modifiable styles & UI editor in Jupyter #1119
Comments
The |
Further, a hook/listener would need to be added to the work done in #1065 so that the URL of the tile layer in the |
This seems reasonable to me at least at a very high level. In addition to a geo use case, I recommend adding a use case of a multi-channel histology image (e.g. different stains) that could also be manipulated in a reasonable way with this widget. @manthey could probably provide this. |
See also what has been going on in #1086. This is a vue component that might be able to be extended to cover the use cases you have. For instance, currently, you pick a color, not a color map. But, we aim to add more features to it over time and it'd be great if we can harmonize our use cases. |
I agree it would be great to harmonize the use cases and bring all of the UI code together. Maybe its worth looking into custom Vue widgets with anywidget (or another toolkit) now instead of prototyping with |
Anywidget looks nice, but a quick look and some searching does not inspire immense confidence in adopting it (e.g. searching "anywidget vue" doesn't seem to surface any good results of people bundling vue with it). In theory it seems it could use any vite-powered build which is cool but anywidget seems a bit boutique use case for very lightweight widgets. |
Currently, we don't expect to change the style except on class instantiation. We store a reference to the source instance in the cache based on the style (amongst other things). Without the source cache, setting the style would just be obtaining the style lock and then calling We could probably resolve this by making |
This was largely implemented with the |
@zachmullen and I were brainstorming a style editor for tile sources that would be exposed in Jupyter alongside the interactive viewer in #1065. Here are my thoughts:
style
@property
toTileSource
(a wrapper around the existing_setStyle()
method and.style
attribute). This will be a clean/simple interface to get/set/update the style on aTileSource
.TileSourceStyle
class extendingdict
. Have thestyle
property return/leverage this class.TileSourceStyle
that makes it easier to update the style for a specific band in the dictionary or any other neat ideas that come along (more of these can come later)_ipython_display_
method toTileSourceStyle
that returns a set ofipywidgets
to control/modify the style. More details below._ipython_display_
interfaceI think we should start with a minimal style-adjusting interface much like what @jtomeck and I created for
django-large-image
:This will have a tree structure for all the available bands and frames with the ability to:
Like the
django-large-image
editor, I think it would be nice to display a thumbnail directly in the widget as well so that users can easily see the styling adjustments.Use
In Jupyter, users would simply output the
.style
property at the end of a cell to get the ipywidgets interface:TileSourceStyle
pseudo codeI think we'll need to keep a reference to the parent tile source so that it is able to reapply itself as it is updated. This will get tricky if trying to share a style across multiple tile sources, so maybe we should brainstorm other approaches.
Uncertainties
My only uncertainty on building this interface is whether calling
_setStyle()
is sufficient to update the style on aTileSource
instance? @manthey, do you have any thoughts on this or feedback on the pseudo code above?The text was updated successfully, but these errors were encountered: