Public
Edited
Jan 17, 2023
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
Insert cell
Insert cell
Insert cell
selectedRows = superstore.filter(d => year == "All" ? true : d.year == year && categoriaSeleccionada == "All" ? true : d.Categoría == categoriaSeleccionada).filter(d => d.Ciudad == "Managua")
Insert cell
Insert cell
Insert cell
groupedDaya = d3.groups(selectedRows, d => d[groupBy], d => d[nodeField])
Insert cell
Insert cell
// nos quedamos con los pedidos con más de un producto
pedidosRelaciones = groupedDaya.map(function(d) {
return {
pedido : d[0],
relaciones : Array.from(d[1].map(p => p[0]))
}
}).filter(d => d.relaciones.length > 1)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
filteredLinksByWeight = linksObj.filter(d => d.value > minLinkWeight)
Insert cell
Insert cell
Insert cell
color = colorField == "Segmento" ? colorScaleSegmentos : genericColorScale


Insert cell
Insert cell
Insert cell
color.domain()
Insert cell
linkWidth = d3.scaleLinear()
.domain([1, d3.max(linksObj, d => d.value)])
.range([1, 3]);
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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