Skip to content

Commit

Permalink
Manage vega/altair overflows
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonstyle committed Nov 15, 2023
1 parent 771b5dc commit 3bc0f84
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/resources/formats/dashboard/quarto-dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,21 @@ function ensureWidgetsFill() {
}
}

function manageOverflow() {
// Don't let vega cells scroll internally
const cellOutputs = document.querySelectorAll(".cell-output-display div");
for (const cellOutput of cellOutputs) {
if (cellOutput.id.startsWith("altair-viz-")) {
cellOutput.parentElement.classList.add("no-overflow-x");
}
}
}

window.document.addEventListener("DOMContentLoaded", function (_event) {
ensureWidgetsFill();

manageOverflow();

// Fixup any sharing links that require urls
// Append url to any sharing urls
const sharingLinks = window.document.querySelectorAll(
Expand Down

0 comments on commit 3bc0f84

Please sign in to comment.