Published
Edited
May 6, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
treeWidth = 960
Insert cell
treeHeight = 600
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
margin = ({top: 20, right: 20, bottom: 45, left: 35})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// energyuse = {
// const energy = await d3.csv("https://www.elementa.nyc/projects/nyc-electrification/typology-data/data/zipcode_monthly.csv", d3.autoType);

// const zips = new Set();
// data.forEach(d => {
// zips.add(+d.zip);
// })
// const check = Array.from(zips)
// const filtered = energy.filter(d => check.includes(d.zip_code));
// let metered = energy.filter(d => d.value >= 0 && d.data_field_display_name === "Total Consumption (T)" && d.year === 2019);
// metered = metered.filter(d => d.unit === "Therms" || d.unit === "MWh");
// const grouped = _.groupBy(metered, d => d.zip_code);
// const output = [];
// for (const [key, values] of Object.entries(grouped)) {
// const electricity = values.filter(d => d.unit === "MWh");
// const gas = values.filter(d => d.unit === "Therms");
// output.push({zip: String(key), therms: _.sumBy(gas, d=> d.value), mwh: _.sumBy(electricity, d=> d.value) });
// }
// return output;

// }
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chroma = require('chroma-js')
Insert cell
Insert cell
Insert cell
histogramWidth = 960
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more