ContinuumIO/elegans

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Elegans

Elegant 3D plots generator with WebGL.

alt text

Description

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.

Demos

| 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 |

Usage
Getting Started

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>
Generating charts with JavaScript

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);
Embed Elegans to your environment

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.

Build Elegans

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
Supported browsers

We are checking if Elegans works well on two browsers.

Dependency
License

Copyright © 2014 by Naoki Nishida
This version of Elegans is licensed under the MIT license.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.