dc.js icon indicating copy to clipboard operation
dc.js copied to clipboard

Add 'clickFilterBehavior' to base-mixin to allow ctrl-click joins

Open bloer opened this issue 10 years ago • 4 comments

The clickFilterBehavior option is intended for ordinal charts, bubble charts, pie charts, etc, i.e., those where clicking on an svg node filters to that node. I have not tested what would happen if a user tried to enable on a brush filter for example.

.clickFilterBehavior has 4 modes:

  • "replace": The clicked node replaces the current filter list. Note that it is not possible to remove the filter in this case without a reset link.
  • "toggle": Filtering for the clicked node is toggled from its current state. Therefore, if no filters are applied, clicking a node will filter all but that node (by applying an inverse filter under the hood).
  • "replaceThenToggle": This is the current behavior. If there are no filters applied, act as 'replace'. If there is one ore more filter applied, act as 'toggle'.
  • "replaceCtrlToggle": This acts like selecting graphics objects in e.g. PowerPoint. Left-click acts as 'replace', and ctrl-click acts as 'toggle'.

bloer avatar May 23 '14 19:05 bloer

This is a great idea! Would you consider writing some tests?

gordonwoodhull avatar May 23 '14 20:05 gordonwoodhull

I'm extremely new to this -- wasn't even aware that it would be possible to write tests for onClick behavior. I'll see if I can come up with something useful next week.

bloer avatar May 23 '14 20:05 bloer

How do I make 'reset' work here??

nisha0809 avatar Aug 27 '14 05:08 nisha0809

So what's the status of tis pr?

Mavlarn avatar Jan 02 '18 05:01 Mavlarn