Skip to content

Commit

Permalink
Clearing filter from dimension on disposal and propagating to groups.
Browse files Browse the repository at this point in the history
Previously, if a filter was present on a dimension, disposing of the
dimension would cause other dimension's group.all() counts to loose
sync with the filters. In certain circumstances, values of
group.all() would become negative.
  • Loading branch information
Spencer Alexander committed Sep 24, 2014
1 parent 01b7ec2 commit 95f75a2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions crossfilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,7 @@ function crossfilter() {

// Removes this dimension and associated groups and event listeners.
function dispose() {
filterAll();
dimensionGroups.forEach(function(group) { group.dispose(); });
var i = dataListeners.indexOf(preAdd);
if (i >= 0) dataListeners.splice(i, 1);
Expand Down
2 changes: 1 addition & 1 deletion crossfilter.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/crossfilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ function crossfilter() {

// Removes this dimension and associated groups and event listeners.
function dispose() {
filterAll();
dimensionGroups.forEach(function(group) { group.dispose(); });
var i = dataListeners.indexOf(preAdd);
if (i >= 0) dataListeners.splice(i, 1);
Expand Down
Loading

0 comments on commit 95f75a2

Please sign in to comment.