useBarPath is complicated to use - This aims to improve it #155
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I have found
<Bar />
anduseBarPath
cumbersome to use. Since by default the bars renders outside the graph and you have to push them in with domainPadding and when you do that theinnerPadding
prop no longer correctly matches the docs. InnerPadding = 0 will equal overlapping bars if an domainPadding is provided.This pullRequest contains my modified version of useBarPath that always renders all bars inside the chartBounds.
This screenshot illustrates how it renders now. The border is the ChartBounds. The innerPadding prop is now a prop that defines how many pixels there are between each bar.
This is not a complete PR-yet. If this change is one that the community would like to adopt I will be more then happy to complete the PR. (This does not affect useBarGroupPath yet for example)
Here is the code to render the above Chart, (data excluded)
Type of Change
How Has This Been Tested?
Not tested via tests yet, awaiting response from maintainers if I should complete the PR first
Checklist:
Will leave this here if I need it later :)
yarn run check:code
and all checks pass