Canvas-based rendering
Unlike DOM-based charting libraries, Kinetix Charts uses HTML5 Canvas for direct pixel manipulation. This approach provides significant performance advantages:- No DOM overhead: Canvas rendering bypasses the browser’s layout and reflow calculations
- Direct pixel control: Each chart element is drawn directly to pixels
- Hardware acceleration: Modern browsers use GPU acceleration for canvas operations
- Memory efficiency: Only the visible pixels are stored, not a DOM tree
Canvas-based rendering handles 100k+ data points smoothly, as highlighted in the README features.
LTTB downsampling algorithm
For datasets with more than 2,000 points, Kinetix Charts automatically applies the Largest-Triangle-Three-Buckets (LTTB) algorithm to reduce the number of points while preserving the visual shape of the data.How LTTB works
The LTTB algorithm intelligently selects which points to keep:- Bucket division: Data is divided into buckets
- Triangle area calculation: For each bucket, it calculates triangle areas formed with neighboring points
- Maximum area selection: Selects the point that forms the largest triangle, preserving visual peaks and valleys
When downsampling activates
- Small datasets
- Large datasets
Datasets with ≤ 2,000 points render without downsampling.
Efficient updates
Kinetix Charts only redraws when necessary, avoiding wasteful render operations.Selective rendering
The chart only re-renders when:- Data changes
- User interactions occur (pan, zoom)
- Configuration updates are applied
- Window resizes happen
Y-axis auto-scaling
When panning or zooming, the Y-axis automatically recalculates to show only the visible data range:Layer architecture
Kinetix Charts uses a layered canvas architecture where different chart components are drawn on separate layers:- Grid layer (z-index: 0): Background grid lines
- Series layers (z-index: 1): Data visualization (lines, bars, etc.)
- Axis layer (z-index: 50): Axes and labels
- Legend layer (z-index: 100): Legend
Benefits of layers
- Selective updates: Only changed layers need to be redrawn
- Proper rendering order: Z-index ensures correct visual stacking
- Composition efficiency: Final image is composed from layer canvases
Series are added dynamically and always render between the grid and axis layers.
Large dataset example
Here’s a practical example of rendering 100,000 points smoothly:Performance best practices
Use appropriate chart types
Different chart types have different performance characteristics:- Line charts: Best for large time-series datasets
- Bar charts: Good for up to a few hundred categories
- Scatter plots: Efficient for large point clouds
- Pie charts: Best for small datasets (< 20 slices)
Limit series count
While Kinetix Charts can handle multiple series, keep in mind:- Each series adds rendering overhead
- Multi-series tooltips query all series
- Recommended: < 10 series for optimal performance
Disable animations for real-time updates
If you’re updating data frequently (e.g., real-time monitoring), disable animations:Use categorical scrolling wisely
For categorical data with many items:Memory management
Kinetix Charts is designed to be memory-efficient:- Zero dependencies: No additional libraries loaded
- Canvas cleanup: Old canvases are properly disposed
- Data references: Only stores references to your data, not copies
- Animation cleanup: Animations are properly cancelled when not needed