You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The way the heatmap implements a filter on an entire axis is to simply call the base filter() function on each cell in the axis. As you can imagine, this is prohibitively slow on even small data sets given that this performs a filter action on the underlying crossfilter object itself. Ideally, the list of values on the axis should be appended to the chart's internal filter values list, and then the chart's filter action should be triggered, as it packages all of the filter values on that internal list into one filterFunction call on the crossfilter - performing a filter on the crossfilter 1 time, rather than k times (where k is the number of cells in an axis).
Here's an immediate, monkey-patching solution. If you look at the heatmap source, you will see that the filter action on an axis is implemented in the filterAxis function, which is called by the x/yAxisOnClick function. Conveniently enough, you can set your own x/yAxisOnClick function. I suggest copying most of filterAxis and modifying the part that calls filter on each cell. You don't have direct access to the chart's internal filter values list, but you can modify it in place by calling chart.filters() and using the splice and push methods of JavaScript arrays.
Ah, that's a very good point. I had thought about combining the individual cells into a larger range, but just not calling filter so much would make a huge difference. There is a PR #557 which opens up the filter manipulation functions which may help here.
There is not that much data here. Is it just the example?
The text was updated successfully, but these errors were encountered: