[svg-developers] how to get width of text node through javascript
Hi folks, My code as following: var svgns = http://www.w3.org/2000/svg;; //Step 1: create one lable var dat= svgDoc.createTextNode(I am one rect); var t = svgDoc.createElementNS(svgns,text); t.setAttributeNS(null,x,6); t.setAttributeNS(null,y,20); t.setAttributeNS(null,text-anchor, start); t.appendChild(d); //Step 2: create one rectangle to wrap the label created in step 1 var r = svgDoc.createElementNS(svgns, rect); r.setAttributeNS(null, x, 5); r.setAttributeNS(null, y, 5); r.setAttributeNS(null, width, 40); //here is dynamic number will be adjusted accrdoing to the label width r.setAttributeNS(null, height, 40); I want to get the width of the text node to make the rect can wrap the label very well, but I can only get the number of letters, anyone knows how to get it? much appreciate for your help in advanced. - To unsubscribe send a message to: [EMAIL PROTECTED] -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: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[svg-developers] Re: how to get width of text node through javascript
could you please explain more about how to invoke the interface. I tried below ways, all were failed: var dat= svgDoc.createTextNode(I am one rect); var t = svgDoc.createElementNS(svgns,text); t.setAttributeNS(null,x,6); t.setAttributeNS(null,y,20); t.setAttributeNS(null,text-anchor, start); t.appendChild(d); dat.getComputedTextLength(); // returns error or t..getComputedTextLength(); // returns 0, not correct too. --- In svg-developers@yahoogroups.com, Antoine Quint [EMAIL PROTECTED] wrote: Hi, You can simply use the .getComputedTextLength() method. It's part of the SVGTextContentElement interface which has other useful methods on it to work with text and tspan elements. http://www.w3.org/TR/SVG11/text.html#InterfaceSVGTextContentElement Antoine -- Blog http://the.fuchsia-design.com - To unsubscribe send a message to: [EMAIL PROTECTED] -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: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [svg-developers] Re: how to get width of text node through javascript
On 15 oct. 07, at 11:31, juninbox wrote: could you please explain more about how to invoke the interface. I tried below ways, all were failed: var dat= svgDoc.createTextNode(I am one rect); var t = svgDoc.createElementNS(svgns,text); t.setAttributeNS(null,x,6); t.setAttributeNS(null,y,20); t.setAttributeNS(null,text-anchor, start); t.appendChild(d); dat.getComputedTextLength(); // returns error Indeed, getComputedTextLength() does not work on text nodes. or t..getComputedTextLength(); // returns 0, not correct too. This should work (well, as long as you have a single dot there). When you call that method, is your text element already added to the document? Make sure it is, and has font-size, etc. information specified either explicitely or implicitely via value inheritance. Antoine -- Blog — http://the.fuchsia-design.com - To unsubscribe send a message to: [EMAIL PROTECTED] -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: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[svg-developers] Re: how to get width of text node through javascript
yes, you right, after I appended the element into svgdoc, I got correct width. many thanks! --- In svg-developers@yahoogroups.com, Antoine Quint [EMAIL PROTECTED] wrote: On 15 oct. 07, at 11:31, juninbox wrote: could you please explain more about how to invoke the interface. I tried below ways, all were failed: var dat= svgDoc.createTextNode(I am one rect); var t = svgDoc.createElementNS(svgns,text); t.setAttributeNS(null,x,6); t.setAttributeNS(null,y,20); t.setAttributeNS(null,text-anchor, start); t.appendChild(d); dat.getComputedTextLength(); // returns error Indeed, getComputedTextLength() does not work on text nodes. or t..getComputedTextLength(); // returns 0, not correct too. This should work (well, as long as you have a single dot there). When you call that method, is your text element already added to the document? Make sure it is, and has font-size, etc. information specified either explicitely or implicitely via value inheritance. Antoine -- Blog http://the.fuchsia-design.com - To unsubscribe send a message to: [EMAIL PROTECTED] -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: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[svg-developers] How to fill a path with color
I have the following code, which builds a pie chart using paths to fill each segmant:- this.PieElements = new Array() // array of pie wedges this.PieElements[this.PieElements.length] = this.SVGDocument.createElementNS(http://www.w3.org/2000/svg;, path) if(SegmentCount == 1){ alert(Segment count=+ this.PieElements.length) this.PieElements[this.PieElements.length - 1].setAttributeNS(null,fill,black) //ADDED BY MJ this.PieElements[this.PieElements.length - 1].setAttributeNS(null,stroke,red) //ADDED BY MJ this.PieElements[this.PieElements.length - 1].setAttributeNS(null,id,black) //ADDED BY MJ } else{ this.PieElements[this.PieElements.length - 1].setAttributeNS(null,fill,Color) //ADDED BY MJ this.PieElements[this.PieElements.length - 1].setAttributeNS(null,stroke,black) //ADDED BY MJ this.PieElements[this.PieElements.length - 1].setAttributeNS(null,id,pie+Color) //ADDED BY MJ } when SegmentCount = 1 the fill does NOT apply. If there is more than 1 segment then the color variable from an array of colors selects a color and fills in the path correctly. Collaborate to Innovate! Register today for Telelogic's annual User Group Conference November 19-21 in South Wales Learn more at www.telelogic.com/campaigns/2007/ugc/uk/index.cfm Telelogic Lifecycle Solutions: Helping You Define, Design Deliver Advanced Systems Software Learn More at www.telelogic.com Mandeep Jootle Senior Web Developer Telelogic UK Ltd. Parkway 1 Broxell Close CV34 5QF, Warwick United Kingdom Phone: +44 (1926) 474 120 Fax: +44 (1926) 474 101 Mobile phone: [EMAIL PROTECTED] http://www.telelogic.com Telelogic - Requirements-Driven Innovation! - The information contained in this e-mail, including any attachment or enclosure, is intended only for the person or entity to which it is addressed and may contain confidential material. Any unauthorized use, review, retransmissions, dissemination, copying or other use of this information by persons or entities other than the intended recipient is prohibited. [Non-text portions of this message have been removed] - To unsubscribe send a message to: [EMAIL PROTECTED] -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: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[svg-developers] Please help to modify a code
Hello, Quite a long time ago, I was helped by a list member with an svg and javascript code for my linguistic research. I greatly appreciate his/her expertise and kindness. Now I am intending to modify the code. The original code is in the following web page: http://www.pinyinology.com/zhgp/characters5.svg In above file, only the Chinese characters in the left small circle appear alternatively. The word in the right small circle stays static. I want to put more words, such as bake, cake, lake, shake, in the right small circle, and make them also replace one another, as do those in the left small circle. So the elements in both left and right small circles will be in movement And the set of buttons, currently controls the movement in left small circle, will do so for both the left and right small circles. I tried to program by myself, but ended with no success at all. The javascript code with //right diagram is the result of my efforts. It does work. I wish someone could help me again. Thanks a lot. Fulio Pen - Tonight's top picks. What will you watch tonight? Preview the hottest shows on Yahoo! TV. [Non-text portions of this message have been removed] - To unsubscribe send a message to: [EMAIL PROTECTED] -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: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[svg-developers] Re: Google searching for SVGs now on?
--- In svg-developers@yahoogroups.com, ~:'' ãããã¨ããããã¾ããã [EMAIL PROTECTED] wrote: I didn't know offiletype, but the results seem very poor. do you have some good cases? with: filetype:svg Here's a query that gives lots of results: filetype:svg site:wikimedia.org Showing that it does search for text in a file: filetype:svgz stop sign It has some limitations, AFAICT: it doesn't really ensure the file is of type SVG (e.g., wikipedia has lots of pages named *.svg, which actually describe an SVG file); it doesn't find pages that are SVG that don't have the file suffix .svg (e.g., most of Andreas's fabulous mapping projects); and it only seems to find pages where the search text appears in the SVG file itself (not in the page linking to it). I find it most useful for searching for static SVG images rather than SVG sites. it's difficult to imagine this show a genuine ranking by popularity. as the SVG most likely isn't checked for links, google process breaks down Well, it does appear to factor in pagerank. This page, for instance, has a pagerank of 3: http://www.progressivepictures.com/map.svg with: site:www.peepo.co.uk filetype:svg there are no results, yet the site is only svg with: site:www.peepo.com filetype:svg there are no results, yet the site has many svg with: filetype:svg peepo only three results, yet there are more than twenty very similar to these, they are all in the same directory and not all appear to be indexed. I took a scan through the pages that are in googles index for these domains, and don't see many svg files referenced in any hrefs on those pages. That will probably inhibit google's ability to find them. While you incorporate .svgs by reference (in img, data, etc attributes), I don't think google will search those. Thanks, --kirby - To unsubscribe send a message to: [EMAIL PROTECTED] -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: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [svg-developers] Re: Google searching for SVGs now on?
kirby, using filetype:svg site:wikimedia.org it's seems evident that google is referencing the text in html pages, the results are labelled .svg but in fact are html regards Jonathan Chetwynd Accessibility Consultant on Media Literacy and the Internet On 15 Oct 2007, at 14:26, skatethere wrote: filetype:svg site:wikimedia.org - To unsubscribe send a message to: [EMAIL PROTECTED] -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: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[svg-developers] Could anyone help to modify a code
Hello, Quite a long time ago, I was helped by a list member with an svg and javascript code for my linguistic research. I sincerely appreciate his/her expertise and kindness. Now I am intending to modify the code. The original code is in the following web page: http://www.pinyinology.com/zhgp/characters5.svg In above file, only the Chinese characters in the left small circle appear alternatively. The word in the right small circle stays static. I want to put several words, such as bake, cake, lake, shake, in the right small circle, and make them also replace one another, as do those in the left small circle. So the elements in both left and right small circles will be in movement And the set of buttons, currently controls the movement in left small circle, will do so for symbols in both the left and right small circles, that is, clicking a button will stop, start, or reset movement in both circles. I tried to program by myself, but ended with no success at all. The javascript code with //right diagram is the result of my efforts. It does work. I wish someone could help me again. Thanks a lot. Fulio Pen - Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more! [Non-text portions of this message have been removed] - To unsubscribe send a message to: [EMAIL PROTECTED] -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: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [svg-developers] Could anyone help to modify a code
Fulio, just to be clear, this is not how I would do it... there's plenty of 'junk code' still present Probably javascript isn't necessary at all, hopefully you can move it along best wishes Jonathan Chetwynd Accessibility Consultant on Media Literacy and the Internet [Non-text portions of this message have been removed] - To unsubscribe send a message to: [EMAIL PROTECTED] -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: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[svg-developers] Re: Gradient problems
Thanks Frank. I use the tag use and it works. And now we found other problem, with use FF2 is very slow. The web is a xhtml document ( embbebed svg ) when i change to SVG pure it works faster. I've functionality in html. This is not true for ff3 or Opera. Is that other bug of FF2? Saludos, Damian --- In svg-developers@yahoogroups.com, Frank Bruder [EMAIL PROTECTED] wrote: Hi, Damian, it sounds like the id attributes of dynamically added content are not processed properly so referencing them would not work. Have you also tried it with graphics containing use elements? I guess they wouldn't work either. I'm not sure if that really is the source of the problem. If that's the case you might work around it by using always the same set of IDs for gradients and then always keeping the same set of gradient elements. When you dynamically replace a graphic you could obtain all gradient elements therein and copy their attributes and child nodes to your permanent gradient elements. Regards, Frank --- In svg-developers@yahoogroups.com, DamianZ damez77@ wrote: Hi. My name is Damian. I'm building a web proyect with SVG and I've this problem: In an interaction with AJAX I obtain a new graphic ( a svg complete with defs and gradients). This replace other svg by DOM API. When firefox rendering the new graphic the gradients is not show it. I guess the problem is the attribute fill:url(#MyGradient) inside style attribute. Is this a bug of firefox? What can I do ? Thanks. I invite to visite my academic project: www.wikidraw.com.ar - To unsubscribe send a message to: [EMAIL PROTECTED] -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: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[svg-developers] I cannot see my own posting
I wish the group leader could see this message. I left this group for a couple of days, and came back about 20 hours ago. After seeing postings by other members in my email account, I sent a message to the list. Not receiving it in my own email account after a few hours, I sent it again, believing the first one must not have been posted. But so far I've seen neither of the postings in my account. . However, a response was sent to my email account about half an hour ago. This means that my message must have appeared on the list at least once. Other members have seen it.. It was just not mailed back to me. I wish this problem can be solved soon, to let me see my own postings and those by others. If you've seen my posting twice, I apologize for the redundancy. Fulio - Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos more. [Non-text portions of this message have been removed] - To unsubscribe send a message to: [EMAIL PROTECTED] -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: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[svg-developers] Job Available
I hope nobody minds me posting this here as the SVG jobs group appears to be defunct:- Mango Solutions are a data analysis company based in the UK who work with some of the largest companies in the world delvering bespoke solutions that allow deployment of sometimes complex analysis to widespread user groups. As part of our work we often utilize SVG based solutions since our customers require production quality graphics. Mango are currently looking to recruit a developer to join the team of 11 in the west of England. The Role Develop, deliver and support bespoke graphical analytical solutions to blue chip clients in a variety of vertical markets. To assist in the deployment and support of developed applications. To participate in the design and implementation of bespoke statistical and reporting applications. Qualifications Degree in computer or mathematical based subject. Experience of developing SVG for Windows interfaces Good Knowledge of Batik Solid knowledge of Java and Internet technologies Useful skills include: XML, HTML, XSLT, JDBC, Databases, Application servers. Excellent communication skills. Offering Opportunity to extend your career within a rapidly evolving dynamic company. Exposure to broad range of technologies in a variety of vertical markets. Flexible working environment and working hours. Competitive salary. If you would like to apply for the position please send an up to date CV to [EMAIL PROTECTED] Likewise if you would like more information about the role or the company please use the same email address. - To unsubscribe send a message to: [EMAIL PROTECTED] -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: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [svg-developers] I cannot see my own posting
Hi, Fulio- I suspect the problem may be on your end. I've seen several posts by you, and your account shows that you should be receiving individual emails. Perhaps you need to update your email address on your account? Your messages do seem to be getting through, as you can see on the Yahoo list page: http://tech.groups.yahoo.com/group/svg-developers/messages Regards- -Doug Fulio Pen wrote (on 10/15/2007 4:11 PM): I wish the group leader could see this message. I left this group for a couple of days, and came back about 20 hours ago. After seeing postings by other members in my email account, I sent a message to the list. Not receiving it in my own email account after a few hours, I sent it again, believing the first one must not have been posted. But so far I've seen neither of the postings in my account. . However, a response was sent to my email account about half an hour ago. This means that my message must have appeared on the list at least once. Other members have seen it.. It was just not mailed back to me. I wish this problem can be solved soon, to let me see my own postings and those by others. If you've seen my posting twice, I apologize for the redundancy. Fulio - To unsubscribe send a message to: [EMAIL PROTECTED] -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: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/