|
From: sfeam (E. Merritt) <eam...@gm...> - 2011-10-20 15:47:22
|
On Thursday, 20 October 2011, pl...@pi... wrote: > On 10/20/11 02:17, Ethan A Merritt wrote: > How about: > > svg name is a javascript variable and has restrictions (eg no spaces or > dots '.' ). If you want to hide the technical details from the user, wouldn't it be better to avoid mention of javascript and simply say: "name" must not contain spaces or punctuation > 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. > >>> Would it be > >>> better to substitute spaces with underscores internally when composing > >>> the id and allow spaces in name, and hence the visible title? It depends on who you expect to be the typical user. I have used svg mostly in the context of making web pages, and most of my experience came from adapting the automated script for generating gnuplot's collection of on-line demos. Because it's an automated script, it depends on the "name" being used exactly as specified. If the program were to do any character substitution then the corresponding javascript generated by the script would not find a plot element with the appropriate name. > ... 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. Aha. But this only seems to be relevant if you point the browser directly at the svg file itself, rather than at an html/xml document that contains the svg file. I hadn't noticed, because I don't normally use the browser that way. I have no objection to adding a "title" keyword, that defaults to the bare plot name if not provided. For that matter, perhaps the keyword "name" should be "jsname"? Anyhow, at some point it would be nice to add a new section to the documentation dealing with generation of web pages. The concerns with javascript namespace, etc, are also relevant to the HTML5 canvas terminal. > 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. Christoph points out that the current scheme doesn't deal well with multiplot mode. All the plots in a multiplot get the same name. Ethan |