Public
Edited
Mar 29, 2023
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
function addStep(iframesrc, type, text) {
const step = document.createElement("div");

const iframe = document.createElement("iframe");
iframe.src = iframesrc;
iframe.style.border = "0px solid transparent";

step.append(iframe);

switch (type) {
case "title":
iframe.width = w;
iframe.style.width = w + "px";
iframe.height = w / 3;
iframe.style.height = w / 3 + "px";
step.style.width = w + "px";
step.style.height = w / 3 + "px";
break;

case "normal":
iframe.width = w;
iframe.style.width = w + "px";
iframe.height = w;
iframe.style.height = w + "px";
step.style.width = w + "px";
step.style.height = w + "px";
break;
}

return step;
}
Insert cell
Insert cell
Insert cell
w = {
var w;

//if vertical screen
//console.log(window.innerWidth, window.innerHeight);
if (window.innerWidth < window.innerHeight) {
console.log("vertical screen");
w = window.innerWidth;
} else {
console.log("horizontal screen");
w = window.innerWidth < 600 ? window.innerWidth : 600;
}

console.log(w);

return w;
}
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