Skip to content

Commit 77d22ba

Browse files
committedJun 23, 2017
workaround flag for #949
1 parent 88a3d35 commit 77d22ba

File tree

4 files changed

+31
-4
lines changed

4 files changed

+31
-4
lines changed
 

‎Changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# 2.0 Series
2+
## 2.0.4
3+
* 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.)
4+
25
## 2.0.3
36
* crossfilter is loaded by its module name (crossfilter2), not its filename (crossfilter). This is intended to help webpack and other automatic module loaders. This is likely to break requireJS configurations; see [#1304](https://github.com/dc-js/dc.js/issues/1304) for details. ([#1213](https://github.com/dc-js/dc.js/issues/1213), [#1214](https://github.com/dc-js/dc.js/issues/1214), [#1261](https://github.com/dc-js/dc.js/issues/1261), [#1293](https://github.com/dc-js/dc.js/issues/1293), [#1302](https://github.com/dc-js/dc.js/issues/1302))
47
* Do not make the pie chart radius bigger than the chart size, by Sandeep Fatangare ([#1279](https://github.com/dc-js/dc.js/pull/1279))

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dc",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"license": "Apache-2.0",
55
"copyright": "2017",
66
"description": "A multi-dimensional charting library built to work natively with crossfilter and rendered using d3.js ",

‎src/stack-mixin.js

+26-1
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ dc.stackMixin = function (_chart) {
3232
var _titles = {};
3333

3434
var _hidableStacks = false;
35+
var _evadeDomainFilter = false;
3536

3637
function domainFilter () {
37-
if (!_chart.x()) {
38+
if (!_chart.x() || _evadeDomainFilter) {
3839
return d3.functor(true);
3940
}
4041
var xDomain = _chart.x().domain();
@@ -263,6 +264,30 @@ dc.stackMixin = function (_chart) {
263264
return _chart;
264265
};
265266

267+
/**
268+
* Since dc.js 2.0, there has been {@link https://github.com/dc-js/dc.js/issues/949 an issue}
269+
* where points are filtered to the current domain. While this is a useful optimization, it is
270+
* incorrectly implemented: the next point outside the domain is required in order to draw lines
271+
* that are clipped to the bounds, as well as bars that are partly clipped.
272+
*
273+
* A fix will be included in dc.js 2.1.x, but a workaround is needed for dc.js 2.0 and until
274+
* that fix is published, so set this flag to skip any filtering of points.
275+
*
276+
* Once the bug is fixed, this flag will have no effect, and it will be deprecated.
277+
* @method evadeDomainFilter
278+
* @memberof dc.stackMixin
279+
* @instance
280+
* @param {Boolean} [evadeDomainFilter=false]
281+
* @returns {Boolean|dc.stackMixin}
282+
*/
283+
_chart.evadeDomainFilter = function (evadeDomainFilter) {
284+
if (!arguments.length) {
285+
return _evadeDomainFilter;
286+
}
287+
_evadeDomainFilter = evadeDomainFilter;
288+
return _chart;
289+
};
290+
266291
function visability (l) {
267292
return !l.hidden;
268293
}

‎web/examples/range-series.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@
3535
focusChart
3636
.width(768)
3737
.height(480)
38-
.chart(function(c) { return dc.lineChart(c).interpolate('basis'); })
38+
.chart(function(c) { return dc.lineChart(c).interpolate('basis').evadeDomainFilter(true); })
3939
.x(d3.scale.linear().domain([0,20]))
4040
.brushOn(false)
4141
.yAxisLabel("Measured Speed km/s")
4242
.xAxisLabel("Run")
43-
.clipPadding(10)
4443
.elasticY(true)
4544
.dimension(runDimension)
4645
.group(runGroup)

0 commit comments

Comments
 (0)