[svg-developers] getTotalLength and getPointAtLength
Two quick and easy questions: 1. Where in the SVG 1.1 spec are these two topics (getTotalLength and getPointAtLength) discussed. I tried searching and couldn't find 'em. 2. If a path is subjected to a transform then do these methods reflect the path before or after the transform? ASV says after but the others all seem to say before. After would seem to make more sense, but given that all the other blokes say before, there must have been a reason. cheers David [Non-text portions of this message have been removed] - To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: svg-developers-dig...@yahoogroups.com svg-developers-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: svg-developers-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [svg-developers] Re: setting an event handler
thanks Holger, Just to make sure I understand, ... naming the function add( ) was just a coincidence since I was using it to add content to the SVG DOM. Would your comments be just as valid if I would have used O.setAttribute("onclick", "silly(evt)" ) ? If I clone a node, and then use (O.getAttribute("onclick")) I'm assuming the "property" or pseudo-property is still there to be interrogated even if I have used addEventListener? cheers David - Original Message - From: Holger Jeromin To: svg-developers@yahoogroups.com Sent: Sunday, October 24, 2010 10:51 AM Subject: [svg-developers] Re: setting an event handler ddailey schrieb am 23.10.2010 18:29: > I've always used something like > > O.setAttribute("onclick","add(evt)") > > to attach an event handler in SVG. But someone told me recently that > > > O.addEventListener("click", function(evt){add(evt)}, false) > > is actually preferrable. (The person who told me this obviously has > young fingers!) > > Well, why might that be? I have yet to see an example that fails to an "add(evt)" is an eval("add(evt)") eval is considered evil :) This cannot be accelerated with the modern JIT Javascript optimisation in the Browsers. -- best regards Holger [Non-text portions of this message have been removed] - To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: svg-developers-dig...@yahoogroups.com svg-developers-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: svg-developers-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [svg-developers] Re: setting an event handler
Thanks Jeff. Yes, it looks as though evt is automatically assumed as the argument in all the browsers I've seen! Thanks, it's only three keystrokes longer than the other way. cheers David - Original Message - From: jeff_schiller To: svg-developers@yahoogroups.com Sent: Sunday, October 24, 2010 12:26 PM Subject: [svg-developers] Re: setting an event handler --- In svg-developers@yahoogroups.com, "ddailey" wrote: > > Hi folks, > > I've always used something like > > O.setAttribute("onclick","add(evt)") > > to attach an event handler in SVG. But someone told me recently that > > O.addEventListener("click", function(evt){add(evt)}, false) O.addEventListener("click", add, false) should work just fine. Is there a browser where it doesn't? I don't see any advantage to wrapping that function call in another function. The third argument specifies whether you want to handle the event during the bubble or the capture phase (not possible using the onclick attribute). Another advantage to using addEventListener is that multiple handlers for the same event can be added. Regards, Jeff [Non-text portions of this message have been removed] - To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: svg-developers-dig...@yahoogroups.com svg-developers-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: svg-developers-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [svg-developers] how to visualise an arbitrary size matrix with svg?
On Sun, 24 Oct 2010 15:15:20 +0200, Jonathan Chetwynd wrote: > 2 Queries around the same idea: > > 1:Is there a simple way to visualise an arbitrary size matrix with svg? > ie say: vary opacity or hue, as a gradient over another arbitrary size > rectangle. Would patterns work? Alteratively, can you use CSS selectors? cheers -- Charles McCathieNevile Opera Software, Standards Group je parle français -- hablo español -- jeg lærer norsk http://my.opera.com/chaals Try Opera: http://www.opera.com - To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: svg-developers-dig...@yahoogroups.com svg-developers-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: svg-developers-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[svg-developers] Re: setting an event handler
--- In svg-developers@yahoogroups.com, "ddailey" wrote: > > Hi folks, > > I've always used something like > > O.setAttribute("onclick","add(evt)") > > to attach an event handler in SVG. But someone told me recently that > > O.addEventListener("click", function(evt){add(evt)}, false) O.addEventListener("click", add, false) should work just fine. Is there a browser where it doesn't? I don't see any advantage to wrapping that function call in another function. The third argument specifies whether you want to handle the event during the bubble or the capture phase (not possible using the onclick attribute). Another advantage to using addEventListener is that multiple handlers for the same event can be added. Regards, Jeff - To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: svg-developers-dig...@yahoogroups.com svg-developers-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: svg-developers-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[svg-developers] Re: Embed SVG from SVG
The bug is fixed in 4.0b8. --- In svg-developers@yahoogroups.com, "Andreas" wrote: > > You are right. Fox 3.6.11 zoom it.The upcoming Fox on Ubuntu 10.10 not. > > --- In svg-developers@yahoogroups.com, Jacob Beard wrote: > > > > Here's FF3.6 on Ubuntu 10.04: > > http://live.echo-flow.com/stackoverflow/www.vanvanvans.com/test/ff3.6-svg-zoom.png > > FF4b6 on Ubuntu: > > http://live.echo-flow.com/stackoverflow/www.vanvanvans.com/test/ff4b6-svg-zoom.png > > > > I see you're using Minefield, though. Maybe this is a new bug, and should be > > reported. > > > > Jake > > > > On Fri, Oct 22, 2010 at 5:20 PM, Andreas wrote: > > > > > > > > > > > A screenshot: > > > > > > http://www.flickr.com/photos/75063...@n00/5105193014/ > > > > > > > > > --- In svg-developers@yahoogroups.com , > > > Jacob Beard wrote: > > > > > > > > Really? That seems to be working for me. > > > > > > > > Jake > > > > > > > > On Thu, Oct 21, 2010 at 9:42 PM, Andreas wrote: > > > > > > > > > > > > > > > > > > > In your example, it don't zoom in Fox. > > > > > > > > > > > > > > > --- In > > > > > svg-developers@yahoogroups.com > > 40yahoogroups.com>, > > > > > Jacob Beard wrote: > > > > > > > > > > > > Hi Marjn, > > > > > > > > > > > > So, this turned out to be less straightforward than I was expecting. > > > > > > Basically, I know of two ways to embed external SVG content inside > > > > > > an > > > SVG > > > > > > document: using the "image" element, and using the "use" element. > > > > > > Unfortunately, Gecko, including Firefox 3.6 and 4b6, seems to not > > > support > > > > > > using image with external SVG resources; however, it does work with > > > the > > > > > use > > > > > > element. On the other hand, there has been a longstanding webkit > > > bug[0] > > > > > that > > > > > > has prevented the use element from linking to external resources; > > > but, > > > > > > webkit does support using image with external resources. So, in > > > > > > order > > > to > > > > > > make this work across browsers, some work is required: > > > > > > > > > > > > > > > > > > > > http://live.echo-flow.com/stackoverflow/www.vanvanvans.com/test/embed.svg > > > > > > > > > > > > The shapes in the middle should now load everywhere. I added an > > > > > > extra > > > > > column > > > > > > of shapes on the far right: the star should load everywhere expect > > > Webkit > > > > > > browsers, and the circle should load everywhere but Firefox. I think > > > the > > > > > > markup I use to make this work is pretty evil, and it might just be > > > > > better > > > > > > to duplicate each image element. If anyone has any suggestions for > > > > > > improvements, I'd like to hear it. > > > > > > > > > > > > Best, > > > > > > > > > > > > Jake > > > > > > > > > > > > [0] https://bugs.webkit.org/show_bug.cgi?id=12499 > > > > > > > > > > > > On Tue, Oct 19, 2010 at 8:58 AM, marijn.kampf wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks for looking at this Jake, a live example can be found at: > > > > > > > http://www.vanvanvans.com/test/embed.svg > > > > > > > it should display two red circles and two red stars, however the > > > svg > > > > > files > > > > > > > aren't shown, only the png files. All files are present in the > > > > > > > same > > > > > folder. > > > > > > > > > > > > > > Marijn > > > > > > > > > > > > > > > > > > > > > --- In > > > > > > > svg-developers@yahoogroups.com > > > > > > > > > > 40yahoogroups.com>, > > > > > > > > > > > > Jacob Beard wrote: > > > > > > > > > > > > > > > > Yes, this should be supported. It's hard to tell where this is > > > > > failing > > > > > > > just > > > > > > > > by looking at the text. Can you post a live example? > > > > > > > > > > > > > > > > Jake > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > [Non-text portions of this message have been removed] > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > [Non-text portions of this message have been removed] > > > > > > > > > > > > > > > > > > > [Non-text portions of this message have been removed] > > > - To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: svg-developers-dig...@yahoogroups.com svg-developers-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: svg-developers-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[svg-developers] Re: setting an event handler
ddailey schrieb am 23.10.2010 18:29: > I've always used something like > > O.setAttribute("onclick","add(evt)") > > to attach an event handler in SVG. But someone told me recently that > > > O.addEventListener("click", function(evt){add(evt)}, false) > > is actually preferrable. (The person who told me this obviously has > young fingers!) > > Well, why might that be? I have yet to see an example that fails to an "add(evt)" is an eval("add(evt)") eval is considered evil :) This cannot be accelerated with the modern JIT Javascript optimisation in the Browsers. -- best regards Holger - To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: svg-developers-dig...@yahoogroups.com svg-developers-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: svg-developers-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[svg-developers] how to visualise an arbitrary size matrix with svg?
2 Queries around the same idea: 1: Is there a simple way to visualise an arbitrary size matrix with svg? ie say: vary opacity or hue, as a gradient over another arbitrary size rectangle. very basic method: fill in a rectangle for each value in the matrix one longwinded method: use radial gradient with one stop 0.24 and another using a 3x3 kernel to give an average value ~0.2575** and a radius calculated from the scale of the matrix (19x19) to the displayed size of the graphic 2: is there a way to input colour or alpha values for an image directly? as suggested here: "To illustrate, suppose you have a input image which is 5 pixels by 5 pixels, whose color values for one of the color channels are as follows:" http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElement Jonathan **using the value at the second row and second column of the matrix attached: 0.235 0.233 0.241 0.236 0.197 0.160 0.127 0.121 0.117 0.138 0.142 0.135 0.164 0.170 0.182 0.212 0.206 0.185 0.179 0.251 0.240 0.252 0.248 0.215 0.171 0.121 0.132 0.119 0.141 0.148 0.161 0.174 0.200 0.220 0.230 0.196 0.174 0.169 0.266 0.280 0.302 0.351 0.288 0.237 0.159 0.184 0.200 0.214 0.241 0.255 0.254 0.251 0.302 0.335 0.263 0.189 0.157 0.250 0.251 0.355 0.716 0.379 0.285 0.311 0.283 0.302 0.317 0.357 0.400 0.344 0.316 0.381 0.698 0.320 0.196 0.168 0.201 0.196 0.298 0.375 0.343 0.332 0.369 0.382 0.402 0.421 0.486 0.822 0.432 0.352 0.311 0.302 0.222 0.145 0.133 0.174 0.166 0.235 0.275 0.320 0.390 0.490 0.491 0.495 0.491 0.505 0.511 0.385 0.288 0.239 0.200 0.157 0.090 0.088 0.116 0.114 0.172 0.220 0.275 0.418 0.859 0.607 0.587 0.598 0.528 0.462 0.336 0.244 0.193 0.144 0.088 0.050 0.048 0.077 0.097 0.124 0.181 0.262 0.371 0.520 0.555 0.647 0.940 0.600 0.470 0.307 0.207 0.154 0.100 0.037 0.009 0.013 0.058 0.068 0.107 0.150 0.209 0.299 0.409 0.509 0.655 0.940 0.588 0.380 0.278 0.175 0.139 0.086 0.018 -0.006 -0.015 0.044 0.045 0.085 0.124 0.177 0.232 0.308 0.451 0.576 0.940 0.548 0.388 0.245 0.158 0.088 0.037 0.006 -0.033 -0.036 0.046 0.045 0.071 0.107 0.154 0.201 0.260 0.334 0.445 0.499 0.402 0.289 0.188 0.121 0.049 0.004 -0.018 -0.043 -0.046 0.066 0.047 0.071 0.086 0.131 0.176 0.219 0.293 0.348 0.343 0.294 0.217 0.147 0.072 0.029 -0.003 -0.037 -0.063 -0.057 0.080 0.074 0.094 0.106 0.132 0.147 0.194 0.238 0.280 0.302 0.238 0.148 0.084 0.038 0.004 -0.010 -0.048 -0.058 -0.058 0.088 0.106 0.138 0.161 0.175 0.161 0.189 0.225 0.255 0.242 0.185 0.106 0.037 0.012 -0.011 -0.032 -0.060 -0.051 -0.069 0.144 0.156 0.214 0.292 0.247 0.193 0.184 0.232 0.273 0.302 0.169 0.036 0.018 -0.005 -0.032 -0.047 -0.056 -0.061 -0.065 0.173 0.198 0.299 0.657 0.308 0.234 0.202 0.225 0.306 0.638 0.127 -0.160 -0.032 -0.012 -0.030 -0.049 -0.063 -0.068 -0.063 0.172 0.193 0.257 0.341 0.276 0.231 0.207 0.209 0.230 0.257 0.118 -0.015 -0.023 0.057 -0.020 -0.017 -0.045 -0.057 -0.060 0.164 0.173 0.205 0.242 0.215 0.184 0.166 0.170 0.166 0.168 0.110 0.014 0.007 0.003 -0.014 -0.020 -0.029 -0.055 -0.063 0.161 0.172 0.200 0.227 0.204 0.190 0.173 0.156 0.161 0.161 0.109 0.037 0.022 0.004 0.007 -0.010 -0.036 -0.041 -0.053 - To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: svg-developers-dig...@yahoogroups.com svg-developers-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: svg-developers-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[svg-developers] Re: How to convert svg rect to path
Thanks for the help has been very useful --- In svg-developers@yahoogroups.com, John Delacour wrote: > > At 11:46 + 20/10/10, fi...@... wrote: > > >Anybody can help me with svg rect convertion to svg path? I need > >know the steps to convert rect parameters to path commands. > > > >Example, I have: > > > >rect: > >height 2.8569181 > >width 90.898613 > >x 20.280216 > >y 838.27399 > >rx 0.9670065 > >ry 1.2499017 > > > >Inkscape make this: > > > >m 21.247223,838.27399 88.964597,0 c 0.53572,0 0.96701,0.55745 > >0.96701,1.2499 l 0,0.35711 c 0,0.69245 -0.43129,1.2499 > >-0.96701,1.2499 l -88.964597,0 c -0.535722,0 -0.967007,-0.55745 > >-0.967007,-1.2499 l 0,-0.35711 c 0,-0.69245 0.431285,-1.2499 > >0.967007,-1.2499 z > > > >My problem is with c command control points. > > You are dealing here not with curves but elliptical arcs, so the > maths is extremely simple. Here's a perl script that does the job > and should be self-explanatory. Where you actually start the path is > up to you. > > > #!/usr/bin/perl > use strict; > # Rectangle > my $height = 2.8569181; > my $width = 90.898613; > my $x = 20.280216; > my $y = 838.27399; > my $rx = 0.9670065; > my $ry = 1.2499017; > # My dims > my $mx = $x; > my $my = $y + $ry; > my $v = $height - 2 * $ry; > my $h = $width - 2 * $rx; > # Print path > print " "m $mx $my " . > "v $v " . > "a $rx $ry 0 0 0 $rx $ry " . > "h $h " . > "a $rx $ry 0 0 0 $rx -$ry " . > "v -$v " . > "a $rx $ry 0 0 0 -$rx -$ry " . > "h -$h " . > "a $rx $ry 0 0 0 -$rx $ry" . > "\" />"; > > RESULT: > > > JD > - To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: svg-developers-dig...@yahoogroups.com svg-developers-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: svg-developers-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/