rewrite features as part of store + add HIGHLIGHT_GROUPS

This commit is contained in:
Lachlan Kermode
2020-05-19 14:08:03 +02:00
parent 154b62f924
commit e93d7d8831
16 changed files with 151 additions and 84 deletions

View File

@@ -287,6 +287,7 @@ class Timeline extends React.Component {
const heightStyle = { height: dims.height }
const extraStyle = { ...heightStyle, ...foldedStyle }
const contentHeight = { height: dims.contentHeight }
const { categories } = this.props.domain
return (
<div className={classes} style={extraStyle}>
@@ -347,10 +348,17 @@ class Timeline extends React.Component {
narrative={this.props.app.narrative}
getDatetimeX={this.getDatetimeX}
getCategoryY={this.state.scaleY}
getHighlights={group => {
if (group === 'None') {
return []
}
return categories.map(c => c.group === group)
}}
getCategoryColor={this.props.methods.getCategoryColor}
transitionDuration={this.state.transitionDuration}
onSelect={this.props.methods.onSelect}
dims={dims}
features={this.props.features}
/>
</svg>
</div>
@@ -378,7 +386,8 @@ function mapStateToProps (state) {
ui: {
dom: state.ui.dom,
styles: state.ui.style.selectedEvents
}
},
features: selectors.getFeatures(state)
}
}