react-financial-charts
react-financial-charts copied to clipboard
feat: add Rectangle and Price Range drawing tools + performance improvements + Storybook 8 + React 18 upgrades
Summary
This PR is a comprehensive update to the interactive components library, including new drawing tools, performance optimizations, and modern tooling upgrades.
Changes
New Components
- Rectangle - Drawing tool for rectangular annotations and area highlighting
- Price Range - Measurement tool for price differences (absolute change + percentage)
Performance Improvements
shouldComponentUpdateimplemented on all interactive components to prevent unnecessary re-renders- Throttled canvas drawing for smoother resize operations
- Optimized hover detection using bounding boxes
- Fixed opacity accumulation issues on canvas redraws
Interactive Features
- Selection support for all interactive objects (click to select)
- Toggle selection (click again to deselect)
- Drag & drop functionality improved
- Resize using control points
- Delete key support for removing selected objects
Components Updated
- Trendline
- Fibonacci Retracement
- Gann Fan
- Equidistant Channel
- Rectangle (new)
- Price Range (new)
Tooling & Dependencies
- Upgraded to Storybook 8.6.18
- React 19 compatibility
- Updated all devDependencies to latest versions
- TypeScript improvements
- ESLint and Prettier updates
Documentation
- Added Storybook stories for all interactive components
- Updated README with new features
- Improved inline documentation
Bug Fixes
- Fixed duplicate rendering issues on interactive objects
- Corrected hover behavior on Equidistant Channel
- Fixed selection not working on some components
- Resolved canvas opacity accumulation during drawing
Testing
All components tested locally with Storybook. Performance verified with React DevTools.
Related
Fixes issues with:
- Selection not working on some components
- Performance degradation with multiple objects
- Canvas opacity accumulation during drawing