-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Coordinate Grid brushing staggered #973
Comments
Hi @mtraynham. You are right, it shouldn't be transitioned when in response to a mouse event. I hadn't noticed that. I'm not sure why the I'll fix it one way or the other today. |
So... disabling that I've pushed a branch |
I think the more general way to code this would probably be to pass down a d3 selection from the events that actually know whether transitions are needed or not - this selection would be either transitioned or not and all subselections would inherit from it. Rather than each piece of code starting from scratch with its own selection and deciding whether to transition or not. It's kind of a big refactor, though. |
Ehh sort of, I still see it happening with Composite charts, usually through this stack trace: _chart._brushing() Alternatively, those could be fixed by changing the code to not reset the y scale and cause
It did resolve for non-composite charts although this looks band-aid-ish. |
I see, the problem here being that setting the Y scale falsely registers as a rescale. This looks like a good fix because it will help toward supporting non-linear scales for elasticY. Thanks! |
Not a problem. After trying my change out, everything on your |
Aha, I think it is for brush rounding - the first line in So it's unrelated to the commit message, just another fix that went into the same commit. |
Wow, breaks 20 tests. Hold on. |
Oof, which part the yAxis change? Or the optional redrawBrush? |
Aha: if (_chart.y() === undefined || _chart.elasticY()) {
if (_chart.y() === undefined) {
_chart.y(d3.scale.linear());
}
_chart.y().domain([yAxisMin(), yAxisMax()]).rangeRound([_chart.yAxisHeight(), 0]);
} etc. |
Ahh good catch! Didn't set the domain for null undefined y scales. |
Hey thanks Gordon! By the way, looking at the commit: Shows the old way I recommended. Not a big deal, just make sure you push the latest web build up when you commit next time 😄 |
Hmm, I think this may be the fix for #808 biting us again. Not building the docs by default can lead to lots of stuff out of sync. |
I also rebroke the resizing of composite charts, fixing this. 😦 Most likely transitions canceling each other out. |
Hey Gordon,
You added a recent change to the renderBrush function, but I think this actually makes the brushing event worse.
My proposal is to remove the call to
redrawBrush
from the_chart._brushing
method at https://github.com/dc-js/dc.js/blob/develop/src/coordinate-grid-mixin.js#L913. It seems unnecessary to "redraw" the brush if the event itself is redrawing the brush. The change you made just amplifies this issue because the redraw now happens with a transition and likely during a user brush. Feel free to clarify if there is a reason it should be calling that method. It likely still needs to call the_chart.fadeDeselectedArea();
at https://github.com/dc-js/dc.js/blob/develop/src/coordinate-grid-mixin.js#L944.The text was updated successfully, but these errors were encountered: