Public
Edited
May 19, 2023
Insert cell
Insert cell
tituNombres = htl.html`<h2>Conoce cuántas personas tienen tu nombre</h4>`
Insert cell
Insert cell
Insert cell
Insert cell
rawData = FileAttachment("Nombres más comunes - Hoja 1 (3).csv").csv()
Insert cell
posicion = [...new Set(rawData.map(d => d.posicion))].sort((a,b) => d3.ascending(a, b))
Insert cell
edadmedia = [...new Set(rawData.map(d => d.edadmedia))].sort((a,b) => d3.ascending(a, b))
Insert cell
nombreb = [...new Set(rawData.filter(d => d.tipo === tipoNombre1).filter(d => d.letra === letra).map(d => d.nombre))].filter(d=> d !== "Total").sort((a,b) => d3.ascending(a, b))
Insert cell
frecuenciab = [...new Set(rawData.map(d => d.frecuencia))].sort((a,b) => d3.ascending(a, b))
Insert cell
letrab = [...new Set(rawData.map(d => d.letra))].sort((a,b) => d3.ascending(a, b))
Insert cell
Insert cell
Insert cell
nombreSelector = Inputs.bind( Inputs.select(nombreb), viewof nombre)
Insert cell
letraSelector = Inputs.bind( Inputs.select(letrab), viewof letra)
Insert cell
Insert cell
result = selectedData.length ? selectedData[0].frecuencia.toLocaleString('de-DE') : ""
Insert cell
result2 = selectedData.length ? selectedData[0].edadmedia.toLocaleString('es-ES') : ""
Insert cell
selectedData = rawData.filter(d => d.tipo === tipoNombre1).filter(d => d.nombre === nombre)
Insert cell
Insert cell
viewof letra = Inputs.input(null)
Insert cell
viewof nombre = Inputs.input(null)
Insert cell
viewof tipoNombre1 = Inputs.input(null)
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