react-financial-charts icon indicating copy to clipboard operation
react-financial-charts copied to clipboard

feat: add Rectangle and Price Range drawing tools + performance improvements + Storybook 8 + React 18 upgrades

Open sgonzaloc opened this issue 7 months ago • 0 comments

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

  • shouldComponentUpdate implemented 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

sgonzaloc avatar Apr 10 '26 22:04 sgonzaloc