From ec3ea5a7c7a4cbbb88a209a61d3406c539c8fd19 Mon Sep 17 00:00:00 2001 From: Franc Camps-Febrer Date: Thu, 17 Jan 2019 11:24:31 -0500 Subject: [PATCH] Adjust y ticks height --- src/components/Timeline.jsx | 3 ++- src/components/TimelineCategories.jsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Timeline.jsx b/src/components/Timeline.jsx index a05c5e3..5c42e17 100644 --- a/src/components/Timeline.jsx +++ b/src/components/Timeline.jsx @@ -82,7 +82,8 @@ class Timeline extends React.Component { } makeScaleY(categories) { - const catsYpos = categories.map((g, i) => (i + 1) * this.state.dims.trackHeight / categories.length); + const tickHeight = 15; + const catsYpos = categories.map((g, i) => (i + 1) * this.state.dims.trackHeight / categories.length + tickHeight / 2); return d3.scaleOrdinal() .domain(categories) .range(catsYpos); diff --git a/src/components/TimelineCategories.jsx b/src/components/TimelineCategories.jsx index d1cd15f..c90697c 100644 --- a/src/components/TimelineCategories.jsx +++ b/src/components/TimelineCategories.jsx @@ -25,7 +25,7 @@ class TimelineCategories extends React.Component { } getY(idx) { - return (idx + 1) * this.props.dims.trackHeight / this.props.categories.length + return (idx + 1) * this.props.dims.trackHeight / this.props.categories.length + 7.5; } renderCategory(category, idx) {