Importing SVG into RaphaelJS
The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From:
xwisdom <xwis... @gmail.com>
Date: Sat, 17 Oct 2009 22:10:59 -0700 (PDT)
Local: Sun, Oct 18 2009 3:10 pm
Subject: Importing SVG into RaphaelJS
Hello,
Is it possible to import an SVG file into RaphaelJS? If not, are there
any plans to do this?
For example:
paper.importSVG('path/to/image.svg');
image = paper.getElementById('mysvg'); // get svg object by id
// code to animate image
PS I've noticed that SVG can be imported using BURSTEngine -
http://hyper-metrix.com/#Burst
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
xwisdom <xwis... @gmail.com>
Date: Sat, 17 Oct 2009 22:10:58 -0700 (PDT)
Local: Sun, Oct 18 2009 3:10 pm
Subject: Importing SVG into RaphaelJS
Hello,
Is it possible to import an SVG file into RaphaelJS? If not, are there
any plans to do this?
For example:
paper.importSVG('path/to/image.svg');
image = paper.getElementById('mysvg'); // get svg object by id
// code to animate image
PS I've noticed that SVG can be imported using BURSTEngine -
http://hyper-metrix.com/#Burst
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
charles thomas <charles... @yahoo.com>
Date: Sun, 18 Oct 2009 16:33:42 -0700 (PDT)
Local: Mon, Oct 19 2009 9:33 am
Subject: Re: Importing SVG into RaphaelJS
Well the most it could extract, that would be immediately useful, would be the path defined in the SVG file being imported.
Thats only been possible since a recent release of Raphael that supports SVG path syntax 100%.
After that it would have to interpret attributes in the SVG file and convert them into the Raphael equivalent.
It seems unlikely anyone would write the whole "import" capability except maybe a plugins for importing the path.
--- On Sat, 10/17/09, xwisdom <xwis... @gmail.com> wrote:
From: xwisdom <xwis... @gmail.com>
Subject: Importing SVG into RaphaelJS
To: "Raphaël" <raphaeljs@googlegroups.com>
Received: Saturday, October 17, 2009, 10:10 PM
Hello,
Is it possible to import an SVG file into RaphaelJS? If not, are there
any plans to do this?
For example:
paper.importSVG('path/to/image.svg');
image = paper.getElementById('mysvg'); // get svg object by id
// code to animate image
PS I've noticed that SVG can be imported using BURSTEngine -
http://hyper-metrix.com/#Burst
__________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr!
http://www.flickr.com/gift/
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
JesseFrye <teaml... @gmail.com>
Date: Thu, 22 Oct 2009 23:20:58 -0700 (PDT)
Local: Fri, Oct 23 2009 4:20 pm
Subject: Re: Importing SVG into RaphaelJS
Use Illustrator to draw your file and then save as an SVG file.
At the Save As dialog box click Show code.
You can copy the coordinates and paste them into your JS code.
You will need to replace the "," (commas) with a space though.
On Oct 18, 4:33 pm, charles thomas <charles... @yahoo.com> wrote:
> Well the most it could extract, that would be immediately useful, would be the path defined in the SVG file being imported.
> Thats only been possible since a recent release of Raphael that supports SVG path syntax 100%.
> After that it would have to interpret attributes in the SVG file and convert them into the Raphael equivalent.
> It seems unlikely anyone would write the whole "import" capability except maybe a plugins for importing the path.
> --- On Sat, 10/17/09, xwisdom <xwis... @gmail.com> wrote:
> From: xwisdom <xwis... @gmail.com>
> Subject: Importing SVG into RaphaelJS
> To: "Raphaël" <raphaeljs@googlegroups.com>
> Received: Saturday, October 17, 2009, 10:10 PM
> Hello,
> Is it possible to import an SVG file into RaphaelJS? If not, are there
> any plans to do this?
> For example:
> paper.importSVG('path/to/image.svg');
> image = paper.getElementById('mysvg'); // get svg object by id
> // code to animate image
> PS I've noticed that SVG can be imported using BURSTEngine -http://hyper-metrix.com/#Burst
> __________________________________________________________________
> Looking for the perfect gift? Give the gift of Flickr!
> http://www.flickr.com/gift/
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Dmitry Baranovskiy <dmitry.baranovs... @gmail.com>
Date: Fri, 23 Oct 2009 17:34:15 +1100
Local: Fri, Oct 23 2009 4:34 pm
Subject: Re: Importing SVG into RaphaelJS
> You will need to replace the "," (commas) with a space though.
Why?
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"Wout." <i... @qimmiq.net>
Date: Fri, 23 Oct 2009 06:42:17 -0700 (PDT)
Local: Fri, Oct 23 2009 11:42 pm
Subject: Re: Importing SVG into RaphaelJS
Soon I will have a full SCG to Raphaeljs available.
It is able to detect all object types and the polygon objects will
neatly converted to a raphael path.
I'm currently still working on the convertion of SVG groups to Raphael
sets.
I guess in a week or two I will release the code on Github.
On 18 Oct, 07:10, xwisdom <xwis... @gmail.com> wrote:
> Hello,
> Is it possible to import an SVG file into RaphaelJS? If not, are there
> any plans to do this?
> For example:
> paper.importSVG('path/to/image.svg');
> image = paper.getElementById('mysvg'); // get svg object by id
> // code to animate image
> PS I've noticed that SVG can be imported using BURSTEngine -http://hyper-metrix.com/#Burst
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Josepssv <josep.... @gmail.com>
Date: Sun, 25 Oct 2009 01:24:08 -0700 (PDT)
Local: Sun, Oct 25 2009 7:24 pm
Subject: Re: Importing SVG into RaphaelJS
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Josepssv <josep.... @gmail.com>
Date: Sun, 25 Oct 2009 01:38:12 -0700 (PDT)
Local: Sun, Oct 25 2009 7:38 pm
Subject: Re: Importing SVG into RaphaelJS
SVG to dojox.gfx Convertor
http://sourceforge.net/projects/svgtodojoxgfx/
and forum
http://aclindsay.com/home/?p=18
On 23 oct, 13:42, "Wout." <i... @qimmiq.net> wrote:
> Soon I will have a full SCG to Raphaeljs available.
> It is able to detect all object types and the polygon objects will
> neatly converted to a raphael path.
> I'm currently still working on the convertion of SVG groups to Raphael
> sets.
> I guess in a week or two I will release the code on Github.
> On 18 Oct, 07:10, xwisdom <xwis... @gmail.com> wrote:
> > Hello,
> > Is it possible to import an SVG file into RaphaelJS? If not, are there
> > any plans to do this?
> > For example:
> > paper.importSVG('path/to/image.svg');
> > image = paper.getElementById('mysvg'); // get svg object by id
> > // code to animate image
> > PS I've noticed that SVG can be imported using BURSTEngine -http://hyper-metrix.com/#Burst
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Josepssv <josep.... @gmail.com>
Date: Fri, 23 Oct 2009 18:53:31 -0700 (PDT)
Local: Sat, Oct 24 2009 11:53 am
Subject: Re: Importing SVG into RaphaelJS
Sencillo usando Mozilla Firefox, Chrome,.. pero no IExplorer, eso
parece complicado.
Implementé algo así
SVG to OPF (Onlypaths Format, JSON code format for SVG)
http://onlypaths.com/aaopblog/2009/2/26/index.htm
Es interesante tener un formato propio que use JSON como sugirió
Antimatter15, también para Raphaeljs
Wout puedo ayudar?
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Josepssv <josep.... @gmail.com>
Date: Fri, 23 Oct 2009 13:53:33 -0700 (PDT)
Local: Sat, Oct 24 2009 6:53 am
Subject: Re: Importing SVG into RaphaelJS
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"Wout." <i... @qimmiq.net>
Date: Mon, 26 Oct 2009 04:54:10 -0700 (PDT)
Local: Mon, Oct 26 2009 10:54 pm
Subject: Re: Importing SVG into RaphaelJS
@Josepssv
No pudo abrir el página de onlypaths.
Hablas inglés?
On 23 Oct, 21:53, Josepssv <josep.... @gmail.com> wrote:
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Josepssv <josep.... @gmail.com>
Date: Tue, 27 Oct 2009 06:12:36 -0700 (PDT)
Local: Wed, Oct 28 2009 12:12 am
Subject: Re: Importing SVG into RaphaelJS
Wout:
Prefiero contestar en español.
Hay opción de traducir
Usar Firefox.
Documento SVG prohibido en IExplorer.
On 26 oct, 13:54, "Wout." <i... @qimmiq.net> wrote:
> @Josepssv
> No pudo abrir el página de onlypaths.
> Hablas inglés?
> On 23 Oct, 21:53, Josepssv <josep.... @gmail.com> wrote:
> > Wout, I collaboratehttp://onlypaths.com/aaopblog/2009/2/26/index.htm
> > SVG to OPF (Onlypaths Format) JSON code
> > Onlypaths will Raphael
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"Wout." <i... @qimmiq.net>
Date: Tue, 27 Oct 2009 08:27:14 -0700 (PDT)
Local: Wed, Oct 28 2009 2:27 am
Subject: Re: Importing SVG into RaphaelJS
No, estaba Safari.
El documento SVG esta demasiado grande por Safari creo.
Pero en Firefox lo puedo abrir.
Me parece un mejor solución que tengo ahora.
On 27 Oct, 14:12, Josepssv <josep.... @gmail.com> wrote:
> Wout:
> Prefiero contestar en español.
> Hay opción de traducir
> Usar Firefox.
> Documento SVG prohibido en IExplorer.
> On 26 oct, 13:54, "Wout." <i... @qimmiq.net> wrote:
> > @Josepssv
> > No pudo abrir el página de onlypaths.
> > Hablas inglés?
> > On 23 Oct, 21:53, Josepssv <josep.... @gmail.com> wrote:
> > > Wout, I collaboratehttp://onlypaths.com/aaopblog/2009/2/26/index.htm
> > > SVG to OPF (Onlypaths Format) JSON code
> > > Onlypaths will Raphael
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Dmitry Baranovskiy <dmitry.baranovs... @gmail.com>
Date: Wed, 28 Oct 2009 09:32:16 +1100
Local: Wed, Oct 28 2009 9:32 am
Subject: Re: Importing SVG into RaphaelJS
Guys, you are not alone on this list. Please speak English or send
each other direct messages.
2009/10/28 Wout. <i... @qimmiq.net>:
> No, estaba Safari.
> El documento SVG esta demasiado grande por Safari creo.
> Pero en Firefox lo puedo abrir.
> Me parece un mejor solución que tengo ahora.
> On 27 Oct, 14:12, Josepssv <josep.... @gmail.com> wrote:
>> Wout:
>> Prefiero contestar en español.
>> Hay opción de traducir
>> Usar Firefox.
>> Documento SVG prohibido en IExplorer.
>> On 26 oct, 13:54, "Wout." <i... @qimmiq.net> wrote:
>> > @Josepssv
>> > No pudo abrir el página de onlypaths.
>> > Hablas inglés?
>> > On 23 Oct, 21:53, Josepssv <josep.... @gmail.com> wrote:
>> > > Wout, I collaboratehttp://onlypaths.com/aaopblog/2009/2/26/index.htm
>> > > SVG to OPF (Onlypaths Format) JSON code
>> > > Onlypaths will Raphael
--
Best regards,
Dmitry Baranovskiy
http://dmitry.baranovskiy.com
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
cartographer <fbuchin... @gmail.com>
Date: Tue, 27 Oct 2009 01:34:32 -0700 (PDT)
Local: Tues, Oct 27 2009 7:34 pm
Subject: Re: Importing SVG into RaphaelJS
@Josepssv:
It is still not clear to me how I can load the OPF data generated with
your converter object in Raphael.
when I do
var opfData = [{id:"svg2", type:"doc", left:0, top:0,
etc:"[...]"}]; // data generated by OPF converter (abbreviated)
var c = paper.path(opfData);
on the Raphael playground page(http://raphaeljs.com/playground.html ),
I get the alert error "S[0] is not defined".
Any hints?
Franz
On 26 Okt., 12:54, "Wout." <i... @qimmiq.net> wrote:
> @Josepssv
> No pudo abrir el página de onlypaths.
> Hablas inglés?
> On 23 Oct, 21:53, Josepssv <josep.... @gmail.com> wrote:
> > Wout, I collaboratehttp://onlypaths.com/aaopblog/2009/2/26/index.htm
> > SVG to OPF (Onlypaths Format) JSON code
> > Onlypaths will Raphael
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Josepssv <josep.... @gmail.com>
Date: Fri, 30 Oct 2009 02:33:39 -0700 (PDT)
Local: Fri, Oct 30 2009 8:33 pm
Subject: Re: Importing SVG into RaphaelJS
No, Cartographer
I will convert OPF to Raphaeljs
I work
On 27 oct, 09:34, cartographer <fbuchin... @gmail.com> wrote:
> @Josepssv:
> It is still not clear to me how I can load the OPF data generated with
> your converter object in Raphael.
> when I do
> var opfData = [{id:"svg2", type:"doc", left:0, top:0,
> etc:"[...]"}]; // data generated by OPF converter (abbreviated)
> var c = paper.path(opfData);
> on the Raphael playground page(http://raphaeljs.com/playground.html ),
> I get the alert error "S[0] is not defined".
> Any hints?
> Franz
> On 26 Okt., 12:54, "Wout." <i... @qimmiq.net> wrote:
> > @Josepssv
> > No pudo abrir el página de onlypaths.
> > Hablas inglés?
> > On 23 Oct, 21:53, Josepssv <josep.... @gmail.com> wrote:
> > > Wout, I collaboratehttp://onlypaths.com/aaopblog/2009/2/26/index.htm
> > > SVG to OPF (Onlypaths Format) JSON code
> > > Onlypaths will Raphael
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
JesseFrye <teaml... @gmail.com>
Date: Sun, 1 Nov 2009 18:54:38 -0800 (PST)
Local: Mon, Nov 2 2009 1:54 pm
Subject: Re: Importing SVG into RaphaelJS
You're right. I must have had a syntax issue when I first started
playing with it. Commas seem fine right now.
On Oct 22, 11:34 pm, Dmitry Baranovskiy <dmitry.baranovs... @gmail.com>
wrote:
> > You will need to replace the "," (commas) with a space though.
> Why?
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Josepssv <josep.... @gmail.com>
Date: Tue, 10 Nov 2009 20:22:08 -0800 (PST)
Local: Wed, Nov 11 2009 3:22 pm
Subject: Re: Importing SVG into RaphaelJS
Completad SVG to OPF to Raphaeljs
http://onlypaths.com/aaopblog/2009/11/7/
Only paths, jeje
On 30 oct, 09:33, Josepssv <josep.... @gmail.com> wrote:
> No, Cartographer
> I will convert OPF to Raphaeljs
> I work
> On 27 oct, 09:34, cartographer <fbuchin... @gmail.com> wrote:
> > @Josepssv:
> > It is still not clear to me how I can load the OPF data generated with
> > your converter object in Raphael.
> > when I do
> > var opfData = [{id:"svg2", type:"doc", left:0, top:0,
> > etc:"[...]"}]; // data generated by OPF converter (abbreviated)
> > var c = paper.path(opfData);
> > on the Raphael playground page(http://raphaeljs.com/playground.html ),
> > I get the alert error "S[0] is not defined".
> > Any hints?
> > Franz
> > On 26 Okt., 12:54, "Wout." <i... @qimmiq.net> wrote:
> > > @Josepssv
> > > No pudo abrir el página de onlypaths.
> > > Hablas inglés?
> > > On 23 Oct, 21:53, Josepssv <josep.... @gmail.com> wrote:
> > > > Wout, I collaboratehttp://onlypaths.com/aaopblog/2009/2/26/index.htm
> > > >SVGto OPF (Onlypaths Format) JSON code
> > > > Onlypaths will Raphael
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Brother Erryn <brotherer... @atomicmonks.com>
Date: Wed, 11 Nov 2009 11:25:07 -0800 (PST)
Local: Thurs, Nov 12 2009 6:25 am
Subject: Re: Importing SVG into RaphaelJS
I submitted a post to do this, but it hasn't made it through
moderation (yet? ever?). It doesn't cover everything, but does quite a
lot. It also uses jQuery to make parts simpler. If you aren't
supporting IE, you can remove the parseXML function/reference and
change the $.get type from 'text' to 'xml':
function parseXML( xml ) {
if( window.ActiveXObject && window.GetObject ) {
var dom = new ActiveXObject( 'Microsoft.XMLDOM' );
dom.loadXML( xml );
return dom;
}
if( window.DOMParser )
return new DOMParser().parseFromString( xml, 'text/xml' );
throw new Error( 'No XML parser available' );
}
$(function(){
$.get('demo.svg', null, function(doc){ // or 'demo.svg'
doc = parseXML(doc);
var root = $(doc).find('svg')[0],
vb = root.getAttribute('viewBox'), dims = vb ? vb.split(' ') :
[0,0,root.getAttribute('width'),root.getAttribute('height')];
var img = Raphael(parseFloat(dims[0]), parseFloat(dims[1]),
parseFloat(dims[2]), parseFloat(dims[3]));
$(root).find('path').each(function(){
var node = this, path = img.path($(this).attr('d'));
$(['stroke-linejoin','stroke','stroke-miterlimit','stroke-
width','fill','stroke-linecap']).each(function(){
if($(node).attr(this.toString()))
path.attr(this, $(node).attr(this.toString()));
});
if($(node).attr('style')) {
var atts = $(node).attr('style').split(';');
for(var i=0;i<atts.length;i++) {
var bits = atts[i].split(':');
path.attr(bits[0],bits[1]);
}
}
/*path.scale(0.5, 0.5);
var box = path.getBBox(), x=box.x+box.width/2.0, y = box.y
+box.height/2.0;
path.translate(x*0.5-x, y*0.5-y);*/
});
}, 'text');
});
On Nov 10, 10:22 pm, Josepssv <josep.
... @gmail.com> wrote:
> Completad SVG to OPF to Raphaeljs
http://onlypaths.com/aaopblog/2009/11/7/
> Only paths, jeje
> On 30 oct, 09:33, Josepssv <josep.... @gmail.com> wrote:
> > No, Cartographer
> > I will convert OPF to Raphaeljs
> > I work
> > On 27 oct, 09:34, cartographer <fbuchin... @gmail.com> wrote:
> > > @Josepssv:
> > > It is still not clear to me how I can load the OPF data generated with
> > > your converter object in Raphael.
> > > when I do
> > > var opfData = [{id:"svg2", type:"doc", left:0, top:0,
> > > etc:"[...]"}]; // data generated by OPF converter (abbreviated)
> > > var c = paper.path(opfData);
> > > on the Raphael playground page(http://raphaeljs.com/playground.html ),
> > > I get the alert error "S[0] is not defined".
> > > Any hints?
> > > Franz
> > > On 26 Okt., 12:54, "Wout." <i... @qimmiq.net> wrote:
> > > > @Josepssv
> > > > No pudo abrir el página de onlypaths.
> > > > Hablas inglés?
> > > > On 23 Oct, 21:53, Josepssv <josep.... @gmail.com> wrote:
> > > > > Wout, I collaboratehttp://onlypaths.com/aaopblog/2009/2/26/index.htm
> > > > >SVGto OPF (Onlypaths Format) JSON code
> > > > > Onlypaths will Raphael
You must
Sign in before you can post messages.
You do not have the permission required to post.