Public
Edited
Mar 4, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
height: 300,
width: width,
x: {
padding: 0,
},
y: {
padding: 0,
tickSize: 0,
domain: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
},

facet: {
data: dataGrouped,
y: d => d3.timeFormat("%Y")(d.dia)
},
color: {
range:["#eaeaea", "green"]
},

marks: [
Plot.cell(dataGroupedFull, {
filter: d=> dataGrouped.find(e=> e.dia.getTime() == d.dia.getTime()),
x: d => d3.timeFormat("%H")(d.dia),
y: d => d3.timeFormat("%a")(d.dia),
fill: "cant",
title: d=>"Visitas: "+d.cant ,
inset: 0.5
})
],
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
dataGrouped = d3.groups(search.filter(e=>+d3.timeFormat("%Y")(e.dia)<2022 && +d3.timeFormat("%Y")(e.dia)>2019), d=>d.dia).map(e=>{
return {dia : e[0],
cant: e[1].length}
})
Insert cell
dataGroupedFull = d3.groups(data.filter(e=>+d3.timeFormat("%Y")(e.dia)<2022 && +d3.timeFormat("%Y")(e.dia)>2019), d=>d.dia).map(e=>{
return {dia : e[0],
cant: e[1].length,
hora: e[1][0].hora,

visitas: e[1]
}
})
Insert cell
import {rangeSlider} from '@easz/range-slider'
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