# Jg-plot\_v0.1 / simple julia - webGl passthrough

**URL:** https://discourse.julialang.org/t/jg-plot-v0-1-simple-julia-webgl-passthrough/8768
**Category:** Visualization
**Created:** [February 2, 2018, 8:16am UTC](https://discourse.julialang.org/t/jg-plot-v0-1-simple-julia-webgl-passthrough/8768 "2018-02-02T08:16:24Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![y4lu](https://avatars.discourse-cdn.com/v4/letter/y/47e85d/32.png) [@y4lu](https://discourse.julialang.org/u/y4lu)
#### Post date: [February 2, 2018, 8:16am UTC](https://discourse.julialang.org/t/jg-plot-v0-1-simple-julia-webgl-passthrough/8768/1 "2018-02-02T08:16:24Z")

</div>

It’s pretty basic currently, just does 2d plots, but the potential is there for 3d animation etc

size is 8Kb, most of which is the html / js / glsl getup  
[https://nofile.io/f/Fzs8RKOa5Rx/jg\_plot.jl](https://nofile.io/f/Fzs8RKOa5Rx/jg_plot.jl)

basic usage: `jg_plot("./test", rand(4, 25))` will give you a test.html file with 4 randomly coloured squiggly lines, currently likes it’s column vectors transposed, ie `jg_plot("./test", rand(25)')`

---

<div class="post-metadata">

### Author: ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)
#### Post date: [February 2, 2018, 10:19am UTC](https://discourse.julialang.org/t/jg-plot-v0-1-simple-julia-webgl-passthrough/8768/2 "2018-02-02T10:19:35Z")

</div>

Would you be interested in collaborating on a WebGL plotting backend for [Makie](https://github.com/JuliaPlots/Makie.jl)?  
I’ve a simple prototype for sending [GLVisualize](https://github.com/JuliaGL/GLVisualize.jl) OpenGL shader to ThreeJS via [WebIO](https://github.com/JuliaGizmos/WebIO.jl)!  
We can expand that for all GLVisualize primitives and get a nice high level plotting API via Makie 🙂  
Let me know if you’re interested, I can publish the repository containing the prototype.

---

<div class="post-metadata">

### Author: ![y4lu](https://avatars.discourse-cdn.com/v4/letter/y/47e85d/32.png) [@y4lu](https://discourse.julialang.org/u/y4lu)
#### Post date: [February 2, 2018, 2:13pm UTC](https://discourse.julialang.org/t/jg-plot-v0-1-simple-julia-webgl-passthrough/8768/3 "2018-02-02T14:13:24Z")

</div>

It does sound quite interesting =)  
Not sure if my webgl skills are quite up to task but i’ll have a look

---

<div class="post-metadata">

### Author: ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)
#### Post date: [February 2, 2018, 3:45pm UTC](https://discourse.julialang.org/t/jg-plot-v0-1-simple-julia-webgl-passthrough/8768/4 "2018-02-02T15:45:58Z")

</div>

Ok I published the proof of concept here: [https://github.com/SimonDanisch/WebVisualize.jl](https://github.com/SimonDanisch/WebVisualize.jl)

---

<div class="post-metadata">

### Author: ![y4lu](https://avatars.discourse-cdn.com/v4/letter/y/47e85d/32.png) [@y4lu](https://discourse.julialang.org/u/y4lu)
#### Post date: [February 3, 2018, 1:16am UTC](https://discourse.julialang.org/t/jg-plot-v0-1-simple-julia-webgl-passthrough/8768/5 "2018-02-03T01:16:21Z")

</div>

Looks pretty nice, could possibly use gl.Points with pointsize instead of triangles for the demo if you wanted to save using a few coords. I’d guess textures would still be allowed

– deleted some old links

---

<div class="post-metadata">

### Author: ![y4lu](https://avatars.discourse-cdn.com/v4/letter/y/47e85d/32.png) [@y4lu](https://discourse.julialang.org/u/y4lu)
#### Post date: [February 3, 2018, 7:56am UTC](https://discourse.julialang.org/t/jg-plot-v0-1-simple-julia-webgl-passthrough/8768/6 "2018-02-03T07:56:53Z")

</div>

It’s getting there, translated forward a bit, still has the z-cutoff / static coloured squares in place of the nice circles, not much done on the julia side though. Added the mesh function  
All generated from julia, but with manual tweaks of the embedded webgl in jg\_plot. This might have to do for now =)

[https://nofile.io/f/wAHX4YrBOQH/testmesh2.html](https://nofile.io/f/wAHX4YrBOQH/testmesh2.html)

---

<div class="post-metadata">

### Author: ![y4lu](https://avatars.discourse-cdn.com/v4/letter/y/47e85d/32.png) [@y4lu](https://discourse.julialang.org/u/y4lu)
#### Post date: [February 5, 2018, 2:56am UTC](https://discourse.julialang.org/t/jg-plot-v0-1-simple-julia-webgl-passthrough/8768/7 "2018-02-05T02:56:27Z")

</div>

It’s not looking too bad now, still quite simple / code isn’t the tidiest…  
[https://nofile.io/f/ByTqOB8gPFm/jg\_plotV2.jl](https://nofile.io/f/ByTqOB8gPFm/jg_plotV2.jl)

output can be quite nice though  
[https://nofile.io/f/uOfDAr9uceq/testmeshv5.html](https://nofile.io/f/uOfDAr9uceq/testmeshv5.html)

sample

```julia
z = jmesh(5,5,10);
jg_plotMesh("testmesh", z);

```

---

<div class="post-metadata">

### Author: ![y4lu](https://avatars.discourse-cdn.com/v4/letter/y/47e85d/32.png) [@y4lu](https://discourse.julialang.org/u/y4lu)
#### Post date: [February 15, 2018, 2:43pm UTC](https://discourse.julialang.org/t/jg-plot-v0-1-simple-julia-webgl-passthrough/8768/8 "2018-02-15T14:43:09Z")

</div>

Cobbled together a bit of network IO, plotting to localhost:8088/Graph seems pretty nice

- 79 sec html string generation with mesh 200x200x200 / 3 point per poly  
10 sec / 350Mb browser transfer returned an "allocation size overflow browser-side =)

- ~10 frames per sec on 100x200x100 points -Firefox w/ LLano integrated graphics

- ~20 fps with 1,000,000 points / +300,000 polys / 11 sec html string gen /  
1:1 point packing - transfer size 42Mb

---

<div class="post-metadata">

### Author: ![y4lu](https://avatars.discourse-cdn.com/v4/letter/y/47e85d/32.png) [@y4lu](https://discourse.julialang.org/u/y4lu)
#### Post date: [February 17, 2018, 10:35am UTC](https://discourse.julialang.org/t/jg-plot-v0-1-simple-julia-webgl-passthrough/8768/9 "2018-02-17T10:35:44Z")

</div>

Minimalist web browser interface to julia  
[jport3 @ nofile.io](https://nofile.io/f/DATD9wVMAnA/jport3.jl)

> ` jlportX(8088);` - needs a new port each call, but only needs to be called once  
> [http://localhost:8088/HTML](http://localhost:8088/HTML) - WebGui starter/test page
> 
> ` Cgraphdata = "jgplot html out / etc"`;  
> [http://localhost:8088/Graph](http://localhost:8088/Graph) - Web plots
