Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

D3.js Is Way More Than Just Another Visualization Framework

DZone's Guide to

D3.js Is Way More Than Just Another Visualization Framework

· Web Dev Zone
Free Resource

Learn how to build modern digital experience apps with Crafter CMS. Download this eBook now. Brought to you in partnership with Crafter Software

If you're an experienced web developer, you probably (a) are intimately familiar with the DOM, and (b) still find data-driven JavaScript apps a little unusual.

You may know about how Backbone.js has brought MVC architecture to the web -- and if you like data-driven programming, but aren't already using Backbone, you really need to check it out. (And if you're thinking about Backbone but can't quite dive fully into its particular brand of JavaScript MVC: DZone is hoping to publish a Backbone Refcard some time soon, so stay tuned!)

But even if you already develop web apps that handle lots of data, you may still think of complex visualization as a thin skin on top of the DOM.

Well, not so thin with Mike Bostock's D3.js in town. ('D3' = 'Data-Driven Documents'.)

In the abstract, D3's idea is simple:

D3 allows you to bind arbitrary data to a Document Object Model (DOM), and then apply data-driven transformations to the document. As a trivial example, you can use D3 to generate a basic HTML table from an array of numbers. Or, use the same data to create an interactive SVG bar chart with smooth transitions and interaction.


But the design details and syntax get pretty weird pretty quick, at least to the dev-eye still habituated to the notion that 'visualization is a thin skin'.

So, for instance, when I first ran into D3, I felt an immediate surge of excitement, followed by a quick back-burnering, sensing that programming with D3 would require a bit of a brain-paradigm shift.

But if you think data-driven documents sound cool,and want to learn more quickly, check out this talk by Mike Dewar (from a recent New York Open Statistical Programming Meetup):

Mike hacks an impressively systematic, extremely clear path straight from JSON data through a prettily-formatted document. Well worth the 56 minutes (especially with all Mike's code samples on github).

Finally, when you're a little more comfortable with the API, here's a neat D3.js playground for you (complete with CSS editor), with a few notes from the creator.

Tons of fun, and potentially extremely useful tool. Enjoy!

Crafter is a modern CMS platform for building modern websites and content-rich digital experiences. Download this eBook now. Brought to you in partnership with Crafter Software.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}