Skip to content

Commit cd931dd

Browse files
author
Niilo Keinänen
committed
Update examples
1 parent c5d6a38 commit cd931dd

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
@@ -32,18 +32,19 @@ const chart = lightningChart({
3232
.Chart3D({
3333
theme: (() => {
3434
const t = Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined
35-
const smallView = Math.min(window.innerWidth, window.innerHeight) < 500
35+
const smallView = window.devicePixelRatio >= 2
3636
if (!window.__lcjsDebugOverlay) {
3737
window.__lcjsDebugOverlay = document.createElement('div')
3838
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'
3939
if (document.body) document.body.appendChild(window.__lcjsDebugOverlay)
4040
setInterval(() => {
4141
if (!window.__lcjsDebugOverlay.parentNode && document.body) document.body.appendChild(window.__lcjsDebugOverlay)
42-
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (Math.min(window.innerWidth, window.innerHeight) < 500)
42+
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (window.devicePixelRatio >= 2)
4343
}, 500)
4444
}
4545
return t && smallView ? lcjs.scaleTheme(t, 0.5) : t
4646
})(),
47+
textRenderer: window.devicePixelRatio >= 2 ? lcjs.htmlTextRenderer : undefined,
4748
})
4849
.setTitle('Generating example data ...')
4950

0 commit comments

Comments
 (0)