How to give views an absolute position (want to pl...
# compose
i
How to give views an absolute position (want to plot dots on a small graph, for which I'm using
Box
/ shapes)?
ah
Modifier.offset
apparently
a
If you're just plotting a graph you'll have a far easier time using
Canvas {}
i
I considered it, but is it good for animations (e.g. interpolate between the old and new positions)?
(with small graph I mean max ~100 points, btw)
a
yes, state reads in a canvas block are observed just like composition and layout, and if that state changes it will be redrawn without needing to recompose to do it.
so animating state values or transition values in a canvas composable are just as effective as they are anywhere else
did something about the shape of the API or docs imply otherwise?
i
ah, no, just assumptions based on unrelated frameworks 😛
I'll give canvas a look then, thanks!
👍 1
a
If there's some other documentation or emphasis we could add that would have changed those assumptions, please let us know 🙂