Skip to content

Conversation

@relativityhd
Copy link

@relativityhd relativityhd commented Nov 30, 2025

This PR should make plotting useful by providing the following new features to explore:

  • Support for Datasets: A new Drop-Down, only rendered for datasets, is used to select a variable from the dataset to render. The sliders are created based on the variables other-dims
  • Utilization of coordinates for sliders
  • Colorbar (Not available for 1D data, so the original lonboard map is returned in such cases, as it was before)
  • Utilization of the new H3Layer for H3 grids
  • New animation feature for multi-dim visualizations based on the sliders
  • New colormap settings: vmin, vmax and robust
  • Colormap settings (incl. center, vmin, vmax and robust) can be specified per-variable
  • Colorrange is static for each variable and does not change when using the sliders to change multi-dim selection.

"AI"-Disclaimer: GitHub Copilot was utilized for code completion, updating tests and the animation feature

@relativityhd relativityhd marked this pull request as ready for review November 30, 2025 23:58
@relativityhd
Copy link
Author

@keewis Maybe you want to have a look at this, since this clashes a lot with the current state of #196

@relativityhd
Copy link
Author

image

This is how it looks like btw

@keewis
Copy link
Member

keewis commented Dec 1, 2025

thanks for the PR, @relativityhd, this is looking great.

Since it is such a big PR, it will take me some time to properly review. And indeed, this will clash with #196, but I'll take care of that.

But as a first feedback, it might be good to have the sliders line up vertically with the same length (not sure how easy that is to do).

@relativityhd
Copy link
Author

No, problem, take your time. I work for my own projects on my branch until this is merged. 👍🏻

It's a little bit hacky, since the "description" value of the slider still needs to be set while hidden, but would you be fine with this?
image

Aligning the current selection labels would require custom event listeners & getters/setters for the sliders, I think that is quite large overhead, so I would leave them as-is.

@relativityhd
Copy link
Author

On a more abstract level: I think lonboard is really missing these features, like selecting layers or colorbars. I am not sure if this is something that should be solved within this library, I rather see this either in lonboard or in an expansion module for lonboard or in a more abstract widget-library for lonboard. What do you think?

@relativityhd
Copy link
Author

relativityhd commented Dec 4, 2025

I found some bugs and note them here to fix them later:

  • If there is a non-spatial dim with exactly 1 entry, the function crashes, probably some dimension alignment issues.
  • For hex-grids loaded from disc it is not possible to create the pyarrow table because the coordinates are chunked: The 'get_hexagon' trait of a H3HexagonLayer instance expected H3 Arrow array must be uint64 type., not the ChunkedArray arro3.core.ChunkedArray<Int64>

@keewis
Copy link
Member

keewis commented Dec 5, 2025

On a more abstract level: I think lonboard is really missing these features, like selecting layers or colorbars. I am not sure if this is something that should be solved within this library, I rather see this either in lonboard or in an expansion module for lonboard or in a more abstract widget-library for lonboard. What do you think?

I very much agree. I've been trying to compose lonboard.Map using ipywidgets, but this is tricky because there's not a single object to use as building blocks. To work around that, MapWithSliders inherits from ipywidgets.VBox, but that's still pretty clunky.

As such, I've started drafting a widget based on anywidget that ties things together a bit more cleanly and uses d3 to handle the colorbar (see #199). This would live in xdggs for now, but could definitely be moved out into a separate package (most certainly the colorbar widget could live elsewhere).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False visualization of h3 polygons crossing the antimeridian

2 participants