diff --git a/src/js/map/map.js b/src/js/map/map.js index 6133b98..f9b3c96 100644 --- a/src/js/map/map.js +++ b/src/js/map/map.js @@ -227,8 +227,8 @@ Stop and start the development process in terminal after you have added your tok // categories.sort((a, b) => { // return (+a.slice(-2) > +b.slice(-2)); // }); - categories.forEach(group => { - eventCount[group] = 0 + categories.forEach(cat => { + eventCount[cat.category] = 0 }); location.events.forEach((event) => {; @@ -239,9 +239,9 @@ Stop and start the development process in terminal after you have added your tok const events = []; while (i < categories.length) { - let _eventsCount = eventCount[categories[i]]; + let _eventsCount = eventCount[categories[i].category]; for (let j = i + 1; j < categories.length; j++) { - _eventsCount += eventCount[categories[j]]; + _eventsCount += eventCount[categories[j].category]; } events.push(_eventsCount); i++; diff --git a/src/js/timeline/timeline.js b/src/js/timeline/timeline.js index ae5f245..d8fb792 100644 --- a/src/js/timeline/timeline.js +++ b/src/js/timeline/timeline.js @@ -513,7 +513,7 @@ export default function(app, ui, methods) { axis.y = d3.axisLeft(scale.y) - .tickValues(categories); + .tickValues(categories.map(c => c.category)); } function update(domain, app) { diff --git a/src/selectors/index.js b/src/selectors/index.js index 40336e8..44809cc 100644 --- a/src/selectors/index.js +++ b/src/selectors/index.js @@ -155,26 +155,9 @@ export const selectLocations = createSelector( */ export const selectCategories = createSelector( [getCategories], - (categories) => { - return Object.values(categories); - } + (categories) => categories ); -/** - * Return categories by group - */ -export const selectCategoryGroups = createSelector( - [selectCategories], - (categories) => { - const groups = {}; - categories.forEach((cat) => { - if (cat.group && !groups[cat.group]) { - groups[cat.group] = cat.group_label; - } - }); - return Object.keys(groups).concat(['other']); - } -); /** * Given a tree of tags, return those tags as a list