Does data2viz have out of the box support for zooming and panning?
Typically zooming and panning is implemented by applying transformations on a canvas element: https://codepen.io/chengarda/pen/wRxoyB, but this probably wouldn’t work with data2viz, since it would mess up the coordinates in the zoom and drag events.
So, if I have the following Viz:
viz {
size = size(600, 600)
circle {
radius = 5.0
x = 5.0
y = 5.0
}
circle {
radius = 5.0
x = 15.0
y = 5.0
}
}.bindRendererOnNewCanvas()
Does data2viz offer functions (such as zoom(delta: Double)
and pan(xOffset: Double, yOffset: Double)
) that I can use?
If not, how should I implement this?
Thanks.