mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 13:28:36 +03:00
refix map selection
This commit is contained in:
@@ -52,9 +52,10 @@ class Dashboard extends React.Component {
|
||||
}
|
||||
|
||||
handleSelect (selected, axis) {
|
||||
const matchedEvents = [selected]
|
||||
const matchedEvents = []
|
||||
const TIMELINE_AXIS = 0
|
||||
if (axis === TIMELINE_AXIS) {
|
||||
matchedEvents.push(selected)
|
||||
// find in events
|
||||
const { events } = this.props.domain
|
||||
const idx = binarySearch(
|
||||
@@ -74,6 +75,10 @@ class Dashboard extends React.Component {
|
||||
matchedEvents.push(events[ptr])
|
||||
ptr += 1
|
||||
}
|
||||
} else { // Map...
|
||||
const std = { ...selected }
|
||||
delete std.sources
|
||||
Object.values(std).forEach(ev => matchedEvents.push(ev))
|
||||
}
|
||||
|
||||
this.props.actions.updateSelected(matchedEvents)
|
||||
@@ -152,14 +157,14 @@ class Dashboard extends React.Component {
|
||||
/>
|
||||
<Map
|
||||
methods={{
|
||||
onSelect: this.handleSelect,
|
||||
onSelect: ev => this.handleSelect(ev, 1),
|
||||
onSelectNarrative: this.setNarrative,
|
||||
getCategoryColor: this.getCategoryColor
|
||||
}}
|
||||
/>
|
||||
<Timeline
|
||||
methods={{
|
||||
onSelect: this.handleSelect,
|
||||
onSelect: ev => this.handleSelect(ev, 0),
|
||||
onUpdateTimerange: actions.updateTimeRange,
|
||||
getCategoryColor: category => this.getCategoryColor(category)
|
||||
}}
|
||||
|
||||
@@ -357,7 +357,7 @@ class Timeline extends React.Component {
|
||||
}}
|
||||
getCategoryColor={this.props.methods.getCategoryColor}
|
||||
transitionDuration={this.state.transitionDuration}
|
||||
onSelect={ev => this.props.methods.onSelect(ev, TIMELINE_AXIS)}
|
||||
onSelect={this.props.methods.onSelect}
|
||||
dims={dims}
|
||||
features={this.props.features}
|
||||
/>
|
||||
|
||||
@@ -60,12 +60,12 @@ const initial = {
|
||||
},
|
||||
timeline: {
|
||||
dimensions: {
|
||||
height: 1250,
|
||||
height: 250,
|
||||
width: 0,
|
||||
marginLeft: 100,
|
||||
marginTop: 15,
|
||||
marginBottom: 60,
|
||||
contentHeight: 800,
|
||||
contentHeight: 200,
|
||||
width_controls: 100
|
||||
},
|
||||
range: [
|
||||
|
||||
Reference in New Issue
Block a user