[Ur] Rendering SVG

Ziv Scully zivscully at gmail.com
Sat Dec 24 14:19:48 EST 2016


You need to tell Ur/Web about the SVG and other tags through Ur/Web's FFI
and a .urs file. (See Section 11.3 of the Ur/Web manual.) I did this once
for simple SVG shapes in the past and am attaching the files. It's not
complete, but you'll hopefully find it helpful as a baseline.

I eventually abandoned the SVG approach for what I was doing because it
didn't play nicely with Ur/Web's <dyn/> tags, but I didn't properly
investigate the issue.



On Sat, Dec 24, 2016 at 1:46 PM, Yves Cloutier <yves.cloutier at gmail.com>
wrote:

> Hello,
>
> What would be the syntax for rendering SVG in urweb? I did a test using:
>
> fun main () = return <xml>
>   <head>
>     <title>Pattern Maker</title>
>   </head>
>
>   <body>
>       <svg height="210" width="500">
>         <line x1="0" y1="0" x2="200" y2="200" style="stroke:rgb(255,0,0);stroke-width:2"
> />
>       </svg>
>   </body>
>
>
> but this doesn't seem to work.
>
>
>
> _______________________________________________
> Ur mailing list
> Ur at impredicative.com
> http://www.impredicative.com/cgi-bin/mailman/listinfo/ur
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20161224/6601f55a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: svg.urp
Type: application/octet-stream
Size: 8 bytes
Desc: not available
URL: <http://www.impredicative.com/pipermail/ur/attachments/20161224/6601f55a/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: svg.urs
Type: application/octet-stream
Size: 2554 bytes
Desc: not available
URL: <http://www.impredicative.com/pipermail/ur/attachments/20161224/6601f55a/attachment-0001.obj>


More information about the Ur mailing list