-
Notifications
You must be signed in to change notification settings - Fork 719
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): handle rendering + tweening missing values #898
Conversation
โฆp, BaseBarSeries
|
||
const xValues = registryEntries.reduce<XScaleInput[]>( | ||
(combined, entry) => | ||
entry ? combined.concat(entry.data.map((d: Datum) => entry.xAccessor(d))) : combined, | ||
entry | ||
? combined.concat(entry.data.map((d: Datum) => entry.xAccessor(d)).filter(valueIsDefined)) |
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.
verified that d3Extent
handles this so no need to filter, will remove
Pull Request Test Coverage Report for Build 334347503
๐ - Coveralls |
to: { t: 1 }, | ||
reset: true, | ||
}); | ||
const tweened = useSpring({ stroke, fill }); |
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.
TIL tweened
because
Inbetweening or tweening is a key process in all types of animation, including computer animation.
@@ -132,8 +126,8 @@ export default function BaseBarGroup< | |||
const bars = registryEntries.flatMap(({ xAccessor, yAccessor, data, key }) => { | |||
const getLength = (d: Datum) => | |||
horizontal | |||
? (xScale(xAccessor(d)) ?? 0) - xZeroPosition | |||
: (yScale(yAccessor(d)) ?? 0) - yZeroPosition; | |||
? (xScale(xAccessor(d)) ?? NaN) - xZeroPosition |
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.
nice
๐ Enhancements
๐ Bug Fix
๐ Internal
This PR is a mix of improvements + new functionality for
xychart
which are all related by the rabbit hole ๐ฐ โซ I went down trying to fix one problem:The improvements are:
*Series
and in scale domain calculation/xychart
demoAnimatedPath
to handle missing values and a changing number of values by usingd3-interpolate-path
for interpolatingpath
d
attributesArea
shapes with missing data (see below) but I think it's the best optionreact-spring
does this beautifully except when the # of points changes which is the cause of the above error ๐ญ[email protected]
to see if it did ... but it does notd3-interpolate
does not handle path string interpolation well (well documented see e.g., here)flubber
is the best at handling all edge cases, but it assumes closed polygon shapes (doesn't apply for lines) and its bundle size is 10x whatd3-interpolate-path
s is.props.horizontal
from all*Series
types toDataProvider
scontext.horizontal
(the start of the ๐ฐ โซ )horizontal
determines orientation forBar
-type series, and it controls nearestdatum
logic for mouse events across all*Series
dev
s, most of the timehorizontal
can be inferred fromscale
types and this could be done once in context vs specified / computed in each*Series
Note issue with missing area data
@kristw @techniq