Course recordings on DaDesktop for Training platform
Visit NobleProg websites for related course
Visit outline: Getting Started with Apache Superset (Course code: superset)
Categories: Apache Superset
Summary
Overview
This session is a hands-on technical training on Apache Superset, focusing on public dashboard sharing, geographic data visualization (using Country Map and Deck.gl), feature flags for user permissions, and data integration workflows. The trainer demonstrates how to configure public access via feature flags and e-frames, share dashboards with pre-filtered states using permalinks, and integrate geographic datasets (CSV, GeoJSON) for choropleth and point-based visualizations. The discussion includes practical challenges with high-resolution GeoJSON, performance optimization, Mapbox integration, and internal vs. external communication strategies. Participants explore use cases for internal reporting and public-facing dashboards, with emphasis on granular permission control and data layering.
Topic (Timeline)
1. Public Dashboard Access & Feature Flags [00:00:23 - 00:06:40]
- Demonstrated public access to a Superset dashboard without authentication by enabling the
public_role_likefeature flag and setting it togamma. - Explained that the
gammarole grants read-only access, equivalent to a public user, and must be explicitly assigned to a dashboard. - Clarified that feature flags are global configuration toggles (e.g.,
ENABLE_PUBLIC_ROLE_LIKE) in Superset’s config, not per-dashboard settings. - Emphasized that public access requires two steps: enabling the feature flag and granting the public/gamma role explicit read access to the target dashboard.
- Noted that the public URL remains identical whether the user is logged in or not, enabling seamless sharing.
2. Permalinks and Filtered Dashboard Sharing [00:06:40 - 00:12:18]
- Demonstrated use of permalinks to share dashboards with embedded filter states (e.g., filtered to APAC and Japan).
- Showed how to generate a permalink via the “three dots” menu → “Copy Permalink,” which encodes current filter values into the URL.
- Confirmed that public users can interact with and modify filters on shared permalinks, even without authentication.
- Highlighted that permalinks are useful for sharing specific analytical views without requiring login or manual filter reapplication.
3. Geographic Visualizations: Country Map and GeoJSON [00:12:18 - 00:26:05]
- Explored Superset’s Country Map visualization, supporting France (departments and regions) via built-in GeoJSON.
- Discussed challenges with high-resolution GeoJSON (e.g., 35,000+ communes), which cause performance issues due to large file sizes and front-end rendering load.
- Advised simplifying GeoJSON geometries (e.g., reducing vertex density by sampling every 2nd/3rd point) to improve performance.
- Explained that Superset requires GeoJSON files to be added to the
superset-frontendcodebase underplugins/legacy-plugin-chart-country-map, with entries inCountries.tsand the corresponding GeoJSON file. - Noted that data must be joined to GeoJSON using standardized identifiers (e.g.,
FR-01for French departments), requiring a reference table or data transformation.
4. Data Integration: CSV and Google Sheets [00:26:05 - 00:30:20]
- Demonstrated importing point data via CSV (latitude/longitude) from Google Sheets into Superset as a dataset.
- Showed how to map columns to geographic coordinates during dataset creation, even with non-standard column names.
- Highlighted that Superset supports CSV import via Google Sheets connection, but requires proper sharing permissions and correct encoding (UTF-8, comma/semicolon delimiters).
- Noted that GeoJSON data can be imported if embedded in a CSV column, but CSV with explicit lat/long is preferred for simplicity.
- Confirmed that data from external sources (e.g., IGN, NOAA) can be converted to CSV and used for point or heatmap visualizations.
5. Advanced Visualization: Deck.gl and Mapbox Integration [00:30:20 - 00:41:13]
- Introduced Deck.gl for advanced geospatial visualizations: scatterplot, heatmap, hexbin, and arc plots.
- Demonstrated using Deck.gl to render point data (e.g., oil wells in France) with color encoding by categorical fields (e.g., acquisition method).
- Showed how to enable Mapbox as a basemap by adding a Mapbox API key in Superset’s configuration (via terminal), enabling satellite, terrain, and custom map styles.
- Noted that Mapbox is optional for internal use (under 200K monthly requests) but may incur costs for public-facing dashboards.
- Clarified that Deck.gl does not render base maps; it relies on external providers (e.g., Mapbox) for background cartography.
6. Dashboard Layout and Custom Elements [00:41:13 - 00:49:28]
- Demonstrated dashboard editing mode: adding text blocks via Markdown, HTML, or emoji using the “Layout Elements” panel.
- Showed how to embed custom images (e.g., icons) using HTML
<img>tags, with images stored in Superset’s frontend static assets (requires terminal access). - Explained layout controls: drag-and-drop chart placement, column/row organization, resizing, and alignment for custom dashboard design.
- Noted that Markdown supports rich formatting, including links, bold, lists, and inline HTML, enabling contextual annotations.
7. GeoJSON Layering and Limitations [00:41:13 - 00:43:33]
- Explored whether Country Map and Deck.gl points can be overlaid (e.g., French departments + oil well points).
- Confirmed that Superset does not natively support layering multiple geographic visualizations (e.g., choropleth + scatter) in a single chart.
- Suggested workarounds: use separate charts or rely on Deck.gl’s ability to render both polygons and points if GeoJSON contains both geometry types.
8. Practical Exercises and Next Steps [00:49:28 - 01:51:06]
- Provided a set of small, focused exercises for participants to practice: creating public dashboards, using permalinks, importing CSV from Google Sheets, and testing Deck.gl visualizations.
- Recommended internal testing environments with write access to datasets for experimentation.
- Advised using simplified GeoJSON for performance and validating coordinate systems (lat/long order).
- Concluded with a break and scheduled follow-up session at 13:00 to continue exploration and address unresolved questions.
Appendix
Key Principles
- Public Access: Enabled via
ENABLE_PUBLIC_ROLE_LIKEfeature flag + assigninggammarole to dashboard. - Permalinks: Encode filter states into URLs for shareable, pre-filtered views.
- GeoJSON Performance: High-detail geometries (>100K vertices) degrade performance; simplify using QGIS or sampling.
- Data Joining: Superset requires standardized geographic keys (e.g.,
FR-01) to link data to map boundaries. - Deck.gl: Best for complex spatial data (points, hexbins, arcs); requires Mapbox API key for custom basemaps.
- Layout Flexibility: Use Markdown and HTML in layout elements to add text, images, and custom styling.
Tools Used
- Apache Superset: Core platform for dashboards and visualizations.
- Google Sheets: Source for CSV data import via public link.
- QGIS: Recommended for simplifying GeoJSON geometries.
- Mapbox: Optional basemap provider (requires API key).
- Docker: Used to run Superset locally; codebase edits require Docker rebuild.
Common Pitfalls
- Incorrect lat/long order in CSV (e.g., lat/long swapped → points appear in Somalia).
- Large GeoJSON files causing browser crashes or slow rendering.
- Missing
gammarole assignment to dashboard despite enabling public flag. - Google Sheets sharing permissions not set to “Anyone with link can view.”
- Mapbox API key not configured in Superset config → blank basemap.
Practice Suggestions
- Create a public dashboard with a permalink containing a region filter.
- Import a CSV of 10–20 point locations (e.g., cities) from Google Sheets and render as a scatterplot.
- Simplify a French commune GeoJSON file to 10% of its original points and test performance.
- Add a custom image (e.g., logo) to a dashboard using HTML in a Markdown block.
- Configure a Mapbox API key and apply a satellite basemap to a Deck.gl heatmap.