proper fix of GRAPH_NONLOCATED

This commit is contained in:
Lachlan Kermode
2020-05-31 16:30:32 +02:00
parent 08bbe9c85e
commit 681447c15b
6 changed files with 25 additions and 11 deletions

View File

@@ -92,7 +92,7 @@ const TimelineEvents = ({
}
}
let eventY = getCategoryY(event.category)
let eventY = getCategoryY ? getCategoryY(event.category) : 0
const isNonlocated = !event.latitude && !event.longitude
if (features.GRAPH_NONLOCATED && isNonlocated) {
const { project } = event

View File

@@ -51,7 +51,8 @@ const TimelineMarkers = ({
}}
/>
}
const isDot = (!features.GRAPH_NONLOCATED && !!event.latitude && !!event.longitude) || (features.GRAPH_NONLOCATED && (event.projectOffset !== -1 || (!!event.latitude && !!event.longitude)))
const isNonlocated = !event.latitude && !event.longitude
const isBar = (!features.GRAPH_NONLOCATED && isNonlocated) || (features.GRAPH_NONLOCATED && features.GRAPH_NONLOCATED.categories.includes(event.category))
switch (event.shape) {
case 'circle':
return renderCircle()
@@ -62,7 +63,7 @@ const TimelineMarkers = ({
case 'star':
return renderCircle()
default:
return isDot ? renderCircle() : renderBar()
return isBar ? renderBar() : renderCircle()
}
}