From 4d89ed1f0ceb5632e0a76671a82114f8cde16a0f Mon Sep 17 00:00:00 2001 From: Freeyorp Date: Tue, 28 May 2013 12:50:17 +1200 Subject: Apply filters from trellis brushes No broadcasting functionality yet. --- public/js/util/trellis-chart.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/js/util/trellis-chart.js b/public/js/util/trellis-chart.js index 97dcc98..bad1cb4 100644 --- a/public/js/util/trellis-chart.js +++ b/public/js/util/trellis-chart.js @@ -166,6 +166,7 @@ function trellisChart(anchor, monoGroups) { d.brush = d3.svg.brush(); d.filter = function(_) { if (!arguments.length) return d._filter; + d.dim.filter(_); d._filter = _; return d; }; @@ -265,12 +266,12 @@ function trellisChart(anchor, monoGroups) { if (brushIsEmpty(extent, d.brush)) { dc.events.trigger(function () { - _chart.filter(null); + d.filter(null); dc.redrawAll(); }); } else { dc.events.trigger(function () { - _chart.filter([extent[0], extent[1]]); + d.filter([extent[0], extent[1]]); dc.redrawAll(); }, dc.constants.EVENT_DELAY); } @@ -326,14 +327,17 @@ function trellisChart(anchor, monoGroups) { + "V" + (2 * y - 8); } - _chart.filter = function() { + _chart.filter = function(_) { /* * TODO: * This is going to be interesting. As the chart is not charting a single * monogroup, and most code is built around this assumption, this might * well end up being a messy special case. */ - return null; + if (!arguments.length) { + return null; + } + return _chart; } return _chart; -- cgit v1.2.3-60-g2f50