You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error: "xScale.invert is not a function" when handling Highlight component onBrush / onBrushEnded events #987
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 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?
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.
As I was tight in time, I had to fork react-vis and to implement a workaround directly.
Is it viable to merge this workaround to uber/react-vis as a temporary solution? bognikol@353b98a
Activity
mcnuttandrew commentedon Oct 2, 2018
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.
bognikol commentedon Oct 31, 2018
I created new pull request to d3-scale where I added band.inverse(). Hopefully it will be merged soon.
d3/d3-scale#151
Cheers
bognikol commentedon Nov 1, 2018
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 :-)
mcnuttandrew commentedon Nov 1, 2018
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.
bognikol commentedon Nov 13, 2018
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.
Is it viable to merge this workaround to uber/react-vis as a temporary solution?
bognikol@353b98a
Cheers,
Bogdan
mcnuttandrew commentedon Nov 13, 2018
Hey @bognikol
Write some tests and throw that branch through our linter and I think it'll be good to go!
bognikol commentedon Nov 29, 2018
Pull request that contains fix: #1046