Add pdfmake dependency
This commit is contained in:
parent
e731882a5d
commit
da51cd5621
707
package-lock.json
generated
707
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -32,6 +32,7 @@
|
||||
"flatpickr": "^4.6.3",
|
||||
"lodash": "^4.17.15",
|
||||
"ng2-charts": "^2.3.2",
|
||||
"pdfmake": "^0.1.70",
|
||||
"quick-score": "0.0.8",
|
||||
"rxjs": "~6.5.5",
|
||||
"str-compare": "^0.1.2",
|
||||
|
@ -61,9 +61,15 @@
|
||||
</rb-form-radio>
|
||||
</div>
|
||||
|
||||
<!-- CSV export -->
|
||||
<rb-icon-button icon="forward-right" mode="primary" (click)="exportCSV()" *ngIf="spectrumNames.length">
|
||||
Export to CSV
|
||||
</rb-icon-button>
|
||||
|
||||
<!-- PDF exprot -->
|
||||
<rb-icon-button icon="forward-right" mode="primary" (click)="exportPDF()" *ngIf="spectrumNames.length">
|
||||
Export to PDF
|
||||
</rb-icon-button>
|
||||
</div>
|
||||
|
||||
<div class="dpt-chart space-below">
|
||||
|
@ -6,7 +6,11 @@ import cloneDeep from 'lodash/cloneDeep';
|
||||
import omit from 'lodash/omit';
|
||||
import { DataService } from '../services/data.service';
|
||||
import { ModelItemModel } from '../models/model-item.model';
|
||||
import * as FileSaver from 'file-saver'
|
||||
import * as FileSaver from 'file-saver';
|
||||
import * as pdfMake from "pdfmake/build/pdfmake";
|
||||
import * as pdfFonts from 'pdfmake/build/vfs_fonts';
|
||||
|
||||
(<any>pdfMake).vfs = pdfFonts.pdfMake.vfs;
|
||||
|
||||
|
||||
@Component({
|
||||
@ -128,4 +132,8 @@ export class PredictionComponent implements OnInit {
|
||||
const csv = predictions.map(line => line.join(";")).join("\n");
|
||||
FileSaver.saveAs(new Blob([csv], { type: 'text/csv;charset=utf-8' }), "predictions.csv");
|
||||
}
|
||||
|
||||
exportPDF() {
|
||||
// TODO: Generate PDF export
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user