|
From: Ethan M. <merritt@u.washington.edu> - 2009-06-11 01:08:44
|
On Wednesday 03 June 2009 14:15:52 pl...@pi... wrote: > Ethan Merritt wrote: > > The issue is clearest for the canvas terminal, where "both directions" does not > > apply. I want to toggle between linear/logscale or linear/transform in the > > javascript code on the browser. There is no back-connection to the original > > gnuplot run. > > > > I am arguing that it may be preferable to send terminal coordinates corresponding > > to linear scale, plus some clue how they should be transformed by the viewer > > upon request. > > I'm wondering about the rationality of this. "Toggling" log/transform > scaling is really a euphormism for a total replot it seems. You > fundementally change the x or y scale transformation and have to do a > full replot of the data, axes and all. My goal is to come as close as feasible to replicating the capabilities of the existing interactive terminals (win x11 wxt qt) in the browser-based terminals (canvas svg). Except that I've kind of given up on svg :-( > This is feasible in a live terminal such as wxt since gnuplot is > available to do the replotting. In the case of write-once interactive > terminals I see two possibilities: > > 1/ export two renditions of the graph and a trivial js routine to toggle > them. This could be similar to the line visibility toggle already > working for svg but on a larger object. I suspect the coding would be > trivial and fairly portable. It's a little worse than that. The axes, including the color palette, can all be individually toggled. So at least in principle you might have to export 2^N alternative plots. I agree that it's unlikely in practice that you would want more than 4 = 2^2 (y or z, colorbar) Also you are forgetting that in order to track mouse coordinates, the browser-side code already has to know how to back-transform the displayed coordinates. Since we have to provide that capability anyhow to allow mousing, why not also use it to toggle the axis scaling? > 2/ export enough information and js code for the interactive terminal to > redraw new axes, tic labels , grid, plot lines, axes labels and > possibily alter the legend. It seems that this close to the entire plot > job except parsing the input data. It is reproducing most of what > gnuplot would do. Gnuplot is no longer a plotter but a preprocessor. > This seems rather off target in terms of what gnuplot should be doing. That overstates the fraction of the total task that would be handed off to the viewer. To handle zoom/unzoom, the code in gnuplot_mouse.js already does most of what you list. It's just not that much code. -- Ethan A Merritt |