Skip to content

Commit

Permalink
scatter plot only select symbols from this chart
Browse files Browse the repository at this point in the history
fixes #874
  • Loading branch information
gordonwoodhull committed Jul 10, 2017
1 parent e28fccf commit 0750a22
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 2.0 Series
## 2.0.5
* legend highlighting functions of scatter plots would select symbols in sibling charts, causing the symbols and sizes to change ([#874](https://github.com/dc-js/dc.js/issues/874))

## 2.0.4
* Temporary flag [`stackMixin.evadeDomainFilter`](http://dc-js.github.io/dc.js/docs/html/dc.stackMixin.html#evadeDomainFilter__anchor) to work around [issue #949](https://github.com/dc-js/dc.js/issues/949) until it's fixed. The flag completely disables filtering of points by the stack mixin, because the current filtering is wrong. (The correct fix will be included in dc.js 2.1.x when it's ready.)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dc",
"version": "2.0.4",
"version": "2.0.5",
"license": "Apache-2.0",
"copyright": "2017",
"description": "A multi-dimensional charting library built to work natively with crossfilter and rendered using d3.js ",
Expand Down
6 changes: 3 additions & 3 deletions src/scatter-plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ dc.scatterPlot = function (parent, chartGroup) {
resizeSymbolsWhere(function (symbol) {
return symbol.attr('fill') === d.color;
}, _highlightedSize);
_chart.selectAll('.chart-body path.symbol').filter(function () {
_chart.chartBodyG().selectAll('.chart-body path.symbol').filter(function () {
return d3.select(this).attr('fill') !== d.color;
}).classed('fadeout', true);
};
Expand All @@ -369,13 +369,13 @@ dc.scatterPlot = function (parent, chartGroup) {
resizeSymbolsWhere(function (symbol) {
return symbol.attr('fill') === d.color;
}, _symbolSize);
_chart.selectAll('.chart-body path.symbol').filter(function () {
_chart.chartBodyG().selectAll('.chart-body path.symbol').filter(function () {
return d3.select(this).attr('fill') !== d.color;
}).classed('fadeout', false);
};

function resizeSymbolsWhere (condition, size) {
var symbols = _chart.selectAll('.chart-body path.symbol').filter(function () {
var symbols = _chart.chartBodyG().selectAll('.chart-body path.symbol').filter(function () {
return condition(d3.select(this));
});
var oldSize = _symbol.size();
Expand Down

0 comments on commit 0750a22

Please sign in to comment.