Quitar la barra de Plotly en las curvas de la ficha
This commit is contained in:
@@ -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>
|
||||
}
|
||||
|
||||
@@ -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
@@ -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 }),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user