chartist icon indicating copy to clipboard operation
chartist copied to clipboard

chore(labels): add option to prevent overlapping labels

Open L-Har opened this issue 1 year ago • 9 comments

Add an option to pie chart that can prevent overlapping labels. If preventOverlappingLabelOffset is Nonzero check if a label has overlapping text then move it the number of pixels up and left (Should be label size)

L-Har avatar Jun 04 '24 12:06 L-Har

@evertheylen Would you mind taking a look at this pull request? I think this would be a useful option if it were to be added into the main branch.

L-Har avatar Jun 04 '24 13:06 L-Har

@L-Har the code looks good from a cursory glance but I'm not sure why you're asking me :)

evertheylen avatar Jun 04 '24 13:06 evertheylen

@evertheylen Sorry about that, I thought you were a maintainer. Thanks for approving though

L-Har avatar Jun 04 '24 13:06 L-Har

@gionkunz Would you mind reviewing this pull request?

L-Har avatar Jun 04 '24 13:06 L-Har

@dangreen Hello. Would you mind taking a look at this pull request? It's just an implementation of a way to prevent overlapping labels in the pie chart. With an option to toggle it on if desired, and unit tests.

L-Har avatar Apr 11 '25 15:04 L-Har

@L-Har Could you please rebase fork to fresh master?

dangreen avatar Apr 11 '25 15:04 dangreen

@dangreen Hello Dan, Sure I can. I've went ahead and rebased this branch to main.

L-Har avatar Apr 11 '25 18:04 L-Har

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 8.33333% with 11 lines in your changes missing coverage. Please review.

Project coverage is 73.51%. Comparing base (6ee19be) to head (46f5ef1). Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
src/charts/PieChart/PieChart.ts 8.33% 11 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1428      +/-   ##
==========================================
- Coverage   74.24%   73.51%   -0.73%     
==========================================
  Files          42       42              
  Lines        1250     1265      +15     
  Branches      328      333       +5     
==========================================
+ Hits          928      930       +2     
- Misses        241      253      +12     
- Partials       81       82       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov-commenter avatar Apr 11 '25 22:04 codecov-commenter

Hey Dan, just wondering if I needed to do anything else to get this PR in chartist? I'm not sure about the size-limit automated test failing, but I'll check out that trailing whitespace automated check if needed.

L-Har avatar Jun 13 '25 21:06 L-Har

@dangreen Of course. Thanks for the tip on the size-limit. And the refactoring. It looked good. I squashed the commits and pushed the changes.

L-Har avatar Jun 27 '25 19:06 L-Har