# Gnuplot 4.6.3 compiled to JS with Emscripten

The API uses a web-worker to start gnuplot, a decent HTML5 browser like firefox (ASM_JS is on) or chrome is required. No feature checks are done here, so nothing happens if your browser is incompatible. Feel free to try other scripts from the demo page. Remember not to change the output / terminal line, this demo is looking for a file named out.svg generated by gnuplot. Theoretically all browser formats are supported, even animated gif. The image is updated as soon as something changes in the script.
The site uses local storage to remember your script in the text area, so when you visit the site again it is still there (your data files are not).
Author: Christian Huettig, Send Mail

Optional: Grant the program read-access to a specific file on your local computer. This file is _not_ uploaded anywhere. Use it for data files that you want to use in your script.

set terminal svg enhanced size 1000,700 set output 'out.svg' # set terminal svg size 600,400 dynamic enhanced fname 'arial' fsize 10 mousing name "heatmaps_3" butt solid # set output 'heatmaps.3.svg' set format cb "%4.1f" set view 49, 28, 1, 1.48 set samples 70, 70 set isosamples 60, 60 set ticslevel 0 set cbtics border in scale 0,0 mirror norotate offset character 0, 0, 0 autojustify set title "4D data (3D Heat Map)\nIndependent value color-mapped onto 3D surface" set title offset character 0, 1, 0 font "" norotate set xlabel "x" set xlabel offset character 3, 0, 0 font "" textcolor lt -1 norotate set xrange [ 5.00000 : 35.0000 ] noreverse nowriteback set ylabel "y" set ylabel offset character -5, 0, 0 font "" textcolor lt -1 rotate by -270 set yrange [ 5.00000 : 35.0000 ] noreverse nowriteback set zlabel "z" set zlabel offset character 2, 0, 0 font "" textcolor lt -1 norotate set pm3d implicit at s set colorbox user set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.03, 0.6, 0 front noborder Z(x,y) = 100. * (sinc(x,y) + 1.5) sinc(x,y) = sin(sqrt((x-20.)**2+(y-20.)**2))/sqrt((x-20.)**2+(y-20.)**2) color(x,y) = 10. * (1.1 + sin((x-20.)/5.)*cos((y-20.)/10.)) GPFUN_Z = "Z(x,y) = 100. * (sinc(x,y) + 1.5)" GPFUN_sinc = "sinc(x,y) = sin(sqrt((x-20.)**2+(y-20.)**2))/sqrt((x-20.)**2+(y-20.)**2)" GPFUN_color = "color(x,y) = 10. * (1.1 + sin((x-20.)/5.)*cos((y-20.)/10.))" splot '++' using 1:2:(Z($1,$2)):(color($1,$2)) with pm3d title "4 data columns x/y/z/color"

## Output:

Loading, please wait.

Update 2013-06-23: Re-compiled with latest emscripten. Hidden surface removal bug fixed. Now at github.
Update 2013-05-11: Update to 4.6.3, {} parser bug gone, files work now and remain in your browser storage! No need for repeated upload.
Update 2012-12-28: Stack reset on re-run, no more out-of-memory. Bug found, no hidden surfaces working atm. Suspecting int64.
Update 2012-12-29: Using of data files possible, local Storage remembers your script
Update 2013-01-02: IE10 compatible now. Surprisingly just 10% slower than chrome.
Update 2013-01-04: UTF8 fix. iOS6 compatible now. Stripped terminals. Enabled gzip compression in webserver, gnuplot.js is 460kb.
Update 2013-01-06: Fallback to data-uri if Blob is not available, works now in a lot more older/mobile browsers.
Update 2013-01-11: Proper reset implemented. Consecutive calls do not remember previous states.