Skip to content

feat: flat common-space helpers for non-flat projections + view-matrix render tests - #10657

Merged
chrisgervang merged 13 commits into
masterfrom
claude/globe-flat-common-helpers-GveWO
Sep 25, 2026
Merged

chrisgervang merged 13 commits into
masterfrom
claude/globe-flat-common-helpers-GveWO

Conversation

@chrisgervang

@chrisgervang chrisgervang commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator

Base of the GlobeView extension series: #10658, #10659, #10660, #10661, #10662, #10663, #10664, #10666

Background

MaskExtension, ClipExtension, FillStyleExtension and TerrainExtension sample a flat common space (Web Mercator, or cartesian in OrthographicView), but under GlobeView geometry.position is sphere XYZ and GlobeViewport.projectFlat() is an identity. Each extension either carries its own PROJECTION_MODE_GLOBE branch or renders incorrectly on the globe. This PR adds one shared GPU/CPU conversion so the fixes in the stacked PRs are one-line calls, and a render test helper to run the same case in several views. Additive only: no behavior change for shipped extensions, no new core exports.

Change List

  • project shader module (GLSL and WGSL): add project_globe_to_mercator_(vec3) and project_common_position_to_flat(vec3|vec4), identity for flat projection modes and sphere to absolute Mercator under GLOBE. The inverse computes Mercator y as log((D + |z|) / |xy|) directly from the sphere position, which stays accurate near the poles where an asin route does not
  • project_common_position_to_flat_wrapped(position, referenceX): x moved to the world copy nearest a reference in every geospatial mode, for bounds and texture lookups (pass the bounds centre)
  • project_common_position_to_flat_continuous(position, referenceX): same, but only under GLOBE, so a polygon spanning the antimeridian stays continuous while flat maps are untouched; for periodic patterns (pass the camera)
  • @deck.gl/extensions projection-utils: add CPU twins isFlatViewport, projectToFlatCommon, projectBoundsToFlatCommon, getFlatCommonOrigin; getRenderBounds returns the full layer extent for non-flat viewports
  • projectToFlatCommon mirrors the GLOBE + METER_OFFSETS shader branch exactly (ENU displacement on the sphere, then the sphere's inverse) instead of going through lng/lat, which diverges by about 200 m at a 300 km offset
  • projectBoundsToFlatCommon unwraps lng/lat bounds whose left edge is more than 180° east of their right edge, so bounds can describe a region across the antimeridian while reversed bounds keep re-ordering
  • test/render/view-presets.ts: expandViewMatrix(case, ['map', 'globe', 'orthographic']) expands one case into per-view cases with shared San Francisco presets and guards against globe cases above the zoom-12 Mercator hand-off
  • Unit tests: GPU/CPU pairing on WebMercatorViewport (zoom 11.5 and 14), GlobeViewport and OrthographicViewport to 12 digits, including a 300 km meter offset, antimeridian and reversed bounds; expandViewMatrix naming and overrides
  • Documentation: project.md; docs/whats-new.md GlobeView compatibility bullet

Ran the unit specs, tsc for core and extensions, and lint.


Note

Medium Risk
Changes core shader projection and shared extension bounds logic used by mask and terrain effects; additive for current callers but incorrect use of flat vs sphere coordinates could break globe rendering in follow-up PRs.

Overview
Adds shared GPU and CPU paths to treat positions in flat Web Mercator (or cartesian) space while rendering on GlobeView, so mask/clip/fill-style/terrain extensions can sample flat framebuffers and test bounds without duplicating globe branches.

The project shader module (GLSL and WGSL) gains project_globe_to_mercator_ and project_common_position_to_flat, plus _wrapped and _continuous variants for antimeridian bounds and seamless periodic patterns. Flat projection modes pass through unchanged.

@deck.gl/extensions projection-utils adds projectToFlatCommon, projectBoundsToFlatCommon, getFlatCommonOrigin, and isFlatViewport, including a globe meter-offsets path that matches the shader (not lng/lat). getRenderBounds skips viewport intersection on non-flat viewports so flat layer bounds are not mixed with sphere viewport bounds.

Also adds expandViewMatrix render-test presets (map / globe / orthographic), unit tests for GPU/CPU pairing and antimeridian bounds, and docs in project.md and whats-new.md.

Reviewed by Cursor Bugbot for commit b228729. Bugbot is set up for automated code reviews on this repo. Configure here.

… module

Texture- and bounds-based extensions (mask, clip, fill patterns, terrain)
index a FLAT common space: Web Mercator for geospatial views, cartesian for
OrthographicView. Under GlobeView geometry.position is sphere XYZ, so every
such extension currently needs its own PROJECTION_MODE_GLOBE branch (terrain
has one; mask needs one) or is simply broken (clip, fill-style, brushing).

Add two projection-generic functions next to project_globe_():

- project_globe_to_mercator_(vec3): the inverse of project_globe_ followed by
  project_mercator_, i.e. sphere XYZ -> absolute Mercator common space.
- project_common_position_to_flat(vec3|vec4): common space -> flat common
  space. Identity for flat projection modes (so offset-relative positions
  under WEB_MERCATOR_AUTO_OFFSET pass through unchanged); inverts the sphere
  under GLOBE. This is the single GPU switch point: a future non-flat
  projection mode is inverted here, next to the forward branch in
  project_position(), and no extension needs to change.

Document the new function in docs/api-reference/core/project.md.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
…on_position_to_flat

project.glsl.ts and project.wgsl.ts are kept in lockstep everywhere else;
mirror the two new functions so WebGPU ports of the extensions have the same
entry point. No WGSL consumer yet (mask/clip/fill-style have no WGSL path).
WGSL has no overloading, so only the vec3 form is provided.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
CPU twins of project_common_position_to_flat() in projection-utils.ts:

- isFlatViewport(viewport): the single place in @deck.gl/extensions that
  tests for GlobeViewport (instanceof _GlobeViewport; swap for a projection
  mode comparison if core ever exports one).
- projectToFlatCommon(layer, position, opts) /
  projectBoundsToFlatCommon(layer, bounds, opts): Layer.projectPosition with
  autoOffset on flat viewports (matches offset-relative geometry.position at
  zoom >= 12), absolute Mercator through the existing reference viewport on
  non-flat ones. Routing through Layer.projectPosition keeps coordinate
  systems, coordinateOrigin and modelMatrix handling identical to the GPU.
- getFlatCommonOrigin(uniforms, viewport): project.commonOrigin on flat
  viewports, [0, 0] under globe where the flat space is absolute (for globe +
  meter-offsets commonOrigin is a sphere position and must not be re-added).
- getRenderBounds() returns the full layer extent for non-flat viewports:
  getViewportBounds() would yield sphere coordinates there, which cannot be
  intersected with Mercator layer bounds. No behaviour change for shipped
  extensions: MaskEffect bails out under globe today and terrain guards the
  call with its own instanceof check.

Existing helpers (getMercatorReferenceViewport, lngLatToMercatorCommon,
joinLayerBounds, makeViewport) are unchanged. Unit spec pins the GPU/CPU
pairing invariant on WebMercator (zoom 11.5 and 14), Globe and Orthographic
viewports.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
…ple views

No extension render test runs under GlobeView today, and only fill/path
cases run under OrthographicView. test/render/view-presets.ts expands one
case into one TestCase per view preset so the same layers and extension are
rendered under MapView, GlobeView and OrthographicView:

- presets share the San Francisco view used by existing goldens; the globe
  preset uses the same lng/lat/zoom (GlobeViewport is calibrated to converge
  with Mercator), the orthographic preset is the pixel space of the map
  preset (toPosition/toBounds map lng/lat data into it).
- the 'map' preset keeps the bare name and golden so existing goldens are
  reused; other presets append -globe / -orthographic.
- a load-time guard rejects globe cases above zoom 12, where GlobeView
  silently hands off to WebMercatorViewport.
- per-preset overrides (skip is merged, other fields replace) and a
  geospatial viewState override let specs keep goldens that use other views.

Covered by a unit spec in the render project; adopted by extension specs in
follow-up PRs.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
@coveralls

coveralls commented Sep 7, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.538% (+0.04%) from 82.497% — claude/globe-flat-common-helpers-GveWO into master

Consumers pass toPosition() straight into getPosition accessors, which
expect a Position tuple; returning number[] forced a cast at every call
site. Return [number, number] from every preset instead.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
@greptile-apps

greptile-apps Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge; all previous findings are resolved and the changes since the previous review introduce no new actionable issues.

Summary

This PR adds shared GPU and CPU helpers for converting non-flat common-space positions into flat Mercator or Cartesian coordinates, plus reusable multi-view render-test presets.

  • Adds matching GLSL and WGSL flat-projection, wrapped-world, and continuous-world helpers.
  • Adds CPU projection, bounds, origin, and viewport-shape utilities for extensions.
  • Covers globe meter offsets, antimeridian bounds, high-zoom Mercator, and orthographic projection.
  • Adds map, globe, and orthographic render-test case expansion.
  • Documents the shader APIs and announces the new support in the v9.4 release notes.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Layer position] --> B[project_position]
  B --> C{Projection mode}
  C -->|Flat map or identity| D[Use common XY]
  C -->|Globe| E[Invert sphere XYZ to Mercator]
  D --> F{Requested behavior}
  E --> F
  F -->|Direct| G[Flat common position]
  F -->|Bounds lookup| H[Wrap X near bounds center]
  F -->|Periodic pattern| I[Wrap X near camera on globe]
  J[CPU layer position] --> K[projectToFlatCommon]
  K --> L[Matching flat common coordinates]
