-
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
heatMap.filter breaks usage with multiple filter elements #1515
Comments
Right, the filter format is a bit weird, taking an extra level of array from what you might expect. It is documented here:
You might want to look at the heatmap source to understand what filter objects it is creating. It is not a lot of code. If you continue to run into trouble, please create a reproducible example (eg a jsfiddle, bl.ock, or observable notebook) and I'll be glad to help. But I think you are probably just missing a pair of square brackets. :) |
No, I'm not missing a pair of square brackets! I'v tried everything .... with, without those brackets, JSON.stringify or cast the array to a string, even tried if the filter is matching the instances of the array and not their values .... Its definatly the not working |
Thanks for the repro. I'll take a look! I am sure there is a way to get it to work, but it might not be obvious. |
Hi @koallalays. My apologies for the misunderstanding.
Related issue: #532 Here is the workaround for your fiddle:
In code: fil = fil.map(c => dc.filters.TwoDimensionalFilter(c));
chart._filter(null)._filter([fil]); Here is my fork of your fiddle: https://jsfiddle.net/gordonwoodhull/dL5myjc3/15/ If you are having issues with other charts not driving the heatmap correctly, I think that is probably a crossfilter setup issue. As you can see in the heatmap filtering example, it definitely is possible to filter using another chart. I doubt it is related, but feel free to open another issue or reply with another fiddle if you are still having trouble with that. I haven't looked into it deeply, but I think the way to fix the current issue would be to override dc.override(_chart, 'filter', function (filter) {
if (!arguments.length) {
return _chart._filter();
}
return _chart._filter(dc.filters.TwoDimensionalFilter(filter));
}); I'll retitle this accordingly. |
fixed in 3.0.12 by deprecating |
Now I see that |
DC-Version: 3.0.11
D3-Version: 5.5.0
Crossfilter: 1.4.6
latest Firefox
I tried to use the function replaceFilter for heatmap.
It only works if i select only one value, but on 2 or more it fails.
There is something weired in dc.filters.TwoDimensionalFilter -> f.isFiltered:
.... anyways I'v rewritten the f.isFiltered to accept "f" beeing an array of arrays, but it didn't work (of course Ive tested if it returns true).
=> it looks like that the result of f.isFiltered is totally ignored. Maybe its used for the clicks on the boxes, but definatly not for replaceFilters()
The text was updated successfully, but these errors were encountered: