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

Performance: Only filter on brush end #898

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mtraynham
Copy link
Contributor

Allows coordinate grid charts to only filter on brush end.

@guilhermecgs
Copy link

I have tested this and it works fine...

If I keep the button pressed, the filter only occur when the brush ends... as expected... This improve the performance and usability a lot.

However, it looks like there is a lag when I start pressing down the mouse button... There is a delay between the mousedown event and the feedback to the user. Probably something not related to the changes in this PR

@gordonwoodhull
Copy link
Contributor

That's great, thanks @guilhermecgs.

Does it help to set dc.EVENT_DELAY = 0;? I think that you should not need it since that's part of the throttle/debounce which this feature effectively disables.

Then again, it's possible that there is some expensive calculation going on between the mousedown and the brush showing. There shouldn't be, but it's possible.

@guilhermecgs
Copy link

@gordonwoodhull

Also, It would be great to add an event to get the preFilter event.. There is only the "filtered"event today

Between prefilter and posFilter, I could add a loading css

@gordonwoodhull
Copy link
Contributor

Hmm, good point - applying the filter can be slow in itself. Right now I guess you could do this by implementing the filterHandler as a pass-through:

var oldHandler = chart.filterHandler();
chart.filterHandler(function (dimension, filters) {
  // start your loading css here
  return oldHandler(dimension, filters);
})

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

Successfully merging this pull request may close these issues.

3 participants