Skip to content

Commit

Permalink
go back in time to commit experimental changes to source js
Browse files Browse the repository at this point in the history
  • Loading branch information
timelyportfolio committed Jan 7, 2018
1 parent 849e971 commit 40fa0dc
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
21 changes: 18 additions & 3 deletions d3.parcoords.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ d3.parcoords = function(config) {
hideAxis : [],
flipAxes: [],
animationTime: 1100, // How long it takes to flip the axis when you double click
rotateLabels: false
rotateLabels: false,
outsideFilters: null
};

extend(__, config);
Expand Down Expand Up @@ -1056,12 +1057,26 @@ var brush = {
//
// @param newSelection - The new set of data items that is currently contained
// by the brushes
function brushUpdated(newSelection) {
function brushUpdated(newSelection, brush_el) {
// if outside filters set then apply these outside filters
if(__.outsideFilters) {
newSelection = newSelection.filter(function(d) {
return d3.keys(__.outsideFilters).every(function(dim, i) {
return __.outsideFilters[dim].indexOf(d[dim]) > -1
})
})
}

__.brushed = newSelection;
events.brush.call(pc,__.brushed);
events.brush.call(pc,__.brushed, brush_el);
pc.renderBrushed();
}


// add brushUpdated to our parcoods
// to make it accessible from outside
pc.brushUpdated = brushUpdated

function brushPredicate(predicate) {
if (!arguments.length) { return brush.predicate; }

Expand Down
18 changes: 16 additions & 2 deletions src/brushes/brushmode.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,26 @@ var brush = {
//
// @param newSelection - The new set of data items that is currently contained
// by the brushes
function brushUpdated(newSelection) {
function brushUpdated(newSelection, brush_el) {
// if outside filters set then apply these outside filters
if(__.outsideFilters) {
newSelection = newSelection.filter(function(d) {
return d3.keys(__.outsideFilters).every(function(dim, i) {
return __.outsideFilters[dim].indexOf(d[dim]) > -1
})
})
}

__.brushed = newSelection;
events.brush.call(pc,__.brushed);
events.brush.call(pc,__.brushed, brush_el);
pc.renderBrushed();
}


// add brushUpdated to our parcoods
// to make it accessible from outside
pc.brushUpdated = brushUpdated

function brushPredicate(predicate) {
if (!arguments.length) { return brush.predicate; }

Expand Down
3 changes: 2 additions & 1 deletion src/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ d3.parcoords = function(config) {
hideAxis : [],
flipAxes: [],
animationTime: 1100, // How long it takes to flip the axis when you double click
rotateLabels: false
rotateLabels: false,
outsideFilters: null
};

extend(__, config);
Expand Down

0 comments on commit 40fa0dc

Please sign in to comment.