Skip to content

fix(deckgl): polygon chart not rendering when boundary column contains nested geometry JSON#38595

Merged
EnxDev merged 3 commits intomasterfrom
enxdev/fix/deck-gl-chart
Mar 13, 2026
Merged

fix(deckgl): polygon chart not rendering when boundary column contains nested geometry JSON#38595
EnxDev merged 3 commits intomasterfrom
enxdev/fix/deck-gl-chart

Conversation

@EnxDev
Copy link
Contributor

@EnxDev EnxDev commented Mar 12, 2026

User description

SUMMARY

The deck.gl Polygon chart was rendering a blank map when the polygon column contained JSON data with coordinates nested inside a geometry key.

The JSON parser only checked for top-level coordinates.
When the key was absent, the row was silently dropped, resulting in an empty features array and a blank map.
This affected the boundary_precipitation dataset where every row uses this format.

The fix adds a fallback to extract coordinates from parsed.geometry.coordinates when parsed.coordinates is not present.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

  • Before
Recording.2026-03-12.112449.mp4
  • After
Recording.2026-03-12.095311.mp4

TESTING INSTRUCTIONS

  1. Add a dataset where the polygon column contains JSON with a nested geometry key, e.g. {"type": "Polygon", "geometry": {"type": "Polygon", "coordinates": [...]}}
  2. Create a new deck.gl Polygon chart using that dataset
  3. Set Polygon Column to the column containing the JSON data, Polygon Encoding to JSON
  4. Add a numeric column as the metric
  5. Save and render the chart
  6. Verify that polygons are now visible on the map

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

CodeAnt-AI Description

Render polygon charts when boundary column contains nested or GeoJSON geometry

What Changed

  • Polygon charts now parse and render polygons when the boundary column contains GeoJSON Feature, GeoJSON Geometry, or JSON objects with a nested "geometry.coordinates" field instead of only top-level coordinates.
  • Rows with nested geometry are no longer dropped, preventing blank maps for datasets that use the nested format.
  • Added unit tests that verify rendering for GeoJSON Feature, GeoJSON Geometry, and nested-geometry JSON inputs.

Impact

✅ Fewer blank polygon maps for datasets with nested geometry JSON
✅ Polygon charts accept GeoJSON Feature/Geometry inputs
✅ Clearer test coverage for polygon input formats

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Mar 12, 2026

Code Review Agent Run #5a70b0

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 8a37dbf..8a37dbf
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/transformProps.test.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/transformProps.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot bot added plugins viz:charts:deck.gl Related to deck.gl charts labels Mar 12, 2026
@codeant-ai-for-open-source codeant-ai-for-open-source bot added the size:L This PR changes 100-499 lines, ignoring generated files label Mar 12, 2026
@codeant-ai-for-open-source
Copy link
Contributor

Sequence Diagram

This PR updates polygon data transformation to support boundary JSON where coordinates are nested under a geometry field. The fallback prevents rows from being dropped and allows deckgl polygon maps to render correctly for affected datasets.

sequenceDiagram
    participant User
    participant PolygonChart
    participant TransformProps
    participant BoundaryJSON
    participant DeckGL

    User->>PolygonChart: Open polygon chart
    PolygonChart->>TransformProps: Transform query rows into polygon features
    TransformProps->>BoundaryJSON: Parse boundary JSON

    alt Top level coordinates exist
        BoundaryJSON-->>TransformProps: Return coordinates
    else Nested geometry coordinates exist
        BoundaryJSON-->>TransformProps: Return geometry coordinates
    end

    TransformProps->>DeckGL: Build polygon features
    DeckGL-->>User: Render polygons on map
Loading

Generated by CodeAnt AI

@netlify
Copy link

netlify bot commented Mar 12, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 453dc00
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69b29838ccb29000089ca5a2
😎 Deploy Preview https://deploy-preview-38595--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@bito-code-review
Copy link
Contributor

The existing test in transformProps.test.ts has been modified in this PR to change the 'geom' data from a plain array to a GeoJSON Polygon object. This aligns with added support for GeoJSON formats, and two new tests were added for Feature and Geometry variants. No further modifications appear needed based on the diff.

@EnxDev EnxDev requested a review from msyavuz March 12, 2026 10:37
@github-actions
Copy link
Contributor

⚠️ DEPRECATED WORKFLOW ⚠️

@EnxDev This workflow is deprecated! Please use the new Superset Showtime system instead:

Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments

@github-actions
Copy link
Contributor

@EnxDev Ephemeral environment spinning up at http://34.215.30.164:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup.

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Mar 12, 2026

Code Review Agent Run #108ec9

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 8a37dbf..453dc00
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/transformProps.test.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@EnxDev EnxDev added hold:testing! On hold for testing and removed hold:testing! On hold for testing labels Mar 12, 2026
@EnxDev EnxDev merged commit 32a64d0 into master Mar 13, 2026
79 of 80 checks passed
@EnxDev EnxDev deleted the enxdev/fix/deck-gl-chart branch March 13, 2026 10:54
michael-s-molina pushed a commit that referenced this pull request Mar 17, 2026
…s nested geometry JSON (#38595)

(cherry picked from commit 32a64d0)
aminghadersohi pushed a commit to aminghadersohi/superset that referenced this pull request Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugins size/L size:L This PR changes 100-499 lines, ignoring generated files testenv-up viz:charts:deck.gl Related to deck.gl charts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants