# Basic configuration
config <- zoom_canvas()
# Custom configuration
config <- zoom_canvas(
key = "my-zoom-behavior",
animation = list(duration = 300, easing = "ease-in-out"),
origin = list(x = 0, y = 0),
sensitivity = 1.5,
preventDefault = FALSE
)
# With keyboard triggers and callback
config <- zoom_canvas(
enable = JS("(event) => !event.altKey"),
trigger = list(
zoomIn = "+",
zoomOut = "-",
reset = "0"
),
onFinish = JS("() => { console.log('Zooming finished'); }")
)
Run the code above in your browser using DataLab