6
votes

Crossfilter supports dimensions with arrays since version 1.4.0-alpha.06 https://github.com/crossfilter/crossfilter/wiki/API-Reference#dimension_with_arrays

Is it possible to exploit this functionality in dc.js?

I haven' found any examples yet... I am aware of the method described in Is there a way to tell crossfilter to treat elements of array as separate records instead of treating whole array as single key?, but that works with earlier versions of crossfilter too (it does not make use of the new functionality).

1
Yes, it's possible. :) Would you care to contribute an example? - Gordon
The cool thing about this is that you just use one of these array dimensions and it should work the same way as any other dimension in dc.js. I think... - Ethan Jewett
P.S. I edited the version mentioned, as this functionality has not (and I assume will not) be introduced in the 1.3.x line. - Ethan Jewett
Thanks, the crossfilter version I was testing was the issue... using 1.4.0 it is possible to get something going on with pies and rows. I'll post an answer with a working example. - emiguevara

1 Answers

10
votes

With help from comments above, I managed to get this working, very simple indeed if you use the right version of crossfilter (1.4.0). Works fine with rowChart() and pieChart().

I made a an example bl.ock based on previous approaches: http://bl.ocks.org/emiguevara/4bd152a8828f6b31270702d97dc0133d