X-Received: by 10.66.72.232 with SMTP id g8mr5947938pav.23.1357126645208; Wed, 02 Jan 2013 03:37:25 -0800 (PST) Received: by 10.49.12.97 with SMTP id x1mr6903484qeb.25.1357126644804; Wed, 02 Jan 2013 03:37:24 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!newsfeed.news.ucla.edu!usenet.stanford.edu!kr7no14101416pbb.0!news-out.google.com!s9ni72755pbb.0!nntp.google.com!f6no5411357pbd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.graphics.apps.gnuplot Date: Wed, 2 Jan 2013 03:37:24 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=79.215.56.252; posting-account=mbLrEAoAAACukM0a4SVvdt_SsMX8JJNd NNTP-Posting-Host: 79.215.56.252 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <426e561f-b6fe-4635-a7f0-76c1964c4cb6@googlegroups.com> Subject: Re: gnuplot running in your browser (compiled with emscripten) From: Christ H Cc: sfeam@users.sourceforge.net Injection-Date: Wed, 02 Jan 2013 11:37:25 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: csiph.com comp.graphics.apps.gnuplot:1570 Hi Ethan, thanks for the feedback! I am a researcher and was trying to run my fluid-d= ynamics code in the browser, which worked surprisingly well too, so the nex= t thing was visualizing the results, where gnuplot is superior than any oth= er JS libraries out there to plot things. My goal was to produce nice print= able plots, which is why I focused on svg and not so much on mousing.=20 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 pro= perly... > I get an error page saying=20 > "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 y= ou do? I tried to include a German umlaut character in the label, I don't g= et an error but the svg is corrupted or not created.=20 >=20 > 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=20 > 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? >=20 > The obvious next step is to extend the mousing code so that you > get true 3D interactive rotation and zoom. =20 > That would be spectacular! ... and tough! ;) You are thinking of a simple feedback of new rotation par= ameters to the script? Even then you would need something like a cube that = the user rotates to illustrate the new rotation position...=20 >=20 > 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. =20 >=20 > 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=20 > needed to the core gnuplot code at all, only to the separate > mousing scripts and the wrapping HTML on the web page. >=20 Regarding 3D, I would love to see features like volume-rendering, iso-surfa= ce and slices. I could not find an open-source tool that can do this, but I= understand that's a whole new level.=20 > 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. Disablin= g readline was important, and I think the only patch in the src was in gnpr= intf(), because the emscripten printf does not understand "% g" so I compac= ted it with a simple else-statement in the if (???=3D=3D"% g") branch when = nothing happens with the string. Maybe there is even more trouble with form= atting... 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 sour= ceforge as well as my web server simply serves static files here... You can= not see the pre/post js files as they are "compiled" with gnuplot itself. >=20 > Happy New Year, To you too!=20 >=20 >=20 >=20 > Ethan >