auto-run all sections on page load
Browse files- experiments/demo_server.py +35 -0
experiments/demo_server.py
CHANGED
|
@@ -578,6 +578,41 @@ function drawCell(d){const c=$("cellcv"),x=c.getContext("2d");
|
|
| 578 |
x.fillText(`phi ${phi.toFixed(3)}`,j*cw+14,i*ch+ch-18)}
|
| 579 |
$("cvcap").textContent="the 3x3 neighborhood of the key's address; darker = stronger write/read weight (the bump kernel)."}
|
| 580 |
window.addEventListener("resize",()=>{});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 581 |
</script></body></html>"""
|
| 582 |
|
| 583 |
|
|
|
|
| 578 |
x.fillText(`phi ${phi.toFixed(3)}`,j*cw+14,i*ch+ch-18)}
|
| 579 |
$("cvcap").textContent="the 3x3 neighborhood of the key's address; darker = stronger write/read weight (the bump kernel)."}
|
| 580 |
window.addEventListener("resize",()=>{});
|
| 581 |
+
|
| 582 |
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 583 |
+
// AUTO-RUN: trigger all four sections on page load so visitors see
|
| 584 |
+
// results immediately without clicking anything
|
| 585 |
+
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 586 |
+
window.addEventListener("load", () => {
|
| 587 |
+
setTimeout(() => {
|
| 588 |
+
// Section 01: custom facts (pre-filled example)
|
| 589 |
+
if ($("runc") && !$("runc").disabled) {
|
| 590 |
+
console.log("auto-run: section 01");
|
| 591 |
+
$("runc").click();
|
| 592 |
+
}
|
| 593 |
+
// Section 02: store at scale (default 128 pairs)
|
| 594 |
+
setTimeout(() => {
|
| 595 |
+
if ($("run") && !$("run").disabled) {
|
| 596 |
+
console.log("auto-run: section 02");
|
| 597 |
+
$("run").click();
|
| 598 |
+
}
|
| 599 |
+
}, 500);
|
| 600 |
+
// Section 03: cost curve
|
| 601 |
+
setTimeout(() => {
|
| 602 |
+
if ($("cost") && !$("cost").disabled) {
|
| 603 |
+
console.log("auto-run: section 03");
|
| 604 |
+
$("cost").click();
|
| 605 |
+
}
|
| 606 |
+
}, 1000);
|
| 607 |
+
// Section 04: cell view (pre-filled fact)
|
| 608 |
+
setTimeout(() => {
|
| 609 |
+
if ($("cv") && !$("cv").disabled) {
|
| 610 |
+
console.log("auto-run: section 04");
|
| 611 |
+
$("cv").click();
|
| 612 |
+
}
|
| 613 |
+
}, 1500);
|
| 614 |
+
}, 100); // small delay for page render
|
| 615 |
+
});
|
| 616 |
</script></body></html>"""
|
| 617 |
|
| 618 |
|