Public
Edited
Apr 24
1 star
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
analysisResults = {
const clicks = analyzeButton;
if (clicks === 0) {
console.log("Analysis cell initialized, waiting for button click.");
return undefined;
}
if (!dataForAnalysis || !geminiAPIKey || !LLM) {
return { error: "Missing data, API key, or model name." };
}
console.log(
`Button clicked (${clicks} times). Calling generateDataInsights...`
);
return generateDataInsights(dataForAnalysis, geminiAPIKey, LLM);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
visualizationCodeResult = {
const clicks = generateVisButton;
if (clicks === 0) {
console.log("Visualization code generation waiting for button click.");
return undefined;
}
if (!findingSelector || !dataForAnalysis || !geminiAPIKey || !LLM) {
console.error(
"Generate Vis button clicked, but required inputs (insight, data, key, LLM) are missing or invalid."
);
return {
error:
"Cannot generate code: Missing selected insight, valid data, or API key.",
timestamp: Date.now()
};
}
console.log(
`Generate Vis button clicked (${clicks} times) for insight ID: ${findingSelector.id}. Calling generateVisualizationCode...`
);
return generateVisualizationCode(
dataForAnalysis,
findingSelector,
geminiAPIKey,
LLM
);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
style = html`
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geist:ital@0;1&display=swap">

<style>
body, svg {
font-family: Geist, sans-serif;
}
</style>
`
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