-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Summary
Add support for Recharts as a third-party charting library that maidr can work with.
Background
Recharts is one of the most popular React-based charting libraries, built on D3 and rendering SVG. It is widely used in React applications and dashboards. chart2music provides a Recharts integration example. chart2music's React documentation notes that many React charting libraries handle tooltip interactions internally, which can limit visual syncing.
What This Involves
- Binder/Adapter: Create a React-compatible adapter (hook or wrapper component) that extracts data from Recharts components and generates the MAIDR JSON schema.
- SVG Highlighting: Recharts renders standard SVG elements, which can be targeted with CSS selectors for highlighting.
- React Integration: Since maidr already has a React component entry point (
react-entry.ts), the Recharts adapter should integrate naturally with React's component lifecycle. - Chart Types: Recharts supports line, bar, area, scatter, pie, radar, treemap, funnel, and composed charts.
Considerations
- Recharts manages its own internal state for tooltips and hover interactions, which may complicate visual synchronization.
- The adapter could work as a wrapper component or a custom hook that sits alongside the Recharts chart.
- Recharts' declarative component API (e.g.,
<BarChart>,<LineChart>) makes it relatively easy to intercept data props.
Reference
- chart2music Recharts example: https://codepen.io/chart2music/full/eYrrRam
- chart2music React walkthrough: https://www.chart2music.com/docs/API/React/
- Recharts: https://recharts.org/
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels