Public
Edited
May 8
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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
classificationRaw = classificationInput
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
mutable targetVariable = null;

Insert cell
mutable selectedVariables = new Set();
Insert cell
rawDataGrups = {
let set1 = new Set(G1.map((d) => d.Idenfinal));
let set2 = new Set(G2.map((d) => d.Idenfinal));
let aux = [];
rawData.forEach((d) => {
let id = d.Idenfinal;
if (set1.has(id)) {
d.__group = nameG1;
aux.push(d);
} else if (set2.has(id)) {
d.__group = nameG2;
aux.push(d);
}
});
return aux;
}
Insert cell
rawData = fetch("http://127.0.0.1:8000/getData") // URL de ejemplo
.then((response) => {
if (!response.ok) {
throw new Error(`Error HTTP: ${response.status}`);
}
return response.text(); // Convertir la respuesta a JSON
})
.then((data) => {
data = d3.csvParse(data, d3.autoType);
console.log("Datos recibidos:", data); // Imprimir los datos en consola
return data;
})
Insert cell
classification = {
let parser = d3.timeParse("%Y-%m-%d");
let data = [];
let precision = [];
let samples = [];
classificationRaw.forEach((d) => {
let fecha = parser(d.Fecha_ini);
data.push(
Object.entries(d.importancia_atributo).map((d) => {
return { value: d[1], var: d[0], fecha: fecha };
})
);
precision.push({ value: d.recall, var: "Precision", fecha: fecha });
samples.push({ value: d["Total muestras"], var: "NSamples", fecha: fecha });
});

return { data: data.flat(), precision: precision, samples: samples };
}
Insert cell
stageData = transformData(rawDataGrups, "Idenfinal", test, "__group")
Insert cell
keys = {
let keys = new Set();
stageData.forEach((d) => {
Object.keys(d).forEach((k) => keys.add(k));
});
return Array.from(keys);
}
Insert cell
Object.keys(stageData[0])
Insert cell
PosibleVariables = keys.slice(5)
Insert cell
xTicksLabels = test
.map((d) => [d.time, d.label])
.filter((d) => d[1])
.concat(ticks.map((d) => [d, null]))
Insert cell
Insert cell
import { FacetedSearch } from "@john-guerra/faceted-search"
Insert cell
import { searchCheckbox } from "@john-guerra/search-checkbox"
Insert cell
import { comparisionCard } from "@ivelascog/comparison-cards"
Insert cell
import { StatisticalCard, config } from "@ivelascog/statistical-card"
Insert cell
import { transformData, stages } from "@ivelascog/to-stages"
Insert cell
import { interval } from "@mootari/range-slider"
Insert cell
import { Swatches } from "@d3/color-legend"
Insert cell
import { button } from "@jeremiak/download-data-button"
Insert cell
import { download } from "@mbostock/lazy-download"
Insert cell
TimeSearcher = {
try {
return await require(`http://localhost:8080/dist/TimeWidget.js?${Date.now()}`);
} catch (e) {
try {
return await require(await FileAttachment("TimeWidget@2.js").url());
} catch (e) {
return await require("time-searcher-plus@0.0.24");
}
}
}
Insert cell
import { listInput } from "@harrislapiroff/list-input"
Insert cell
test = fetch("http://127.0.0.1:8000/getConfig") // URL de ejemplo
.then((response) => {
if (!response.ok) {
throw new Error(`Error HTTP: ${response.status}`);
}
return response.json(); // Convertir la respuesta a JSON
})
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