-
{ this.onClickArrow(); }}
+ onClick={() => { this.onClickArrow() }}
hideInfo={isNarrative}
/>
@@ -263,43 +264,43 @@ class Timeline extends React.Component {
width={dims.width}
height={dims.height}
>
-
-
- { this.onDragStart() }}
onDrag={() => { this.onDrag() }}
onDragEnd={() => { this.onDragEnd() }}
categories={this.props.domain.categories}
/>
- { this.onMoveTime(dir) }}
/>
-
-
-
-
- );
+ )
}
}
@@ -326,11 +327,9 @@ function mapStateToProps(state) {
narratives: state.domain.narratives
},
app: {
- timerange: selectors.getTimeRange(state),
- dims: state.app.timeline.dimensions,
selected: state.app.selected,
language: state.app.language,
- zoomLevels: state.app.timeline.zoomLevels,
+ timeline: state.app.timeline,
narrative: state.app.narrative
},
ui: {
@@ -339,4 +338,4 @@ function mapStateToProps(state) {
}
}
-export default connect(mapStateToProps)(Timeline);
+export default connect(mapStateToProps)(Timeline)
diff --git a/src/reducers/app.js b/src/reducers/app.js
index 43e39aa..f17afac 100644
--- a/src/reducers/app.js
+++ b/src/reducers/app.js
@@ -36,8 +36,8 @@ function updateSelected(appState, action) {
}
function updateNarrative(appState, action) {
- let minTime = appState.filters.timerange[0]
- let maxTime = appState.filters.timerange[1]
+ let minTime = appState.timeline.range[0]
+ let maxTime = appState.timeline.range[1]
let cornerBound0 = [180, 180]
let cornerBound1 = [-180, -180]
diff --git a/src/selectors/index.js b/src/selectors/index.js
index e9dfab2..6494b4a 100644
--- a/src/selectors/index.js
+++ b/src/selectors/index.js
@@ -25,7 +25,7 @@ export const getNotifications = state => state.domain.notifications
export const getTagTree = state => state.domain.tags
export const getTagsFilter = state => state.app.filters.tags
export const getCategoriesFilter = state => state.app.filters.categories
-export const getTimeRange = state => state.app.filters.timerange
+export const getTimeRange = state => state.app.timeline.range
/**
diff --git a/src/store/initial.js b/src/store/initial.js
index 9c3326a..ad7f021 100644
--- a/src/store/initial.js
+++ b/src/store/initial.js
@@ -39,23 +39,24 @@ const initial = {
current: null
},
filters: {
- timerange: [
- new Date(2013, 2, 23, 12),
- new Date(2016, 2, 23, 12)
- ],
- mapBounds: null,
tags: [],
categories: [],
views: {
events: true,
- coevents: false,
routes: false,
sites: true
},
},
isMobile: (/Mobi/.test(navigator.userAgent)),
language: 'en-US',
- mapAnchor: [31.356397, 34.784818],
+ map: {
+ anchor: [31.356397, 34.784818],
+ startZoom: 10,
+ minZoom: 7,
+ maxZoom: 18,
+ bounds: null,
+ maxBounds: [[180, -180], [-180, 180]]
+ },
timeline: {
dimensions: {
height: 140,
@@ -66,6 +67,10 @@ const initial = {
margin_top: 20,
trackHeight: 80
},
+ range: [
+ new Date(2013, 2, 23, 12),
+ new Date(2016, 2, 23, 12)
+ ],
zoomLevels: [
{ label: '3 years', duration: 1576800 },
{ label: '3 months', duration: 129600 },
@@ -92,6 +97,7 @@ const initial = {
* as well as dom elements to attach SVG
*/
ui: {
+ tiles: 'openstreetmap', // ['openstreetmap', 'streets', 'satellite']
style: {
categories: {
default: '#f3de2c',
@@ -127,7 +133,7 @@ if (process.env.store) {
}
// NB: config.js dates get implicitly converted to strings in mergeDeepLeft
-appStore.app.filters.timerange[0] = new Date(appStore.app.filters.timerange[0])
-appStore.app.filters.timerange[1] = new Date(appStore.app.filters.timerange[1])
+appStore.app.timeline.range[0] = new Date(appStore.app.timeline.range[0])
+appStore.app.timeline.range[1] = new Date(appStore.app.timeline.range[1])
export default appStore