-
Notifications
You must be signed in to change notification settings - Fork 835
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
Error: "xScale.invert is not a function" when handling Highlight component onBrush / onBrushEnded events #987
Comments
Hey @bognikol Unfortunately the Highlight component does not current support brushing across ordinal or categorical axes. This is because we rely on d3-scale which does not support inverses for those sorts of scales. I would be happy to accept a PR adjusting them here, or, maybe more engineeringly applaud a PR to d3-scale adding that functionality (though I kinda assume there is a reason it is not supported?). You can sort of get around this in the same way that we do in the parallel coordinates chart. |
I created new pull request to d3-scale where I added band.inverse(). Hopefully it will be merged soon. Cheers |
Hi @mcnuttandrew, I need d3/d3-scale#151 to be merged rather quickly. What is your previous experience, is anyone going to look at it any time soon? What is the status of d3-scale repo in general? Is it better approach to make a workaround is react-vis? Thanks :-) |
Hey @bognikol In my experience d3 can sometimes be slow moving. That said looking at the other PRs open on that repo, there is exactly a PR covering this problem that hasn't been merged in two years. So this looks bad but there is a light. Specifically, it appears vega-scale (https://github.com/vega/vega-scale) supports exactly this usage. I would support a PR that brings in vega-scale just for your use case, but with a follow up issue to stop using d3-scale and use vega-scale instead. Sorry I pointed you in the wrong direction about PRing d3-scale initially, mea culpa. |
Hi @mcnuttandrew, No problem for wrong directions :-) As I was tight in time, I had to fork react-vis and to implement a workaround directly. Cheers, |
Hey @bognikol Write some tests and throw that branch through our linter and I think it'll be good to go! |
Pull request that contains fix: #1046 |
Not sure if this is a defect, but I get following error when trying to handle onBrush / onBrushEnded events on Highlight component:
while using Highlight component like this:
Any ideas?
Thanks in advance :-)
The text was updated successfully, but these errors were encountered: