This repository is for the codebase of a lightweight Angular v7 web component that allows the users to download data in CSV, JSON and BibTeX formats.
The component is used on the PDBe-KB Aggregated Views of Proteins to provide download at various sections of these pages.
Get the code and install dependencies
git clone https://github.com/PDBe-KB/component-csv-exporter.git
cd component-csv-exporter
npm i
Running the app
ng serve
Running tests
ng test
The main template (i.e. index.html by default) should also have the following CSS imports:
<link rel="stylesheet" href="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/css/ebi-global.css" type="text/css" media="all"/>
<link rel="stylesheet" href="https://ebi.emblstatic.net/web_guidelines/EBI-Icon-fonts/v1.3/fonts.css" type="text/css" media="all"/>
<link rel="stylesheet" href="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/css/theme-pdbe-green.css" type="text/css" media="all"/>
The component can be added to any Angular v7 apps.
Import the component in app.module.ts by default.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { CsvExporterComponent } from './csv-exporter/csv-exporter.component';
@NgModule({
declarations: [
AppComponent,
CsvExporterComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
<app-csv-exporter [data]="data" [accession]="accession" [section]="section" category="publication"></app-csv-exporter>
The data model depends on the type of information to be exported.
[
['PubMed ID', 'Title', 'Related PDB entries'],
['PMID 123', 'FOO BAR', '1foo;2bar']
]
{
'publications': [
{
'pubmed_id': 'PMID',
'title': 'TITLE'
}
]
}
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Mihaly Varadi - Initial Implementation - mvaradi
See also the list of contributors who participated in this project.
This project is licensed under the EMBL-EBI License - see the LICENSE file for details
We would like to thank the PDBe team and the PDBe-KB partner resources for their feedback and contributions.
