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

Better primitives for custom filter behaviors #716

Open
gordonwoodhull opened this issue Sep 24, 2014 · 1 comment
Open

Better primitives for custom filter behaviors #716

gordonwoodhull opened this issue Sep 24, 2014 · 1 comment
Milestone

Comments

@gordonwoodhull
Copy link
Contributor

We have single select (as the common custom behavior of onclick filter null then filter x), toggle select, and a couple range selects. But what if you want something in between?

It would be great to have an API for manipulating the filter set and then committing it.

I guess automatic commit (if that's what we want) would imply that it's a callback or event.

The obvious primitives are: add, remove, toggle, union, intersect. We already have these but they are not exposed conveniently or safely.

This complements #557. #557 makes the underlying primitives pluggable, but you would still have to fetch them and call them e.g chart.addFilterHandler()('b') - and then remember to redrawGroup. Pretty ugly.

Instead, call something like setFilters, passing a function which itself gets passed add, remove, and toggle.

The current toggle filter behavior (filter) can be written in terms of this.

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

1 participant