-
Notifications
You must be signed in to change notification settings - Fork 524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve horizontal charts #1258
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR improves support and consistency for horizontal charts. The goal of this change was to make it possible to turn any existing chart into a horizontal chart by adding the
horizontal
prop to the chart without needing to alter any other props.x
value always refers to the independent dimension, and they
value always refers to the dependent dimension.VictoryAxis
components is no longer tied to whether or not they are thedependentAxis
Breaking Changes
Most Horizontal Charts
The change in how props with x and y values are treated (i.e.
scale
,domain
, etc) will be a breaking change for most horizontal charts. In most cases, reversing thex
andy
values of props you are providing to your horizontal chart will be sufficient to correct the change. For example:Should be changed to:
Props affected by this change are:
scale
,domain
,maxDomain
,minDomain
,domainPadding
, andcategories
Horizontal Charts with Event Containers
Dimension props such as
brushDimension
have changed so that they always refer to the dimension of the target variable (x for the independent variable, and y for the dependent variable). For example, aVictoryBrushContainer
component withbrushDimension="x"
will move and expand only in the independent dimension regardless of whether the chart is horizontal.Props affected by this change are:
brushDimension
,cursorDimension
,selectionDimension
,voronoiDimension
, andzoomDimension
Horizontal Charts with Custom dataComponents
The position values (i.e.
x
,y
,x0
,y0
) supplied to customdataComponents
from components likeVictoryChart
will be scaled for the layout of the horizontal chart. Users who rely on these values may need to flip them or adjust them depending on their use caseHorizontal VictoryBoxPlot
Previously
VictoryBoxPlot
required data to be flipped (x values flipped with y values) in order to plot horizontal charts. This is no longer required, and providing data in this format will no longer work correctly. To correct for this change, it should be sufficient to flip the data used in horizontal charts