richardfogaca opened a new pull request, #40100:
URL: https://github.com/apache/superset/pull/40100

   ### SUMMARY
   
   Fixes #39572.
   
   DeckGL Polygon previously treated every GeoJSON payload as if it were a 
single Polygon and selected coordinates[0]. That is the outer ring for a 
Polygon, but for a MultiPolygon it is only the first polygon part, so valid 
remaining parts were dropped before the layer rendered.
   
   This change keeps the fix at the existing Polygon transformProps conversion 
boundary and expands GeoJSON MultiPolygon geometry into one DeckGL Polygon 
feature per polygon part. Each emitted part keeps the source row 
metric/elevation/extra properties, so one MultiPolygon row renders completely 
without requiring duplicated dataset rows.
   
   Reviewer focus:
   - 
`superset-frontend/plugins/preset-chart-deckgl/src/layers/Polygon/transformProps.ts`
 for the JSON geometry normalization and per-part feature expansion.
   - 
`superset-frontend/plugins/preset-chart-deckgl/src/layers/Polygon/transformProps.test.ts`
 for the MultiPolygon regression coverage and adjacent conversion guarantees.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Screenshots not attached to this description; reproducible from the steps 
below.
   
   Live validation:
   - Runtime / environment: local Superset development stack from this repo's 
`docker-compose.yml`, with the standard `examples` data initialized.
   - Entry point / scenario: a single-row dataset whose boundary column is a 
GeoJSON `MultiPolygon` with two separated square parts 
(`[[[-10,0],[-5,0],[-5,5],[-10,5],[-10,0]]]` and 
`[[[5,0],[10,0],[10,5],[5,5],[5,0]]]`), surfaced through a DeckGL Polygon 
Explore chart with `line_type=json` against that boundary column. Configure 
`Metric` so the legend value is non-empty (the row metric in the probe was 
`100`).
   - Observed signal (before): the rendered map showed only the western polygon 
part; the eastern polygon part was missing despite being present in the same 
MultiPolygon row. Pixel-level component analysis on the chart canvas counted 
exactly 1 large filled polygon component.
   - Observed signal (after): the same chart on the same row rendered both 
separated polygon parts at their expected map positions, and the metric legend 
still showed the source row value (`100`) for both parts. Pixel-level component 
analysis counted 2 large filled polygon components of equal area, matching the 
two equal-sized squares in the fixture.
   - Pass / regression condition: the DeckGL Polygon canvas must render one 
filled polygon per polygon part of a GeoJSON `MultiPolygon` boundary value, and 
each rendered part must carry the source row's metric value. Regression would 
be either fewer rendered parts than the input MultiPolygon contains, or 
per-part metrics differing from the source row.
   
   ### TESTING INSTRUCTIONS
   
   - [x] `cd superset-frontend && npm run test -- 
plugins/preset-chart-deckgl/src/layers/Polygon/transformProps.test.ts` - 
verifies MultiPolygon expansion plus adjacent Polygon, nested geometry, invalid 
JSON, geohash/default, metric, and elevation behavior at the transform boundary.
   - [x] `cd superset-frontend && npx oxlint --config oxlint.json --quiet 
plugins/preset-chart-deckgl/src/layers/Polygon/transformProps.ts 
plugins/preset-chart-deckgl/src/layers/Polygon/transformProps.test.ts` - 
verifies lint coverage for the changed frontend files.
   - [x] `cd superset-frontend && npm run type` - verifies the TypeScript 
project typecheck.
   - [x] `pre-commit run --files 
superset-frontend/plugins/preset-chart-deckgl/src/layers/Polygon/transformProps.ts
 
superset-frontend/plugins/preset-chart-deckgl/src/layers/Polygon/transformProps.test.ts`
 - verifies repository pre-commit hooks for the changed files.
   - [x] Manual browser check in a local Superset development runtime: open a 
DeckGL Polygon chart configured with one GeoJSON MultiPolygon row containing 
two separated polygon parts; confirm both parts render and the metric legend 
still reflects the source row value.
   
   ### ADDITIONAL INFORMATION
   
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: Fixes #39572
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to