feat: add option to prevent overlapping labels#1428
feat: add option to prevent overlapping labels#1428dangreen merged 7 commits intochartist-js:mainfrom
Conversation
|
@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. |
|
Codecov ReportAttention: Patch coverage is
❗ 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 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Dan Onoshko <danon0404@gmail.com>
4726914 to
24d7c11
Compare
…arameters typed correctly.
|
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
left a comment
There was a problem hiding this comment.
Also please run pnpm build && pnpm test:size and increase size in .size-limit.json
|
@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
left a comment
There was a problem hiding this comment.
I like the suggested changes.
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)