React Semiconductors Dashboard

Creates a React Semiconductors Dashboard using SciChart.js. Use the FastRectangleRenderableSeries and its customTextureOptions property to create a custom tiling texture fill.

src/App.tsx
import "./styles.css";
import { useEffect, useState, useRef } from "react";
import { generateWaferLotData, WaferLotData, WaferDayData } from "./waferData";
import { SciChartReact, TResolvedReturnType } from "scichart-react";
import { drawLineChart } from "./lineChart";
import { drawColumnChart } from "./columnChart";
import { drawWaferGrid } from "./waferGrid";
import { drawParetoChart } from "./paretoChart";


import { SciChartSurface } from "scichart";

export default function Overview() {
    const [data, setData] = useState<WaferDayData[]>([]);
    const [selectedDay, setSelectedDay] = useState<WaferDayData | null>(null);
    const [showColumnChart, setShowColumnChart] = useState<boolean>(false);
    const columnChartRef = useRef<{
        sciChartSurface: SciChartSurface;
        updateData: (batchData: WaferLotData[], fireSelectionChanged: boolean) => void;
        updateSelection: (point: WaferLotData) => void;
    } | null>(null);
    const paretoChartRef = useRef<{
        sciChartSurface: SciChartSurface;
        updateData: (batchData: WaferLotData[], fireSelectionChanged: boolean) => void;
        updateSelection: (point: WaferLotData) => void;
    } | null>(null);
    const waferChartRef = useRef<{
        sciChartSurface: SciChartSurface;
        generateSubcharts: (selectedPoint: WaferLotData) => void;
    } | null>(null);

    useEffect(() => {
        const data = generateWaferLotData(15, 15, new Date(2023, 0, 1));
        setData(data);
        setSelectedDay(data[0]);
    }, []);

    const handleColumnChartInit = (chartInstance: TResolvedReturnType<typeof drawColumnChart>) => {
        columnChartRef.current = chartInstance;
    };

    const handleParetoChartInit = (chartInstance: any) => {
        paretoChartRef.current = chartInstance;
    };

    const handleWaferChartInit = (chartInstance: TResolvedReturnType<typeof drawWaferGrid>) => {
        waferChartRef.current = chartInstance;
    };

    // Handler for when a point is selected in the line chart
    const handlePointSelected = (point: WaferDayData) => {
        point.Batches[0].isSelected = true;
        // Update both charts since they are both always rendered
        columnChartRef.current?.updateData(point.Batches, showColumnChart);
        paretoChartRef.current?.updateData(point.Batches, !showColumnChart);
    };

    // Handler for when a point is selected in the column or pareto chart chart
    const handleBatchSelected = (point: WaferLotData, isColumnChart: boolean) => {
        if (isColumnChart) {
            paretoChartRef.current?.updateSelection(point);
        } else {
            columnChartRef.current?.updateSelection(point);
        }
        waferChartRef.current?.generateSubcharts(point);
    };

    // Custom init functions that pass data to chart drawing functions
    const initLineChart = async (rootElement: string | HTMLDivElement) => {
        return drawLineChart(rootElement, data, handlePointSelected);
    };

    const initColumnChart = async (rootElement: string | HTMLDivElement) => {
        return drawColumnChart(rootElement, data[0].Batches, handleBatchSelected);
    };

    const initParetoChart = async (rootElement: string | HTMLDivElement) => {
        return drawParetoChart(rootElement, data[0].Batches, handleBatchSelected);
    };

    const initWaferChart = async (rootElement: string | HTMLDivElement) => {
        if (selectedDay) {
            selectedDay.Batches[0].isSelected = true;
            return drawWaferGrid(rootElement, selectedDay.Batches[0]); // Pass selectedPoint which will be used to generate data
        }
        return null;
    };

    return data.length ? (
        <div className="sc-chart-wrapper sc-semiconductors-dashboard-container">
            <div className="sc-semiconductors-dashboard-layout">
                <div className="sc-semiconductors-line-chart-container">
                    <SciChartReact
                        initChart={initLineChart}
                        className="sc-semiconductors-sci-chart"
                    />
                </div>

                {/* Row for Column and Scatter Charts side by side */}
                <div className="sc-semiconductors-charts-row">
                    <div className="sc-semiconductors-column-chart-container">
                        <div className="sc-semiconductors-chart-header">
                            <div className="sc-button-group" role="group" aria-label="Batch chart type">
                                <button
                                    type="button"
                                    className="sc-button"
                                    aria-pressed={!showColumnChart}
                                    onClick={() => setShowColumnChart(false)}
                                >
                                    Pareto Chart
                                </button>
                                <button
                                    type="button"
                                    className="sc-button"
                                    aria-pressed={showColumnChart}
                                    onClick={() => setShowColumnChart(true)}
                                >
                                    Column Chart
                                </button>
                            </div>
                        </div>
                        <div className="sc-semiconductors-chart-wrapper">
                            <SciChartReact
                                key="columnChart"
                                initChart={initColumnChart}
                                className="sc-semiconductors-sci-chart"
                                onInit={handleColumnChartInit}
                                hidden={!showColumnChart}
                            />
                            <SciChartReact
                                key="paretoChart"
                                initChart={initParetoChart}
                                className="sc-semiconductors-sci-chart"
                                onInit={handleParetoChartInit}
                                hidden={showColumnChart}
                            />
                        </div>
                    </div>

                    {/* Scatter Chart or Wafer Chart based on selection */}
                    <div className="sc-semiconductors-scatter-wafer-container">
                        <SciChartReact
                            key="plotChart"
                            initChart={initWaferChart}
                            className="sc-semiconductors-sci-chart cursor-pointer"
                            onInit={handleWaferChartInit}
                        />
                    </div>
                </div>
            </div>
        </div>
    ) : null;
}

