-
Notifications
You must be signed in to change notification settings - Fork 713
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
new(xychart): add Animated(BarSeries, BarStack, BarGroup) #873
Conversation
orientation === 'left' || orientation === 'right' | ||
? margin?.[orientation] | ||
: undefined, | ||
...props.tickLabelProps?.(value, index), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the only thing that was changed here is that all ...axisStyles.tickLabel
styles are applied by default and the user-specified styles (props.tickLabelProps
) are overrides. this makes it way easier to override a single style or two.
|
||
return ( | ||
<g className="visx-bar-group"> | ||
<BarsComponent bars={bars} horizontal={horizontal} xScale={xScale} yScale={yScale} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is all the same as previous BarGroup
, bars
are just passed to BarsComponent
now.
|
||
return ( | ||
<g className="vx-bar-series"> | ||
<BarsComponent bars={bars} horizontal={horizontal} xScale={xScale} yScale={yScale} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is all the same as previous BarSeries
, bars
are just passed to BarsComponent
now.
|
||
return ( | ||
<g className="visx-bar-stack"> | ||
<BarsComponent bars={bars} horizontal={horizontal} xScale={xScale} yScale={yScale} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is all the same as previous BarStack
, bars
are just passed to BarsComponent
now.
95b6662
to
3d54674
Compare
c52ac08
to
b60d94f
Compare
Pull Request Test Coverage Report for Build 309632235
💛 - Coveralls |
3d54674
to
8be48e7
Compare
…private/ directory
b388988
to
fe7d094
Compare
|
||
return barStack.map((bar, index) => { | ||
const barX = getX(bar); | ||
if (!isValidNumber(barX)) return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we log a warning here? or are there cases where devs would expect bar{X|Y} to not be a valid number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair point. I have an item in the project tracker to do a sweep across series to make sure they handle null
s / missing values properly so will think about it for that. my sense is that we don't need a warning since null
values likely are common.
TODO
master
when the base branch PRs are merged🚀 Enhancements
This PR
react-spring
animated variants ofBarSeries
,BarStack
, andBarGroup
BaseBarSeries
,BaseBarStack
, andBaseBarGroup
, and then creating the equivalentBarSeries
/AnimatedBarSeries
, etc. by passingBars
or (new)AnimatedBars
as theBarsComponent
(this approach was used forGrid/AnimatedGrid
, andAxis/AnimatedAxis
react-spring
as apeerDependency
(this will only be required if you use any of theAnimatedGrid/Axis/BarSeries/BarStack/BarGroup
components)Updated the demo to use these by default. I tested enter/update/leave transitions by tweaking several demo config options.
@kristw @techniq