React Polar Uniform Heatmap Chart

Creates a React Polar Uniform Heatmap Chart using SciChart's powerful JavaScript Charts and its range of features.

Fullscreen

Edit

 Edit

Docs

drawExample.ts

index.tsx

theme.ts

generateHeatmapData.ts

Copy to clipboard
Minimise
Fullscreen
1import {
2    PolarMouseWheelZoomModifier,
3    PolarZoomExtentsModifier,
4    PolarPanModifier,
5    PolarNumericAxis,
6    SciChartPolarSurface,
7    EPolarAxisMode, 
8    NumberRange, 
9    EAxisAlignment, 
10    EPolarLabelMode,
11    HeatmapColorMap,
12    UniformHeatmapDataSeries,
13    PolarUniformHeatmapRenderableSeries,
14    HeatmapLegend,
15    Thickness,
16} from "scichart";
17import { appTheme } from "../../../theme";
18import { generateHeatmapData } from "./generateHeatmapData";
19
20const HEATMAP_WIDTH = 300;
21const HEATMAP_HEIGHT = 500;
22
23// Define color map globally to be used in both the chart and the legend
24const COLOR_MAP = new HeatmapColorMap({
25    minimum: 0,
26    maximum: 1,
27    gradientStops: [
28        { offset: 0, color: appTheme.VividPink },
29        { offset: 0.1, color: appTheme.VividOrange },
30        { offset: 0.2, color: appTheme.MutedRed },
31        { offset: 0.5, color: appTheme.VividGreen },
32        { offset: 0.8, color: appTheme.VividSkyBlue },
33        { offset: 0.9, color: appTheme.Indigo },
34        { offset: 1, color: appTheme.DarkIndigo },
35    ]
36})
37
38export const drawExample = async (rootElement: string | HTMLDivElement) => {
39    const { sciChartSurface, wasmContext } = await SciChartPolarSurface.create(rootElement, {
40        theme: appTheme.SciChartJsTheme,
41        padding: new Thickness(0, 60, 0, 0)
42    });
43
44    const radialAxisY = new PolarNumericAxis(wasmContext, {
45        polarAxisMode: EPolarAxisMode.Radial,
46        axisAlignment: EAxisAlignment.Right,
47        visibleRangeLimit: new NumberRange(0, HEATMAP_HEIGHT),
48        useNativeText: true,
49        drawMinorGridLines: false,
50
51        drawMajorTickLines: false,
52        drawMinorTickLines: false,
53        labelPrecision: 0,
54        innerRadius: 0.2
55    });
56    sciChartSurface.yAxes.add(radialAxisY);
57
58    const angularAxisX = new PolarNumericAxis(wasmContext, {
59        polarAxisMode: EPolarAxisMode.Angular,
60        axisAlignment: EAxisAlignment.Top,
61        flippedCoordinates: true,
62        useNativeText: true,
63
64        drawMajorTickLines: false,
65        drawMinorTickLines: false,
66        polarLabelMode: EPolarLabelMode.Parallel,
67        labelPrecision: 0,
68        totalAngle: Math.PI / 2
69    });
70    sciChartSurface.xAxes.add(angularAxisX);
71
72    const heatmapSeries = new PolarUniformHeatmapRenderableSeries(wasmContext, {
73        dataSeries: new UniformHeatmapDataSeries(wasmContext, {
74            zValues: generateHeatmapData(HEATMAP_WIDTH, HEATMAP_HEIGHT, 1999),
75            xStart: 0,
76            xStep: 1,
77            yStart: 0,
78            yStep: 1,
79        }),
80        colorMap: COLOR_MAP,
81        stroke: "white",
82        strokeThickness: 5,
83    });
84    sciChartSurface.renderableSeries.add(heatmapSeries);
85
86    sciChartSurface.chartModifiers.add(
87        new PolarPanModifier(),
88        new PolarZoomExtentsModifier(),
89        new PolarMouseWheelZoomModifier()
90    );
91
92    return { sciChartSurface, wasmContext };
93};
94
95// Draws a Heatmap legend over the <div id={divHeatmapLegend}></div>
96export const drawHeatmapLegend = async (rootElement: string | HTMLDivElement) => {
97    const { heatmapLegend } = await HeatmapLegend.create(rootElement, {
98        theme: {
99            ...appTheme.SciChartJsTheme,
100            sciChartBackground: appTheme.DarkIndigo + "BB",
101            loadingAnimationBackground: appTheme.DarkIndigo + "BB",
102        },
103        yAxisOptions: {
104            isInnerAxis: true,
105            labelStyle: {
106                fontSize: 14,
107                color: appTheme.ForegroundColor,
108            },
109            axisBorder: {
110                borderRight: 2,
111                color: appTheme.ForegroundColor,
112            },
113            majorTickLineStyle: {
114                color: appTheme.ForegroundColor,
115                tickSize: 8,
116                strokeThickness: 2,
117            },
118            minorTickLineStyle: {
119                color: appTheme.ForegroundColor,
120                tickSize: 4,
121                strokeThickness: 1,
122            },
123        },
124        colorMap: COLOR_MAP
125    });
126
127    return { sciChartSurface: heatmapLegend.innerSciChartSurface.sciChartSurface };
128};

React Polar Uniform Heatmap Chart

Overview

This React example showcases a Polar Uniform Heatmap Chart using SciChart.js, integrating the heatmap visualization into a React component. The implementation combines the polar heatmap with a standalone legend component.

Technical Implementation

The chart is rendered using SciChartReact component with initChart={drawExample} prop. The heatmap surface and legend are separate instances, both using the shared COLOR_MAP for consistent coloring. The main chart features polar axes configured with innerRadius and totalAngle properties to control the circular layout.

