Rich Interactions Showcase

Demonstrates rich interactivity with custom modifiers using SciChart.js, High Performance JavaScript Charts

Fullscreen

Edit

 Edit

Docs

drawExample.ts

Copy to clipboard
Minimise
Fullscreen
1// Loading ... 

Interactive Wave Simulation Heatmap Demo with JavaScript

Overview

This example, titled "Heatmap Interactions", demonstrates a powerful real-time 2D wave simulation using SciChart.js implemented in JavaScript. It showcases advanced interactive features such as dynamic addition of input/output annotations and custom drag-and-drop behavior, enabling users to interact with heatmap data in real time.

Technical Implementation

The implementation extends the base class ChartModifierBase2D to create custom modifiers like AddIOModifier and PointDragModifier. These modifiers handle mouse events to add annotations and update data series, following patterns detailed in the Custom Chart Modifier API. Coordinate transformations are managed with functions such as translateFromCanvasToSeriesViewRect(), which convert canvas mouse coordinates into data coordinates via APIs described in the Axis APIs - Convert Pixel to Data Coordinates documentation.

Interactive annotations are used extensively; for instance, TextAnnotation prompts like "Add Input" and "Add Output" provide user interactivity. For more details on creating movable and interactive annotations, refer to the TextAnnotation documentation.

Real-time simulation is achieved by updating a UniformHeatmapDataSeries on a recurring timer, effectively simulating 2D wave propagation. This approach is well covered in the Updating (Realtime) Heatmaps documentation. Additionally, custom animations using GenericAnimation add fade-in help messages, ensuring smooth visual transitions; you can learn more about this in the Generic Animations documentation.

Features and Capabilities

  • Dynamic Annotation Handling: Users can add or remove annotations interactively, with snapping behavior managed by properties like stepSize.
  • Real-time Data Updates: The heatmap is continuously updated to simulate wave propagation in real time.
  • Drag and Drop Interaction: Custom modifiers enable hit testing and dynamic updating of XyDataSeries data points; see Custom ChartModifiers documentation for more details.
  • High DPI Optimization: The implementation leverages DpiHelper.PIXEL_RATIO to ensure accurate interactions on high-resolution displays.

Integration and Best Practices

This example is built purely with JavaScript, avoiding additional frameworks such as Angular or React. Its modular structure separates chart initialization, modifier logic, and simulation updates, which aligns with best practices for maintainable and high-performance interactive chart applications. Developers are encouraged to consult the provided documentation links to gain deeper insights into customizing chart behavior and optimizing performance with SciChart.js.

javascript Chart Examples & Demos

See Also: Performance Demos & Showcases (12 Demos)

Realtime JavaScript Chart Performance Demo | SciChart.js

Realtime JavaScript Chart Performance Demo

This demo showcases the incredible realtime performance of our JavaScript charts by updating the series with millions of data-points!

Load 500 Series x 500 Points Performance Demo | SciChart

Load 500 Series x 500 Points Performance Demo

This demo showcases the incredible performance of our JavaScript Chart by loading 500 series with 500 points (250k points) instantly!

Load 1 Million Points Performance Demo | SciChart.js Demo

Load 1 Million Points Performance Demo

This demo showcases the incredible performance of our JavaScript Chart by loading a million points instantly.

Realtime Ghosted Traces | Javascript Charts | SciChart.js Demo

Realtime Ghosted Traces

This demo showcases the realtime performance of our JavaScript Chart by animating several series with thousands of data-points at 60 FPS

Realtime Audio Spectrum Analyzer Chart | SciChart.js Demo

Realtime Audio Spectrum Analyzer Chart Example

See the frequency of recordings with the JavaScript audio spectrum analyzer example from SciChart. This real-time visualizer demo uses a Fourier Transform.

Oil & Gas Explorer JavaScript Dashboard | SciChart.js

Oil & Gas Explorer JavaScript Dashboard

Demonstrates how to create Oil and Gas Dashboard

Client/Server Websocket Data Streaming | SciChart.js Demo

Client/Server Websocket Data Streaming

This demo showcases the incredible realtime performance of our JavaScript charts by updating the series with millions of data-points!

Server Traffic Dashboard | Javascript Charts | SciChart.js Demo

Server Traffic Dashboard

This dashboard demo showcases the incredible realtime performance of our JavaScript charts by updating the series with millions of data-points!

Dynamic Layout Showcase | Javascript Charts | SciChart.js Demo

Dynamic Layout Showcase

Demonstrates a custom modifier which can convert from single chart to grid layout and back.

Dragabble Event Markers | Javascript Charts | SciChart.js Demo

Dragabble Event Markers

Demonstrates how to repurpose a Candlestick Series into dragabble, labled, event markers

JavaScript Population Pyramid | Javascript Charts | SciChart.js

JavaScript Population Pyramid

Population Pyramid of Europe and Africa

NEW!
High Performance SVG Cursor & Rollover | SciChart.js Demo

High Performance SVG Cursor & Rollover

Demonstrates how to use the SVG render layer in SciChart.js to maintain smooth cursor interaction on heavy charts with millions of points.

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