Name: elegans
Owner: Continuum Analytics, Inc.
Description: Elegant 3D plots generator with WebGL.
Forked from: domitry/elegans
Created: 2015-10-13 11:00:43.0
Updated: 2017-09-17 18:03:01.0
Pushed: 2015-11-01 14:21:05.0
Homepage: http://elegans.readthedocs.org/
Size: 1604
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Elegant 3D plots generator with WebGL.
Elegans is a 3D plotting library written in JavaScript. You can generate charts in JavaScript, and show them on your browser.
We began to develop Elegans in order to embed it into other languages like Ruby and Python, so you can embed it into your environments in a relatively simple way. See 'Embed Elegans into your environments' paragraph in 'Usage' below.
Elegans is still in its alpha release, and some charts and options are not implemented yet. Please see documents to learn more.
| Name | Shortcuts function | Data type | Legend option | Link to examples | |:—- |:——— |:——— |:—–:|:—————-:| | Elegans.Surface | Elegans.SurfacePlot | Matrix | o | example | | Elegans.Wireframe | Elegans.WireframePlot | Matrix | o | example | | Elegans.Line | Elegans.LinePlot | Array | o | example | | Elegans.Particles | Elegans.ParticlesPlot | Array | o | example | | Elegans.Scatter | Elegans.ScatterPlot | Array | o | example |
Download latest version of Elegans from here. And add code below to your html file.
ipt type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/three.js/r66/three.min.js"></script>
ipt type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.4.4/d3.min.js"></script>
ipt type="text/javascript" src="your_link_to_elegans.min.js"></script>
At first you need to create stage, then generate some charts add them to the stage.
stage = new Elegans.Stage(d3.select(#vis));
surface = new Elegans.Surface(data);
e.add(surface);
e.render();
You can generate the same charts more simply, with d3.js selection and method chain style.
elect('#vis').datum(data).call(Elegans.SurfacePlot);
Elegans has API to make it easier to embed it into environments except browsers, like IPython notebook. What you have to do is only to generate simple JSON object, and embed it into static html templates. See below.
model = {charts:[{type:"Particles",data:{x:[1,2,3],y:[1,2,3],z:[1,2,3]},options:{color:"#000000"}}], options:{width:500, height:500}};
ans.Embed.parse(model, "#vis");
If you need more information, see documents.
At first, pull repository from github.
pull https://github.com/domitry/elegans.git
You need to install npm with node.js before building Elegans. You can build it by running commands below.
legans
install
t release
We are checking if Elegans works well on two browsers.
Copyright © 2014 by Naoki Nishida
This version of Elegans is licensed under the MIT license.