In most browsers’ JavaScript environments, console
is a global object unrelated to the DOM – it provides debugging functions (e.g. console.log()
)… unless you’re clobbering it with a d3 DOM selection elsewhere, console.append()
is unlikely to behave the way you seem to think it will.
Replace console
with a bona-fide d3 selection, like:
var svg = d3.select('div.vis').attr(…); // et cetera
and inspect this object, to ensure your DOM logic is sound.