dash-javascript, let me show you it

March 11 2009, 2:36pm

dash-javascript is our latest little invention. It’s a bit different from dash-ruby, dash-python, et al.; those are about sending data to Dash. dash-javascript is about pulling data from Dash.

We’ve built dash-javascript because we know that Dash isn’t where everyone wants to see their data. Many apps have an admin backend, or even a custom dashboard pulling some ad-hoc metrics. There’s no reason those folks should have to log into Dash to get their numbers. We also know that ya’ll love showing off your feats of optimization with pretty graphs. Who are we to stand in your way?

So, dash-javascript gives you access to data from your Dash apps in whatever app you want. Suppose you’ve got something like this in your app’s administration backend:

<div id="health"> CPU value: </div>

You can insert the latest CPU value for your app with this bit of jQuery-flavored [removed]

$('#health').dash({fetch: 'latest', token: 'your-read-token', metric: 'cpu'}, function(value) { $(this).append(value); });

That’s it. You’re free to display data however you like. Throw it into a DOM element (as above), graph it with your favorite canvas or Flash-based charts or do whatever fits your taste.

Consider this an early-access preview. The API for this will change depending on what people need. We’re also planning on building easily embedded widgets, so if there’s any particular visualization you’d like to see, let us know!

You can get dash-javascript via GitHub; it’s even documented! If you have questions or feedback, we’d love to hear it.