export svg

149 views
Skip to first unread message

Andy Woods

unread,
Dec 1, 2015, 3:56:35 PM12/1/15
to Haxe
Hi all,

would anyone know of a package that can do this? It seems this non-opensource project can, http://nanofl.com/. Cant get acces to the source-code though :(

I used to make graphics for scientific papers with AS3 and then export to png (which cant scale). I would LOVE to though,  #1 move over to Haxe to do this, #2 be able to export to svg!

Many thanks,
Andy.

Andy Woods

unread,
Dec 1, 2015, 4:39:26 PM12/1/15
to Haxe
Allan Dowdeswell found openfl snapsvg https://github.com/ngrebenshikov/openfl snapsvg that can do the job.

Would prefer a way to export directly from openfl-svg -- cest la vie ;)

Juraj Kirchheim

unread,
Dec 1, 2015, 4:48:55 PM12/1/15
to haxe...@googlegroups.com
Hey Andy,

could you elaborate on what exactly you seek to export SVG from (e.g. which openfl backend, what kind of graphics etc.)?

Best,
Juraj

On Tue, Dec 1, 2015 at 10:39 PM, Andy Woods <andyt...@gmail.com> wrote:
Allan Dowdeswell found openfl snapsvg https://github.com/ngrebenshikov/openfl snapsvg that can do the job.

Would prefer a way to export directly from openfl-svg -- cest la vie ;)

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Confidant

unread,
Dec 1, 2015, 10:46:45 PM12/1/15
to Haxe
For the record, I have needed to export SVG files from browser output in the past. While it is possible to do it from a browser using "blobs", it is not supported in IE9 or lower so I chose to upload the SVG to the server which returned it as the proper file type. Let me know if you want the PHP for that.

Confidant

unread,
Dec 1, 2015, 10:50:21 PM12/1/15
to Haxe
If the OpenFL/SnapSVG doesn't work, you might consider converting a Haxe swf file using Google Swiffy (which converts it to SVG) and then grabbing the data from that.

Andy Woods

unread,
Dec 2, 2015, 4:17:28 AM12/2/15
to Haxe
Hi Juraj,

I'm fond of creating graphics from lots of data crunching (eg as3 project), by generating simple shapes on a Sprite (via sprite.graphics in flash/openfl). Fingers crossed googleGroups has embedded a eg pic below (but here is a link to a silly psychology paper where I've made several such pics).

Hi Confidant, afraid (I am fairly sure) that Google Swiffy doesnt let you export SWFs where graphics are code generated.

Confidant, re SVG export via php, I think it may be possible via the Developer Console or via Element.innerSvg (link). If I can get openFl-snapSVG to work, I should be able to get SVGs that way perhaps.

cheers all, 
Andy.





Victor / tokiop

unread,
Dec 2, 2015, 4:57:04 AM12/2/15
to haxe...@googlegroups.com
hi,

On 01/12/2015 21:56, Andy Woods wrote:
> would anyone know of a package that can do this? It seems this
> non-opensource project can, http://nanofl.com/. Cant get acces to the
> source-code though :(

The NanoFl svg exporter plugin is available under Apache 2.0 license,
didn't try it though :

https://bitbucket.org/nanofl/plugins/src/8f7c3e08d34a?at=default

Yaroslav may have more infos on usage..

lots of other gems on his personnal bitbucket !
https://bitbucket.org/yar3333/

cheers,

Victor

Andy Woods

unread,
Dec 2, 2015, 8:46:19 AM12/2/15
to Haxe
Well, I found a simple as3 svg exporter (link) and Ian Harrigan persuaded me to have a go porting it: https://github.com/andytwoods/Haxe_SVG_export. Needs more work, and at the mo only deals with a single shape.

Victor, afraid NanoFL svg has way too many libraries hidden behind a paywall :(


cheers, Andy.

Confidant

unread,
Dec 2, 2015, 10:45:06 AM12/2/15
to Haxe
I was pleasantly surprised that Swiffy successfully converted an AS2 swf drawing application for me. It used the graphics drawing functions for that (lines, rectangles, ellipses). I didn't experiment with anything in AS3.

Andy Woods

unread,
Dec 2, 2015, 12:33:21 PM12/2/15
to Haxe

Confidant

unread,
Dec 3, 2015, 10:45:16 AM12/3/15
to Haxe
Can you try switching the embedded Swiffy runtime script to this one? -> https://www.gstatic.com/swiffy/v6.0.2/runtime.js
-Allan

Confidant

unread,
Dec 3, 2015, 10:51:26 AM12/3/15
to Haxe
It might give you an error like "TypeError: this.it.gt is not a function"

Andy Woods

unread,
Dec 3, 2015, 3:43:07 PM12/3/15
to Haxe
just for future readers with the same aim in mind. I scrapped my svg port. Instead I thought to use awesome JS http://d3js.org/ package via eg https://github.com/mikedotalmond/d3-haxe-extern

It will be nice to keep things sane by coding in Haxe, whilst using such an established JS library (that's unfortunately written in crazy bananas JS).

Many thanks everyone for your inputs :) 

Philippe Elsass

unread,
Dec 3, 2015, 6:18:35 PM12/3/15
to Haxe
Using an existing JS library if you can is certainly sensible :)

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.



--
Philippe

Confidant

unread,
Dec 4, 2015, 9:37:51 AM12/4/15
to Haxe
Good choice!
Reply all
Reply to author
Forward
0 new messages