Skip to content

Conversation

@Soumashree-Das
Copy link

Fixes #535

Tasks

  • Reviewed
    contribution guidelines
  • PR is descriptively titled and links the original issue above.
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening
    your PR Run
    tests
    locally to check for errors.
  • Commits are in a uniquely-named feature branch and have no merge conflicts
  • Looked for possible updates in documentation and added updates where
    applicable
  • Updated CHANGELOG.rst

Description

This PR replaces the deprecated C3 charting library with the modern, responsive, and React-friendly Recharts library for all pie charts in ScanCode Workbench.

Recharts improves performance, handles congested labels better, and integrates cleanly with the v4 React renderer. As requested in Issue #535, this PR also adds optional slice-click support—allowing parent components to navigate to corresponding detail views when a user clicks on a pie slice.

Key Changes

  • Removed all usage of C3 from the PieChart component.
  • Implemented a new Recharts-based PieChart using <PieChart>, <Pie>, <Cell>, <Tooltip>, and <Legend>.
  • Preserved existing color mapping through LEGEND_COLORS.
  • Added an optional onSliceClick(sliceName) callback for interactive navigation.
  • Cleaned and updated piechart.css: removed old .c3-* rules and added Recharts tooltip styles.
  • Updated documentation to reference Recharts instead of C3.
  • Updated CHANGELOG.rst accordingly.

Notes

This PR focuses specifically on replacing C3 pie charts and enabling slice interaction as described in #535. Other chart types can be updated in future enhancements if needed.

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.

Better library for displaying charts

1 participant