chore(labels): add option to prevent overlapping labels
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)
@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 the code looks good from a cursory glance but I'm not sure why you're asking me :)
@evertheylen Sorry about that, I thought you were a maintainer. Thanks for approving though
@gionkunz Would you mind reviewing this pull request?
@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 Could you please rebase fork to fresh master?
@dangreen Hello Dan, Sure I can. I've went ahead and rebased this branch to main.
:warning: Please install the 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.
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.
@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.