I did not use D3.js directly but I did use a charting library relying on D3.js.
Here is a proof-of-concept of how I wrapped a JS lib: https://github.com/numforge/monocle/blob/cfedeff642b7e67161b6abffc2a1edaf93b030ad/src/monocle/viz.nim#L20-L30
For a full-fledged library, check nim-plotly: https://github.com/brentp/nim-plotly/blob/cfaeb79ab494c5fa35d3065dc77385c23c6b68e2/src/plotly/tmpl_html.nim (this includes initializing a D3 context)
Thanks for the links -- they were very helpful!
It's in the early stages, but I've got some things working with D3 now. Check out https://github.com/hiteshjasani/nim-d3 for the code and examples.
As an aside, I really want to thank @araq and others who were involved in making generics. They really helped with binding statically typed nim with dynamically typed javascript. I didn't have to write a bunch of redundant boilerplate code matching types -- so thank you!