Skip to content

Refactor: extract shared hooks/components, add memoization#27

Merged
islubee merged 1 commit intomainfrom
claude/explore-repo-overview-aYE7G
Apr 20, 2026
Merged

Refactor: extract shared hooks/components, add memoization#27
islubee merged 1 commit intomainfrom
claude/explore-repo-overview-aYE7G

Conversation

@islubee
Copy link
Copy Markdown
Owner

@islubee islubee commented Apr 20, 2026

  • useTooltip hook: consolidates wrapperRef, tooltip state, and showTooltip/moveTooltip/hideTooltip handlers shared across all charts
  • ChartLayout component: consolidates the legend+wrapper+tooltip layout pattern duplicated in every chart
  • useMemo for all D3 scale and bin computations so tooltip hover re-renders do not recompute scales unnecessarily
  • useCallback for all event handlers for stable references
  • useMemo for legendItems, barStyle, colorScale
  • Bars/Circles: add onMouseEnter/Leave/Move to propTypes
  • ChartLayout/Legend/Tooltip exported from Components/index.js
  • StackedBarChart: fix segment keys from index-only to key+index, add showLegend defaultProp true

- useTooltip hook: consolidates wrapperRef, tooltip state, and
  showTooltip/moveTooltip/hideTooltip handlers shared across all charts
- ChartLayout component: consolidates the legend+wrapper+tooltip layout
  pattern duplicated in every chart
- useMemo for all D3 scale and bin computations so tooltip hover
  re-renders do not recompute scales unnecessarily
- useCallback for all event handlers for stable references
- useMemo for legendItems, barStyle, colorScale
- Bars/Circles: add onMouseEnter/Leave/Move to propTypes
- ChartLayout/Legend/Tooltip exported from Components/index.js
- StackedBarChart: fix segment keys from index-only to key+index,
  add showLegend defaultProp true

https://claude.ai/code/session_01Bf9veNX9mqfMqrCEGnujAo
@islubee islubee merged commit 397441a into main Apr 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants