Re: [svg-developers] Re: How to make SVG image pattern fill move with object?

2013-02-12 Thread yannick . bochatay
Hi, the best advice I can give is : always trust what Robert says. It works with the transform attribute : $('rect').attr('transform', "translate("+ (Math.sin(i+=.01)*100+100) + ")"); Best regards, Yannick - Mail original - De: "Yang Zhang" À: svg-developers@yahoogroups.com Envoyé: Lund

Re: [svg-developers] getElementById -problem in Firefox - works in IE with Adobe PlugIn

2013-02-01 Thread yannick . bochatay
Hi, just put your code at the end or wrap it in an "onload" function. Cheers, Yannick - Mail original - De: "PETER" À: svg-developers@yahoogroups.com Envoyé: Vendredi 1 Février 2013 18:16:23 Objet: [svg-developers] getElementById -problem in Firefox - works in IE with Adobe PlugIn

Re: [svg-developers] Re: Loading SVG images dynamically and then accessing the dom

2012-11-19 Thread yannick . bochatay
Thanks Erik, I had foolishly never thought it would work so simply with responseXML. Pranav, I think the best way is to get rid of embed or object tags. Then you can access easily every HTML and SVG elements : var svg = document.querySelector('svg'); var div = document.querySelecto

Re: [svg-developers] Re: Loading SVG images dynamically and then accessing the dom

2012-11-19 Thread yannick . bochatay
Hi, personally, since it's possible in modern browsers, I would put the svg directly in html. And you can load and parse your file with an ajax call : var r = new XMLHttpRequest(); r.open("GET", "myFile.svg",true); r.onreadystatechange = function () { if (this.readyState != 4 || this.status !

Re: [svg-developers] Re: Standard Hover Effect

2012-10-18 Thread yannick . bochatay
Hi, why don't you just use css and pseudo class ":hover" ? To do more stuff with javascript and "use" elements, I use this test : var target = evt.target; if (!target.parentNode && target.correspondingUseElement) { target = target.correspondingUseElement; } So it works with Chrome and IE. Yanni

[svg-developers] svg file to image with 1 line of javascript and no library

2012-07-28 Thread yannick . bochatay
Hi all, maybe I'm naive, but I just discover that the canvas html element could draw svg files in one line of code. See the live example : http://ybochatay.fr/svg2png.htm The first butterfly is the original svg file, the second is the image drawn with canvas. Then you can easily export it to png

Re: [svg-developers] Re: Zoom In Out wih SVG

