From 07a9341fa5f9601a6dd9fb53f498a4d5665e77cc Mon Sep 17 00:00:00 2001 From: Lachlan Kermode Date: Mon, 8 Jun 2020 16:55:57 +0200 Subject: [PATCH] return bar markers rendering --- src/common/utilities.js | 2 +- src/components/presentational/Timeline/DatetimeBar.js | 2 +- src/components/presentational/Timeline/Events.js | 2 +- src/components/presentational/Timeline/Markers.js | 7 ++++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/common/utilities.js b/src/common/utilities.js index d32e343..3d208a7 100644 --- a/src/common/utilities.js +++ b/src/common/utilities.js @@ -163,7 +163,7 @@ export function calcOpacity (num) { * other events there are in the same render. The idea here is that the * overlaying of events builds up a 'heat map' of the event space, where * darker areas represent more events with proportion */ - const base = num >= 1 ? 0.6 : 0 + const base = num >= 1 ? 0.3 : 0 return base + (Math.min(0.5, 0.08 * (num - 1))) } diff --git a/src/components/presentational/Timeline/DatetimeBar.js b/src/components/presentational/Timeline/DatetimeBar.js index cc3d0c4..2af18b4 100644 --- a/src/components/presentational/Timeline/DatetimeBar.js +++ b/src/components/presentational/Timeline/DatetimeBar.js @@ -33,7 +33,7 @@ export default ({ className='event' x={x} y={y - sectionHeight + (idx * sectionHeight) + (sectionHeight / 2)} - style={{ ...styleProps, opacity: h ? 0.5 : 0.1 }} + style={{ ...styleProps, opacity: h ? 0.3 : 0.1 }} width={width} height={sectionHeight} /> diff --git a/src/components/presentational/Timeline/Events.js b/src/components/presentational/Timeline/Events.js index d6c55eb..86a1b73 100644 --- a/src/components/presentational/Timeline/Events.js +++ b/src/components/presentational/Timeline/Events.js @@ -21,7 +21,7 @@ function renderDot (event, styles, props) { function renderBar (event, styles, props) { const fillOpacity = props.features.GRAPH_NONLOCATED ? event.projectOffset >= 0 ? styles.opacity : 0.5 - : 0.6 + : calcOpacity(1) return } - const isNonlocated = !event.latitude && !event.longitude + const isDot = (!!event.location && !!event.longitude) || (features.GRAPH_NONLOCATED && event.projectOffset !== -1) + switch (event.shape) { case 'circle': return renderCircle() @@ -59,7 +60,7 @@ const TimelineMarkers = ({ case 'star': return renderCircle() default: - return (!features.GRAPH_NONLOCATED && isNonlocated) ? renderBar : renderCircle() + return isDot ? renderCircle() : renderBar() } }