|
From: <pl...@pi...> - 2011-10-20 11:03:26
|
On 10/20/11 02:17, Ethan A Merritt wrote: > On Wednesday, October 19, 2011 03:57:09 pm pl...@pi... wrote: >>> Since I raised the topic , there are two things there the id and the >>> title, name gets used for both. >>> >>> Clearly id cannot have spaces so attempting a name with a space throws >>> an error, though >>> " line 133: illegal javascript variable name" is a bit cryptic unless >>> one is familiar with the mechanics of svg. > > Well, it really is the javascript that cares, not the svg. > But feel free to suggest a more helpful error message. I fully agree it is accurate and it is js syntax that requires it but to a user trying to make a graph they're just going to say "WTF!?" . The message makes sense to the programmer but is totally out of context for the user. How about: svg name is a javascript variable and has restrictions (eg no spaces or dots '.' ). Of course , parsing the name as I suggested would probably prevent the user needing to know what a valid js variable name is. He probably should not need this level of knowledge to plot a graph. > >>> A title with underscores, though legible, is not too pretty. Would it be >>> better to substitute spaces with underscores internally when composing >>> the id and allow spaces in name, and hence the visible title? > > Sorry, I don't understand what you are suggesting there. What do you mean > by the "visible" title? Visible to whom? Using what tool? > You seem to have missed my point earlier that name is used twice. Once as svg id , once as svg title. It is the title which is visible in the viewer. In the case of firefox it appears in the tab title and the currently displayed tab's title is also shown in FF window title bar. Showing the filename or title in the application title bar is fairly common and I would expect this on other viewers as well. So TITLE is visible and has no js restrictions, ID has the restrictions you pointed out. >> PS I've just noticed that even when I do specify a name , the svg title >> still gets "plot_1" appended to the name I specified. >> >> Is this necessary in some way , or is it an oversight? > > It is absolutely necessary. That is how the document distinguishes which > elements belong to plot 1, which to plot 2, and so on. That way it is > possible to globally toggle properties of one plot without affecting the > others. These, by the way, are multiple plots within the same graph. > If there are multiple graphs in the document, then we have globally > accessible handles for > name1_plot_1 ... name1_plot_N > name2_plot_1 ... name2_plot_M > and so on. > Yes, I appreciate why you need different and unique ID's , this is a well thought out feature . Again , I think this is simply that you missed my distinction about id vs. title. I see no reason why the svg title has to be affected plot_N . I don't see right away where you could have multiple plots without an HTML wrapper, in which case it is the title of the wrapper that will get displayed. Maybe I'm missing some case you are aware of. > Note that someone requested a more complex namespace > https://sourceforge.net/tracker/?func=detail&aid=3205221&group_id=2055&atid=352055 > and Christoph Bersch put together a patch that may or may not satisfy > the request. Neither Christoph nor I am sufficiently knowledgeable about > svg to judge whether the request is reasonable and whether the patch > implements it correctly. Please help us by adding your thoughts, if you can. > > Ethan > svg title element is a text element that is intended to be human readable, it is not part of the namespace. I'll look at the patch , but I'm not sure that I'm a qualified svg standards inspector ;) Thanks again. |