Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #1220

Re: how to display mouse tracking box in gnuplot canvas terminal

From sfeam <sfeam@users.sourceforge.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: how to display mouse tracking box in gnuplot canvas terminal
Followup-To comp.graphics.apps.gnuplot
Date 2012-06-22 19:43 -0700
Organization gnuplot development team
Message-ID <js3ah2$tbp$1@dont-email.me> (permalink)
References <3f292874-db7c-4f06-8a0b-be6479cade21@s6g2000pbi.googlegroups.com>

Followups directed to: comp.graphics.apps.gnuplot

Show all headers | View raw


jaya choudhary wrote:

> Hi,
> I have installed gnuplot4.6 in my Fedora 15 system. I am trying to
> plot a graph using gnuplot canvas terminal and wrap it in an html file
> so that a mouse tracking box is visible below the plot. It should
> allow tracking mouse movement, zoom in, zoom out etc. as shown on
> http://gnuplot.sourceforge.net/demo_canvas_4.6/.
> 
> I am using the following file fishplot.html:
> 
> 
> <html>
> <head>
> <script src="canvastext.js"></script>
> <script src="gnuplot_common.js"></script>
> <script src="gnuplot_mouse.js"></script>
> <link rel="stylesheet" type="text/css" href="gnuplot_mouse.css" />
> </head>
> <body onload="fishplot();">
> <script src="fishplot.js"></script>
> <canvas id="fishplot" width=600 height=400>
> <div id="err_msg">No support for HTML 5 canvas element</div>
> </canvas>
> </body>
> </html>
> 
> The gnuplot commands used are:
> gnuplot>set term canvas name 'fishplot' standalone mousing
> gnuplot>set output 'fishplot.js'
> gnuplot>plot sin(x)
> 
> When fishplot.html is viewed in browser, only the left click
> functionality which marks the current co-ordinates of mouse in
> browser is working.

I would expect the zoom operation to work also (click and drag to define 
zoom box).  Is it not working?

> How to make the mouse-tracking toolbox appear in browser and how to
> make those functionality work?

You need to provide an appropriately named set of fields for the
browser to print the mouse coordinates in (HTML, not javascript).
There is a sample file showing how this might look in the gnuplot
source distribution
  .../demo/html/mousebox.template

That directory also contains the script webify_canvas.pl that is
used to general the demos you see on-line.  If you name your 
gnuplot command file fishplot.dem, then from the demo/html
directory you can type
   make -f Makefile.canvas fishplot.html
to generate a mouseable HTML page in the same style as the online
demos.


> Do I need to write additional code for .html and .js files? If yes,
> then why is the 'left click ' function working?

You do not need to write additional javascript unless you want to
customize the formatting of mouse coordinates, or apply some other
custom transformation.  I think all the mousing functions are
probably working, but you haven't provided anywhere for the output
to appear.

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

how to display mouse tracking box in gnuplot canvas terminal jaya choudhary <cse.jaya@gmail.com> - 2012-06-22 02:46 -0700
  Re: how to display mouse tracking box in gnuplot canvas terminal sfeam <sfeam@users.sourceforge.net> - 2012-06-22 19:43 -0700
    Re: how to display mouse tracking box in gnuplot canvas terminal jaya choudhary <cse.jaya@gmail.com> - 2012-06-25 00:02 -0700
      Re: how to display mouse tracking box in gnuplot canvas terminal sfeam <eamerritt@gmail.com> - 2012-06-25 07:49 -0700
        Re: how to display mouse tracking box in gnuplot canvas terminal jaya choudhary <cse.jaya@gmail.com> - 2012-06-26 04:03 -0700

csiph-web