Code Monkey home page Code Monkey logo

elegans's Introduction

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.

<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/three.js/r66/three.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.4.4/d3.min.js"></script>
<script 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.

var stage = new Elegans.Stage(d3.select(#vis));
var surface = new Elegans.Surface(data);
stage.add(surface);
stage.render();

You can generate the same charts more simply, with d3.js selection and method chain style.

d3.select('#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.

var 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}};
Elegans.Embed.parse(model, "#vis");

If you need more information, see documents.

Build Elegans

At first, pull repository from github.

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

cd elegans
npm install
grunt release

Supported browsers

We are checking if Elegans works well on two browsers.

  • Google Chrome: Latest version
  • Firefox: Latest version

Dependency

  • d3.js version 3.4.4
  • three.js version r66

License

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

elegans's People

Contributors

domitry avatar jlstevens avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.