changes = FileAttachment("rent-changed-year@1.tsv")
.tsv({ typed: true })
.then((data) => {
const formatMonth = d3.utcFormat("%b");
return data.map((row) => ({
apn: row.apn,
unit: row.unit,
oldDate: row.date,
newDate: row.newDate,
oldRentNominal: row.rent,
newRentNominal: row.newRent,
oldRentReal:
(row.rent /
cpi.filter((c) => c.Year == row.date.getFullYear())[0][
formatMonth(row.date)
]) *
313.207,
newRentReal:
(row.newRent /
cpi.filter((c) => c.Year == row.newDate.getFullYear())[0][
formatMonth(row.newDate)
]) *
313.207
}));
})