Apache Superset is an open-source BI platform: it connects to the database, runs the query and shows it in a chart or a dashboard. The superset-plugin-chart-silverpoint package adds 56 visualization types to its gallery, one per chart a table can feed: Silverpoint Bar chart, Silverpoint Sankey chart, and so on.

The division of labour is clear. Superset queries, aggregates, filters and sorts; silverpoint draws, with @silverpoint/react 0.11.1 and the specFromTable function of @silverpoint/embed 0.11.1, which we saw in article 30.

Hatched bar chart of the sum of wins per team, sorted from highest to lowest, as Silverpoint Bar chart draws it in Superset

Requirements

Requirement
SupersetThe master branch (React 18.3), that is, the release after 6.1. Versions 6.0 and 6.1 ship React 17 and are not supported
Peer dependencies@superset-ui/core, @superset-ui/chart-controls, react and react-dom ^18.3.0

Install the plugin

From Superset's frontend:

cd superset-frontend
npm install superset-plugin-chart-silverpoint

Register the preset next to Superset's own:

// src/visualizations/presets/MainPreset.ts (MainPreset.js before Superset master)
import { SilverpointChartPreset } from 'superset-plugin-chart-silverpoint';

export default class MainPreset extends Preset {
  constructor() {
    super({
      name: 'Legacy charts',
      presets: [
        new SilverpointChartPreset(),
        // or a subset:
        // new SilverpointChartPreset({ charts: ['bar-chart', 'line-chart', 'sankey-chart'] }),
      ],
      plugins: [ /* … Superset's own … */ ],
    });
  }
}

And rebuild the frontend:

npm run build
# Superset master's .npmrc sets min-release-age=3: for three days after a silverpoint
# release npm answers ETARGET for @silverpoint/*. Wait, or:
npm install superset-plugin-chart-silverpoint --min-release-age=0
# in the image: docker build --build-arg NPM_MIN_RELEASE_AGE=0 …

Mind the comment in the block above: the .npmrc of Superset's master branch requires a package to have been published for at least three days. For those three days after a silverpoint release, npm answers ETARGET for @silverpoint/*. Either wait, or install with --min-release-age=0.

The package imports the library's stylesheet and EB Garamond itself, each chart has a light and a dark thumbnail, and Superset's webpack configuration needs no change. If you would rather not build by hand, the repository has docker/Dockerfile, which builds a Superset image with the plugins registered, and docker/compose.yml, which runs it with the examples loaded.

Each chart

PanelWhat it holds
QueryOne control per role: a dimension role takes a column, a measure role takes a metric and a temporal role adds a time grain. Plus the filters, the row limit and the sort order
OptionsThe chart's own options (curve, orientation…) and the title
AppearanceGround, substrate, mode and palette. Theme default follows Superset's light or dark theme

The panels were not written by hand: they are generated from the host catalog, so each chart asks for exactly the roles and options it has.

Example: wins per team

For a bar chart with each team's wins:

  1. Pick Silverpoint Bar chart in the gallery.
  2. In X, the column team.
  3. In Value, the metric SUM(wins).
  4. Sort by the metric, descending.

Superset aggregates, filters and sorts; the plugin binds the result with specFromTable and draws it.

Three things worth knowing:

  • If a column or metric is missing, Superset shows its chart error with the reason.
  • Under forced colours or the system's increase contrast, every chart draws in precision mode, whatever the panel says.
  • It does not emit cross-filters yet.

Why not a .supx?

Superset has a new extensions system (.supx files), but an extension cannot contribute a chart type: it only sees @apache-superset/core, which has no chart registry. That is why the classic plugin is, for now, the only path.

Next