-
-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for svg viewbox #88
Conversation
It seems a really good feature, but I have to investigate if there could be some drawback. |
Do you have any comments on this PR? |
Sorry, but I haven't had the opportunity to study it yet. Hope to find enough time soon. |
I missed this pull request and basically programmed the same thing to only find @kheyse-oqton was there first 😄 (https://github.com/TimVanMourik/react-svg-pan-zoom). I more or less made the exact same change. So hereby consider this an endorsement of this feature! @chrvadala, I really love this work, it's an amazing React component and just what I needed for my application. The only drawback of this issue that I can think of is that it alters the behaviour of users that at the moment have an (unused) viewbox property on their tag. |
* Add x and y to SVG * initialise to zero, because not mandatory * Update translations in fitToViewer * bugfix in setting new SVG x and y * Set default value for SVG x and y * Merge PR #88 from @kheyse-oqton with current version * stylistic changes * Update fit to viewer as switch statement More explicit handling of the translations as a function of alignment options * Cleaning up of the constructor and componentDidUpdate functions * using destructured values in Miniature * small scaling bugfix * small scale fix: scaling should be with viewer scaleLevel, not scaleY * adds ViewboxStory * minor ViewboxStory fix * rename SVGViewBoxXY to SVGMinXY * in order to reuse the standard name as defined in SVG RFC https://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute, please rename SVGViewBoxX and SVGViewBoxY with SVGMinX and SVGMinY #150 (comment) * Move viewbox parser to separate file * please move the ViewBox parser in a new file called utils/ViewBoxParser.js #150 (comment) * make ViewBox parser W3C compliant This should do the trick and is more readable than a regex, IMO #150 (comment) * replace `withViewBox` by `viewBox` #150 (comment)
PR moved on #150 and released with version 3.3.0 |
Support for svg viewbox. if a viewbox is defined, it overrides the svg width and height.
Fixes #86.
Allows to write: