Public
Edited
Jan 10
Insert cell
Insert cell
Insert cell
x = [0, ..._.shuffle([1, 2, 3])]
Insert cell
Insert cell
function reshape_energy(response) {
const zip = (row, columns) => _.zip(row, columns).map(d => d.flat());

const rows = response.data;
const columns = response.columns
const reshaped = rows.map(row => {
let zipped = zip(row, columns);
let obj = {}
zipped.forEach(d => {obj[d[1]] = d[0]});
return obj;
});

return reshaped;

}
Insert cell
Insert cell
reshaped_chars = reshape_characteristics(building)
Insert cell
reshaped_en = reshape_energy(building)
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
Insert cell
points = data.map(d => {
let scale = d3.scaleLinear([0, _.sum(d.weightedVals)], [0, 1]);
let ps = d.weightedVals.map(dd => scale(dd) * 100);
let zeros = new Array(ps.length).fill(0);
let zipped = _.zip(zeros, ps).flat();
zipped.push(0);
return {...d, points: zipped}
})
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