#424 Add interactive zoom/unzoom to canvas terminal

closed-accepted
Ethan Merritt
None
5
2009-04-01
2009-03-18
Ethan Merritt
No

This patch updates canvas.trm and gnuplot_mouse.js to support additional interactive operations, including zoom/unzoom.

Features:
- Client side click-and-drag zooming of plots
- Coordinate space oversampled to retain precision
- Size of output *.js files reduced by roughly 25%

Possible extensions under consideration:
- Add widget to increase/decrease font size
- Add widget to toggle log/unlog axis scale
- Allow some regions of the plot (e.g. title, colorbar)
to be excluded from zooming
- Make the point types into javascript subroutines
so that they are invariant under zooming

Demos:
- Demo collection has been updated with patched driver.
Check out zoom/unzoom using the front page sample plot

http://gnuplot.sourceforge.net/demo_canvas/

Wishlist:
- Add widget to toggle log/unlog of color palette
- Improved zoom algorithm that considers [x,y] jointly
- Do something more useful with 3D plots
- Automate scripting to allow generation of multiple
zoomable plots on a single web page

Discussion

  • Ethan Merritt
    Ethan Merritt
    2009-03-20

    - Break out the point type definitions and other helper routines into a separate file gnuplot_lib01.js.
    - Calculate zooming based on coordinate pairs [x,y], allowing different clipping decisions depending on where [x,y] is on the canvas.
    - Add a help-page link
    File Added: canvas_zoom_20mar2009.patch

     
  • Ethan Merritt
    Ethan Merritt
    2009-03-22

    Adds client-side zoom/unzoom to canvas terminal

     
  • Ethan Merritt
    Ethan Merritt
    2009-03-22

    -Track x2 and y2 axes, if present
    -More complete set of CSS entities
    -Left-click leaves an annotated point on the plot
    File Added: canvas_zoom_21mar2009.patch

     
  • Ethan Merritt
    Ethan Merritt
    2009-03-30

    Adds client-side zoom/unzoom/hotkeys to canvas terminal

     
  • Ethan Merritt
    Ethan Merritt
    2009-03-30

    This iteration adds basic hotkey support (keys: r e n p u g).

    Works fine in Opera.
    Unfortunately I cannot persuade Firefox to deliver the keypress events to the script;
    maybe there is some obscure configuration setting?

     
  • Ethan Merritt
    Ethan Merritt
    2009-04-01

    Added to cvs.
    Still to do:
    - Persuade Firefox to deliver keypress events
    - Write a toggle log scale widget to hook up to the 'l' hotkey
    - It would be nice if one could pass a format statement for mouse tracking

     
  • Ethan Merritt
    Ethan Merritt
    2009-04-01

    • status: open --> closed-accepted