This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
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.
Per FormidableLabs/victory#862, the docs currently state that:
This is a simple change to make, but when I did so, the result was not great:
And given that we support multiple
itemsPerRow
, even if the docs were correct there'd still be a desire to specify column and row gutters independently.In fact all of the vertical
<VictoryLegend>
demos are relying on the fact thatgutter
only applies horizontally – they are not assuming that the docs are correct. If we made this change to match the docs, it would be a real pain for everyone using Victory to upgrade, because their chart layouts would likely be broken.So this PR takes a different approach: when
gutter
is a number, it still only refers to the column gutter, no matter the orientation. But it adds support forgutter
being an object like{ column: 50, row: 25 }
. We can update the docs to reflect this.Details regarding the object shape can be fleshed out here (should it be
{ horizontal, vertical }
?{ top, bottom, left, right }
?), but I think this general approach is the way to go./cc @boygirl @ebrillhart @tacomanator