Hi Daniel,
Unify takes an optional :key-fn that it uses to track identity when data changes.
It defaults to just using index, which can be a problem if (as you've discovered) the newer dataset has fewer elements than the old.
If your data has something like a database primary key id, you can use that:
(unify my-data mapping :key-fn #(:id %))
you can also force unify to update everything every time its run by saying ":force-update? true", but you should only really use that if the mapping-fn references some changeable state outside of the dataset.
best,
Kevin
I'm using unify! to create a scatterplot with c2 0.2.0. The data is stored in an atom, which is reset! with new data. Points from the old data set will stick around if my new data set has fewer points than the previous data set.
How can I prevent this from happening? Is there some way to make c2 view a container as a cohesive whole?
--
Kevin Lynagh
Keming Labshttp://keminglabs.com
888.502.1042