Skip to content

Commit

Permalink
Merge branch 'release/3.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwoodhull committed May 11, 2018
2 parents 0a758f4 + cea8966 commit faef863
Show file tree
Hide file tree
Showing 28 changed files with 596 additions and 317 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
@@ -1,3 +1,7 @@
## 3.0.2
* Allow row chart `.xAxis` to be settable. Since the type of axis can't be detected by the chart, provide [example](https://dc-js.github.io/dc.js/examples/row-top-axis.html) of setting the position of axis and grid lines manually.
* In a composite chart, the brush is only applied on the parent, by Deepak Kumar. This fixes many composite chart brushing issues, but let us know if it broke any of your use cases! ([#1408](https://github.com/dc-js/dc.js/pull/1408) / [#1424](https://github.com/dc-js/dc.js/issues/1424) / [#479](https://github.com/dc-js/dc.js/issues/479) / [#390](https://github.com/dc-js/dc.js/issues/390) / [#706](https://github.com/dc-js/dc.js/issues/706) / [#878](https://github.com/dc-js/dc.js/issues/878))

## 3.0.1
* Test compatibility with D3v4 as well as D3v5, by Deepak Kumar ([#1430](https://github.com/dc-js/dc.js/pull/1430))
* Add new charts/widgets to class hierarchy in documentation
Expand Down
121 changes: 62 additions & 59 deletions dc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dc.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dc.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dc.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "dc",
"version": "3.0.1",
"version": "3.0.2",
"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
2 changes: 2 additions & 0 deletions spec/composite-chart-spec.js
Expand Up @@ -704,6 +704,7 @@ describe('dc.compositeChart', function () {
});

it('should filter the child charts', function () {
jasmine.clock().tick(100);
expect(otherDimension.top(Infinity).length).toBe(4);
});

Expand All @@ -714,6 +715,7 @@ describe('dc.compositeChart', function () {
});

it('should filter down to fewer points', function () {
jasmine.clock().tick(100);
expect(otherDimension.top(Infinity).length).toBe(2);
});

Expand Down
2 changes: 1 addition & 1 deletion spec/coordinate-grid-chart-spec.js
Expand Up @@ -741,7 +741,7 @@ describe('dc.coordinateGridChart', function () {
});

it('should update its range chart\'s filter', function () {
expect(chart.rangeChart().filter()).toEqual(chart.filter());
expect(dc.utils.arraysEqual(chart.rangeChart().filter(), chart.filter())).toEqual(true);
});

it('should trigger redraw on its range chart', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/bar-chart.js
Expand Up @@ -228,7 +228,7 @@ dc.barChart = function (parent, chartGroup) {
bars.classed(dc.constants.SELECTED_CLASS, false);
bars.classed(dc.constants.DESELECTED_CLASS, false);
}
} else if (_chart.brushOn()) {
} else if (_chart.brushOn() || _chart.parentBrushOn()) {
if (!_chart.brushIsEmpty(brushSelection)) {
var start = brushSelection[0];
var end = brushSelection[1];
Expand Down
2 changes: 1 addition & 1 deletion src/box-plot.js
Expand Up @@ -192,7 +192,7 @@ dc.boxPlot = function (parent, chartGroup) {
}
});
} else {
if (!_chart.brushOn()) {
if (!(_chart.brushOn() || _chart.parentBrushOn())) {
return;
}
var start = brushSelection[0];
Expand Down
42 changes: 11 additions & 31 deletions src/composite-chart.js
Expand Up @@ -60,42 +60,21 @@ dc.compositeChart = function (parent, chartGroup) {
child.svg(_chart.svg());
child.xUnits(_chart.xUnits());
child.transitionDuration(_chart.transitionDuration(), _chart.transitionDelay());
child.brushOn(_chart.brushOn());
child.parentBrushOn(_chart.brushOn());
child.brushOn(false);
child.renderTitle(_chart.renderTitle());
child.elasticX(_chart.elasticX());
}

return g;
});

_chart._brushing = function () {
// Avoids infinite recursion (mutual recursion between range and focus operations)
// Source Event will be null when brush.move is called programmatically (see below as well).
if (!d3.event.sourceEvent) { return; }

// Ignore event if recursive event - i.e. not directly generated by user action (like mouse/touch etc.)
// In this case we are more worried about this handler causing brush move programmatically which will
// cause this handler to be invoked again with a new d3.event (and current event set as sourceEvent)
// This check avoids recursive calls
if (d3.event.sourceEvent.type && ['start', 'brush', 'end'].indexOf(d3.event.sourceEvent.type) !== -1) {
return;
}

var brushSelection = d3.event.selection;
if (brushSelection) {
brushSelection = brushSelection.map(_chart.x().invert);
}
brushSelection = _chart.extendBrush(brushSelection);

_chart.redrawBrush(brushSelection, false);

var brushIsEmpty = _chart.brushIsEmpty(brushSelection);

_chart.replaceFilter(brushIsEmpty ? null : brushSelection);

_chart.applyBrushSelection = function (rangedFilter) {
_chart.replaceFilter(rangedFilter);
for (var i = 0; i < _children.length; ++i) {
_children[i].replaceFilter(brushIsEmpty ? null : brushSelection);
_children[i].replaceFilter(rangedFilter);
}
_chart.redrawGroup();
};

_chart._prepareYAxis = function () {
Expand Down Expand Up @@ -285,10 +264,11 @@ dc.compositeChart = function (parent, chartGroup) {
};

_chart.fadeDeselectedArea = function (brushSelection) {
for (var i = 0; i < _children.length; ++i) {
var child = _children[i];
child.brush(_chart.brush());
child.fadeDeselectedArea(brushSelection);
if (_chart.brushOn()) {
for (var i = 0; i < _children.length; ++i) {
var child = _children[i];
child.fadeDeselectedArea(brushSelection);
}
}
};

Expand Down

0 comments on commit faef863

Please sign in to comment.