From dce956d357f08ca18fe19659710b6d5cbff2c166 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sun, 31 Dec 2017 16:11:39 +0100 Subject: [PATCH 1/2] Fix pitstoppoints reduce their size after mouseout event --- js/diagrams.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/diagrams.js b/js/diagrams.js index 771d57a..12069b9 100644 --- a/js/diagrams.js +++ b/js/diagrams.js @@ -448,7 +448,7 @@ function createLineGraph(containerId, raceData){ textArr = getLapTextArray(raceData,d); }else if(dataType === elemTypes.pitstoppoint){ d3.select(this) - .attr("r", linePointSize); + .attr("r", linePointSize * 1.4); textArr = getPitStopTextArray(raceData,d); }else if(dataType === elemTypes.endpoint){ d3.select(this) From d4d4a62ee2bce06cc92cadc017b63c658c9d729d Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sun, 31 Dec 2017 16:42:30 +0100 Subject: [PATCH 2/2] Increase y distance from mouse cursor to tooltip --- js/diagrams.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/diagrams.js b/js/diagrams.js index 12069b9..ef7cbd6 100644 --- a/js/diagrams.js +++ b/js/diagrams.js @@ -418,7 +418,7 @@ function createLineGraph(containerId, raceData){ .attr("width", textMaxLength + "em") .attr("height", (textArr.length + 1) + "em") .attr("x", function() { if(xRatio < 0.70) return d3.mouse(this)[0] + 10; else return d3.mouse(this)[0] - 130; }) - .attr("y", function() { return d3.mouse(this)[1] + 10; }); + .attr("y", function() { return d3.mouse(this)[1] + 25; }); //Necessary to add Text for each Line textArr.forEach((text, textIndex) =>{ @@ -426,7 +426,7 @@ function createLineGraph(containerId, raceData){ tooltipGroup.append("text") .attr("dy", (textIndex + 1) + "em") .attr("x", function() { if(xRatio < 0.70) return d3.mouse(this)[0] + 15; else return d3.mouse(this)[0] - 125; }) - .attr("y", function() { return d3.mouse(this)[1] + 15; }) + .attr("y", function() { return d3.mouse(this)[1] + 30; }) .text(function() { return text; // Value of the text });