-
Notifications
You must be signed in to change notification settings - Fork 33
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
Best place for SVG FFI #8
Comments
Ah, that'd be useful. This would be used through the In terms of the implementation I'd take an element directly and leave it up to the user to fetch that element using e.g. getElementById. Does that seem sensible? |
It is being used very simplistically in my code currently:
and then in
So I was thinking about just adding the foreign import to a module, like Looking at that name now, it would probably be more descriptive if it's |
@costructuralist At Statebox, we have some similar code, as well as FFI functions to start SVG animations and such things: statebox@fa7a0c1#diff-0b00078fa9da87176b5c60d0360a4591R3, so perhaps they should be considered here as well. |
I have implemented an
clientToSvgCoordinates
FFI function to convert from screen coordinates to SVG coordinates using thegetScreenCTM
Javascript function (see http://svgdiscovery.com/E/Ed.htm and https://developer.mozilla.org/en-US/docs/Web/API/SVGGraphicsElement#Methods).I think it would be nice to have this function available in
purescript-halogen-svg
itself - where do you think is the best place to add it (and related FFI functions)?Here's the Javascript code:
The text was updated successfully, but these errors were encountered: