20261118 Sharts Colors

This commit is contained in:
Manuel Aurrecoechea Castillo
2026-11-18 15:43:23 -06:00
parent 58ff3870be
commit 97fcb37761
10 changed files with 54 additions and 34 deletions
+4 -3
View File
@@ -2,6 +2,7 @@ import { AfterViewInit, Component, inject, ElementRef, Input, OnChanges, OnDestr
import { MatButtonModule } from '@angular/material/button';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { PlotlyFigure } from '../../features/indicadores/indicadores.models';
import { recolorFigure } from '../../features/indicadores/indicadores-c2-palette';
import { PlotlyController } from './plotly-controller';
import { PLOTLY_LOADER } from './plotly-runtime';
@@ -68,12 +69,12 @@ export class PlotlyChart implements AfterViewInit, OnChanges, OnDestroy {
this.observer = new ResizeObserver(this.windowResize);
this.observer.observe(this.host.nativeElement);
} else window.addEventListener('resize', this.windowResize);
this.controller.setFigure(this.figure);
this.controller.setFigure(recolorFigure(this.figure));
// Also supply the initial width in browsers without ResizeObserver.
this.windowResize();
}
ngOnChanges() { if (this.figure) this.controller?.setFigure(this.figure); }
retry() { this.controller?.setFigure(this.figure); }
ngOnChanges() { if (this.figure) this.controller?.setFigure(recolorFigure(this.figure)); }
retry() { this.controller?.setFigure(recolorFigure(this.figure)); }
ngOnDestroy() {
this.observer?.disconnect();
if (this.widthFrame !== undefined) cancelAnimationFrame(this.widthFrame);