Skip to content

Commit

Permalink
Misc fixes:
Browse files Browse the repository at this point in the history
Donut chart fixes
Disease Ontology styling
viral stuff styling
  • Loading branch information
KeithKelleher committed Jul 16, 2020
1 parent 841c5d7 commit fdddc33
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 23 deletions.
1 change: 0 additions & 1 deletion server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export function app() {

// All regular routes use the Universal engine
server.get('*', (req, res) => {
console.log(req.url);
res.render(indexHtml, { req, providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }] });
});

Expand Down
1 change: 0 additions & 1 deletion src/app/api-page/api-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class ApiPageComponent implements OnInit{
const dialogRef = this.dialog.open(ApiHelpComponent);

dialogRef.afterClosed().subscribe(result => {
console.log(`Dialog result: ${result}`);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
[buttonText]="'Explore Associated Targets'">
</pharos-explore-list-button>
</div>
<div class="section">
<div class="section" fxFlex="35">
<div *ngIf="this.disease.uniprotDescription">
<mat-card-subtitle>
Uniprot Description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

.section{
padding: 0 2em 2em 2em;
max-width: 35%;
}

.mat-card-subtitle{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<mat-card>
<mat-card-content>
<mat-card-title>
Disease Ontology
Disease Hierarchy
</mat-card-title>
<div class="content">
<mat-card class="section">
<mat-card-subtitle>Parents</mat-card-subtitle>
<div *ngFor="let parent of this.disease.parents">
<div *ngFor="let parent of this.disease.parents" class="ancestorListItem">
<ncats-property-display [showLabel]="false"
[property]="{term:parent.name + ' (' + parent.targetCountsTotal + ')', internalLink:'/diseases/' + parent.name}">{{parent.targetCountsTotal}}</ncats-property-display>
<div FxFlex class="assoc-count">
Expand All @@ -23,7 +23,7 @@ <h3>{{assocCount.value}}</h3>
</mat-card>
<mat-card class="section">
<mat-card-subtitle>Children</mat-card-subtitle>
<div *ngFor="let child of this.disease.children">
<div *ngFor="let child of this.disease.children" class="ancestorListItem">
<ncats-property-display [showLabel]="false"
[property]="{term:child.name + ' (' + child.targetCountsTotal + ')', internalLink:'/diseases/' + child.name}">{{child.targetCountsTotal}}</ncats-property-display>
<div FxFlex class="assoc-count">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
}

.mat-card-subtitle{
padding-top: 2em;
font-size: 175%;
padding-top: 0.75em;
}

.mat-card{
Expand All @@ -33,3 +34,7 @@
.assoc-count:first-child{
padding-left: 0;
}

.ancestorListItem{
padding-left: 1em;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@
</div>
</div>
<div class="headerRow">
<mat-paginator
[pageSize]="10"
[length]="target.interactingViruses.length"
[hidePageSize]="true"
[showFirstLastButtons]=true
(page)="paginate($event)"
#viralpaginator></mat-paginator>
<div fxFlex="100" fxFlexAlign="end">
<mat-paginator
[pageSize]="10"
[length]="target.interactingViruses.length"
[hidePageSize]="true"
[showFirstLastButtons]=true
(page)="paginate($event)"
#viralpaginator>
</mat-paginator>
</div>
</div>
<div *ngFor="let virus of this.visibleList">
<pharos-virus-details [virus]="virus"></pharos-virus-details>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div fxLayout="row" fxLayoutAlign="space-around center">
<div fxFlex="50" fxFlex.lt-md="80" *ngIf=donutData>
<pharos-donut-chart [data]= donutData.values (clickSlice)="filterDonutChart($event)"></pharos-donut-chart>
<pharos-donut-chart [data]="donutData.values" (clickSlice)="filterDonutChart($event)"></pharos-donut-chart>
</div>
</div>
<div fxLayout="row" fxLayoutAlign="space-around start">
Expand All @@ -10,7 +10,7 @@
</div>
<div fxLayout="row" fxLayoutAlign="space-around start">
<div fxFlex="60" fxFlex.lt-md="80" *ngIf=donutData>
<pharos-visualization-options (fieldChange)="changeDonutChart($event)" [facets] = facets></pharos-visualization-options>
<pharos-visualization-options (fieldChange)="changeDonutChart($event)" [facets]="facets"></pharos-visualization-options>
</div>
</div>
<mat-divider class="space-divider"></mat-divider>
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {AfterViewInit, Component, Input, OnInit} from '@angular/core';
import {ChangeDetectorRef, Component, Input, OnInit} from '@angular/core';
import {PharosConfig} from '../../../../config/pharos-config';
import {SelectedFacetService} from '../filter-panel/selected-facet.service';
import {Facet} from '../../../models/facet';
import {DynamicPanelComponent} from '../../../tools/dynamic-panel/dynamic-panel.component';
import {takeUntil} from 'rxjs/operators';
import {PageData} from '../../../models/page-data';
import {PathResolverService} from '../filter-panel/path-resolver.service';
import {ActivatedRoute} from '@angular/router';

Expand Down Expand Up @@ -62,14 +61,14 @@ export class DataListVisualizationsComponent extends DynamicPanelComponent imple
*/
ngOnInit() {
this._data
// listen to data as long as term is undefined or null
// listen to data as long as term is undefined or null
.pipe(
takeUntil(this.ngUnsubscribe)
)
.subscribe(x => {
if (this.data && this.data.facets) {
let selection = this.data.facets[0];
if(!!this.selectedDonut) { // remember which facet was selected, if there was one
if (!!this.selectedDonut) { // remember which facet was selected, if there was one
selection = this.data.facets.find(x => {
return x.facet == this.selectedDonut
});
Expand All @@ -88,6 +87,7 @@ export class DataListVisualizationsComponent extends DynamicPanelComponent imple
changeDonutChart(field: string): void {
this.selectedDonut = field;
this.donutData = this.facets.filter(facet => facet.facet === field)[0];
this.donutData.values = this.donutData.values.filter(v => {return true;}); // trigger changes on bound property
}

/**
Expand All @@ -97,6 +97,7 @@ export class DataListVisualizationsComponent extends DynamicPanelComponent imple
filterDonutChart(data: any) {
this.selectedFacetService.setFacets({name: this.donutData.facet, change: {added: [data.name]}});
const queryParams = this.selectedFacetService.getFacetsAsUrlStrings();
this.pathResolverService.navigate(queryParams, this._route);
this.pathResolverService.navigate(queryParams, this._route, this.selectedFacetService.getPseudoFacets());
}

}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.mat-chip-list{
padding-bottom: .75vh;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {Facet} from '../../../../models/facet';
@Component({
selector: 'pharos-visualization-options',
templateUrl: './visualization-options.component.html',
styleUrls: ['./visualization-options.component.css']
styleUrls: ['./visualization-options.component.scss']
})
export class VisualizationOptionsComponent implements OnInit {

Expand Down

0 comments on commit fdddc33

Please sign in to comment.