add datetime (analog of location in Map) in Timeline

This commit is contained in:
Lachlan Kermode
2019-01-08 11:37:47 +00:00
parent ff68fb1cad
commit 8e6c07d194
5 changed files with 134 additions and 81 deletions

View File

@@ -25,6 +25,7 @@ class Map extends React.Component {
mapTransformX: 0,
mapTransformY: 0
}
this.styleLocation = this.styleLocation.bind(this)
}
componentDidMount(){
@@ -157,12 +158,24 @@ class Map extends React.Component {
);
}
/**
* Determines additional styles on the <circle> for each location.
* A location consists of an array of events (location.events). The function
* also has full access to the domain and redux state to derive values if
* necessary. The function should return a regular style object.
*/
styleLocation(location) {
return {
fill: 'orange'
}
}
renderEvents() {
return (
<MapEvents
svg={this.svgRef.current}
locations={this.props.domain.locations}
styleLocation={(loc) => ({ /* TODO: add styles by location */ })}
styleLocation={this.styleLocation}
categories={this.props.domain.categories}
map={this.map}
mapTransformX={this.state.mapTransformX}