Here's a little thing I put together (ended up being short enough for a gist):
http://bl.ocks.org/bollwyvl/b34ffe2f40d64f3aae0fBecause of the asynchrony, it's not a good fit for d3 right now, but you can do anything you want inside the worker: some useful cases might be loading up a big data set, or performing an expensive calculation.
The data passed back out could then drive DOM manipulation.