-
Notifications
You must be signed in to change notification settings - Fork 39
Merging additions in ecoscope
fork
#592
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
+cc @vgeorge for visibility |
See #613 in which @vgeorge started a PR to add your additions to lonboard.
In terms of API design, what do you think about just documenting that you can access the generated layers via from lonboard import viz
viz_layers = viz(data).layers Then we don't need another top-level function just to create layers.
It looks like you made this boolean? So you didn't have a use case of customizing the controller; just of turning off interaction?
I see that all of your deck widgets subclass from I have to think about this a little more. |
In a world where I already have a map with some layers, and I want to add another layer based on the output of
Yep
On a slightly related note, the way those are implemented also duplicates |
Well, we could add an def add_layer(self, layer: BaseLayer | Sequence[BaseLayer] | Map):
if isinstance(layer, Map):
layer = layer.layers
... And then you could do from lonboard import viz
first_map = viz(...)
first_map.add_layer(viz(other_data)) Separately, we should probably store the list of layers as a tuple under the hood, so that changing the list of layers forces it to be a new object, so that traitlets knows to sync it to the frontend. |
I like that. I've adopted something similar within |
Well, as I understand it, traitlets can observe when a new Python object is provided, but not if the object has mutated. That is, it checks for equality using
spectate is old and unmaintained. psygnal is modern, maintained, and already a dependency (via anywidget) but I never figured out how to use it. https://psygnal.readthedocs.io/en/stable/dataclasses/, #210 |
Ref #592 (comment) This should be easier to follow for users. Mutating a list trait doesn't propagate any updates to the frontend. Rather, you must set a new object. Storing tuple traits instead of list traits means that it's impossible for the user to accidentally not sync those updates to the frontend.
#620 now stores internal sequences as lists and added a |
Things I've added in our fork that may be worth adding/reviewing here
Things that are simple(ish) to merge
mapWidth
toMap
viz
that returns a layer rather than a mapMapView
inindex.tsx
- we're doing this to allowrepeat=true
controller
Python side inMap
Less simple
lonboard
and if that's even a good idea.The text was updated successfully, but these errors were encountered: