Skip to content

feat(aggregation-layers): support normalized palettes and contours - #11168

Merged
ibgreen merged 4 commits into
masterfrom
codex/normalized-aggregation
Nov 18, 2026
Merged

ibgreen merged 4 commits into
masterfrom
codex/normalized-aggregation

Conversation

@ibgreen

@ibgreen ibgreen commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • yarn lint
  • 15 focused headless tests passed. Two existing HeatmapLayer WebGPU tests timed out during local WebGPU setup and were excluded from the focused rerun.

Note

Low Risk
The changes are opt-in via Deck's normalizedColors setting and preserve existing byte behavior for default palettes and typed arrays.

Overview
Extends Deck's normalizedColors option to aggregation layer palettes and contour definitions. When enabled, custom plain-array palette entries for GridLayer, HexagonLayer, ScreenGridLayer, and HeatmapLayer, as well as contour line and band colors in ContourLayer, accept normalized 0–1 float values.

Color conversion utilities (toByteColor and packColorRange) 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T23:18:02.693932Z 8213622 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ibgreen ibgreen mentioned this pull request Nov 17, 2026
22 of 52 tasks
@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Adds opt-in normalized colors to aggregation palettes and contour styles while preserving built-in palettes and byte inputs.

  • Four aggregation layers read custom palettes as normalized colors.
  • Contour lines and bands use normalized colors when the setting is on.

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

@coveralls

coveralls commented Nov 17, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.528% (-0.004%) from 82.532% — codex/normalized-aggregation into master

…ed-aggregation

# Conflicts:
#	docs/whats-new.md
#	modules/aggregation-layers/src/contour-layer/contour-layer.ts
@ibgreen
ibgreen merged commit 8ee9db2 into master Nov 18, 2026
7 checks passed
@ibgreen
ibgreen deleted the codex/normalized-aggregation branch November 18, 2026 00:18

@chrisgervang chrisgervang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) =>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines 128 to +129
* @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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: After @default, TSDoc shows this as part of the default (also screen-grid-layer.ts:66). Could it move up?

Suggested change
* @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

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.

3 participants