lab3 p2 step5

This commit is contained in:
2026-03-20 12:12:19 +10:00
parent 1121944fb1
commit c368e1eef8
3 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
// Входные данные:
// data - исходный массив (например, buildings)
// key - поле, по которому осуществляется группировка
function createArrGraph(data, key) {
const groupObj = d3.group(data, d => d[key]);
let arrGraph =[];
for(let entry of groupObj) {
const minMax = d3.extent(entry[1].map(d => d['Высота']));
arrGraph.push({labelX : entry[0], values : minMax});
}
return arrGraph;
}