Code Monkey home page Code Monkey logo

d3plus's Introduction

NPM Release Dependency Status Dependency Status NPM Downloads License


Bar Charts

Tree Maps

Scatter Plots

Stacked Areas

Line Plots

Networks

Box Plots

Pie Charts

Geo Maps

Bubbles

A javascript library that extends the popular D3.js to enable fast and beautiful visualizations.

Helpful Links

Environment Setup

Download the latest versions of D3plus (directory includes all dependencies):

http://d3plus.org/d3plus.zip

Note that because we will be running these files locally, our browser will raise errors when trying to do AJAX requests. The best way around this is to run a local server, if you have python installed this can be accomplished on the command line via:

python -m SimpleHTTPServer 8888 &

or for Python 3+

python -m http.server 8888 &

Once this is running, go to http://localhost:8888/.

Another alternative is using MAMP (on OSX) or WampServer (on Windows), which will install a local version of the Apache web server.

Creating a Visualization

To initialize a D3plus visualization, you must first create a container element in the page body:

<div id="viz"></div>

Then, you must initialize the visualization:

var visualization = d3plus.viz()

Finally, given we have a "data" variable as an array of objects, we pass both that "data" and our container element (using standard D3 Selection Methods) to the visualization:

visualization
	.data(data)
	.container("#viz")

And that's it! All you have to do now is invoke the Draw method to draw the visualization on the page.

visualization.draw()

Changing Variables

Given you followed the tutorial above to create a D3plus visualization, your page should look, well, fairly empty and broken.

That is because there are some specific methods you should invoke on your visualization that will tell it a little more about your data and what you would like to display. For example, if you want to display a Tree Map and your data is keyed with an id of "person", you would call the following methods:

visualization
	.type("tree_map")
	.id("person")
	.draw()

Once you set the methods you need to change, you just need to invoke the Draw method again to display your changes.

d3plus's People

Contributors

davelandry avatar alexandersimoes avatar dsmilkov avatar ericjohnf avatar jazzido avatar danihodovic avatar tkh44 avatar

Watchers

James Cloos 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.