embedding SVG

29 views
Skip to first unread message

Kyle

unread,
Dec 3, 2011, 11:50:33 PM12/3/11
to jsLINB
How would I go about embedding SVG? Is there a way to directly insert
HTML? Perhaps I just do not understand enough about how this all
works yet...

I have an industrial control application that I want to put a web UI
on. I need some graphics to display the positions of machines as well
as standard text-based output like temperatures, distances etc. I was
thinking of using SVG+JavaScript to do this via AJAX/JSONRPC data from
the server.

Thanks for any tips.

Best,
Kyle

JustGo

unread,
Dec 4, 2011, 12:28:36 AM12/4/11
to jsLINB
1. Some widgets have setHtml function:

span.setHtml('xxxxxxxxxxxx')
div.setHtml('xxxxxxxxxxxx')
pane.setHtml('xxxxxxxxxxxx')
panel.setHtml('xxxxxxxxxxxx')
dialog.setHtml('xxxxxxxxxxxx')
...

2. Or, you can set html to any node as following:
div.
panel.getSubNode('PANEL').html('xxxxxxxxxxxxx');

Kyle

unread,
Dec 4, 2011, 10:40:28 AM12/4/11
to jsLINB
In order to use the interface package in SVG, I need to generate the
SVG statically with a separate tool (Inkscape+special editing). Can I
use a < svg ... src="somefile.svg">< /svg> in the HTML I set?
Ideally, I would like to make it part of a static HTML page, but I do
not need to.

Thanks for the tips.

Best,
Kyle

JustGo

unread,
Dec 4, 2011, 7:30:42 PM12/4/11
to jsLINB
try this:

<object data="test.svg" width="500" height="500" type="image/svg
+xml">
<embed src="test.svg" width="500" height="500" type="image/svg+xml" /
>
</object>

Kyle

unread,
Dec 6, 2011, 12:12:53 AM12/6/11
to jsLINB
Thanks! It looks like I need to get better with HTML. This project
looks really useful. If I can combine it with SVG and JavaScript for
use as an HMI (Human/Machine Interface) tool, I will be quite happy!

Best,
Kyle

JustGo

unread,
Dec 6, 2011, 12:39:32 AM12/6/11
to jsLINB
Yes, I'm considerring to add a SVG widget into media group for this
case.

Kyle

unread,
Dec 6, 2011, 9:47:58 AM12/6/11
to jsLINB
That would be really useful for me! There is the problem that most of
the versions of IE do not support it. There are some libraries
(Amble, Raphael) that allow it to work, mostly, on older versions of
IE. Only IE 9+ supports SVG, and I am not sure how well it is
supported on IE 9. So, it would require some shim JavaScript to make
it work. I had planned on pulling in one of the above libraries in
order to use SVG. Raphael also has a nice add-on package gRaphael for
graphs that does not use Flash.

Thanks for the responses.

Best,
Kyle

Reply all
Reply to author
Forward
0 new messages