SVG to dojox.gfx Javascript convertor

I have created the first iteration of a SVG to dojox.gfx converter. This will enable easier transition from designing an SVG document in a program like Inkscape and actually using that SVG with Dojo’s experimental SVG tools. As I said, this is the first iteration, so if it doesn’t seem to be working correctly, let me know. I hope this helps some people who ran into the same frustration that I did. Here’s the link.

Tags: , , , , , ,

13 Responses to “SVG to dojox.gfx Javascript convertor”

  1. Just want to know if your convertor is Open source ?

    if yes is there a place I can download ?

    Thanks

    bd
    ps.: don’t try to go to my website, it is down for the moment,

  2. admin says:

    I have not yet decided on whether I will be releasing it as open source or not. Currently it is written in PHP with a simple AJAX web interface on top of that. What are you interested in using it for?

    -Aaron

  3. Bern says:

    Well, I did some prototype to create a GIS viewer using dojo,

    I want to integrate svg files in the viewer to define different layer, in GIS you can have large files, svg can reduce the size significally,

    I am in the process to recreate the viewer as a dojo Widget, my first attemp was to test different way of doing it,

    I had some problem with the alignment of different objects, (toolbar, image and plain json data) Firefox and IE react differently, anyway I think I am found the way to do it so now I am moving to a more OO widget,

    to have a svg2json will be nice to have, also I am thinking to use the viewer to have topological (network) object (maybe saved in svg).

    I will try to get back my website on with an early version of the viewer, so you can see by yourself.

    bd

  4. admin says:

    I am considering releasing the source as GPL. If you contact me via the email address listed on the converter page, or leave me your email address here, we can communicate over email.

    -Aaron

  5. Rufor says:

    Greatings, Interesting, I`ll quote it on my site later.
    Thanks
    Rufor

  6. Feneric says:

    It doesn’t seem to work for me; I can only get it to spit out:

    Fatal error: Call to undefined method SVG::addPolyline() in /home1/aclindsa/public_html/svgparser/parser/parser/Parser.php on line 262

  7. admin says:

    Hmmm, it seems to be working for the examples I throw at it – can you post the specific SVG that you’re trying when you get that error?

    -Aaron

  8. Feneric says:

    Here’s a really simple one I threw together by hand. It comes up fine in both Firefox and Safari by fails in a manner similar to the above:

  9. Feneric says:

    Oops, it didn’t display:

    <?xml version=”1.0″ encoding=”utf-8″?>
    <!DOCTYPE svg PUBLIC “-//W3C//DTD SVG 1.0//EN” “http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd”>
    <svg version=”1.0″ xmlns=”http://www.w3.org/2000/svg” xmlns:xlink=”http://www.w3.org/1999/xlink”>
    <g>
    <circle cx=”50″ cy=”50″ r=”50″ stroke=”#000000″ stroke-width=”0.5″ fill=”#FFFFCC”/>
    <line x1=”30″ x2=”70″ y1=”75″ y2=”75″ stroke=”#000000″ stroke-width=”2″ stroke-linecap=”round”/>
    <ellipse cx=”0″ cy=”0″ rx=”5″ ry=”10″ stroke=”#000000″ stroke-width=”1″ fill=”#CCFFCC” transform=”translate(65,42)”/>
    <ellipse cx=”0″ cy=”0″ rx=”5″ ry=”10″ stroke=”#000000″ stroke-width=”1″ fill=”#CCFFCC” transform=”translate(35,42)”/>
    </g>
    </svg>

  10. Alpana Tiwari says:

    Hi Aaron,
    Was looking into your converter. Would like to correspond more, some issues are listed below.
    1)Do you support layers?
    2)The SVG shapes do not retain their IDs – any plans for adding that, or is the code available so it can be enhanced?
    3)The converter did not show me any ‘text’ nodes – are they supported?
    4)It replaced some “solid” strokes with “dashed” strokes – do you know why?

    Can we correspond directly via email?
    Thanks,
    Alpana

  11. Feneric says:

    It’s good to see that you’ve been pushing this forward. Back in August I decided to rework the old svg2gfx XSLT script to work on more modern SVG files, and at this point it’s already useable enough to have some real sites online that have made use of it (see http://www.shiningstarslearningcenter.com/ http://www.nearta.com/ and http://www.keepsaugusatown.info/ for a few examples of its output in the wild). It’s currently living at http://dist.saugus.net/ but I’ve been working with the Dojo guys to get it pulled back into the tree as a replacement for the much less functional svg2gfx that’s currently there.

Leave a Reply