Loading

Reviews (9) · Last reviewed commit: "docs(extensions): shorten projection-uti..."

…t twin

Add project_common_position_to_flat_wrapped(position, referenceX) in GLSL
and WGSL. The flat inverse of the globe projection has a seam at the
antimeridian where x jumps by a world width; moving vertices to within
half a world of a reference (a bounds centre, or the camera) keeps
geometry that spans 180 degrees continuous.

projectToFlatCommon now mirrors the GLOBE + METER_OFFSETS shader branch
exactly (ENU displacement on the sphere, then the sphere's inverse),
instead of going through lng/lat, which diverges quadratically with the
offset. projectBoundsToFlatCommon unwraps lng/lat bounds whose left edge
is east of their right edge so they can describe a region across the
antimeridian.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
@chrisgervang
chrisgervang force-pushed the claude/globe-flat-common-helpers-GveWO branch from a8649cc to 5539059 Compare September 20, 2026 21:40
project_common_position_to_flat_wrapped now moves x to the world copy
nearest the reference in every geospatial projection mode, matching the
CPU helper that unwraps antimeridian bounds on flat maps too. The
globe-only behaviour needed by periodic patterns, which must not jump at
world boundaries on a flat map, becomes
project_common_position_to_flat_continuous.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
Treat bounds as crossing when the left edge is more than 180 degrees east
of the right edge (the shorter arc is the one meant). Edges closer than
that in the wrong order are re-ordered as before, so reversed bounds keep
working.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
Comment thread docs/api-reference/core/project.md Resolved

@felixpalmer felixpalmer 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.

I'm supportive of the general idea of this PR, but worry that we might hit precision issues. It's nice that these new functions are purely additive, so safe to add - but the followup PRs might break things, especially on some GPUs which we haven't tested on


// Inverse of project_globe_ followed by a Mercator projection: converts a position in
// globe common space (sphere XYZ) into absolute Mercator common space.
vec2 project_globe_to_mercator_(vec3 spherePos) {

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.

I think the math can be simplified here, already the fact that this converts using degrees() and project_mercator_ goes back using radians() smells off.

An AI suggestion (which I haven't verified):

 // ln(tan(PI/4 + radians(89.9)/2)) — matches project_mercator_'s latitude clamp
  const float MAX_MERCATOR_Y_ = 7.0439589847;

  // Inverse of project_globe_ followed by a Mercator projection.
  // Mercator y is atanh(sin(lat)), which has a cancellation-free closed form directly
  from the
  // sphere position, so latitude is never formed: asin's conditioning degrades as
  1/cos(lat)
  // (~100 m of error at 89.9 vs ~1 mm here). abs(z) keeps D + |z| away from cancellation
  near
  // the south pole; the sign puts it back.
  vec2 project_globe_to_mercator_(vec3 spherePos) {
    float h = max(length(spherePos.xy), 1e-20);
    float D = length(spherePos);
    float y = sign(spherePos.z) * min(log((D + abs(spherePos.z)) / h), MAX_MERCATOR_Y_);
    // project_mercator_'s wrapLongitude branch is a no-op here: atan already returns
  (-PI, PI]
    float x = atan(spherePos.x, -spherePos.y);
    return (vec2(x, y) + PI) * WORLD_SCALE;
  }

return referenceX + t - TILE_SIZE * floor(t / TILE_SIZE) - TILE_SIZE * 0.5;
}

//

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.

These comments are much longer than what is normal for this file

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'll take another pass


// Moves a flat Mercator x to the world copy nearest to referenceX (within half a world width)
float project_wrap_flat_x_(float x, float referenceX) {
float t = x - referenceX + TILE_SIZE * 0.5;

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.

Simpler?

 return x - TILE_SIZE * floor((x - referenceX) / TILE_SIZE + 0.5);

onAfterUpdate: ({layer}) => {
// The layer's own projection is sphere XYZ (radius GLOBE_RADIUS = 256)...
const sphere = layer.projectPosition(POSITION);
expect(Math.hypot(sphere[0], sphere[1], sphere[2])).toBeCloseTo(256, 3);

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.

3 is an exceptional large tolerance, would expect more like 12. Same below

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Great catch, thanks for taking a close look at this. Your suggested formula is looking much better

… comments

Compute Mercator y directly from the sphere position as
log((D + |z|) / |xy|), which equals atanh(sin(lat)) and avoids forming
the latitude with asin, whose conditioning degrades near the poles.
Simplify the world-copy wrap to a single floor and trim the helper
comments to the length used elsewhere in the module. Unit test
tolerances tightened to 12 digits.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
@chrisgervang
chrisgervang merged commit ba16261 into master Sep 25, 2026
8 checks passed
@chrisgervang

Copy link
Copy Markdown
Collaborator Author

but the followup PRs might break things, especially on some GPUs which we haven't tested on

Thanks! Yeah, are there situations where you can remember we've been bitten in the past?

I have a Mac, Nvidia Windows, and an iPhone - in addition to the Linux render tests..

I'm curious how I might uncover surprises

@chrisgervang chrisgervang added this to the v9.4 patch releases milestone Oct 4, 2026
@chrisgervang chrisgervang mentioned this pull request Oct 7, 2026
53 of 66 tasks
chrisgervang added a commit that referenced this pull request Oct 22, 2026
…x render tests (#10657)

* feat(core): add project_common_position_to_flat to the project shader module

Texture- and bounds-based extensions (mask, clip, fill patterns, terrain)
index a FLAT common space: Web Mercator for geospatial views, cartesian for
OrthographicView. Under GlobeView geometry.position is sphere XYZ, so every
such extension currently needs its own PROJECTION_MODE_GLOBE branch (terrain
has one; mask needs one) or is simply broken (clip, fill-style, brushing).

Add two projection-generic functions next to project_globe_():

- project_globe_to_mercator_(vec3): the inverse of project_globe_ followed by
  project_mercator_, i.e. sphere XYZ -> absolute Mercator common space.
- project_common_position_to_flat(vec3|vec4): common space -> flat common
  space. Identity for flat projection modes (so offset-relative positions
  under WEB_MERCATOR_AUTO_OFFSET pass through unchanged); inverts the sphere
  under GLOBE. This is the single GPU switch point: a future non-flat
  projection mode is inverted here, next to the forward branch in
  project_position(), and no extension needs to change.

Document the new function in docs/api-reference/core/project.md.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* feat(core): WGSL parity for project_globe_to_mercator_ / project_common_position_to_flat

project.glsl.ts and project.wgsl.ts are kept in lockstep everywhere else;
mirror the two new functions so WebGPU ports of the extensions have the same
entry point. No WGSL consumer yet (mask/clip/fill-style have no WGSL path).
WGSL has no overloading, so only the vec3 form is provided.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* feat(extensions): flat common-space CPU helpers for non-flat viewports

CPU twins of project_common_position_to_flat() in projection-utils.ts:

- isFlatViewport(viewport): the single place in @deck.gl/extensions that
  tests for GlobeViewport (instanceof _GlobeViewport; swap for a projection
  mode comparison if core ever exports one).
- projectToFlatCommon(layer, position, opts) /
  projectBoundsToFlatCommon(layer, bounds, opts): Layer.projectPosition with
  autoOffset on flat viewports (matches offset-relative geometry.position at
  zoom >= 12), absolute Mercator through the existing reference viewport on
  non-flat ones. Routing through Layer.projectPosition keeps coordinate
  systems, coordinateOrigin and modelMatrix handling identical to the GPU.
- getFlatCommonOrigin(uniforms, viewport): project.commonOrigin on flat
  viewports, [0, 0] under globe where the flat space is absolute (for globe +
  meter-offsets commonOrigin is a sphere position and must not be re-added).
- getRenderBounds() returns the full layer extent for non-flat viewports:
  getViewportBounds() would yield sphere coordinates there, which cannot be
  intersected with Mercator layer bounds. No behaviour change for shipped
  extensions: MaskEffect bails out under globe today and terrain guards the
  call with its own instanceof check.

Existing helpers (getMercatorReferenceViewport, lngLatToMercatorCommon,
joinLayerBounds, makeViewport) are unchanged. Unit spec pins the GPU/CPU
pairing invariant on WebMercator (zoom 11.5 and 14), Globe and Orthographic
viewports.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* test(render): add view-matrix helper for rendering a case under multiple views

No extension render test runs under GlobeView today, and only fill/path
cases run under OrthographicView. test/render/view-presets.ts expands one
case into one TestCase per view preset so the same layers and extension are
rendered under MapView, GlobeView and OrthographicView:

- presets share the San Francisco view used by existing goldens; the globe
  preset uses the same lng/lat/zoom (GlobeViewport is calibrated to converge
  with Mercator), the orthographic preset is the pixel space of the map
  preset (toPosition/toBounds map lng/lat data into it).
- the 'map' preset keeps the bare name and golden so existing goldens are
  reused; other presets append -globe / -orthographic.
- a load-time guard rejects globe cases above zoom 12, where GlobeView
  silently hands off to WebMercatorViewport.
- per-preset overrides (skip is merged, other fields replace) and a
  geospatial viewState override let specs keep goldens that use other views.

Covered by a unit spec in the render project; adopted by extension specs in
follow-up PRs.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* test(render): type view preset toPosition as a 2-tuple

Consumers pass toPosition() straight into getPosition accessors, which
expect a Position tuple; returning number[] forced a cast at every call
site. Return [number, number] from every preset instead.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* feat(core, extensions): wrapped flat projection and exact meter-offset twin

Add project_common_position_to_flat_wrapped(position, referenceX) in GLSL
and WGSL. The flat inverse of the globe projection has a seam at the
antimeridian where x jumps by a world width; moving vertices to within
half a world of a reference (a bounds centre, or the camera) keeps
geometry that spans 180 degrees continuous.

projectToFlatCommon now mirrors the GLOBE + METER_OFFSETS shader branch
exactly (ENU displacement on the sphere, then the sphere's inverse),
instead of going through lng/lat, which diverges quadratically with the
offset. projectBoundsToFlatCommon unwraps lng/lat bounds whose left edge
is east of their right edge so they can describe a region across the
antimeridian.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* feat(core): separate wrapped and continuous flat projection helpers

project_common_position_to_flat_wrapped now moves x to the world copy
nearest the reference in every geospatial projection mode, matching the
CPU helper that unwraps antimeridian bounds on flat maps too. The
globe-only behaviour needed by periodic patterns, which must not jump at
world boundaries on a flat map, becomes
project_common_position_to_flat_continuous.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* fix(extensions): only unwrap lng/lat bounds that cross the antimeridian

Treat bounds as crossing when the left edge is more than 180 degrees east
of the right edge (the shorter arc is the one meant). Edges closer than
that in the wrong order are re-ordered as before, so reversed bounds keep
working.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* docs: note the flat common-space project shader helpers in what's new

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* refactor(core): closed-form globe to Mercator inverse, shorter shader comments

Compute Mercator y directly from the sphere position as
log((D + |z|) / |xy|), which equals atanh(sin(lat)) and avoids forming
the latitude with asin, whose conditioning degrades near the poles.
Simplify the world-copy wrap to a single floor and trim the helper
comments to the length used elsewhere in the module. Unit test
tolerances tightened to 12 digits.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

* docs(extensions): shorten projection-utils comments to house style

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9

---------

Co-authored-by: Claude <[email protected]>
(cherry picked from commit ba16261)
@chrisgervang

Copy link
Copy Markdown
Collaborator Author

Released in deck.gl 9.4.1.

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.

4 participants