Creates a React Semiconductors Dashboard using SciChart.js. Use the FastRectangleRenderableSeries and its customTextureOptions property to create a custom tiling texture fill.
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;
}
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.
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.
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.
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.
The dashboard is implemented as a React component (index.tsx) utilizing SciChart React for multi-chart coordination.
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 is generated semi-randomly in waferData.ts using a hierarchical structure.
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.
lineChart.ts)Inputs: waferData array, onPointSelected callback
Returns: Chart surface, WebAssembly context
Callback: onPointSelected(point: WaferDayData, index: number)
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.
columnChart.ts)Inputs: waferData batch array, onBatchSelected callback
Returns: Chart surface, updateData method, selection modifier
Callback: onBatchSelected(point: WaferLotData, isColumnChart: boolean)
Update: updateData(batchData, fireSelectionChanged)
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.
paretoChart.ts)Inputs: waferData batch array, onBatchSelected callback
Returns: Chart surface, updateData method, selection modifier
Callback: onBatchSelected(point: WaferLotData, isColumnChart: boolean)
Update: updateData(waferData, fireSelectionChanged)
CumulativePercentageFilter extends XyFilterBase for real-time cumulative percentage calculations.FastColumnRenderableSeries (primary) and FastLineRenderableSeries (cumulative).waferGrid.ts)Input: selectedPoint — single WaferLotData seed for wafer defect patterns.
Returns: Main chart surface, generateSubcharts method.
Update: generateSubcharts(selectedPoint) regenerates all 12 sub-charts.
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.
handlePointSelected provides selected day data.
updateData() methods receive new batch arrays and manage state.
-handleBatchSelected provides selected batch and chart type.
-generateSubcharts() regenerates all wafer sub-charts.
-Column and Pareto chart share selection information via shared metadata
-Manual synchronization ensures consistent state between both views.
freezeWhenOutOfView: true prevents unnecessary updates.
Chart toggling uses CSS display properties instead of unmounting.
Sub-chart regeneration only when required.
Automatic cleanup via SciChart disposal mechanisms.
Ref-based chart management prevents leaks.
Efficient data handling for large datasets.
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.










