Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use of bitwise xor in filterFunction causes bugs & contradicts docs #121

Closed
countergram opened this issue Aug 5, 2014 · 1 comment
Closed

Comments

@countergram
Copy link

According to the API docs, filterFunction "Filters records such that the specified function returns truthy when called with this dimension's value"

However, it uses a bitwise xor (^) as a comparison operator which makes otherwise "truthy" values other than 1/0/true/false cause undesired behavior (e.g. adding items that are already present).

Fix: Force the output of the given function to true or false rather than relying on its truthyness. I think using ? true : false works?

Reference: http://stackoverflow.com/questions/25083383/custom-text-filter-for-dc-js-datatable/25129514#25129514

@jasondavies
Copy link
Collaborator

Thanks! Fixed in version 1.3.8.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants