novus/nvd3 — pull request #118 by GerHobbelt (2012-07-28 15:07:48+00:00)
Title: tiny tooltip CSS fix + lineWithFocusChart .x() and .y() fix

Following your advice to use .x() and .y() instead of the deprecated mapping to {x:..., y:...} I ran into trouble with a whole lot of NaNs while working on someone's gist.

See also the second commit comment: take http://bl.ocks.org/3192376 and just replace the script links to the nvd3 sources as per before this commit, e.g. using your own nvd3 repo and see the graph fail due to SVG parse errors being logged with lots of NaNs in them.
This will even happen when you change the gist's graph .y() invocation in index.html ~ line 77 to

chart.y(function(d) {
return d[1] || 0;
});

simply because the .y() will only 'reach' the lines, but not the lines2 in that chart, so that '|| 0' doesn't work for the bottom graph of the chart, ever.

The culprit is the use of d3.rebind() in lineWithFocusChart.js: it links line callbacks from lines to chart, but does not 'sync' lines and lines2.
I expect the rest of 'em need to be done the same way, that is getting rid of d3.rebind completely. Any other charts with multiple copies a la lines + lines2 should suffer the same fate, unless I'm grossly mistaken, that is.

Cheers!

Ger