Skip to content

chore: bump to deck.gl 9.4 and deck.gl-raster 0.8 - #1272

Merged
kylebarron merged 1 commit into
mainfrom
kyle/deck-gl-9.4
Sep 29, 2026
Merged

kylebarron merged 1 commit into
mainfrom
kyle/deck-gl-9.4

Conversation

@kylebarron

@kylebarron kylebarron commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Note

This PR was written by Claude (Claude Code), not by @kylebarron.

Closes #1262

Upgrades to deck.gl 9.4 (the last v9 release), luma.gl 9.4, and deck.gl-raster 0.8. deck.gl-raster 0.8 requires deck.gl 9.4.

Changes

  • deck.gl and luma.gl: @deck.gl/* → ^9.4.0 and @luma.gl/* → ^9.4.2. Both are updated in package.json and in the overrides in pnpm-workspace.yaml. Those overrides keep a single copy of each package, and they had held the lockfile at 9.3 even after package.json was bumped.
  • deck.gl-raster family: @developmentseed/affine, deck.gl-raster, morecantile and raster-reproject → ^0.8.1 together. This removes the duplicate @developmentseed/affine 0.6.1 and 0.7.0 copies that main bundles today. It brings in deck.gl-raster's fixes:
    • center-first tile loading, now handled by deck.gl 9.4 itself;
    • lighting turned off for raster layers;
    • isLoaded returning false while metadata loads;
    • tile traversal latitudes clamped to [-90, 90];
    • COG open failures reported through onError.
  • Undeclared dependencies: @deck.gl/aggregation-layers, @deck.gl/geo-layers, @deck.gl/widgets and @luma.gl/core are now declared. They were imported in src/, or required as peers, but only installed because pnpm installs missing peers automatically. The stale aggregation-layers 9.3.1 peer was what caused an "unmet peer" warning.
  • loaders.gl: the twelve loaders.gl packages that deck.gl and luma.gl depend on directly are overridden to ~4.4.5.
    • @luma.gl/gltf 9.4 requires loaders.gl ~4.4.5, while deck.gl 9.4 accepts ^4.4.3.
    • loaders.gl packages pin exact versions of each other.
    • Without the overrides, a fresh resolution mixes 4.4.5 and 4.5.x. An esbuild metafile showed that bundles seven loaders.gl packages twice.
  • dependabot: @developmentseed/* is grouped with deck.gl, so the family moves together.

Not switching to @deck.gl/maplibre yet

9.4 adds @deck.gl/maplibre as the MapLibre replacement for @deck.gl/mapbox. But in 9.4.0 it draws interleaved layers that set beforeId above every MapLibre layer on first page load (visgl/deck.gl#10733). That would break lonboard's before_id, so this PR stays on @deck.gl/mapbox ^9.4.0. deck.gl-raster made the same call; see developmentseed/deck.gl-raster#661. The fix, visgl/deck.gl#10734, is open. The switch from MapboxOverlay to MapLibreOverlay in src/renderers/overlay.tsx can happen once a release includes it; that's tracked in #1273.

Verification

Picking. deck.gl 9.4 drops the auto-generated instancePickingColors attribute. Nothing in lonboard reads it, but the existing UI tests never actually asserted that picking works. New tests/ui/test_picking.py clicks a feature and checks that Python receives the right selected_index, for scatterplot, path, polygon and solid polygon layers. It passes on main (deck.gl 9.3) and on this branch.

Static HTML exports. 15 exports were checked in headless Chromium on both main and this branch: five layer types (scatterplot, path, polygon, text, H3) in each of the overlaid, interleaved and reverse-controlled modes.

  • Hover tooltips appear in every case.
  • The controls render the same way on both versions.
  • No console errors.

Raster. A local tiled GeoTIFF rendered through RasterLayer.from_geotiff and deck.gl-raster 0.8 displays correctly.

Replacing a map. Swapping one map for another in the same output reuses the MapLibre instance (reuseMaps). It renders correctly in both overlaid and interleaved modes, with no "WebGL context already attached" error. That's the problem deck.gl-raster#668 hit under React StrictMode.

Checks:

  • pnpm install --frozen-lockfile: clean, with no peer-dependency warnings.
  • biome check: clean.
  • tsc --noEmit: the same 8 errors as main, with identical messages.
  • pytest: 226 passed, 1 skipped.

Things to know

🤖 Written by Claude Code

- Bump @deck.gl/* to ^9.4.0 and @luma.gl/* to ^9.4.2, in both
  package.json and the pnpm overrides that keep a single copy of each.
- Bump the @developmentseed/* family to ^0.8.1 together. deck.gl-raster
  0.8 requires deck.gl 9.4, and this removes the duplicate 0.6.1 and
  0.7.0 copies of @developmentseed/affine that were bundled.
- Declare @deck.gl/aggregation-layers, @deck.gl/geo-layers,
  @deck.gl/widgets and @luma.gl/core directly. They were imported or
  required as peers but only installed transitively.
- Override the loaders.gl packages that deck.gl and luma.gl depend on to
  ~4.4.5. @luma.gl/gltf 9.4 requires ~4.4.5 while deck.gl accepts
  ^4.4.3, and loaders.gl packages pin exact versions of each other, so
  otherwise seven loaders.gl packages are bundled twice.
- Group @developmentseed/* with deck.gl in dependabot.

Stay on @deck.gl/mapbox rather than the new @deck.gl/maplibre: in
9.4.0, @deck.gl/maplibre draws layers with a beforeId above every
MapLibre layer on first load (visgl/deck.gl#10733).

Add UI tests that clicking a feature sets selected_index for scatterplot,
path, polygon and solid polygon layers, since deck.gl 9.4 changed how
picking colors are generated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ds-release-bot ds-release-bot Bot added the chore label Sep 29, 2026
@kylebarron
kylebarron enabled auto-merge (squash) September 29, 2026 16:37
@kylebarron
kylebarron merged commit 9ec2408 into main Sep 29, 2026
7 checks passed
@kylebarron
kylebarron deleted the kyle/deck-gl-9.4 branch September 29, 2026 16:38
kylebarron added a commit that referenced this pull request Sep 29, 2026
> [!NOTE]
> This PR was written by Claude (Claude Code), not by @kylebarron.

## Problem

`selected_index` is documented as the row that was clicked, usable as
`gdf.iloc[layer.selected_index]`. Three things made it wrong:

1. **A click on the first row was ignored.** `onClick` returned early on
`!pickingInfo.index`, and index 0 is falsy. deck.gl uses `-1`, not `0`,
when nothing was picked.
2. **With more than one record batch, the index was the row's position
within its batch.** Each batch is rendered as its own deck.gl layer, and
the picking info from `@geoarrow/deck.gl-geoarrow` is relative to that
layer's batch. For a 4-row table in batches of 2, clicking the 4th row
gave `selected_index == 1`. Lonboard splits large tables into batches
automatically, so this affects anyone with large data.
3. **Clicking a `HeatmapLayer` set `selected_index` to an arbitrary
number**, such as `2490556` for a 3-row table. deck.gl's `HeatmapLayer`
doesn't support picking: it draws the heatmap's colors in the picking
pass, and deck.gl decodes the color under the cursor as an index.

There was no issue for these. The first two were found while testing the
deck.gl 9.4 upgrade (#1272) and exist on deck.gl 9.3 too. The third was
found while fixing them.

## Changes

This PR has two commits, so the heatmap change can be dropped or split
out.

**Commit 1: the index**

- `onClick` moves from `BaseLayerModel` to `BaseArrowLayerModel`. It
receives the batch index of the layer that was clicked, returns when
`index < 0`, and adds the number of rows in all earlier batches.
- The H3, A5, geohash and S2 models called `baseLayerProps()` without a
batch index. They now pass it.

**Commit 2: the heatmap**

- `HeatmapModel` sets `pickable: false`, as `BitmapModel` already does.

## Behavior changes to be aware of

- Anyone who worked around the old value, for example by adding the
batch offset themselves, will now get an index that is offset twice. For
tables with a single batch, the only change is that row 0 works.
- H3, A5, geohash and S2 layers with extension props given as arrays
(e.g. `get_filter_value`) used the first batch's values for every batch.
They now use each batch's own values. This is a side effect of passing
the batch index.
- Layers that aren't backed by an Arrow table (bitmap, bitmap tile,
raster, surface) no longer get an `onClick` handler. They never set
`selected_index` before either: they always report index 0, which the
old check discarded.
- A heatmap is no longer pickable, so it no longer blocks clicks and
hovers on layers underneath it. The Python `pickable` trait has no
effect on a heatmap.

The tooltip, the side panel and `Map.on_click` are unaffected. They use
the picked row object and the coordinate, not the index.

## Tests

`tests/ui/test_picking.py` goes from 4 tests to 26. Each one clicks a
feature in the browser and checks the value Python receives.

| Test | Checks |
|---|---|
| `test_click_sets_selected_index` ×4 (existing) | Last row of a single
batch |
| `test_click_first_row_sets_selected_index` ×4 | Row 0 gives 0 |
| `test_click_in_later_batch_sets_table_index` ×12 | 6 rows in batches
of 2; rows 2, 3 and 5 |
| `test_click_multipolygon_in_later_batch_sets_table_index` | Counts
rows, not the parts of a multi-part geometry |
| `test_click_h3_cell_sets_table_index` ×3 | An H3 layer in two batches;
rows 0, 2 and 3 |
| `test_click_on_empty_map_does_not_set_selected_index` | A click on
empty map sets nothing |
| `test_click_heatmap_does_not_set_selected_index` | A click on a
heatmap sets nothing |

The ×4 and ×12 tests are parametrized over scatterplot, path, polygon
and solid polygon layers.

Against `main`'s frontend code, 21 of the 26 fail and 5 pass. The 5 are
the 4 existing tests and the empty-map click.

Geohash, S2, text, column, point cloud, arc and trips layers were also
clicked in a browser with the fix, on tables in two batches, and gave
the right index. Those checks aren't part of the test suite.

## Checks

- `pytest`: 250 passed, 1 skipped.
- `pnpm test`: 6 passed.
- `biome check`: clean.
- `tsc --noEmit`: 7 errors, the same 7 as `main`.

## Not verified

- The A5 layer wasn't clicked in a browser. It uses the same code path
as the H3, geohash and S2 layers.
- Raster and surface layers were checked by reading the code only.

🤖 Written by [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update to deck.gl 9.4

1 participant