title: Replace crossfilter data, restore dimensions and groups
body: <p>I'm using <a href="http://dc-js.github.io">dc.js</a> to render a nice bubble chart of a dataset. Underlying dc.js is <a href="https://github.com/square/crossfilter">crossfilter</a>.</p>
  
  <p>I'd like to smoothly refresh my chart with new data from the server. <a href="https://github.com/dc-js/dc.js/issues/177">This issue on Github</a> makes it clear that it is possible to do this by:</p>
  
  <ol>
  <li>deleting all the data from the crossfilter</li>
  <li>adding in the new data</li>
  <li>calling <code>dc.redrawAll()</code>. </li>
  </ol>
  
  <p>I've got this working but in order to delete all the data, you first have to clear all the filters (because <a href="https://github.com/square/crossfilter/wiki/API-Reference#crossfilter_remove"><code>crossfilter.remove</code></a> only removes the records matching the current filter).</p>
  
  <p>I'd like to 'remember' how my data was filtered before, so I can reconstruct the filter again once I've replaced all the data. I'm willing to get into the guts of the <code>crossfilter</code> code, but any pointers would be helpful.</p>
  
  <p>Additionally: if anyone knows a way of updating crossfilter data based on a unique key, that'd be gold dust!</p>