From f90b73ce735fb1c1148cb07902748f5d7e4f6d69 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sat, 30 Dec 2017 23:53:56 +0100 Subject: [PATCH] Reformat brushed() --- js/diagrams.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/js/diagrams.js b/js/diagrams.js index 0d0070a..7e4c6f2 100644 --- a/js/diagrams.js +++ b/js/diagrams.js @@ -507,10 +507,8 @@ function createLineGraph(containerId, raceData){ if (d3.event.sourceEvent && d3.event.sourceEvent.type === "zoom") return; // ignore brush-by-zoom var s = d3.event.selection || x2.range(); x.domain(s.map(x2.invert, x2)); - - updateElements(); - - //Update the "preview" rectangle + updateElements(); + // Update the "preview" rectangle svg.select(".zoom").call(zoom.transform, d3.zoomIdentity .scale(graphPosWidth.width / (s[1] - s[0])) .translate(-s[0], 0));