|
| 1 | +window.lcjsSmallView = window.devicePixelRatio >= 2 |
| 2 | +if (!window.__lcjsDebugOverlay) { |
| 3 | + window.__lcjsDebugOverlay = document.createElement('div') |
| 4 | + window.__lcjsDebugOverlay.style.cssText = 'position:fixed;top:10px;left:10px;background:rgba(0,0,0,0.7);color:#fff;padding:4px 8px;z-index:99999;font:12px monospace;pointer-events:none' |
| 5 | + const attach = () => { if (document.body && !window.__lcjsDebugOverlay.parentNode) document.body.appendChild(window.__lcjsDebugOverlay) } |
| 6 | + attach() |
| 7 | + setInterval(() => { |
| 8 | + attach() |
| 9 | + window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + window.lcjsSmallView |
| 10 | + }, 500) |
| 11 | +} |
1 | 12 | const lcjs = require('@lightningchart/lcjs') |
2 | 13 | const xydata = require('@lightningchart/xydata') |
3 | 14 |
|
@@ -35,19 +46,9 @@ const dashboard = lightningChart({ |
35 | 46 | .Dashboard({ |
36 | 47 | theme: (() => { |
37 | 48 | const t = Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined |
38 | | - const smallView = window.devicePixelRatio >= 2 |
39 | | - if (!window.__lcjsDebugOverlay) { |
40 | | - window.__lcjsDebugOverlay = document.createElement('div') |
41 | | - 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' |
42 | | - if (document.body) document.body.appendChild(window.__lcjsDebugOverlay) |
43 | | - setInterval(() => { |
44 | | - if (!window.__lcjsDebugOverlay.parentNode && document.body) document.body.appendChild(window.__lcjsDebugOverlay) |
45 | | - window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (window.devicePixelRatio >= 2) |
46 | | - }, 500) |
47 | | - } |
48 | | - return t && smallView ? lcjs.scaleTheme(t, 0.5) : t |
| 49 | + return t && window.lcjsSmallView ? lcjs.scaleTheme(t, 0.5) : t |
49 | 50 | })(), |
50 | | -textRenderer: window.devicePixelRatio >= 2 ? lcjs.htmlTextRenderer : undefined, |
| 51 | +textRenderer: window.lcjsSmallView ? lcjs.htmlTextRenderer : undefined, |
51 | 52 | numberOfColumns: 1, |
52 | 53 | numberOfRows: 2, |
53 | 54 | }) |
|
0 commit comments