Alright. So Julia doesn't have access to any of the D3 stuff. Instead, Julia basically just sends a message to the client that says ''here are some points to plot," and the browser is responsible for determining what it will look like and how to present it with D3.
There is a message-passing API that Julia uses to talk to the browser (with a webserver sandwiched in the middle but you can pretend like it's not there). It's implemented in ui/webserver/julia_web_base.j (do a git pull right this second if you haven't already).
But for graphics (and other web repl specific functionality in the future), the implementation of the network stack (julia_web_base.j) can be ignored. All of the graphics functions are in ui/webserver/julia_web.j, so this is where to go if you want to extend the functionality (we can move it to j/ if that's better -- we just need to make sure it isn't loaded for the non-web repls).
The graphics functions themselves are pretty simple -- all they do is send a __MSG_OUTPUT_PLOT message (all of the variable names in the network stuff star with two underscores to prevent name collisions with user variables -- is there a better way to do this namespacing?) to the browser with the appropriate data.
In index.htm, near the end of the callback function, after the line if (data[id][0] == MSG_OUTPUT_PLOT), you'll find all the D3 plotting code. D3 has a kinda steep learning curve, so let me know if you want me to explain any of that. Also there are some plot-related styles at the end of styles.css.