-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
SVG viewbox support (2.0) #150
Conversation
Thanks for your PR, I'll study it. It would be better to have a solution that doesn't break current users. What if we introduce a new prop called considerVieport? This give to users a way to selectevely chose if handle viewport or not. |
Sure, I'll rename the prop to Could you tell me what to test specifically? Whether the mouse panning behaviour is still correct? Or more than that? |
More explicit handling of the translations as a function of alignment options
I updated the PR to use the Current behaviour is:
I believe all events are updated correctly, fit to selection, zoom (on view center), and pan. |
You can check out (a test deployment of) the application for which I'm using this component here: This is already linking the update from this PR. |
ping |
Hi @TimVanMourik ,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* 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 chrvadala#150 (comment)
* please move the ViewBox parser in a new file called utils/ViewBoxParser.js chrvadala#150 (comment)
This should do the trick and is more readable than a regex, IMO chrvadala#150 (comment)
Thanks for the review, @chrvadala! I fixed each of the four points in the respective commits. |
pong |
Sorry, this weekend I'm out... I should be able to work on it next week.. apologize for the delay |
Released with version 3.3.0 |
Nice, thanks! :D |
This pull request is analogous to #88 by @kheyse-oqton but updated and merged with the latest version of this library. It facilitates the use of the
viewBox
property of the mainsvg
.FROM:
TO:
This centers the view of the main svg and the miniature around the specified viewBox.
The only obvious side effect for current users is that in the unlikely scenario that they have
viewBox
specified, the centering will be affected. This is an unlikely case, because would be an unused property in the current version of this component.