mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 13:28:36 +03:00
improve project graph
This commit is contained in:
@@ -94,6 +94,7 @@ function MapEvents ({ getCategoryColor, categories, projectPoint, styleLocation,
|
||||
longitude: '32.2'
|
||||
}
|
||||
*/
|
||||
if (!location.latitude || !location.longitude) return null
|
||||
const { x, y } = projectPoint([location.latitude, location.longitude])
|
||||
|
||||
// in narrative mode, only render events in narrative
|
||||
|
||||
@@ -21,5 +21,3 @@ export default ({
|
||||
height={height}
|
||||
/>
|
||||
)
|
||||
|
||||
// export default () => null
|
||||
|
||||
@@ -136,22 +136,27 @@ const TimelineEvents = ({
|
||||
// })
|
||||
// })
|
||||
|
||||
let projects
|
||||
let renderProjects = () => null
|
||||
if (process.env.features.ASSOCIATIVE_EVENTS_BY_TAG) {
|
||||
projects = datetimes[1]
|
||||
const projects = datetimes[1]
|
||||
datetimes = datetimes[0]
|
||||
renderProjects = function () {
|
||||
return <React.Fragment>
|
||||
{projects.map(project => <Project
|
||||
{...project}
|
||||
getX={getDatetimeX}
|
||||
dims={dims}
|
||||
colour={getCategoryColor(project.category)}
|
||||
/>)}
|
||||
</React.Fragment>
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<g
|
||||
clipPath={'url(#clip)'}
|
||||
>
|
||||
{projects.map(project => (<Project
|
||||
{...project}
|
||||
getX={getDatetimeX}
|
||||
dims={dims}
|
||||
colour={getCategoryColor(project.category)}
|
||||
/>))}
|
||||
{renderProjects()}
|
||||
{datetimes.map(datetime => renderDatetime(datetime))}
|
||||
</g>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user