2012-07-23 Thread yannick . bochatay
Hi Barkha, the getScreenCTM method will help you (http://www.w3.org/TR/SVG/types.html#__svg__SVGLocatable__getScreenCTM). I wrote a little example : http://jsfiddle.net/ybochatay/aUYay/ by clicking in the svg area you'll get the coordinates of your mouse relatively to the specified viewbox. Regar

Re: [svg-developers] Preferred way of generating SVG

2012-06-13 Thread yannick . bochatay
Hi, I agree with Jason, javascript is the most promising way, the only one which will work on all platforms without any plugin. Yannick - Mail original - De: "Jason Barnabas" À: svg-developers@yahoogroups.com Envoyé: Mercredi 13 Juin 2012 08:22:28 Objet: Re: [svg-developers] Preferred wa

Re: [svg-developers] Zoom In Out wih SVG

2012-06-09 Thread yannick . bochatay
I've worked on a library with zoom and pan features : http://ybochatay.fr/CariSVG/ It works fine but I won't maintain it : I'm completely rewriting it with a wrapper (instead of working with prototypes), a better API and in a way to get autocompletion in Eclipse. Here's a first draft for mousewh

Re: [svg-developers] Re: Zoom In Out wih SVG

2012-06-07 Thread yannick . bochatay
no API, countless global variables, browser sniffing, etc, to my mind SVGPan is not a good choice. But it's short and standalone so it can help to understand how a zoom can work. Yannick - Mail original - De: "jamesd" À: svg-developers@yahoogroups.com Envoyé: Mercredi 6 Juin 2012 22:33:

Re: [svg-developers] Methods getScreenBBox(), getBBox(), getScreenCTM() ?

2012-05-31 Thread yannick . bochatay
Hi Manfred, you only need to test if the method exists : var myElmt = document.getElementById('myElmt'); var box; if (myElmt.getScreenBBox) { box = myElmt.getScreenBBox(); } else { /* fallback */ } Cheers, Yannick - Mail original - De: "Manfred Staudinger" À: svg-developers@y

Re: [svg-developers] Methods getScreenBBox(), getBBox(), getScreenCTM() ?

2012-05-31 Thread yannick . bochatay
Hi Manfred, getBBox and getScreenCTM are implemented in all modern browsers (IE>=9). Unfortunately there's no ideal workaround for getScreenBBox, as you can read here : http://groups.google.com/group/lib-gwt-svg/browse_thread/thread/1560b1282433fbd5 The simpliest is probably to use the getBoundin

Re: [svg-developers] Get first parameter of rotate function

2012-05-22 Thread yannick . bochatay
Hi, you'd better use the transform property of the SVG DOM elements. Here is a little function to get the angle properly : http://jsbin.com/usopay/edit#javascript,html Yannick - Mail original - De: "svgdeveloper" À: svg-developers@yahoogroups.com Envoyé: Dimanche 20 Mai 2012 13:41:11 Obj

Re: [svg-developers] Stopping back button in Safari

2012-04-06 Thread yannick . bochatay
Hi Chris, All you can do is dealing with the HTML5 history API, but you can't really stop the back button, and it's not advisable. https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history Yannick - Mail original - De: "Chris Peto" À: svg-developers@yahoogroups.com Envoyé: Ma

Re: [svg-developers] Trying to work around text's lack of a background

2012-04-06 Thread yannick . bochatay
Hi Ben, since the getBBox method returns a SVGRect object, it's only few lines of javascript to create/update a rect element behind your text element, no math and you can go shopping. function setText(textElmt,str) { textElmt.textContent = str; var box = textElmt.getBBox(); var rect = d

Re: [svg-developers] showing full svg content whithout calculating extents

2012-04-06 Thread yannick . bochatay
Hi, if all your shapes are included in a g element, you can use the getBBox method on this node to get the dimensions. In your example : document.getElementById('G2').getBBox() Yannick - Mail original - De: "Alireza" À: svg-developers@yahoogroups.com Envoyé: Jeudi 5 Avril 2012 10:19:19

Re: [svg-developers] Reverse the Javascript?

2012-04-06 Thread yannick . bochatay
Hi James, you can use window.scrollTo(0,0). https://developer.mozilla.org/en/Window.scrollBy https://developer.mozilla.org/fr/DOM/window.scrollTo Yannick - Mail original - De: "jamesd" À: svg-developers@yahoogroups.com Envoyé: Vendredi 6 Avril 2012 01:43:11 Objet: [svg-developers] Revers

Re: [svg-developers] Re: Bezier curves : adding curves equivalent to share control points?

2012-02-14 Thread yannick . bochatay
I think you mix the order of the arguments : C x1,y1 x2,y2 x,y in "c1", the second control point is 105,55 and the current point 105,55 too. So the reflection is 105,55. I guess the correct code is : Cheers, Yannick - Mail original - De: "philsvg" À: svg-developers@yahoogroups.com

Re: [svg-developers] Bezier curves : adding curves equivalent to share control points?

2012-02-13 Thread yannick . bochatay
Bonjour Philippe, you have a syntax error in "c2" : "S 200,100 200,55 200,55" is not valid. In "c4", in the "S" segment the first control point is the reflection of the last one : in your case the last control point is "150,10", the current point is "150,100", so the reflection is "150,190" and n

Re: [svg-developers] markerline symbol

2012-02-03 Thread yannick . bochatay
Hi Ruth, is the getPointAtLength method what you're looking for ? http://www.w3.org/TR/SVG/paths.html#InterfaceSVGPathElement Yannick - Mail original - De: "Ruth Lang" À: svg-developers@yahoogroups.com Envoyé: Vendredi 3 Février 2012 17:42:56 Objet: [svg-developers] markerline symbol

Re: [svg-developers] problem adding multiple SVG's containing event listeners in HTML5

2012-01-26 Thread yannick . bochatay
Hi, your variables are declared as global, so when you call the init function a second time, they are overwritten. Just move these variables and functions inside the Init constructor and it will be fine (see below). Yannick function Init(anchor) { var SVGRoot = null; var

Re: [svg-developers] SVG in HTML5

2012-01-16 Thread yannick . bochatay
Hi Aron, just change the input type to "button", cause "submit" will reload the page. Yannick - Mail original - De: "aronsta" À: svg-developers@yahoogroups.com Envoyé: Vendredi 13 Janvier 2012 10:39:17 Objet: [svg-developers] SVG in HTML5 Hello everyone! I'm new to SVG and web desi

Re: [svg-developers] NodeList.prototype in opera

2012-01-07 Thread yannick . bochatay
Thanks Erik. It's surprising from Opera, usually so compliant. One more reason not to extend prototypes probably. Yannick. - Mail original - De: "Erik Dahlstrom" À: svg-developers@yahoogroups.com Envoyé: Jeudi 5 Janvier 2012 15:03:28 Objet: Re: [svg-developers] NodeList.prototype in opera

Re: [svg-developers] Bézier Curves or Catmull-Rom Curves

2012-01-07 Thread yannick . bochatay
I can talk about CariSVG since I wrote it. I would be glad if you used it, but be careful it's a draft, there's already many things I need to improve. If you need to smooth a path, you can try this little function : http://jsfiddle.net/ybochatay/gQEZw/ raphaeljs is a great library since it works w

Re: [svg-developers] Use the cursor (arrows) to move up and down elements?

2012-01-07 Thread yannick . bochatay
up and down > elements? > > Thanks a lot for that. > > Would the elements be listed in the first line as [g4, g8, g12] or as > ["g4", "g8", "g12"...]? > > Do I need to add a onclick event to the text elements from which then the >

Re: [svg-developers] NodeList.prototype in opera

2012-01-05 Thread yannick . bochatay
I just downloaded opera 12 alpha and I get the same result. Here's the screenshot : Yannick - Mail original - De: "Cameron McCormack" À: svg-developers@yahoogroups.com Cc: "yannick bochatay" Envoyé: Mercredi 4 Janvier 2012 23:47:51 O

[svg-developers] NodeList.prototype in opera

2012-01-04 Thread yannick . bochatay
7;).myExtendedMethod); //undefined This is not a SVG issue but I didn't found any resource on the web (except this one without any answer), and I know there are experts in opera browser in this mailing-list. Thanks in advance for your help ! Cheers Yannick Bochatay [Non-text portions of this

