diff --git a/Changelog.md b/Changelog.md index 311017977..95ac328e2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,4 +1,5 @@ ## 3.0.12 +* heatmap takes ordinary filter objects and conversion of coordinates is deprecated ([#1515](https://github.com/dc-js/dc.js/issues/1515)) * Provide alternate, more descriptive names for properties so that the meaning is not overloaded, to reduce confusion and improve code clarity: * `dataTable.group` and `dataGrid.group` took a nesting function, not a crossfilter group, so they are replaced with a new property called `section` ([#855](https://github.com/dc-js/dc.js/issues/855)). Additionally, `dataTable.section` is no longer mandatory and defaults to the empty string. The old property names are still supported, but they emit an informational message recommending the better name. They could be deprecated in the future (but there is probably no need). diff --git a/src/heatmap.js b/src/heatmap.js index 86310148e..45874ed24 100644 --- a/src/heatmap.js +++ b/src/heatmap.js @@ -106,17 +106,22 @@ dc.heatMap = function (parent, chartGroup) { var filters = selection.data().map(function (kv) { return dc.filters.TwoDimensionalFilter(kv.key); }); - _chart._filter([filters]); + _chart.filter([filters]); _chart.redrawGroup(); }); } + var nonstandard_filter = _logger.deprecate(function(filter) { + return _chart._filter(dc.filters.TwoDimensionalFilter(filter)); + }, 'heatmap.filter taking a coordinate is deprecated - please pass dc.filters.TwoDimensionalFilter instead'); dc.override(_chart, 'filter', function (filter) { if (!arguments.length) { return _chart._filter(); } - - return _chart._filter(dc.filters.TwoDimensionalFilter(filter)); + if(filter.filterType !== 'TwoDimensionalFilter' && + !(Array.isArray(filter) && filter[0].filterType === 'TwoDimensionalFilter')) + return nonstandard_filter(filter); + return _chart._filter(filter); }); /**