dc-js / dc.js

Multi-Dimensional charting built to work natively with crossfilter rendered with d3.js
Apache License 2.0
7.42k stars 1.81k forks source link

adjust brush if domain changes in ordinal brushing #1814

Open gordonwoodhull opened 3 years ago

gordonwoodhull commented 3 years ago

1809 got me thinking in depth about ordinal brushing.

If the order of the ordinal keys do not change, but keys are added or removed due to remove_empty_groups or data streaming, it's possible to change the brush to fit the data.

Since you don't want a redraw to trigger a refilter, this can only work if the dimension uses the natural order of the key, and we use dimension.filterRange (no filterHandler) on the ordinal domain.

That would be a nice simplification. I wonder if I considered this and rejected it when writing the original example.