When my site first initializes, it queries a server to get back some data. I can\'t lay anything out on the page until this data gets back. With d3.js, I can use d3.json()
You're basically doing it the only way. The callback function has to be the one initiating the rest of your code. You don't need all your code in the callback function though, you can introduce indirection. So the callback function will call another function inside which would be what is currently in your callback function.