Semiconductors Dashboard Example - React

Overview

The Semiconductors Dashboard demonstrates a sophisticated semiconductor manufacturing quality control interface that enables users to analyze wafer production data across multiple dimensions and hierarchical levels.

Main Components

  • Yield Trend Chart (Top Panel): Line chart showing quality trends over time with clickable data points.

  • Batch Analysis (Bottom Left): Switchable view between Column Chart and Pareto Chart for batch-level analysis.

  • Wafer Maps (Bottom Right): Grid of 12 sub-charts displaying detailed wafer defect maps.

Primary Workflow

  • Click any point on the yield trend line chart to drill down into batch data for that specific day.

  • Toggle between Column Chart and Pareto Chart views using header buttons to analyze batch data differently.

  • Select individual batches from either chart view to examine corresponding wafer defect patterns.

  • All charts are synchronized — selections automatically propagate across all dashboard views.

Interactive Features

  • Point Selection: Navigate through hierarchical data levels (Day → Batch → Wafer).

  • Chart Switching: Seamless toggle between analytical views without losing context.

  • Synchronized Navigation: Selection state maintained across all chart components.

  • Responsive Tooltips: Custom SVG tooltips showing detailed batch quality summaries.

  • Zoom and Pan: Standard chart navigation controls where appropriate.

Technical Implementation

The dashboard is implemented as a React component (index.tsx) utilizing SciChart React for multi-chart coordination.

SciChart React Integration

  • SciChartReact components manage chart instance creation and lifecycle automatically.

  • Each chart exposes initialization functions that accept callback handlers for inter-chart communication.

  • React refs maintain references to chart instances and their APIs for programmatic control.

  • Lifecycle handled by SciChart React ensures proper cleanup and memory management.

Data Structure

Data is generated semi-randomly in waferData.ts using a hierarchical structure.

