visual updates

This commit is contained in:
Lachlan Kermode
2020-05-31 09:44:03 +02:00
parent 404dd618ae
commit dd9d52cb1b
2 changed files with 5 additions and 4 deletions

View File

@@ -32,7 +32,7 @@ export default ({
onClick={onSelect}
className='event'
x={x}
y={y - sectionHeight + (idx * sectionHeight)}
y={y - sectionHeight + (idx * sectionHeight) + (sectionHeight / 2)}
style={{ ...styleProps, opacity: h ? 0.5 : 0.1 }}
width={width}
height={sectionHeight}

View File

@@ -92,10 +92,11 @@ const TimelineEvents = ({
}
}
let defaultY = getCategoryY(event.category)
let colour = event.colour ? event.colour : getCategoryColor(event.category)
const styles = {
fill: colour,
fillOpacity: calcOpacity(1),
fillOpacity: defaultY > 0 ? calcOpacity(1) : 0,
transition: `transform ${transitionDuration / 1000}s ease`
}
@@ -103,8 +104,8 @@ const TimelineEvents = ({
x: getDatetimeX(event.timestamp),
y: (features.GRAPH_NONLOCATED && !event.latitude && !event.longitude)
? event.projectOffset >= 0 ? dims.trackHeight - event.projectOffset : dims.marginTop
: getCategoryY ? getCategoryY(event.category) : () => null,
onSelect: () => onSelect(event),
: getCategoryY ? defaultY : () => null,
onSelect: () => onSelect([event]),
dims,
highlights: features.HIGHLIGHT_GROUPS ? getHighlights(event.tags[features.HIGHLIGHT_GROUPS.tagIndexIndicatingGroup]) : [],
features