Apache Superset legacy heatmap chart plugin providing D3.js-based visualization for correlation matrices and data density patterns.
—
The main plugin class that integrates the heatmap chart with Apache Superset's chart framework.
Extends Superset's ChartPlugin to provide heatmap visualization functionality.
/**
* Main plugin class for registering heatmap chart with Superset
* Extends ChartPlugin from @superset-ui/core
*/
class HeatmapChartPlugin extends ChartPlugin {
/**
* Creates a new heatmap chart plugin instance
* Sets up metadata, transform function, control panel, and chart loader
*/
constructor();
/**
* Configures the plugin with options
* @param options - Configuration object containing the chart key
* @param options.key - Unique identifier for the chart type
* @returns The plugin instance for method chaining
*/
configure(options: { key: string }): HeatmapChartPlugin;
/**
* Registers the plugin with Superset's chart registry
* Makes the chart available for use in dashboards and explore view
*/
register(): void;
}Usage Example:
import HeatmapChartPlugin from '@superset-ui/legacy-plugin-chart-heatmap';
// Create and register the plugin
const heatmapPlugin = new HeatmapChartPlugin();
heatmapPlugin.configure({ key: 'heatmap' }).register();
// Alternative one-liner
new HeatmapChartPlugin().configure({ key: 'heatmap' }).register();Metadata configuration that defines the chart's properties and gallery examples.
interface ChartMetadata {
/** Category for chart organization in UI */
category: string;
/** Credits/attribution for chart inspiration */
credits: string[];
/** Description text shown in chart selection */
description: string;
/** Example gallery images with captions */
exampleGallery: Array<{
url: string;
caption: string;
}>;
/** Display name for the chart */
name: string;
/** Tags for chart categorization and search */
tags: string[];
/** Thumbnail image for chart selection */
thumbnail: string;
/** Whether to use legacy API format */
useLegacyApi: boolean;
}The metadata includes:
t('Correlation') - Localized 'Correlation' categoryt('Heatmap') - Localized 'Heatmap' display name[t('Business'), t('Intensity'), t('Legacy'), t('Density'), t('Predictive'), t('Single Metric')]['http://bl.ocks.org/mbostock/3074470'] - Attribution to original D3 exampleuseLegacyApi: true for backward compatibilityThe constructor automatically sets up the plugin with required components:
() => import('./ReactHeatmap') - Dynamic import for code splittingChartMetadata instance with category, gallery, and localizationtransformProps function mapping FormData to component props// Internal constructor setup (not directly callable)
super({
loadChart: () => import('./ReactHeatmap'),
metadata: new ChartMetadata({
category: t('Correlation'),
credits: ['http://bl.ocks.org/mbostock/3074470'],
description: t('Visualize a related metric across pairs of groups...'),
exampleGallery: [
{ url: transportation, caption: t('Sizes of vehicles') },
{ url: channels, caption: t('Relationships between community channels') },
{ url: employment, caption: t('Employment and education') }
],
name: t('Heatmap'),
tags: [t('Business'), t('Intensity'), t('Legacy'), t('Density'), t('Predictive'), t('Single Metric')],
thumbnail,
useLegacyApi: true
}),
transformProps,
controlPanel
});Install with Tessl CLI
npx tessl i tessl/npm-superset-ui--legacy-plugin-chart-heatmap