Features and Capabilities

The example demonstrates React-specific integration patterns while maintaining all JavaScript features: heatmap rendering, polar coordinate system, and interactive modifiers. The legend is positioned absolutely within the component layout, showcasing React's composition capabilities.

Integration and Best Practices

The implementation uses SciChart's React wrapper (scichart-react) for seamless integration. Best practices include proper component structure for chart and legend separation, and responsive styling. For React-specific guidance, see SciChart React documentation.

react Chart Examples & Demos

See Also: Polar Charts (21 Demos)

React Polar Line Chart | React Charts | SciChart.js Demo

React Polar Line Chart

Explore the React Polar Line Chart example to create data labels, line interpolation, gradient palette stroke and startup animations. Try the SciChart Demo.

React Polar Spline Line Chart | React Charts | SciChart.js

React Polar Spline Line Chart

Try the React Polar Spline Line Chart example to see SciChart's GPU-accelerated rendering in action. Choose a cubic spline or polar interpolation. View demo.

React Multi-Cycle Polar Line | React Charts | SciChart.js

React Multi Cycle-Polar Line Example

Create a React Multi-Cycle Polar Chart to plot data over multiple cycles and visualize patterns over time. This example shows surface temperature by month.

React Polar Column Chart | React Polar Bar Chart | SciChart

React Polar Column | React Polar Bar

Try the React Polar Bar Chart example to render bars in a polar layout with gradient fills and animations. Use SciChart for seamless integration with React.

React Polar Column Category Chart | SciChart.js Demo

React Polar Column Category Chart

Create a React Polar Colum Category chart visualizing UK consumer price changes. Try the demo with a custom positive/negative threshold fill and stroke.

React Polar Range Column Chart | React Charts | SciChart.js

React Polar Range Column Chart

Create a React Polar Range Column Chart with SciChart. This example displays monthly minimum and maximum temperatures within a Polar layout. Try the demo.

React Windrose Plot | React Polar Stacked Radial Column Chart

React Windrose Plot | React Polar Stacked Radial Column Chart

View the React Windrose Chart example to display directional data with stacked columns in a polar layout. Try the polar chart demo with customizable labels.

React Polar Sunburst Chart | React Charts | SciChart.js

React Polar Sunburst Chart

See the React Sunburst Chart example with multiple levels, smooth animation transitions and dynamically updating segment colors. Try the SciChart demo.

React Polar Radial Column Chart | React Charts | SciChart.js

React Polar Radial Column Chart

View the React Radial Column Chart example to see the difference that SciChart has to offer. Switch radial and angular axes and add interactive modifiers.

React Stacked Radial Column Chart | Stacked Radial Bar Chart

React Stacked Radial Column Chart | Stacked Radial Bar Chart

This React Stacked Radial Bar Chart example shows Olympic medal data by country. Try the demo for yourself with async initialization and theme application.

React Polar Area Chart | Polar Mountain Chart | SciChart

React Polar Area Chart | Polar Mountain Chart

The React Polar Area Chart example, also known as Nightingale Rose Chart, renders an area series with polar coordinates with interactive legend controls.

React Polar Stacked Radial Mountain Chart | SciChart.js

React Polar Stacked Radial Mountain Chart

Try the React Stacked Radial Mountain Chart example to show multiple datasets on a polar layout with a stacked mountain series and animated transitions.

React Polar Band | Polar Error Bands Chart | SciChart.js

React Polar Band | Polar Error Bands Chart

Create a React Polar Chart with regular and interpolated error bands. Enhance a standard chart with shaded areas to show upper and lower data boundaries.

React Polar Scatter Chart | React Charts | SciChart.js Demo

React Polar Scatter Chart

Build a React Polar Scatter Chart with this example to render multiple scatter series on radial and angular axes. Try the flexible SciChart demo today.

React Polar Radar Chart | Spider Radar Chart | SciChart

React Polar Radar Chart

View the React Polar Radar Chart example. Also known as the Spider Radar Chart, view the scalability and stability that SciChart has to offer. Try demo.

React Polar Gauge Chart | React Circular Gauge | SciChart

React Gauge Charts

Create React Gauge Charts, including a React Circular Gauge Dashboard, with React-friendly initialization and responsive design. Give the SciChart demo a go.

React Arc Gauge & FIFO Scrolling Charts Dashboard | SciChart

React Arc Gauge & FIFO Scrolling Charts Dashboard Example

View React Arc Gauge Charts alongside FIFO Scrolling Charts, all on the same dashboard with real-time, high-performance data rendering. Try the demo.

React Polar Heatmap | B-Mode Image Ultrasound | Medical Heatmap

React Polar Heatmap | B-Mode Image Ultrasound | Medical Heatmap

No description available for this example yet

React Polar Partial Arc | React Charts | SciChart.js Demo

React Polar Partial Arc

Create a React Polar Partial Arc that bends from a full Polar Circle to a Cartesian-like arc. Try the demo to display an arc segment with Polar coordinates.

React Polar Axis Label Modes | React Charts | SciChart.js

React Polar Axis Label Modes

Create a React Polar Axis Label with SciChart. This demo shows the various label modes for Polar Axes – all optimised for pan, zoom, and mouse wheel.

React Polar Map Example | React Charts | SciChart.js Demo

React Polar Map Example

View the React Polar Map Example using the SciChartReact component. Display geographic data as color-coded triangles on a polar coordinate system. Try demo.

SciChart Ltd, 16 Beaufort Court, Admirals Way, Docklands, London, E14 9XL.