Repository navigation
feat(aggregation-layers): support normalized palettes and contours - #11168
Conversation
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. |
[Medium impact] The PR appears safe to merge. SummaryAdds opt-in normalized colors to aggregation palettes and contour styles while preserving built-in palettes and byte inputs.
No new actionable issues found. Both earlier findings are addressed. Reviews (4) · Last reviewed commit: "Merge branch 'master' of github.com:visg..." · Reviewed by Greptile |
…ed-aggregation # Conflicts: # docs/whats-new.md # modules/aggregation-layers/src/contour-layer/contour-layer.ts
chrisgervang
left a comment
There was a problem hiding this comment.
Reviewed 76ac8cb after merge; follow-ups below. One P1 in the docs, outside the diff. Palette packing keeps byte typed and flat entries, the cell layers rebuild their textures on toggle, and contour colors are converted once.
P1: The colorRange entries in grid-layer.md, hexagon-layer.md and screen-grid-layer.md still say "Each intensity is a value between 0 and 255", and heatmap-layer.md:169 says "Each channel is a number between 0-255". The guide table in using-layers.md#normalized-colors has no row for these palettes or for ContourLayer contours colors. Could we add a palette row and qualify each entry with a link to it?
Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.
Generated by Claude Code
| const {zOffset} = this.props; | ||
| const normalized = this.usesNormalizedColors(); | ||
| /** Convert user-supplied contour styles at the sublayer boundary. */ | ||
| const getContourColor = ({contour}: ContourLine | ContourPolygon) => |
There was a problem hiding this comment.
P2: No test covers this conversion or the cell-layer texture rebuild on toggle. The new test calls packColorRange directly, so a layer that stops passing normalizedColorRange still passes.
Could we add a ContourLayer case that toggles normalizedColors and checks the lines sublayer's getColor?
Generated by Claude Code
| * @default `6-class YlOrRd` - [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6) | ||
| * Custom plain-array entries are 0–1 when Deck normalizedColors is enabled. |
There was a problem hiding this comment.
Non-blocking: After @default, TSDoc shows this as part of the default (also screen-grid-layer.ts:66). Could it move up?
| * @default `6-class YlOrRd` - [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6) | |
| * Custom plain-array entries are 0–1 when Deck normalizedColors is enabled. | |
| * Custom plain-array entries are 0–1 when Deck normalizedColors is enabled. | |
| * | |
| * @default `6-class YlOrRd` - [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6) |
Generated by Claude Code
For #11146. Apply normalizedColors to GridLayer, HexagonLayer, ScreenGridLayer, and HeatmapLayer palettes, plus ContourLayer line and band colors. Built-in palettes, typed entries, and flat byte palettes retain their existing encoding.
Validation
Note
Low Risk
The changes are opt-in via Deck's
normalizedColorssetting and preserve existing byte behavior for default palettes and typed arrays.Overview
Extends Deck's
normalizedColorsoption to aggregation layer palettes and contour definitions. When enabled, custom plain-array palette entries forGridLayer,HexagonLayer,ScreenGridLayer, andHeatmapLayer, as well as contour line and band colors inContourLayer, accept normalized 0–1 float values.Color conversion utilities (
toByteColorandpackColorRange) translate normalized plain-array inputs into byte representations for texture sampling and sublayer rendering, while preserving byte encodings for default palettes, flat numeric arrays, and typed array inputs. Sublayers and texture state listeners now trigger texture rebuilds or attribute updates whenever the normalized color setting or palette changes.Reviewed by Cursor Bugbot for commit 76ac8cb. Bugbot is set up for automated code reviews on this repo. Configure here.