I have the following map and filter functions in order to get my csv file data with their column names as keys.
d3.csv("Sales Export Friendly 3-19-17.csv", function(data) {
sales = data
.map(sale => [
sale["Unit Booked"],
new Date(sale["Booking Date"]).getMonth() + 1,
new Date(sale["Checkin"]).getMonth() + 1,
(new Date(sale["Checkout"]).valueOf() - new Date(sale["Checkin"]).valueOf())/(24*60*60*1000),
+sale["Total Stay"],
(+sale["Total Stay"]) / ((new Date(sale["Checkout"]).valueOf() - new Date(sale["Checkin"]).valueOf())/(24*60*60*1000)),
])
.filter(([unit, date, checkin, LOS, total, avgNight]) => !isNaN(total));
This works for most purposes but I haven't figured out how to retain the column names to reference them as axes in a d3 multidimensional type of viz (parallel coordinates). I think it may have to do with the use of map and filter?