|
From: <pl...@pi...> - 2008-12-22 10:24:14
|
Ethan A Merritt wrote: >> Hi Ethan, >> >> maybe I'm missing the point but can't the javascript be included in the >> SVG xml? I don't see it as desirable solution to wait for a response >> from sourceforge before my plot can fully render, nor that I need an >> open internet connection to diplay a local file. > > I know very little about mixing javascript and svg, so I can't answer > that question. But the shared URL could still be a local file. I'll try to find time to look into that a bit over the new year. If you can link to an external script I dont see why it can't be within the file itself. > >> Externalising what could potentially be common and invariant code may be >> an option but I would have thought the first aim should be a self >> contained svg file. > > In pretty much all cases that I generate SVG plots, it is for display on > dynamically generated pages that contain multiple plots. Again I don't > know that much about it, but it would seem to me that you would need a > single copy of the script that serves the entire page, and mousing into > the box of any individual plot just triggers a new mouse_coord->plot_coord > transformation matrix. I don't know if you can have multiple copies of > the same script on the same page, separated by the scope of the > <svg> tags. But maybe you can. > I have not tried to do this in detail but I envisage a <script> tag defining the function called from an onclick or onhover event on elements on the graph. This may be possible on the <svg> itself. Bill's plot toggle seems to establish the principal of how to do that. In the mean time it would be good to start defining what functionality to add and how to integrate this into gnuplot command structure. I would strongly recommend a well thought out and extensible structure because the possibilities that this kind of technique opens up are vast. It should be anticipated from the outset that this will develop over time to be a very full featured extension quite likely with the need to user definable elements. Maybe a starting point would be to see how to add Bill's toggle and the coord display features to the command structure. I only have a user's understanding of the command syntax so I'll let others consider that one. regards, Peter. |