CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-superset-ui--legacy-plugin-chart-heatmap

Apache Superset legacy heatmap chart plugin providing D3.js-based visualization for correlation matrices and data density patterns.

Pending
Overview
Eval results
Files

plugin-registration.mddocs/

Plugin Registration

The main plugin class that integrates the heatmap chart with Apache Superset's chart framework.

Capabilities

HeatmapChartPlugin Class

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();

Chart Metadata

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:

  • Category: t('Correlation') - Localized 'Correlation' category
  • Name: t('Heatmap') - Localized 'Heatmap' display name
  • Tags: [t('Business'), t('Intensity'), t('Legacy'), t('Density'), t('Predictive'), t('Single Metric')]
  • Credits: ['http://bl.ocks.org/mbostock/3074470'] - Attribution to original D3 example
  • Description: Localized text explaining correlation visualization use cases
  • Example Gallery: Three examples with captions:
    • Transportation (sizes of vehicles)
    • Channels (relationships between community channels)
    • Employment (employment and education)
  • Thumbnail: Static PNG thumbnail image
  • Legacy API: useLegacyApi: true for backward compatibility

Plugin Constructor Configuration

The constructor automatically sets up the plugin with required components:

  • Chart Loader: () => import('./ReactHeatmap') - Dynamic import for code splitting
  • Metadata: ChartMetadata instance with category, gallery, and localization
  • Transform Props: transformProps function mapping FormData to component props
  • Control Panel: Complete configuration with query and heatmap option sections
// 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

docs

chart-configuration.md

heatmap-visualization.md

index.md

plugin-registration.md

tile.json