Public
Edited
Nov 30, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
tsPeso
Insert cell
Insert cell
statsCardChart = StatisticalCard(SelectedTime,{config:configImpact, colorScale: brushesFirstScale})
Insert cell
comparisonChart = comparisionCard(SelectedTime, { config: configImpact, colorScale: brushesFirstScale})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
nonSelectedAlpha = 0.2
Insert cell
selectedAlpha = 0.2
Insert cell
groupsScale = d3.scaleOrdinal(["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"])
Insert cell
Swatches(brushesScale[0])
Insert cell
Swatches(brushesScale[1])
Insert cell
// brushesScale = d3.scaleOrdinal(["hsl(60, 100%, 50%)","hsl(240, 100%, 50%)","#f0027f","#bf5b17","#666666"])
brushesScale = [d3.scaleOrdinal(["#a1dab4","#41b6c4","#225ea8"]), d3.scaleOrdinal(["#fbb4b9","#f768a1","#ae017e"])]//d3.scaleOrdinal(d3.schemeCategory10)
Insert cell
brushesFirstScale = d3.scaleOrdinal(["#a1dab4","#fbb4b9"])
Insert cell
brushesLastScale = d3.scaleOrdinal(["#225ea8","#ae017e"])
Insert cell
curvaspc = FileAttachment("curvasPC@2.json").json()
Insert cell
curvaspeso = FileAttachment("curvasPeso@2.json").json()
Insert cell
curvastalla = FileAttachment("curvasTalla@2.json").json()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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 }))
//data = FileAttachment("curatedData@1.csv").csv({typed: true});
//data = FileAttachment("dataFiltered.csv").csv({typed: true});
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
selectedStages = {
let rawData = transformData(G1, "Code", stages, "__group");
//rawData = rawData.filter(d => d["__time"] > 24 && d["__time"] < 100 )
rawData = rawData.filter(d => d["peso"] < 20000 && d["peso"] >500 && d["talla"] < 120 && d["PC"] < 60) ;
return rawData
}
Insert cell
SelectedTime = {
let aux = new Map();
tsPC.forEach((g, gId) => {
let selectedSet = new Set(g.selection.map(d=> d[0]));
let gData = dataF.filter((d) => selectedSet.has(d["Code"]) && d["V389"] < 20000);
aux.set(gId, gData);
});

return aux;
}
Insert cell
dataF = data.slice(0,maxTimelines).filter(d => d["ERN_Ballard"] < 50 && d["ERN_Ballard"] > 20)
Insert cell
import {Treemap} from "@d3/treemap"
Insert cell
import {searchCheckbox} from "@ivelascog/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 "@ivelascog/faceted-search"
Insert cell
import {interval} from "@ivelascog/range-event"
Insert cell
import {ViolinPlot, FacetViolinPlot} from "@ivelascog/violin-plot-wip"
Insert cell
TimeSearcher = {
try {
return await require(`http://localhost:8080/dist/TimeSearcher.js?${Date.now()}`)
} catch (e) {
return await require(await FileAttachment("TimeSearcher@14.js").url())
}
}
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more