Description
None of the charts support live-updating data with smooth transitions between states. This is essential for monitoring dashboards and IoT applications.
Proposed API
```tsx
import { useRealtimeChart } from '@/components/charts';
function LiveMetrics() {
const { data, ref } = useRealtimeChart({
source: 'ws://metrics.example.com/stream',
windowSize: 60, // keep last 60 data points
interval: 1000, // update every second
});
return ;
}
```
Features
- WebSocket, SSE, and polling interval support
- Sliding window of N data points
- Smooth animated transitions between frames
- Auto-reconnect on connection loss
- Pause/resume capability
Primary targets
- LineChart (time-series monitoring)
- BarChart (live comparisons)
- GaugeChart (real-time metrics)
Tasks
Description
None of the charts support live-updating data with smooth transitions between states. This is essential for monitoring dashboards and IoT applications.
Proposed API
```tsx
import { useRealtimeChart } from '@/components/charts';
function LiveMetrics() {
const { data, ref } = useRealtimeChart({
source: 'ws://metrics.example.com/stream',
windowSize: 60, // keep last 60 data points
interval: 1000, // update every second
});
return ;
}
```
Features
Primary targets
Tasks