Public
Edited
May 14, 2023
1 fork
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
tsPeso
Insert cell
Insert cell
Insert cell
comparisonChart = {
comparisionCard(SelectedTime, { config: configImpact, colorScale: brushesScale})
Insert cell
Insert cell
viewof attribsImpact = {
const allAttribs = Object.keys(data[0]).filter(a => !isNaN(data[0][a])); // only use quant attribs

return searchCheckbox(allAttribs, {
label: "Atributos",
height: 150,
value: this?.value /* keep previous value */ || [
"V389",
"CD12"
]
});
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
groupsScale = d3.scaleOrdinal(["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"])
Insert cell
brushesScale = d3.scaleOrdinal(["#fdc086","#386cb0","#f0027f","#bf5b17","#666666"])
Insert cell
{
G1; G2 // make it reactive on filter updates
return Swatches(groupsScale, {label: "Grupos"})
}
Insert cell
curvaspc = FileAttachment("curvasPC.json").json()
Insert cell
curvaspeso = FileAttachment("curvasPeso.json").json()
Insert cell
curvastalla = FileAttachment("curvasTalla.json").json()
Insert cell
{
G1; G2 // make it reactive on filter updates
return Swatches(brushesScale, {label: "Grupos"})
}
Insert cell
Insert cell
configImpact
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
maxTimelines = 2000;
Insert cell
dataFiltered = {
const tsPesoE = viewof tsPeso
const tsTallaE = viewof tsTalla;
const tsPCE = viewof tsPC
let dataFiltered = getData([tsPeso, tsTalla, tsPC]);
tsPesoE.ts.setExternalSelection(dataFiltered)
tsTallaE.ts.setExternalSelection(dataFiltered)
tsPCE.ts.setExternalSelection(dataFiltered)
return dataFiltered
}
Insert cell
Insert cell
Insert cell
data = FileAttachment("KMC-50k-Base 1993-2022 Jul -20220929.csv.zip")
.zip()
.then((res) => res.file("KMC-50k-Base 1993-2022 Jul -20220929.csv").csv({ typed: true }))
Insert cell
selectedStages = {
let rawData = transformData(G1G2, "Code", stages, "__group");
rawData = rawData.filter(d => d["__time"] > 24 && d["__time"] < 100 )
rawData.forEach((d) => {
if (d["peso"] > 20000 || d["peso"] < 100) {
d["peso"] = null;
}
if (d["talla"] > 80 || d["talla"] < 20) {
d["talla"] = null;
}

if (d["PC"] > 50 || d["PC"] < 10) {
d["PC"] = null;
}
});
return rawData
}
Insert cell
G1G2 = G1.concat(G2)
Insert cell
SelectedTime = {
let aux = new Map();
dataFiltered.forEach((selectedIds, id) => {
let gData = dataF.filter((d) => selectedIds.has(d["Code"]) && d["V389"] < 20000);
aux.set(id, gData);
});

return aux;
}
Insert cell
dataF = data.filter(d => d["ERN_Ballard"] < 50 && d["ERN_Ballard"] > 20)
Insert cell
updateG1 = G1.forEach(d => d["__group"] = nameG1)
Insert cell
updateG2 = G2.forEach(d => d["__group"] = nameG2)
Insert cell
import {Treemap} from "@d3/treemap"
Insert cell
import {searchCheckbox} from "@john-guerra/search-checkbox"
Insert cell
import {transformData,stages} from "@ivelascog/to-stages"
Insert cell
import {StatisticalCard, config} from "@ivelascog/statistical-card"
Insert cell
import {comparisionCard} from "@ivelascog/comparison-cards"
Insert cell
import { Swatches } from "@d3/color-legend"
Insert cell
import {FacetedSearch} from "@john-guerra/faceted-search"
Insert cell
import {ViolinPlot, FacetViolinPlot} from "@john-guerra/violin-plot"
Insert cell
TimeSearcher = {
try {
return await require(`http://localhost:8080/dist/TimeSearcher.js?${Date.now()}`)
} catch (e) {
return await require(await FileAttachment("TimeSearcher@1.js").url())
}
}
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