Skip to content

Add real-time / streaming data support #49

Description

@yuribodo

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

  • Create `useRealtimeChart` hook
  • Implement WebSocket data source
  • Implement SSE data source
  • Implement polling interval source
  • Add sliding window management
  • Smooth transition animations between updates
  • Add documentation and examples
  • Add tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2: nice-to-haveNice to have - polish and advanced featuresenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions