Public
Edited
Feb 16
Insert cell
Insert cell
Insert cell
(async function() {
// Wait for 100ms to ensure the DOM elements are fully loaded
await new Promise(resolve => setTimeout(resolve, 100));

// Find the Tableau container by its ID
var divElement = document.getElementById("viz1739715555490");

// Check if the container exists
if (divElement) {
var vizElement = divElement.getElementsByTagName("object")[0];

// Ensure the <object> element is found
if (vizElement) {
// Adjust the dimensions based on the width of the container
if (divElement.offsetWidth > 800) {
vizElement.style.width = "1000px";
vizElement.style.height = "827px";
} else if (divElement.offsetWidth > 500) {
vizElement.style.width = "1000px";
vizElement.style.height = "827px";
} else {
vizElement.style.width = "100%";
vizElement.style.height = "727px";
}

// Dynamically load the Tableau JavaScript API
var scriptElement = document.createElement("script");
scriptElement.src = "https://public.tableau.com/javascripts/api/viz_v1.js";
document.body.appendChild(scriptElement);
} else {
console.error("Error: Tableau <object> element not found.");
}
} else {
console.error("Error: Tableau container #viz1739715555490 not found.");
}
})();

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