Skip to content

Commit

Permalink
Merge pull request #13 from almossawi/master
Browse files Browse the repository at this point in the history
Update for D3 4.x
  • Loading branch information
dandehavilland authored Aug 3, 2016
2 parents 5475405 + c40f106 commit ea7cc55
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions dist/mg_line_brushing.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function get_brush_interval(args) {

if (!resolution) {
if (args.time_series) {
resolution = d3.time.day;
resolution = d3.timeDay;
} else {
resolution = 1;
}
Expand Down Expand Up @@ -145,11 +145,9 @@ function brushing() {
.classed('mg-brush', true);

extentRect = brushingGroup.append('rect')
.attr({
opacity: 0,
y: args.top,
height: args.height - args.bottom - args.top - args.buffer
})
.attr('opacity', 0)
.attr('y', args.top)
.attr('height', args.height - args.bottom - args.top - args.buffer)
.classed('mg-extent', true);

// mousedown, start area selection
Expand All @@ -176,11 +174,10 @@ function brushing() {
newX = Math.min(originX, mouseX),
width = Math.max(originX, mouseX) - newX;

extentRect.attr({
x: newX,
width: width,
opacity: 1
});
extentRect
.attr('x', newX)
.attr('width', width)
.attr('opacity', 1);
}
});

Expand All @@ -189,8 +186,7 @@ function brushing() {
mouseDown = false;
svg.classed('mg-brushing-in-progress', false);

var args = chartContext.args,
xScale = args.scales.X,
var xScale = args.scales.X,
yScale = args.scales.Y,
flatData = [].concat.apply([], args.data),
boundedData,
Expand Down

0 comments on commit ea7cc55

Please sign in to comment.