dc-js / dc.js

Multi-Dimensional charting built to work natively with crossfilter rendered with d3.js
Apache License 2.0
7.42k stars 1.81k forks source link

selectMenu doesn't work with date keys #1188

Open gordonwoodhull opened 8 years ago

gordonwoodhull commented 8 years ago

It is effectively coercing the keys to strings, because it is filtering on the value attribute of the <option> tags. It should use the original data instead of pulling from HTML attributes.

            values = selectedOptions.map(function (d) {
                return d.value;
            });

https://github.com/dc-js/dc.js/blob/develop/src/select-menu.js#L99

should use d3.select(d).datum().key instead.

(Unless there's something more idiomatic we can do - usually not an issue because we are attaching event handlers directly to the elements, but here we are listening to the parent which doesn't itself have data (should it?))

gordonwoodhull commented 8 years ago

Prompted by

http://stackoverflow.com/questions/38591613/how-to-create-interaction-with-selectmenu-in-dc-js