dc-js / dc.leaflet.js

DC charts using Leaflet maps
Apache License 2.0
52 stars 24 forks source link

gray-out colors? #43

Closed Tablel352 closed 3 years ago

Tablel352 commented 3 years ago

In the dc charts (not dc leaflet), when selecting a group, the other groups get grayed-out. (tested with the bubbleChart)

Would this also be desired behavior for the dc leaflet maps?

gordonwoodhull commented 3 years ago

As mentioned in the documentation, you can set the unselectedColor to a function. The chart takes this somewhat literally, and will show all bubbles that color even when none is selected. To approximate the behavior of other charts, you can do

          .unselectedColor(d => choro.filters().length ? 'grey' : choro.getColor(d))

Only single selection is supported, though.

image
Tablel352 commented 3 years ago

thanks, works now!