Skip to content

Conversation

@JoshuaJADaniel
Copy link

@JoshuaJADaniel JoshuaJADaniel commented Nov 20, 2025

SUMMARY

The deck.gl Geojson visualization allows users to visualize point, line, and polygon geometries on maps using the GeoJSON specification. Currently, users can only render points as circles, however, deck.gl's GeoJsonLayer supports rendering points as circles, icons, and/or text according to the GeoJsonLayer documentation.

This pull request extends the existing functionality, allowing users to additionally render points as labels and/or icons.

Approach

To support both basic and advanced use cases, we implemented two configuration flows for adding labels and/or icons:

  • "Basic" flow: This is the common case where users just want to show labels and/or icons with little customization. The user can customize the labels and/or icons using only UI controls.
  • "Advanced" flow: This is the niche case where users need more per-point customization and/or would like to set options not exposed in the basic flow. The user does this by typing in a JavaScript function that returns a configuration object aligned with deck.gl's documentation.

Rationale

deck.gl's GeoJsonLayer supports many options for labels and icons, but exposing all of them in the UI would lead to a cluttered experience. The approach taken here avoids cluttering the UI while flexibly supporting both basic and advanced use cases.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Text/Label Support Demo

text-feature.mp4

Icon Support Demo

icon-feature.mp4

TESTING INSTRUCTIONS

  1. Create a GeoJSON dataset.

    Click here for the sample dataset from the demo


    You can use this query to create a dataset in Superset using the SQL Lab interface:

    SELECT '{
      "type": "FeatureCollection",
      "name": "Top 10 Most Populous US States (2024 Estimates)",
      "features": [
        {
          "type": "Feature",
          "geometry": {
            "type": "Point",
            "coordinates": [-121.468926, 38.555605]
          },
          "properties": {
            "longName": "California",
            "shortName": "CA"
          }
        },
        {
          "type": "Feature",
          "geometry": {
            "type": "Point",
            "coordinates": [-97.7431, 30.2672]
          },
          "properties": {
            "longName": "Texas",
            "shortName": "TX"
          }
        },
        {
          "type": "Feature",
          "geometry": {
            "type": "Point",
            "coordinates": [-84.27277, 30.4518]
          },
          "properties": {
            "longName": "Florida",
            "shortName": "FL"
          }
        },
        {
          "type": "Feature",
          "geometry": {
            "type": "Point",
            "coordinates": [-73.781339, 42.659829]
          },
          "properties": {
            "longName": "New York",
            "shortName": "NY"
          }
        },
        {
          "type": "Feature",
          "geometry": {
            "type": "Point",
            "coordinates": [-76.875613, 40.269789]
          },
          "properties": {
            "longName": "Pennsylvania",
            "shortName": "PA"
          }
        },
        {
          "type": "Feature",
          "geometry": {
            "type": "Point",
            "coordinates": [-89.650373, 39.78325]
          },
          "properties": {
            "longName": "Illinois",
            "shortName": "IL"
          }
        },
        {
          "type": "Feature",
          "geometry": {
            "type": "Point",
            "coordinates": [-83.000647, 39.962245]
          },
          "properties": {
            "longName": "Ohio",
            "shortName": "OH"
          }
        },
        {
          "type": "Feature",
          "geometry": {
            "type": "Point",
            "coordinates": [-84.39, 33.76]
          },
          "properties": {
            "longName": "Georgia",
            "shortName": "GA"
          }
        },
        {
          "type": "Feature",
          "geometry": {
            "type": "Point",
            "coordinates": [-78.638, 35.771]
          },
          "properties": {
            "longName": "North Carolina",
            "shortName": "NC"
          }
        },
        {
          "type": "Feature",
          "geometry": {
            "type": "Point",
            "coordinates": [-84.5467, 42.7335]
          },
          "properties": {
            "longName": "Michigan",
            "shortName": "MI"
          }
        }
      ]
    }' as JSON
  2. Create a deck.gl Geojson chart/visualization using the dataset created in step 1.

  3. Under the Query section, fill the required GeoJson Column field (if using the sample dataset, select JSON).

  4. Under the GeoJson Settings section, configure label and/or icon settings as was shown in the demo videos.

Notes

  • For JavaScript mode, ensure that the ENABLE_JAVASCRIPT_CONTROLS feature flag is enabled.
  • For icons, image URLs must conform to your configured CSP settings. For the demo, I added https://static.thenounproject.com to the connect-src directive in the CSP found in superset/config.py. If you simply want to test icons without modifying the CSP, you can try this sample image URL (it is hosted on cartocdn, which is included in the default CSP).

ADDITIONAL INFORMATION

  • Has associated issue: Fixes Feature request: Support icons and/or text points in deck.gl GeoJSON chart #34621
  • Required feature flags: ENABLE_JAVASCRIPT_CONTROLS
  • 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

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Nov 20, 2025

Code Review Agent Run #b486f3

Actionable Suggestions - 0
Review Details
  • Files reviewed - 5 · Commit Range: f187f7a..c79c175
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/Geojson.test.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/Geojson.tsx
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/controlPanel.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/Shared_DeckGL.tsx
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/controls.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 Default Agent You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot bot added the viz:charts:deck.gl Related to deck.gl charts label Nov 20, 2025
@JoshuaJADaniel JoshuaJADaniel changed the title Feature/support icons and text in geojson chart feat(chart): support icons and text in the deck.gl Geojson visualization Nov 20, 2025
@SupersetOdT
Copy link

