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
Custom filters work on other charts built from the same crossfilter, but not on the chart where the filter was applied. Example:
let bubbleChartFilter = {
filterType: "bubbleChartFilter",
isFiltered: function (value) {
return value > 0;
},
};
This filter considers only data items where the dimension's value is greater than 0. When used in dc.bubbleChart("#bubble-chart").filter(bubbleChartFilter), it is correctly applied to the chart's crossfilter dimension and, as expected, it is picked up by crossfilter groups derived from other dimensions, but no data is displayed on the bubble chart. The reason is that the isSelectedNode method of the BubbleMixing class works for filter values only and not for filter objects. The code below based on _defaultFilterHandler solves the problem. I presume that a similar solution can be applied to the other charts.
isSelectedNode = function (d) {
for (let i = 0; i < this._filters.length; i++) {
const filter = this._filters[i];
if (filter.isFiltered) {
if (filter.isFiltered(d.key)) {
return true;
}
} else if (filter <= d.key && filter >= d.key) {
return true;
}
}
return this._filters.length == 0;
};
The text was updated successfully, but these errors were encountered:
Custom filters work on other charts built from the same crossfilter, but not on the chart where the filter was applied. Example:
This filter considers only data items where the dimension's value is greater than 0. When used in
dc.bubbleChart("#bubble-chart").filter(bubbleChartFilter)
, it is correctly applied to the chart's crossfilter dimension and, as expected, it is picked up by crossfilter groups derived from other dimensions, but no data is displayed on the bubble chart. The reason is that theisSelectedNode
method of theBubbleMixing
class works for filter values only and not for filter objects. The code below based on_defaultFilterHandler
solves the problem. I presume that a similar solution can be applied to the other charts.The text was updated successfully, but these errors were encountered: