Repository navigation
feat(layers): honor normalizedColors for GeoJSON color accessors - #11157
Conversation
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryAdds support for normalized plain-array colors in top-level
Reviews (5) · Last reviewed commit: "Normalize GeoJSON text outlines before f..." · Reviewed by Greptile |
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 4b9c3ac. Configure here.
chrisgervang
left a comment
There was a problem hiding this comment.
Reviewed 0c1b2ff after merge; follow-ups below. One P1: the GeoJsonLayer paragraph renders under filled, and the color entries still say 0–255. Both are still on master. Defaults, typed arrays and the byte boundary at the sublayers are sound.
Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.
Generated by Claude Code
| With Deck's [`normalizedColors`](../core/deck.md#normalizedcolors), plain-array color | ||
| accessors on a top-level GeoJsonLayer use 0–1 channels. This includes constants and | ||
| callback results for fills, strokes, icons, and text colors. Omitted alpha is opaque. | ||
| The layer converts these colors to bytes before forwarding them to its sublayers. | ||
| Built-in defaults, typed arrays, and binary attributes keep their existing encoding. |
There was a problem hiding this comment.
P1: This paragraph sits above #### getFillColor, so it renders as the end of filled. getFillColor and getLineColor still say "Each channel is a number between 0-255". The sentence about converting to bytes before forwarding gives the reader nothing to act on.
Could we drop the paragraph and give each color entry the ScatterplotLayer sentence? The guide already lists the kept encodings.
Details
- ScatterplotLayer sentence: "Channels use the 0–255 range by default. See Deck’s
normalizedColorsto use 0–1 plain arrays." - On master the entries are at
geojson-layer.md:236and:261.
Generated by Claude Code
| result.updateTriggers[targetKey] = | ||
| normalize && typeof value === 'function' | ||
| ? [normalize, ...(Array.isArray(trigger) ? trigger : [trigger])] | ||
| : trigger; |
There was a problem hiding this comment.
P2: With normalizedColors on, an object updateTriggers entry now recomputes the child color attribute on every update. [true, trigger] makes the compare check the object by identity, so an inline {getFillColor: {scheme}} changes each render. Before, its keys were compared.
Could this use the object-preserving helper that TextLayer and PolygonLayer use?
Details
comparePropscompares one level, so array element1is compared with===.- Same helper:
text-layer.ts:49,polygon-layer.ts:30,fill-style-extension.ts:340on master.
Generated by Claude Code

For #11146
Background
GeoJsonLayer passes colors to child layers that use byte channels. Decode normalized plain-array inputs once at the GeoJSON boundary and preserve generated defaults, typed arrays, and binary inputs.
Change List
Verified with
yarn lintand eight focused Chromium tests.Note
Low Risk
Opt-in behavior gated behind the
normalizedColorsflag with fallback to existing byte encoding, covered by unit tests.Overview
Extends the
normalizedColorsDeck setting to top-levelGeoJsonLayerinstances. Plain JavaScript array color accessors and constants (including fill, stroke, icon, and text colors) can now be supplied in 0–1 channels.In
forwardProps, color accessors are wrapped or converted to standard 0–255 byte arrays before forwarding to child sublayers, while preserving defaults, typed arrays, and binary inputs. Update triggers are also updated to invalidate child color attributes when normalization changes.Reviewed by Cursor Bugbot for commit 0c1b2ff. Bugbot is set up for automated code reviews on this repo. Configure here.