Waouw !! Great !! Congratulation !

+1 !!!

@sadpandajoe
Copy link
Member

@DamianPendrak mind taking a look since it's deck.gl

Copilot finished reviewing on behalf of sadpandajoe November 20, 2025 18:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds support for rendering GeoJSON points as text labels and/or icons in the deck.gl GeoJSON visualization. Previously, points could only be rendered as circles. The feature provides both a "basic" UI-driven configuration flow and an "advanced" JavaScript-driven flow for users who need more customization.

  • Adds label rendering with configurable property name, color, size, and units
  • Adds icon rendering with configurable URL, size, and units
  • Provides JavaScript mode for advanced per-point customization of labels and icons

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/controls.ts Adds BLACK_COLOR constant for default label color
superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/Shared_DeckGL.tsx Exports jsFunctionControl for use in GeoJSON control panel
superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/controlPanel.ts Adds UI controls for enabling and configuring labels and icons in both basic and JavaScript modes
superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/Geojson.tsx Implements label and icon rendering logic, including helper functions to compute options from form data or JavaScript output
superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/Geojson.test.ts Adds unit tests for the new helper functions that compute label and icon options

return [];
}

export const PRIMARY_COLOR = { r: 0, g: 122, b: 135, a: 1 };
Copy link
Member

Choose a reason for hiding this comment

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

@msyavuz @mistercrunch if anyone's keeping a punch list somewhere of themable things, this PRIMARY_COLOR setting could be a good one to match with the theme's primary color.

@rusackas rusackas added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Nov 25, 2025
@github-actions github-actions bot added 🎪 c79c175 🚦 building Environment c79c175 status: building 🎪 c79c175 📅 2025-11-25T22-59 Environment c79c175 created at 2025-11-25T22-59 🎪 c79c175 ⌛ 48h Environment c79c175 expires after 48h 🎪 c79c175 🤡 rusackas Environment c79c175 requested by rusackas and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Nov 25, 2025
@github-actions
Copy link
Contributor

🎪 Showtime is building environment on GHA for c79c175

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

This looks SO cool!

The only thing I'd like to request right now (to prevent XSS attacks) is to put the Javascript forms and the checkboxes to reveal them behind the ENABLE_JAVASCRIPT_CONTROLS feature flag by adding isFeatureEnabled(FeatureFlag.ENABLE_JAVASCRIPT_CONTROLS) where relevant. A lot of orgs have that flag turned off for (very good) safety reasons.

Otherwise, this is complete awesomeness!

description: t(
'The image URL of the icon to display for GeoJSON points. ' +
'Note that the image URL must conform to the content ' +
'security policy (CSP) in order to load correctly.',
Copy link
Member

Choose a reason for hiding this comment

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

Appreciate the CSP note! Very important :D

@github-actions github-actions bot added 🎪 c79c175 🚦 deploying Environment c79c175 status: deploying 🎪 c79c175 🚦 running Environment c79c175 status: running 🎪 🎯 c79c175 Active environment pointer - c79c175 is receiving traffic 🎪 c79c175 🌐 34.213.178.163:8080 Environment c79c175 URL: http://34.213.178.163:8080 (click to visit) and removed 🎪 c79c175 🚦 building Environment c79c175 status: building 🎪 c79c175 🚦 deploying Environment c79c175 status: deploying 🎪 c79c175 🚦 running Environment c79c175 status: running 🎪 🎯 c79c175 Active environment pointer - c79c175 is receiving traffic labels Nov 25, 2025
@github-actions
Copy link
Contributor

🎪 Showtime deployed environment on GHA for c79c175

Environment: http://34.213.178.163:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@JoshuaJADaniel JoshuaJADaniel force-pushed the feature/support-icons-and-text-in-geojson-chart branch from d8c00e8 to c79c175 Compare November 26, 2025 06:46
@JoshuaJADaniel
Copy link
Author

This looks SO cool!

The only thing I'd like to request right now (to prevent XSS attacks) is to put the Javascript forms and the checkboxes to reveal them behind the ENABLE_JAVASCRIPT_CONTROLS feature flag by adding isFeatureEnabled(FeatureFlag.ENABLE_JAVASCRIPT_CONTROLS) where relevant. A lot of orgs have that flag turned off for (very good) safety reasons.

Otherwise, this is complete awesomeness!

@rusackas Thank you, and valid security concern! I made this change in 740b3c2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎪 c79c175 🚦 running Environment c79c175 status: running 🎪 c79c175 🤡 rusackas Environment c79c175 requested by rusackas 🎪 c79c175 🌐 34.213.178.163:8080 Environment c79c175 URL: http://34.213.178.163:8080 (click to visit) 🎪 c79c175 ⌛ 48h Environment c79c175 expires after 48h 🎪 c79c175 📅 2025-11-25T22-59 Environment c79c175 created at 2025-11-25T22-59 plugins 🎪 🔒 showtime-blocked size/XL viz:charts:deck.gl Related to deck.gl charts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Support icons and/or text points in deck.gl GeoJSON chart

4 participants