Re: [svg-developers] audio problem

2011-12-22 Thread yannick . bochatay
Hi, the "audio" tag is not SVG but HTML, so you have to use the " foreignobject " tag : Yannick http://ybochatay.fr - Mail original - De: "ozeroguz01" À: svg-developers@yahoogroups.com Envoyé: Jeudi 22 Décembre 2011 13:58:03 Objet: [svg-developers] audio problem

Re: [svg-developers] Interactive SVG & matrix calculations

2011-10-26 Thread yannick . bochatay
Hi, To scale or rotate about a fixed point, you have first to translate your element so that the fixed point is at the origin. Then you perform the scaling or rotation and then the inverse of the original translation to move the fixed point back to its original position. For example, if you want

Re: [svg-developers] normalizedPathSegList

2011-10-19 Thread yannick . bochatay
and Z segments. You can set the degree of Bezier Curves to approximate arcs (1 will produce L segments, 2 Q, 3 C), and the defaultFlatness. Regards, Yannick Bochatay http://ybochatay.fr - Mail original - De: "yannick bochatay" À: svg-developers@yahoogroups.com Envoyé: Mercredi

Re: [svg-developers] Use the cursor (arrows) to move up and down elements?

2011-10-17 Thread yannick . bochatay
be initiated? Stef On Oct 13, 2011, at 6:48 AM, yannick.bocha...@free.fr wrote: > Hi, > I wrote something quickly (no test), are you looking for something like that ? > Regards, > > Yannick Bochatay > http://ybochatay.fr > > var yourListOfElements = [ elmt1, elmt2 /*, etc

Re: [svg-developers] SVG - marketing efforts

2011-10-13 Thread yannick . bochatay
I totally agree with you. Most people are excited with canvas technology but nobody seems to care about svg, which can usually do as well and for years. I just do not understand. I'm not good in marketing but I hope word of mouth will finally make its way. Regards, Yannick Bochatay

Re: [svg-developers] Mouseover to show a line, mouseclick to leave it there. How?

2011-10-13 Thread yannick . bochatay
('mouseout',hideLine,false); yourElement.addEventListener('click',function() { yourElement.removeEventListener('mouseout',hideLine,false); },false); I hope it will help. Cheers, Yannick Bochatay http://ybochatay.fr - Mail original - De: "luftikus_1

Re: [svg-developers] Use the cursor (arrows) to move up and down elements?

2011-10-13 Thread yannick . bochatay
Hi, I wrote something quickly (no test), are you looking for something like that ? Regards, Yannick Bochatay http://ybochatay.fr var yourListOfElements = [ elmt1, elmt2 /*, etc */ ]; var currentElement = false; var focusOnElement = function(ind) { if (currentElement) { /* code to blur

[svg-developers] normalizedPathSegList

2011-10-12 Thread yannick . bochatay
ld do (but not implemented yet) ? I wrote an example at http://jsfiddle.net/s32LX/, but I've put the code below anyway. Best regards, Yannick Bochatay http://ybochatay.fr SVGPathElement.prototype.mtx2attrs = function(mtx) { var seg,letter,point,pt={}, angle = Math.ata