improve project graph

This commit is contained in:
Lachlan Kermode
2020-03-27 17:44:52 +01:00
parent 85476ee6fb
commit 421af5e60c
7 changed files with 99 additions and 59 deletions

View File

@@ -69,7 +69,7 @@ class TimelineAxis extends React.Component {
/>
<g
ref={this.xAxis1Ref}
transform={`translate(0, ${this.props.dims.trackHeight + 35})`}
transform={`translate(0, 10)`}
clipPath={`url(#clip)`}
className={`axis axisHourText`}
/>

View File

@@ -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

View File

@@ -21,5 +21,3 @@ export default ({
height={height}
/>
)
// export default () => null

View File

@@ -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>
)