-
Notifications
You must be signed in to change notification settings - Fork 715
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(vx-react-spring): add AnimatedGridRows/Columns + animationTrajectory #787
Conversation
: [new Date('2020-02-01'), new Date('2020-03-01')]; | ||
const logValues = dataToggle ? [1, 10, 100, 1000, 10000] : [0.0001, 0.001, 0.1, 1, 10, 100]; | ||
const axes: AxisDemoProps<AxisScale<number>>[] = useMemo(() => { | ||
// toggle between two value ranges to demo animation |
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.
all just indented to memoize
|
||
// In order to plot values on an axis, output of the scale must be number. | ||
// Some scales return undefined. | ||
export type GridScaleOutput = number | NumberLike | undefined; |
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.
updated this to match AxisScaleOutput
because it simplifies the types in this PR (and logically they should be the same)
}: TicksRendererProps<Scale> & Pick<TransitionConfig<Scale>, 'animationTrajectory'>) { | ||
const animatedTicks = useTransition(ticks, tick => `${tick.value}-${horizontal}`, { | ||
unique: true, | ||
...useLineTransitionConfig({ scale, animateXOrY: horizontal ? 'x' : 'y', animationTrajectory }), |
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 + the <>
wrapper below are the only updates in this file. AnimatedTicks
was previously a directory and the indentation with <>
made git think it's a new file
packages/vx-react-spring/src/spring-configs/useLineTransitionConfig.ts
Outdated
Show resolved
Hide resolved
084680e
to
d64d86f
Compare
…dLines, demo improvements
0dd5ba3
to
c70b093
Compare
woot! |
TODO::
🚀 Enhancements
Part of the
XYChart
project, this PR[
@vx/grid
]children
prop toGridRows
+GridColumns
to support animated rendering[
@vx/react-spring
]AnimatedGridRows
+AnimatedGridColumns
AnimatedTicks/useAnimatedTicksConfig
tospring-configs/useAnimatedLineTransitionConfig
so it can power both animated tick + grid linesanimationTrajectory=outside | inside | min | max
toAnimatedAxis
andAnimatedGridRows/Columns
[
@vx/demo
]/axis
demo to includeAnimatedGrid*
and aanimationTrajectory
config💥 Breaking Changes
[
@vx/grid
]GridColumnProps
=>GridColumnsProps
(+s
) to matchGridRowsProps
@hshoff @kristw @techniq