Quitar la barra de Plotly en las curvas de la ficha

This commit is contained in:
2026-12-03 00:24:50 -06:00
parent b43c89befd
commit 24415b79b6
3 changed files with 9 additions and 4 deletions
+2 -2
View File
@@ -298,7 +298,7 @@
@if (riskSeries.value()?.length) {
<app-risk-series [series]="riskSeries.value()!" />
} @else {
<app-plot [figure]="curve()" [height]="300" />
<app-plot [figure]="curve()" [height]="300" [toolbar]="false" />
}
</details>
}
@@ -615,7 +615,7 @@
Kaplan-Meier de pacientes con sus mismos valores (IC 95 % Greenwood log-log; n =
{{ c.n }}, fallecidos = {{ c.fallecidos }}).
</p>
<app-plot [figure]="c.figure" [height]="340" />
<app-plot [figure]="c.figure" [height]="340" [toolbar]="false" />
} @else {
<p class="muted">{{ c.missing }}</p>
}
+1 -1
View File
@@ -78,7 +78,7 @@ export function parseSeries(answer: Parameters): Series[] {
@for (assumption of assumptions(); track assumption) {
<p class="muted">{{ assumption }}</p>
}
<app-plot [figure]="figure()" [height]="340" />
<app-plot [figure]="figure()" [height]="340" [toolbar]="false" />
}
@if (!available().length) {
<p class="muted">No disponible: datos insuficientes.</p>
+6 -1
View File
@@ -75,12 +75,17 @@ const CONFIG: Partial<Plotly.Config> = {
export class Plot implements OnDestroy {
readonly figure = input.required<Figure>();
readonly height = input(320);
/** Plotly's buttons over the chart; a record's curves go without them */
readonly toolbar = input(true);
private readonly host = viewChild.required<ElementRef<HTMLDivElement>>('host');
constructor() {
effect(() => {
const { data, layout } = this.figure();
void Plotly.react(this.host().nativeElement, withRoom(data), layoutOf(layout), CONFIG);
void Plotly.react(this.host().nativeElement, withRoom(data), layoutOf(layout), {
...CONFIG,
...(this.toolbar() ? {} : { displayModeBar: false }),
});
});
}