NickQiZhu/dc.js — pull request #241 by gordonwoodhull (2013-08-13 22:19:57+00:00)
Title: support for elements as anchors

(reopening pull request on a new branch so i can start another ;)

jQuery is okay with an element object being used as a selector. This patch allows dc.js to work with elements as well as '#id' selectors, instead of assuming that the selector is a string.

This in turn allows one to create dc.js plots "offscreen" and then add them to the document DOM once they are complete. We are successfully using this patch (against 1.4) in cscheid/rcloud.

I am not sure if there is a performance gain but it is helpful when creating visualizations dynamically to build up the dc plot and then paste it in whole, rather than having to create the div, wait for it to be rendered, and then attach it to dc.js.

Cheers,
Gordon