Skip to content

Commit 822e706

Browse files
author
Niilo Keinänen
committed
Update examples
1 parent f8b3a63 commit 822e706

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,19 @@ const dashboard = lightningChart({
3535
.Dashboard({
3636
theme: (() => {
3737
const t = Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined
38-
const smallView = Math.min(window.innerWidth, window.innerHeight) < 500
38+
const smallView = window.devicePixelRatio >= 2
3939
if (!window.__lcjsDebugOverlay) {
4040
window.__lcjsDebugOverlay = document.createElement('div')
4141
window.__lcjsDebugOverlay.style.cssText = 'position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);color:#fff;padding:4px 8px;z-index:99999;font:12px monospace;pointer-events:none'
4242
if (document.body) document.body.appendChild(window.__lcjsDebugOverlay)
4343
setInterval(() => {
4444
if (!window.__lcjsDebugOverlay.parentNode && document.body) document.body.appendChild(window.__lcjsDebugOverlay)
45-
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (Math.min(window.innerWidth, window.innerHeight) < 500)
45+
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (window.devicePixelRatio >= 2)
4646
}, 500)
4747
}
4848
return t && smallView ? lcjs.scaleTheme(t, 0.5) : t
4949
})(),
50+
textRenderer: window.devicePixelRatio >= 2 ? lcjs.htmlTextRenderer : undefined,
5051
numberOfColumns: 1,
5152
numberOfRows: 2,
5253
})

0 commit comments

Comments
 (0)