WebApp shared: Plotly partial bundle, card actions, print report, export module
Plotly partial bundle (bar, scatter, box, pie, sankey, contour) replacing the cartesian dist; card-actions (published Measure definitions, settings, Volver); Descargar reporte with a print stylesheet; export module: xlsx with frozen header, autofilter, Parámetros sheet and 5,000-row cap, pdfmake documents with header/footer, allRows following next links, file names without patient identifiers; lazy-loaded export libraries. Checks on milkpc (node:22): npm ci, ng build (initial 567 kB / 134 kB transfer), ng test 7 files passed.
This commit is contained in:
+5
-5
@@ -1,6 +1,6 @@
|
||||
import { Component, effect, ElementRef, input, OnDestroy, viewChild } from '@angular/core';
|
||||
// The cartesian bundle: bars, lines, box and pie, as today's charts use.
|
||||
import Plotly from 'plotly.js-cartesian-dist-min';
|
||||
import type * as Plotly from 'plotly.js';
|
||||
import plotly from './plotly-bundle';
|
||||
|
||||
export type Figure = { data: Partial<Plotly.Data>[]; layout?: Partial<Plotly.Layout> };
|
||||
|
||||
@@ -26,7 +26,7 @@ const LAYOUT: Partial<Plotly.Layout> = {
|
||||
const CONFIG: Partial<Plotly.Config> = {
|
||||
responsive: true,
|
||||
displaylogo: false,
|
||||
modeBarButtonsToRemove: ['sendDataToCloud', 'lasso2d', 'select2d'],
|
||||
modeBarButtonsToRemove: ['lasso2d', 'select2d'],
|
||||
};
|
||||
|
||||
/** One Plotly chart: the figure, drawn with the platform's layout and config. */
|
||||
@@ -43,7 +43,7 @@ export class Plot implements OnDestroy {
|
||||
constructor() {
|
||||
effect(() => {
|
||||
const { data, layout } = this.figure();
|
||||
void Plotly.react(
|
||||
void plotly.react(
|
||||
this.host().nativeElement,
|
||||
data as Plotly.Data[],
|
||||
{ ...LAYOUT, ...layout },
|
||||
@@ -53,6 +53,6 @@ export class Plot implements OnDestroy {
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
Plotly.purge(this.host().nativeElement);
|
||||
plotly.purge(this.host().nativeElement);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user