summaryrefslogtreecommitdiff
path: root/client/data.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/data.js')
-rw-r--r--client/data.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/client/data.js b/client/data.js
index 15792c9..eb5d41f 100644
--- a/client/data.js
+++ b/client/data.js
@@ -2,6 +2,8 @@ const files = [
"housing-costs-and-income-inequality",
"income-inequality-over-time",
"shares-of-wealth",
+ "weekly-earnings",
+ "household-wealth",
]
const dataPromises = files.map(name => {
@@ -10,11 +12,15 @@ const dataPromises = files.map(name => {
}).then(text => {
let lines = text.split('\n').map(line => line.split(','))
const h = lines.shift()
- return { name, h, lines, }
+ return {
+ name,
+ h,
+ lines: lines.filter(s => !!s)
+ }
})
})
const allPromises = Promise.all(dataPromises).then(data => {
- return data.reduce((a,b) => { a[b.name]=b, a }, {})
+ return data.reduce((a,b) => { a[b.name.replace(/-/g, '_')] = b; return a }, {})
})
const load = () => {
return allPromises