Interfaces

  • WaferDayData: Contains daily summary metrics (Mean1, Mean2) and an array of WaferLotData batches.

  • WaferLotData:: Batch-level data with quality categorization (Good, Marginal, Fail), input variables (Input1, Input2), output measurements (Measure1, Measure2, Measure3), and selection state tracking.

Custom Chart Implementations

1. Line Chart (lineChart.ts)

API Surface

  • Inputs: waferData array, onPointSelected callback

  • Returns: Chart surface, WebAssembly context

  • Callback: onPointSelected(point: WaferDayData, index: number)

Key Features

  • FastLineRenderableSeries with point markers for trend visualization.

  • Custom metadata interface IWaferPointMetadata extends point data with selection state.

  • DataPointSelectionPaletteProvider for visual selection feedback.

  • Custom tooltip and DataLabelProvider showing Input1 values above points.

2. Column Chart (columnChart.ts)

API Surface:

  • Inputs: waferData batch array, onBatchSelected callback

  • Returns: Chart surface, updateData method, selection modifier

  • Callback: onBatchSelected(point: WaferLotData, isColumnChart: boolean)

  • Update: updateData(batchData, fireSelectionChanged)

Key Features

  • StackedColumnRenderableSeries displaying three measures as stacked components.

  • XyNDataSeries with arrayCount: 3 for multi-dimensional data.

  • DataPointSelectionPaletteProvider for visual selection feedback.

  • Dynamic column width calculation and coordinate mapping.

3. Pareto Chart (paretoChart.ts)

API Surface

  • Inputs: waferData batch array, onBatchSelected callback

  • Returns: Chart surface, updateData method, selection modifier

  • Callback: onBatchSelected(point: WaferLotData, isColumnChart: boolean)

  • Update: updateData(waferData, fireSelectionChanged)

Key Custom Component

  • CumulativePercentageFilter extends XyFilterBase for real-time cumulative percentage calculations.
  • Combines FastColumnRenderableSeries (primary) and FastLineRenderableSeries (cumulative).
  • Dual Y-axis configuration with different scales.
  • Automatic data sorting by quality in descending order.

4. Wafer Grid (waferGrid.ts)

API Surface

  • Input: selectedPoint — single WaferLotData seed for wafer defect patterns.

  • Returns: Main chart surface, generateSubcharts method.

  • Update: generateSubcharts(selectedPoint) regenerates all 12 sub-charts.

Advanced Features

  • SciChartSubSurface API for creating 12 independent sub-charts.

  • FastRectangleRenderableSeries for wafer die representation.

  • RectanglePaletteProvider implementing IFillPaletteProvider for defect-based coloring.

  • Seeded random generation in generateGridOfPoints for reproducible wafer patterns.

Cross-Chart Synchronization

Communication Flow

1. Line Chart → Column/Pareto:

  • handlePointSelected provides selected day data.

  • updateData() methods receive new batch arrays and manage state.

2. Column/Pareto → Wafer Grid:

-handleBatchSelected provides selected batch and chart type.

-generateSubcharts() regenerates all wafer sub-charts.

3. Selection Management:

-Column and Pareto chart share selection information via shared metadata

-Manual synchronization ensures consistent state between both views.

Performance Optimizations

Efficient Rendering

  • freezeWhenOutOfView: true prevents unnecessary updates.

  • Chart toggling uses CSS display properties instead of unmounting.

  • Sub-chart regeneration only when required.

Memory Management

  • Automatic cleanup via SciChart disposal mechanisms.

  • Ref-based chart management prevents leaks.

  • Efficient data handling for large datasets.

Styling and Theming

Centralized theme system (appTheme) ensures consistent:

  • Color palettes for categories

  • Typography and spacing

  • Visual feedback for selections

  • Responsive layout behavior

The Semiconductors Dashboard showcases advanced SciChart.js capabilities — including multi-chart coordination, hierarchical data exploration, sub-chart architectures, and synchronized user interactions — making it ideal for industrial and scientific analytics.