-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
Great library! One suggestion for the README file.
Please include examples that setup up the viewbox. I spent about an hour trying to figure out why the most basic examples wouldn't integrate with my existing svgdotjs code. Turns out I wasn't setting the viewbox and I wouldn't have known to do this unless I dug into the issues on this repo.
A basic example might be:
// enables panZoom
var canvas = SVG()
.addTo('#id')
.size(1000, 1000)
.viewbox('0 0 500 500')
.panZoom()
// zoom programatically
canvas.zoom(lvl, point)
I understand that this will setup a 1000x1000 canvas and create 500x500 viewbox.
If you don't do something like this then one gets console errors like:
Error: <svg> attribute viewBox: Expected number...
Thank you!
MightyPork, Frodojj, BillyPurvis, Oxyrus, drew-moore and 4 moreBillyPurvis and Oxyruschriso86, BillyPurvis, Oxyrus and iongion
Metadata
Metadata
Assignees
Labels
No labels