Skip to content
Snippets Groups Projects
Commit 88d684b0 authored by Julian Matschinske's avatar Julian Matschinske
Browse files

Add some more options

parent c8f5d916
No related branches found
No related tags found
No related merge requests found
...@@ -14,15 +14,9 @@ export class QueryTileComponent { ...@@ -14,15 +14,9 @@ export class QueryTileComponent {
querySearch(term: string, item: Wrapper) { querySearch(term: string, item: Wrapper) {
term = term.toLowerCase(); term = term.toLowerCase();
if (item.type === 'host') {
const data = item.data as Protein; const data = item.data as Protein;
return data.name.toLowerCase().indexOf(term) > -1 || data.proteinName.toLowerCase().indexOf(term) > -1 || return data.name.toLowerCase().indexOf(term) > -1 || data.proteinName.toLowerCase().indexOf(term) > -1 ||
item.type.toLowerCase().indexOf(term) > -1; item.type.toLowerCase().indexOf(term) > -1;
} else {
const data = item.data as ViralProtein;
return data.effectName.toLowerCase().indexOf(term) > -1 || data.virusName.toLowerCase().indexOf(term) > -1 ||
item.type.toLowerCase().indexOf(term) > -1;
}
} }
select(item) { select(item) {
......
...@@ -2,6 +2,7 @@ export interface IConfig { ...@@ -2,6 +2,7 @@ export interface IConfig {
legendUrl: string; legendUrl: string;
legendClass: string; legendClass: string;
taskName: string; taskName: string;
showLeftSidebar: boolean;
showOverview: boolean; showOverview: boolean;
showQuery: boolean; showQuery: boolean;
showFilter: boolean; showFilter: boolean;
...@@ -15,8 +16,9 @@ export interface IConfig { ...@@ -15,8 +16,9 @@ export interface IConfig {
export const defaultConfig: IConfig = { export const defaultConfig: IConfig = {
legendUrl: 'https://exbio.wzw.tum.de/covex/assets/leg1.png', legendUrl: 'https://exbio.wzw.tum.de/covex/assets/leg1.png',
taskName: 'Run Task X',
legendClass: 'legend', legendClass: 'legend',
taskName: 'Run Task X',
showLeftSidebar: true,
showOverview: true, showOverview: true,
showQuery: true, showQuery: true,
showFilter: true, showFilter: true,
......
...@@ -22,8 +22,6 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges { ...@@ -22,8 +22,6 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges {
public show = false; public show = false;
@Input() @Input()
public target: 'drug' | 'drug-target'; public target: 'drug' | 'drug-target';
@Input()
public dataset: Dataset;
@Output() @Output()
public showChange = new EventEmitter<boolean>(); public showChange = new EventEmitter<boolean>();
...@@ -110,8 +108,7 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges { ...@@ -110,8 +108,7 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges {
seeds: this.analysis.getSelection().map((item) => item.backendId), seeds: this.analysis.getSelection().map((item) => item.backendId),
}; };
parameters.strain_or_drugs = this.target === 'drug' ? 'drugs' : this.dataset.backendId; parameters.target_or_drugs = this.target === 'drug' ? 'drugs' : 'PPI';
parameters.bait_datasets = this.dataset.data;
if (this.algorithm === 'trustrank') { if (this.algorithm === 'trustrank') {
parameters.damping_factor = this.trustrankDampingFactor; parameters.damping_factor = this.trustrankDampingFactor;
......
...@@ -203,8 +203,8 @@ ...@@ -203,8 +203,8 @@
</div> </div>
</div> </div>
<div *ngIf="myConfig.showItemSelector" class="covex sidebar bar-right"> <div *ngIf="myConfig.showLeftSidebar" class="covex sidebar bar-right">
<div class="card bar-large"> <div *ngIf="myConfig.showItemSelector" class="card bar-large">
<header class="card-header"> <header class="card-header">
<p class="card-header-title"> <p class="card-header-title">
<span class="icon"> <span class="icon">
......
...@@ -38,7 +38,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -38,7 +38,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
private networkJSON = '{"nodes": [], "edges": []}'; private networkJSON = '{"nodes": [], "edges": []}';
public myConfig: IConfig = defaultConfig; public myConfig: IConfig = JSON.parse(JSON.stringify(defaultConfig));
@Input() @Input()
public onload: undefined | string; public onload: undefined | string;
...@@ -50,7 +50,6 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -50,7 +50,6 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
} }
const configObj = JSON.parse(config); const configObj = JSON.parse(config);
this.myConfig = JSON.parse(JSON.stringify(defaultConfig));
for (const key of Object.keys(configObj)) { for (const key of Object.keys(configObj)) {
this.myConfig[key] = configObj[key]; this.myConfig[key] = configObj[key];
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
export const environment = { export const environment = {
production: false, production: false,
backend: 'http://localhost:8000/', backend: 'https://exbio.wzw.tum.de/netex_dev/api/',
}; };
/* /*
......
...@@ -23,12 +23,18 @@ ...@@ -23,12 +23,18 @@
</head> </head>
<body> <body>
<button onclick="setNetwork('netexp1')">Set Network 1</button> <input type="checkbox" onclick=changeConfigStr('{"showOverview":'+this.checked+'}') checked /> Show overview<br>
<button onclick="setNetwork('netexp2')">Set Network 2</button> <input type="checkbox" onclick=changeConfigStr('{"showQuery":'+this.checked+'}') /> Show query<br>
<input type="checkbox" onclick=changeConfigStr('{"showFilter":'+this.checked+'}') /> Show filter<br>
<input type="checkbox" onclick=changeConfigStr('{"showLeftSidebar":'+this.checked+'}') checked /> Show sidebar<br>
<br>
<button onclick="changeConfig()">Hide sidebar</button> <button onclick="changeConfig()">Hide sidebar</button>
<button onclick="setNetwork('netexp1')">Add proteins</button>
<div style="border: 3px solid red"> <div style="border: 3px solid red">
<network-expander id="netexp1" config='{"legendClass": "my-legend-1"}' onload="init1()"></network-expander> <network-expander id="netexp1" config='{"legendClass": "my-legend-1", "showQuery": false, "showFilter": false}' onload="init1()" style="height: 100vh"></network-expander>
</div> </div>
<!-- <!--
...@@ -49,6 +55,12 @@ ...@@ -49,6 +55,12 @@
netexp.setAttribute('config', '{"showLeftSidebar": false}'); netexp.setAttribute('config', '{"showLeftSidebar": false}');
} }
function changeConfigStr(config) {
console.log(config);
const netexp = document.getElementById('netexp1');
netexp.setAttribute('config', config);
}
function setNetwork(nw) { function setNetwork(nw) {
const netexp = document.getElementById(nw); const netexp = document.getElementById(nw);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment