-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
New select menu widget #771
Conversation
Nice! This will be very helpful. I have been rather backlogged, but I see open seas ahead, and hope to review this soon. I think multiple select would be a nice option, but I won't make that a condition for acceptance. Thank you! And thank you for what look like thorough tests, much appreciated! |
Really glad to be able to give back to the library! Regarding the multiple select, I'd be happy to work on that too, but I may need some feedback on some details, e.g. which version (single or multiple) should be the default, etc. |
Just saw this question on SO asking for the multiple selection version: http://stackoverflow.com/questions/27335763/is-it-possible-to-search-in-bubble-chart-with-dc-js I don't think it matters too much which is the default. The filter modes are a bit inconsistent/incomplete in dc.js anyway. (I have some ideas about that, but a lot of higher priorities, since people seem to be able to hack around it.) |
Ok, I started working on the multiple select option for the menu. I should be able to submit a second PR soon. |
Cool! I'll schedule this for 2.1 because I'm just trying to fix bugs for 2.0. So January is a good target. |
I made the changes to the new Let me know if you would like anything changed whenever you get a chance to review it. |
The single select menu is working nicely. Just saw this thread in a long time. Will take the multi select widget for a spin |
Merged to develop/2.1 branch. Added a Thanks @madebydna! |
I had a need for select menu "chart" type in dc and I have seen it requested in other places, 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 thefilterDisplayed
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.