Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interactiveBisect fails to correctly locate item for versions of d3 >= 3.4.4 #554

Closed
ghost opened this issue May 17, 2014 · 5 comments
Closed

Comments

@ghost
Copy link

ghost commented May 17, 2014

It seems that a change in d3 version 3.4.4 to d3.bisector has broken the interactiveBisect functionality.
d3.bisector now supports a comparator argument if the method passed takes two parameters instead of the one needed for an accessor ( https://github.com/mbostock/d3/wiki/Arrays#d3_bisector )
Unfortunately nv.interactiveBisect is passing

function(d,i) { return d.x;}

Which is being interpreted by d3.bisect as a comparator, and stopping the interactiveBisect working, ( it will only hilight the 0th or 1st data point. )

@DavidSouther
Copy link
Contributor

Looks like a trivially easy fix (remove the i element); not sure if I'm missing something. It certainly is technically a breaking change - d3/d3#1767 - though I'll chalk that one to a possibly drunk programmer with a bad sense of code style.

@sudheesh001
Copy link

Could someone explain a little more about this bug. Looking at the nv.interactiveBisect as used in this test. It takes 3 parameters, whereas the template that @bfhobbes posted

function(d, i) { return d.x; }

Am I missing something ?

@portante
Copy link
Contributor

portante commented Feb 9, 2015

@sudheesh001, please check out the development branch as of b014281, you should see that now nvd3 is working with 3.4.4 and later, but NOT with any version earlier.

@robinfhu
Copy link
Contributor

Yeah nvd3 as it stands now doesn't work with d3 3.4.4 or later. We have a fix in the development branch.

@robinfhu
Copy link
Contributor

Linked #760

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants