MCPcopy Create free account
hub / github.com/chartjs/Chart.js / onWindowResize

Function onWindowResize

src/platform/platform.dom.js:164–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

162let oldDevicePixelRatio = 0;
163
164function onWindowResize() {
165 const dpr = window.devicePixelRatio;
166 if (dpr === oldDevicePixelRatio) {
167 return;
168 }
169 oldDevicePixelRatio = dpr;
170 drpListeningCharts.forEach((resize, chart) => {
171 if (chart.currentDevicePixelRatio !== dpr) {
172 resize();
173 }
174 });
175}
176
177function listenDevicePixelRatioChanges(chart, resize) {
178 if (!drpListeningCharts.size) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected