dc-js/dc.js — pull request #771 by madebydna (2014-11-20 05:26:55+00:00)
Title: New select menu widget

I had a need for select menu "chart" type in dc and I have seen it requested in [other places](https://groups.google.com/forum/#!topic/dc-js-user-group/9mHGM-J-ndY), so I created a simple widget that adds this functionality.

The widget creates an HTML select tag with options corresponding to the chart's (crossfilter) groups. By default the option text will display the group key and the group value separated by a colon. The select menu will filter the chart's dimension by the group key represented by the selected option ( also encoded in the option's `value` attribute).

On redraw, the chart filters out options whose value (according to the `valueAccessor`) is < 1. This behavior can be overridden by using the `filterDisplayed` function.

The generated HTML select tag is single select (rather than a multiple select) and on redraw the options that corresponds to the current filter will be selected. Not sure if a multiple select is more in keeping with the behavior of other `dc.js` charts, but I could change it to a multiple select if needed.

Let me know if there is any interest in pulling this in and, in case there is, whether I should make any changes.