clean handler semantics in Dashboard.jsx (further)

This commit is contained in:
Lachlan Kermode
2018-12-05 11:36:29 +00:00
parent eeb242ef87
commit 13befd298a
5 changed files with 11 additions and 17 deletions

View File

@@ -22,7 +22,6 @@ class CardStack extends React.Component {
event={event}
language={this.props.language}
tools={this.props.tools}
// isLoading={this.props.isLoading}
getNarrativeLinks={this.props.getNarrativeLinks}
getCategoryGroup={this.props.getCategoryGroup}
getCategoryColor={this.props.getCategoryColor}

View File

@@ -94,8 +94,8 @@ class Dashboard extends React.Component {
<div>
<Viewport
methods={{
select: this.handleSelect,
highlight: this.handleHighlight,
onSelect: this.handleSelect,
// onHighlight: this.handleHighlight,
getCategoryColor: category => this.getCategoryColor(category)
}}
/>
@@ -111,9 +111,11 @@ class Dashboard extends React.Component {
getCategoryColor={category => this.getCategoryColor(category)}
/>
<Timeline
onSelect={this.handleSelect}
onUpdateTimerange={this.updateTimerange}
getCategoryColor={category => this.getCategoryColor(category)}
methods={{
onSelect: this.handleSelect,
onUpdateTimerange: this.updateTimerange,
getCategoryColor: category => this.getCategoryColor(category)
}}
/>
<InfoPopUp
ui={this.props.ui}

View File

@@ -19,13 +19,7 @@ class Timeline extends React.Component {
dom: this.props.dom
}
const methods = {
onSelect: this.props.onSelect,
onUpdateTimerange: this.props.onUpdateTimerange,
getCategoryColor: this.props.getCategoryColor
}
this.timeline = new TimelineLogic(this.props.app, ui, methods);
this.timeline = new TimelineLogic(this.props.app, ui, this.props.methods);
this.timeline.update(this.props.domain, this.props.app);
this.timeline.render(this.props.domain);
}

View File

@@ -21,7 +21,6 @@ export default function(newApp, ui, methods) {
}
const getCategoryColor = methods.getCategoryColor;
const select = methods.select;
const narrativeProps = ui.narratives;
// Map Settings
@@ -272,7 +271,7 @@ Stop and start the development process in terminal after you have added your tok
${lMap.latLngToLayerPoint(d.LatLng).y})`;
})
.on('click', (location) => {
select(location.events);
methods.onSelect(location.events);
});
const eventsDom = g.selectAll('.location')

View File

@@ -119,10 +119,10 @@ const initial = {
narratives: {
default: {
style: 'solid', // ['dotted', 'solid']
style: 'dotted', // ['dotted', 'solid']
opacity: 0.9, // range between 0 and 1
stroke: 'red', // Any hex or rgb code
strokeWidth: 5
strokeWidth: 2
},
narrative_1: {
style: 'solid', // ['dotted', 'solid']