Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scatter plot brushing - resizeFiltered #938

Closed
Sumbera opened this issue May 21, 2015 · 3 comments
Closed

scatter plot brushing - resizeFiltered #938

Sumbera opened this issue May 21, 2015 · 3 comments

Comments

@Sumbera
Copy link

Sumbera commented May 21, 2015

when brushing, only resize (path) changes on symbols, this is not consistent with other graphs that usually grey-out filtered-out elements.

would be great to have a chance to set color of filtered/non-filtered symbols on scatter plot, for example by extending resizeFiltered function with fill attribute :

   function resizeFiltered(filter) {
    var symbols = _chart.selectAll('.chart-body path.symbol').each(function (d) {
        this.filtered = filter && filter.isFiltered(d.key);
    });

    dc.transition(symbols, _chart.transitionDuration()).attr('d', _symbol)
                                                       .attr('fill', _chart.getColor); // --add this 
}
@gordonwoodhull gordonwoodhull added this to the v2.1 milestone May 24, 2015
@gordonwoodhull
Copy link
Contributor

Yeah. Also, why do the selected ones get smaller instead of larger?

@Sumbera
Copy link
Author

Sumbera commented May 25, 2015

this is another issue, var _highlightedSize = 5; is set up by default (so if user code spec symbol large than this it will go smaller). As initial default it could be specified like this:

 var _highlightedSize = _symbolSize-2;

btw, _chart.highlightedSize could accept function too

@gordonwoodhull gordonwoodhull modified the milestones: v2.0, v2.1 Feb 19, 2016
gordonwoodhull added a commit that referenced this issue Feb 19, 2016
for #938
simplify some of the logic
breaks three tests, however, so not merging to master yet.

also introduces emptySize as a better name for hiddenSize
@gordonwoodhull
Copy link
Contributor

@pbrockman, here is the issue you were describing.

I added .excludedSize(), .excludedColor() and .excludedOpacity() to make the behavior more direct and customizable. It still defaults to making the non-filtered ("excluded") points smaller.

"Highlighted" and "filtered" used to be sort of the same thing, which didn't make sense, because when nothing is filtered, it shouldn't all be highlighted. I consider that a bug, so I'm okay with breaking the old behavior there.

I also thought hiddenSize was kind of a dumb name, so I've aliased it to emptySize.

The logic was a bit too complicated (writing special flags to the DOM elements instead of just running the filter at the beginning of drawing), so I made it somewhat better. (It could still be simplified around highlighting, which now means just from the legend, but I left that untouched.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants