File: sg_plotly_resize.js

package info (click to toggle)
scikit-learn 1.7.2%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,752 kB
  • sloc: python: 219,120; cpp: 5,790; ansic: 846; makefile: 191; javascript: 110
file content (10 lines) | stat: -rw-r--r-- 455 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
// Related to https://github.com/scikit-learn/scikit-learn/issues/30279
// There an interaction between plotly and bootstrap/pydata-sphinx-theme
// that causes plotly figures to not detect the right-hand sidebar width

// Plotly figures are responsive, this triggers a resize event once the DOM has
// finished loading so that they resize themselves.

document.addEventListener("DOMContentLoaded", () => {
  window.dispatchEvent(new Event("resize"));
});