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


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

Re: gnuplot running in your browser (compiled with emscripten)

Newsgroups comp.graphics.apps.gnuplot
Date 2013-01-02 03:37 -0800
References <aab46ae5-c5bd-4dab-80a6-db75d59ffe46@googlegroups.com> <kc00ri$glu$1@dont-email.me>
Message-ID <426e561f-b6fe-4635-a7f0-76c1964c4cb6@googlegroups.com> (permalink)
Subject Re: gnuplot running in your browser (compiled with emscripten)
From Christ H <chhu79@googlemail.com>

Show all headers | View raw


Hi Ethan,

thanks for the feedback! I am a researcher and was trying to run my fluid-dynamics code in the browser, which worked surprisingly well too, so the next thing was visualizing the results, where gnuplot is superior than any other JS libraries out there to plot things. My goal was to produce nice printable plots, which is why I focused on svg and not so much on mousing. 
You clearly tested this already more than I did. :)

> 2.5MB is pretty small already, but I think you could cut that down
> further by trimming the number of terminal drivers in the build.
> I can't see much point in context/corel/mif/pslatex/tektronix support.
Great idea! I removed X support via configure options already. Where would I need to start? Or is this possible with more config options?


> Aside from the problem with hidden3d, I notice that NaN and infinities
> are not handled correctly.  You can see this by running imageNAN.dem or
> by typing "print NaN".
I see, that might be a tough one, although JS handles infinity, NaN etc properly...

> I get an error page saying 
> "error on line 80 at column 36: Encoding error"
> if there are UTF-8 characters in the input script.
> It's not clear what level of the processing stack is involved;
> this is not an error from gnuplot per se.
Agreed, I am not sure how encoding is handled for HTML elements. What did you do? I tried to include a German umlaut character in the label, I don't get an error but the svg is corrupted or not created. 

> 
> I would have thought that modifying the script to use
>   set term svg enhanced size 1000,700 mouse \
>            jsdir "http://gnuplot.sourceforge.net/demo_svg_4.6/"
> would be sufficient to enable mousing, but it isn't.  This
> could be due to sandboxing by the browser (chrome), but I didn't 
> pursue it further.  Clearly it should work to include the mousing
> support scripts with the rest of the downloaded code, however
> in order to play with the mousing script it would be easier if it
> lived in a separate editable location.  Which brings me to...
I don't understand the mousing support, does gnuplot produce an additional js?

> 
> The obvious next step is to extend the mousing code so that you
> get true 3D interactive rotation and zoom.  
> That would be spectacular!
... and tough! ;) You are thinking of a simple feedback of new rotation parameters to the script? Even then you would need something like a cube that the user rotates to illustrate the new rotation position... 


> 
> 3D mouse support would be easier to do using the canvas terminal
> instead of svg because that way there needn't be an intermediate
> file (svg.out) in local storage.  
> 
> Either way the amount of new code required would be small;
> so far as I can see, the only thing required is to add hooks so
> that mouse events trigger a call back into the existing
> gp_exec_event() routine.  It could well be that no change is 
> needed to the core gnuplot code at all, only to the separate
> mousing scripts and the wrapping HTML on the web page.
> 
Regarding 3D, I would love to see features like volume-rendering, iso-surface and slices. I could not find an open-source tool that can do this, but I understand that's a whole new level. 

> Please send me, or upload to the SourceForge site, whatever
> code changes you needed to "patch some little things".
> I'd be happy to shepherd them into the current CVS version.
Great! I needed the most time testing what configure options work. Disabling readline was important, and I think the only patch in the src was in gnprintf(), because the emscripten printf does not understand "% g" so I compacted it with a simple else-statement in the if (???=="% g") branch when nothing happens with the string. Maybe there is even more trouble with formatting... I am happy to share the pre/post JS files needed and the compile script, and the little API I wrote. It is possible to host all this at sourceforge as well as my web server simply serves static files here... You cannot see the pre/post js files as they are "compiled" with gnuplot itself.


> 
> 	Happy New Year,
To you too! 

> 
> 
> 
> 		Ethan
> 

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


Thread

gnuplot running in your browser (compiled with emscripten) Christ H <chhu79@googlemail.com> - 2013-01-01 12:39 -0800
  Re: gnuplot running in your browser (compiled with emscripten) sfeam <sfeam@users.sourceforge.net> - 2013-01-01 17:00 -0800
    Re: gnuplot running in your browser (compiled with emscripten) Christ H <chhu79@googlemail.com> - 2013-01-02 03:37 -0800
      Re: gnuplot running in your browser (compiled with emscripten) sfeam <sfeam@users.sourceforge.net> - 2013-01-02 11:45 -0800
  Re: gnuplot running in your browser (compiled with emscripten) Christ H <chhu79@googlemail.com> - 2013-01-04 06:13 -0800
    Re: gnuplot running in your browser (compiled with emscripten) Christ H <chhu79@googlemail.com> - 2013-01-14 04:29 -0800
      Re: gnuplot running in your browser (compiled with emscripten) Christ H <chhu79@googlemail.com> - 2013-01-16 03:36 -0800
        Re: gnuplot running in your browser (compiled with emscripten) sfeam <sfeam@users.sourceforge.net> - 2013-01-16 15:36 -0800

csiph-web