Repository navigation
Add an automatic SQL color scale legend widget - #11193
Conversation
2c75b52 to
d067e8a
Compare
9419c73 to
18e2f61
Compare
d067e8a to
c5da73e
Compare
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5da73e3bf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
[Medium impact] The follow-up changes appear safe to merge. SummaryAdds an experimental legend that follows SQL color scales on layers eligible to draw in each view.
The Line example’s export-name fix is in dependent PR #11192; that part of this assessment depends on the stacked PR.
|
ibgreen
left a comment
There was a problem hiding this comment.
One small classified-legend edge case: repeated quantile breaks can render duplicate intervals and swatches. With Arrow values [1, 1, 1, 1] and SCALE_QUANTILE(value, 3, PALETTE('#000000', '#aaaaaa', '#ffffff')), all map rows use white, but ColorLegend renders two identical white 1 – 1 entries. I verified this against the actual accessor and widget source with a VNode harness (not a browser). Consider building legend intervals from unique boundaries and special-casing a singleton extent to one labeled swatch; add a tied-values fixture.
c5da73e to
e959f31
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e959f31. Configure here.
Brings in master, including #11240. The examples-v10 and website import conflicts take #11240's version, which already imports `/legacy`. The "Heatmap filtering" whats-new section, which an earlier merge here dropped by mistake, comes back with master's update. Master added `_ColorScaleWidget` to @deck.gl/widgets (#11193), so the root wraps it too, as the wrappers test requires for every widget class. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LGNhMnSJ94uYgx7ihcVwPn
chrisgervang
left a comment
There was a problem hiding this comment.
Reviewed ffa12e5 after merge; follow-ups below.
No P1s.
Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.
Generated by Claude Code
| } | ||
| } | ||
|
|
||
| test('_ColorScaleWidget respects screen filters and its attached viewport', async () => { |
There was a problem hiding this comment.
P2: The tests cover continuous, quantile and composite scales. Ordinal swatches and threshold or quantize intervals render through their own branches and have no test.
Could we add ordinal and threshold cases?
Generated by Claude Code
| return scales.map(([accessor, scale]) => ({ | ||
| layerId: layer.id, | ||
| accessor, | ||
| label: scales.length === 1 ? layer.id : `${layer.id} · ${formatAccessorLabel(accessor)}`, |
There was a problem hiding this comment.
Non-blocking: Legends are titled with the layer id and accessor, such as Readings · fill color. Could the title prefer descriptor.label and units when a scale sets them?
Generated by Claude Code
| viewports: Viewport[]; | ||
| layers: Layer[]; | ||
| /** Drawable layers that passed the screen filters in each viewport. */ | ||
| renderedLayers?: ReadonlyMap<Viewport, ReadonlySet<Layer>>; |
There was a problem hiding this comment.
P2: onRedraw now passes renderedLayers to every widget, but the onRedraw entry in widget.md lists only viewports and layers. Custom widgets can use it, so it is public API.
Could we add a renderedLayers bullet to that entry?
Generated by Claude Code
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.

Follow up of #11159
Background
SQL color scales derive domains from layer data. Applications need a legend that follows the scales and the layers drawn in each view.
Change List
_ColorScaleWidgetLayer._getResolvedColorScales()and its typesCore and widgets builds, lint, Node and Chromium tests passed.
Note
Low Risk
Low risk as changes introduce an opt-in experimental widget and non-breaking, backward-compatible additions to layer visibility tracking and scale metadata.
Overview
Adds an experimental
_ColorScaleWidgetto@deck.gl/widgetsthat automatically generates legends for SQL color accessors on visible layers.To power the widget,
Layerexposes an experimental_getResolvedColorScales()method returning scale descriptors and color samplers, preserving active scales while queries re-evaluate. Additionally,DeckRendererandLayersPassnow track viewport-eligible drawable layers and passrenderedLayersthrough toWidgetonRedrawlifecycle methods.The widget renders collapsible legends supporting categorical swatches, continuous color ramps, and discrete or quantile bins with adaptive numeric precision. It also includes comprehensive test coverage, documentation, and an interactive documentation demo.
Reviewed by Cursor Bugbot for commit ffa12e5. Bugbot is set up for automated code reviews on this repo. Configure here.