Skip to content

Commit 0e5b989

Browse files
committed
Heatmap: More debug statements
1 parent 6850e93 commit 0e5b989

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/app/pages/circular-heatmap/circular-heatmap.component.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ export class CircularHeatmapComponent implements OnInit, OnDestroy {
7878
ngOnInit(): void {
7979
const savedTheme: string = this.themeService.getTheme() || 'light';
8080
this.themeService.setTheme(savedTheme); // sets .light-theme or .dark-theme
81+
console.log(`${perfNow()}s: ngOnInit: pre request animation frame: (stylesheets: ${document.styleSheets.length}) Initial theme:`, this.theme);
8182
requestAnimationFrame(() => {
8283
// Now the DOM has the correct class and CSS vars are live
83-
console.log(`${perfNow()}s: ngOnInit: Initial theme:`, this.theme);
84+
console.log(`${perfNow()}s: ngOnInit: (stylesheets: ${document.styleSheets.length}) Initial theme:`, this.theme);
8485
const css = getComputedStyle(document.body);
8586
this.theme_colors = {
8687
background: css.getPropertyValue('--heatmap-background').trim(),
@@ -143,7 +144,7 @@ export class CircularHeatmapComponent implements OnInit, OnDestroy {
143144
// Reactively handle theme changes (if user toggles later)
144145
this.themeService.theme$.pipe(takeUntil(this.destroy$)).subscribe((theme: string) => {
145146
console.log(`${perfNow()}s: themeService.pipe: Theme changed to:`, theme);
146-
console.log(`${perfNow()}s: themeService.pipe: bk.gr col: '${getComputedStyle(document.body).getPropertyValue('--heatmap-background').trim()}'`);
147+
console.log(`${perfNow()}s: themeService.pipe: (stylesheets: ${document.styleSheets.length}) bk.gr col: '${getComputedStyle(document.body).getPropertyValue('--heatmap-background').trim()}'`);
147148
// Wait for next animation frame to ensure CSS variables are updated
148149
requestAnimationFrame(() => {
149150
const css = getComputedStyle(document.body);
@@ -154,14 +155,14 @@ export class CircularHeatmapComponent implements OnInit, OnDestroy {
154155
cursor: css.getPropertyValue('--heatmap-cursor-hover').trim(),
155156
stroke: css.getPropertyValue('--heatmap-stroke').trim(),
156157
};
157-
console.debug(`${perfNow()}s: themeService.pipe: Heatmap theme colors:`, this.theme_colors);
158+
console.debug(`${perfNow()}s: themeService.pipe: (stylesheets: ${document.styleSheets.length}) Heatmap theme colors:`, this.theme_colors);
158159
if (!this.theme_colors['background'] || !this.theme_colors['filled']) {
159160
console.debug(css);
160161
console.debug(`${perfNow()}s: ------------------ Black day --------------`);
161162
var DBG_i: number = 0;
162163
var interval = setInterval(() => {
163164
DBG_i++;
164-
console.debug(`${perfNow()}s: #${DBG_i} themeService.pipe: bk.gr col: '${getComputedStyle(document.body).getPropertyValue('--heatmap-background').trim()}'`);
165+
console.debug(`${perfNow()}s: #${DBG_i} (stylesheets: ${document.styleSheets.length}) themeService.pipe: bk.gr col: '${getComputedStyle(document.body).getPropertyValue('--heatmap-background').trim()}'`);
165166
if (DBG_i >= 100) {
166167
clearInterval(interval);
167168
}

0 commit comments

Comments
 (0)