-
Notifications
You must be signed in to change notification settings - Fork 729
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 BarGroup #870
Conversation
@@ -56,28 +58,48 @@ export default function Example({ height }: Props) { | |||
numTicks={numTicks} | |||
/> | |||
{renderBarStack && ( | |||
<g fillOpacity={renderLineSeries ? 0.5 : 1}> |
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.
g
element wasn't used
const groupScale = useMemo( | ||
() => | ||
scaleBand<string>({ | ||
domain: [...dataKeys], // @TODO order |
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.
reminder to myself to add this prop
|
||
// try to figure out the 0 baseline for correct rendering of negative values | ||
// we aren't sure if these are numeric scales or not ahead of time | ||
const maybeXZero = xScale(0) ?? 0; |
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.
some of this is duplicated in BarSeries
. I'm going to focus on animated bars next, and will try to remove some of the duplication.
Pull Request Test Coverage Report for Build 214
💛 - Coveralls |
<g className="visx-bar-group"> | ||
{registryEntries.map(({ xAccessor, yAccessor, data, key }) => | ||
data.map((datum, index) => { | ||
const barLength = horizontal |
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.
similar to suggestion on barstack, these conditions can be moved outside to save n
times redundant check.
406603f
to
6ec13a9
Compare
new(demo/xychart): add BarGroup new(xychart/BarGroup): add mouseover/out fix(demo/xychart): better ux new(xychart/BarGroup): add sortBars internal(xychart/BarGroup): add perf improvements
4d3d30c
to
d6d09c0
Compare
* test(xychart/mocks): add @visx/event mock * test(xychart): add BarGroup tests * test(xychart): add mousemove/out tests to all series * test(xychart): remove .test. from setupTooltipTest filename * lint(xychart/setupTooltipTest)
@williaster hello. can I use this in the latest version of library? |
Hey @r0st1kuzh , sorry we have not published the It should be ready for publishing in the next couple of weeks, tho. I created #884 to track it (or you can follow the |
TODO
master
whenBarStack
new(xychart): add BarStack series #865 is merged🚀 Enhancements
This adds a
BarGroup
series to@visx/xychart
which supports tooltips, negative values, and horizontal rendering like other*Series
. It updates the/xychart
demo to include it.@kristw @techniq