From 5222fc24813a4a12e857e620be019c83771bd47f Mon Sep 17 00:00:00 2001 From: Franc Camps-Febrer Date: Thu, 27 Dec 2018 17:40:17 +0100 Subject: [PATCH] Center timeline --- src/js/timeline/timeline.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/timeline/timeline.js b/src/js/timeline/timeline.js index bd317e8..c475d1f 100644 --- a/src/js/timeline/timeline.js +++ b/src/js/timeline/timeline.js @@ -323,7 +323,9 @@ export default function(svg, newApp, ui, methods) { const groupStep = (106 - 30) / domain.categories.length; let groupYs = Array.apply(null, Array(domain.categories.length)); groupYs = groupYs.map((g, i) => { - return 30 + i * groupStep; + //return 30 + i * groupStep; + const h = 106 - 30 + return (i + 1) * h / groupYs.length - 15; }); scale.y = d3.scaleOrdinal()