You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to update the scale on a Grid component every few milliseconds, in accordance with a mouse drag. I have this working already with plain d3, but I am attempting to rewrite it using react & vx.
But Grid has no innerRef. It looks like Grid just builds an SVG group that wraps a bunch of lines, which makes sense. But without a way to reference the inner refs, it seems that you must rely on setState to update the Grid scales, and this is really non-performant. It is laggy and for anything beyond about 2 updates per second.
Is there a way to update the xScale and yScale on a Grid in a performant way, so that it can be done without lag every few milliseconds?
The text was updated successfully, but these errors were encountered:
Sorry for the delay, closing this as it should now be possible with AnimatedGrid from @vx/react-spring (added in 0.0.199), or using a similar approach if you don't want to use react-spring.
I would like to update the scale on a
Grid
component every few milliseconds, in accordance with a mouse drag. I have this working already with plain d3, but I am attempting to rewrite it using react & vx.You can manipulate a
LinePath
this way easily by using its innerRef instead of using setState.But Grid has no
innerRef
. It looks likeGrid
just builds an SVG group that wraps a bunch ofline
s, which makes sense. But without a way to reference the inner refs, it seems that you must rely onsetState
to update theGrid
scales, and this is really non-performant. It is laggy and for anything beyond about 2 updates per second.Is there a way to update the
xScale
andyScale
on aGrid
in a performant way, so that it can be done without lag every few milliseconds?The text was updated successfully, but these errors were encountered: