Over a million developers have joined DZone.

See the Tree Move Smoothly: Dynamic Graphs Using Web Workers and jQuery

DZone's Guide to

See the Tree Move Smoothly: Dynamic Graphs Using Web Workers and jQuery

· Web Dev Zone
Free Resource

Add user login and MFA to your next project in minutes. Create a free Okta developer account, drop in one of our SDKs to your application and get back to building.

The purpose of the emerging Web Workers standard is to help JavaScript programs run smoothly and predictably in the client's browser -- in other words, to open multiple JavaScript threads.

Which JavaScript, of course, like a beginning pianist learning only the right-hand part, can't do. From a purely computational perspective, this radical, built-in serialism is probably JavaScript's biggest problem -- or at least one of the obstacles to treating it as a full-fledged 'serious' language.

Web Workers fix that, in effect, but this post is about a library designed to combine one kind of multithread-ish-ness with another: arbor.js, a graph visualization library using Web Workers and jQuery.

One of the neat things about graph visualization, as opposed to (say) text-streams (or tables), is that a visible graph lets the user's eyes scan over multiple things at once, in a path the user chooses (though with some paths suggested by connecting lines) -- thus giving the user's massively parallel brain access to all kinds of information at once. 

And arbor.js does this extremely well, taking full advantage of cutting-edge web technology to produce extremely smooth visuals, with an extremely straightforward API. (That API reference page is coded pretty slickly too.)

Here's how one sample project looks:

Actually I'm a sucker for any graph (or tree), so this kind of thing especially lights up my brain.

But graphs are great for visualizing lots of different kinds of data, and Web Workers removes a major technical weakness of JavaScript -- so why not give arbor.js a try?


Launch your application faster with Okta’s user management API. Register today for the free forever developer edition!


Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}