|
From: Ethan A M. <merritt@u.washington.edu> - 2008-12-21 19:42:22
|
On Sunday 21 December 2008, pl...@pi... wrote: > > I have had another think about adding functionality to svg terminal. > Today I realised that in using my gnuplot output to study system > performance I am constantly needing to read x,y values off the graph. > This currently means zooming to a large magnification, placing the mouse > cursor and then scrolling with arrow keys and praying that it falls near > enought to the axis to read the minor ticks near the cursor. > > In short rather unsatisfactory and hacky. > > What I need is something like the wxt terminal cursor output. > > How feasible would it be to add an onhover or onclick event and grab > the event x,y and display plot related x,y values? It should be feasible. I have been trying to drum up enthusiasm for this, and find a volunteer to code it. > That sounds like it would be fraught with browser compatibility issues. To some extent. But there are working example of cross-platform code that uses javascript to do mouse-tracking. Here is one: http://dunnbypaul.net/js_mouse/ As I see it, we need to put the following in place: - create a jscript/ECMScript/javascript/whatever mouse-tracker, which can be loaded from either the user's own web site or from some central place like the gnuplot pages on SourceForge. It should read the current mouse coords, apply a transformation matrix (see next) and print the transformed coordinates on the page, similar to the current interactive terminals. - have the svg driver emit code that refers to the script by its URL, and initializes the coordinate system to correspond to the one in the current plot by providing an appropriate transformation matrix. There may be other ways to do it. I am intrigued by the "canvas terminal driver" uploaded to SourceForge as patch #2056054 -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |