Skip to content

Commit

Permalink
Add parallel coordinates example.
Browse files Browse the repository at this point in the history
This includes a d3.extent convenience method for [d3.min, d3.max], and fixes the
brush component such that the resizers are hidden when the extent is empty.
  • Loading branch information
mbostock committed Nov 2, 2011
1 parent af589a0 commit 149320f
Show file tree
Hide file tree
Showing 7 changed files with 562 additions and 6 deletions.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -48,6 +48,7 @@ d3.core.js: \
src/core/median.js \
src/core/min.js \
src/core/max.js \
src/core/extent.js \
src/core/random.js \
src/core/number.js \
src/core/sum.js \
Expand Down
11 changes: 9 additions & 2 deletions d3.js
Expand Up @@ -105,6 +105,9 @@ d3.max = function(array, f) {
}
return a;
};
d3.extent = function() {
return [d3.min.apply(d3, arguments), d3.max.apply(d3, arguments)];
};
d3.random = {
normal: function(mean, deviation) {
if (arguments.length < 2) deviation = 1;
Expand Down Expand Up @@ -3890,7 +3893,7 @@ d3.svg.brush = function() {
.attr("width", 6)
.attr("height", 6)
.style("visibility", "hidden")
.style("pointer-events", "all")
.style("pointer-events", brush.empty() ? "none" : "all")
.style("cursor", function(d) { return d3_svg_brushCursor[d]; });

// Remove any superfluous resizers.
Expand All @@ -3915,6 +3918,7 @@ d3.svg.brush = function() {
var target = d3.select(d3.event.target);

// Store some global state for the duration of the brush gesture.
d3_svg_brush = brush;
d3_svg_brushTarget = this;
d3_svg_brushExtent = extent;
d3_svg_brushOffset = d3.svg.mouse(d3_svg_brushTarget);
Expand Down Expand Up @@ -4036,7 +4040,8 @@ d3.svg.brush = function() {
return brush;
};

var d3_svg_brushDispatch,
var d3_svg_brush,
d3_svg_brushDispatch,
d3_svg_brushTarget,
d3_svg_brushX,
d3_svg_brushY,
Expand Down Expand Up @@ -4160,7 +4165,9 @@ function d3_svg_brushMove1(mouse, scale, i) {
function d3_svg_brushUp() {
if (d3_svg_brushOffset) {
d3_svg_brushMove();
d3.select(d3_svg_brushTarget).selectAll(".resize").style("pointer-events", d3_svg_brush.empty() ? "none" : "all");
d3_svg_brushDispatch("brushend");
d3_svg_brush =
d3_svg_brushDispatch =
d3_svg_brushTarget =
d3_svg_brushX =
Expand Down
4 changes: 2 additions & 2 deletions d3.min.js

Large diffs are not rendered by default.

0 comments on commit 149320f

Please sign in to comment.