Superset Legacy Chart plugin providing parallel coordinates visualization for multi-dimensional data analysis
—
The core visualization components that render the parallel coordinates chart using React and D3.js. This includes both the React wrapper component and the underlying D3-based visualization function.
Styled React component that wraps the D3 visualization with Superset theming and responsive design.
/**
* React component for parallel coordinates visualization with styling
* @param props - Component props including data and configuration
* @returns JSX element with styled parallel coordinates chart
*/
function ParallelCoordinates(props: ParallelCoordinatesProps): JSX.Element;
interface ParallelCoordinatesProps {
/** CSS class name for styling (required) */
className: string;
/** Array of data objects with metric values */
data: Array<Record<string, any>>;
/** Chart width in pixels */
width: number;
/** Chart height in pixels */
height: number;
/** Field name for color mapping (optional) */
colorMetric?: string;
/** Whether to include series as an axis */
includeSeries: boolean;
/** Color scheme name for gradient coloring */
linearColorScheme: string;
/** Array of metric field names to display as axes */
metrics: string[];
/** Series field name */
series?: string;
/** Whether to display interactive data table */
showDatatable: boolean;
}Usage Examples:
import ParallelCoordinates from '@superset-ui/legacy-plugin-chart-parallel-coordinates';
// Basic usage
<ParallelCoordinates
className="my-chart"
data={[
{ metric1: 10, metric2: 20, metric3: 30, category: 'A' },
{ metric1: 15, metric2: 25, metric3: 35, category: 'B' }
]}
width={800}
height={400}
metrics={['metric1', 'metric2', 'metric3']}
includeSeries={false}
linearColorScheme="viridis"
showDatatable={false}
/>
// With color mapping and data table
<ParallelCoordinates
className="my-chart"
data={data}
width={800}
height={600}
metrics={['sales', 'profit', 'customers']}
colorMetric="profit"
series="region"
includeSeries={true}
linearColorScheme="plasma"
showDatatable={true}
/>The underlying D3-based function that handles the actual rendering and interaction logic.
/**
* Core D3-based parallel coordinates visualization function
* @param element - DOM element to render the chart into
* @param props - Visualization configuration and data
*/
function ParallelCoordinates(element: HTMLElement, props: VisualizationProps): void;
interface VisualizationProps {
/** Array of data objects with metric values */
data: Array<Record<string, any>>;
/** Chart width in pixels */
width: number;
/** Chart height in pixels */
height: number;
/** Field name for color mapping (optional) */
colorMetric?: string;
/** Whether to include series as an axis */
includeSeries: boolean;
/** Color scheme name for gradient coloring */
linearColorScheme: string;
/** Array of metric field names to display as axes */
metrics: string[];
/** Series field name */
series?: string;
/** Whether to display interactive data table */
showDatatable: boolean;
}The chart provides several interactive features:
Axis Reordering:
Brushing and Filtering:
Data Table Integration:
Line Rendering:
Axes and Labels:
/**
* Data processing and type inference
*/
interface DataProcessing {
/** Column selection based on includeSeries option */
columns: string[];
/** Type mapping for each column */
types: Record<string, 'string' | 'number'>;
/** Color scale function */
colorScale: (value: any) => string;
}Type Inference:
Color Mapping:
Chart Dimensions:
showDatatable is true: chart height = total height / 2Canvas Layers:
The component handles several edge cases:
Install with Tessl CLI
npx tessl i tessl/npm-superset-ui--legacy-plugin-chart-parallel-coordinates