diff --git a/angular.json b/angular.json index e78cb81e4f0fc2a6ad8b129e9815be3e15b51066..1604dc15e0bdd5b254d834fe71cd8627c155656e 100644 --- a/angular.json +++ b/angular.json @@ -54,6 +54,33 @@ } ] }, + "uhh-production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.uhh.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "2mb", + "maximumError": "5mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "6kb", + "maximumError": "500kb" + } + ] + }, "remote": { "optimization": true, "outputHashing": "all", diff --git a/drugstone-test.html b/drugstone-test.html index 99701258fc4c0c824f9299d5956dc94344d8a0e3..89a6aef06efdaebc34f8a4495da8e382f17ac8a0 100644 --- a/drugstone-test.html +++ b/drugstone-test.html @@ -1,16 +1,16 @@ -<!doctype html> <html lang="en"> <head> <link rel="stylesheet" type="text/css" href="src/theme.css"> - <script src="https://cdn.jsdelivr.net/gh/AndiMajore/drugstone-releases@0.7.1-rc1/remote/drugsTone.js"></script> - <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/AndiMajore/drugstone-releases@0.7.1-rc1/remote/styles.css"> + <script src="https://cdn.jsdelivr.net/gh/AndiMajore/drugstone-releases@0.7.9-rc3/uhh/drugsTone.js"></script> +<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/AndiMajore/drugstone-releases@0.7.9-rc3/uhh/styles.css">--> + <link rel="stylesheet" type="text/css" href="./drugsTone-build/styles.css"> </head> <body> <div style="height: 700px; width: 1300px;"> <network-expander - id='drugstone-panel-1' - config='{"nodeGroups":{"0.5":{"type":"gene","color":"#CCFF33FF","groupName":"0.5","shape":"star"},"1.5":{"type":"gene","color":"#66FF33FF","groupName":"1.5","shape":"circle"},"2.0":{"type":"gene","color":"#33CC33FF","groupName":"2.0","shape":"circle"},"patientGroup":{"type":"gene","color":"#FF0000FF","groupName":"Patients","shape":"circle"}},"edgeGroups":{"normal":{"color":"black","groupName":"Custom Group"},"dashed":{"color":"#000857","groupName":"Dashed","dashes":[3,2]}},"identifier":"symbol","legendUrl":"https://exbio.wzw.tum.de/covex/assets/leg1.png"}' - network='{"nodes":[{"id":"TP53","group":"0.5","x":4,"y":6},{"id":"C5","group":"0.5","x":6,"y":4},{"id":"Patient","group":"patientGroup"},{"label":"PTEN","id":"PTEN","group":0.5}],"edges":[{"from":"TP53","to":"C5","group":"dashed"},{"from":"TP53","to":"PTEN","group":"dashed"},{"from":"Patient","to":"C5","group":"normal"},{"from":"Patient","to":"PTEN","group":"normal"}]}'> + id='example-drugst.one' + config='{"nodeGroups":{"patient":{"type":"patient","color":"#000000","font":{"color":"#f0f0f0"},"groupName":"Patient","shape":"image","image":"https://static.thenounproject.com/png/22780-200.png","shadow":true},"condition":{"type":"condition","color":"#000000","font":{"color":"#f0f0f0"},"groupName":"Condition","shape":"text","shadow":false},"important":{"type":"gene","color":"#ff881f","font":{"color":"#f0f0f0"},"groupName":"Important Gene","shape":"star","shadow":true},"gene":{"type":"gene","color":"#4da300","font":{"color":"#f0f0f0"},"groupName":"Gene","shape":"circle","shadow":true}},"edgeGroups":{"genotype":{"color":"white","groupName":"Relevant Gene","shadow":false},"has-condition":{"color":"white","groupName":"Has Condition","dashes":[2,2],"shadow":false},"ggi":{"color":"#ffffff","groupName":"Interaction","dashes":[3,2],"shadow":false}},"identifier":"symbol","title":"Breast cancer example network","nodeShadow":false,"edgeShadow":false,"showLegend":true}' + network='{"nodes":[{"id":"patient-1","group":"patient","x":592,"y":446},{"id":"patient-2","group":"patient","x":235,"y":87},{"id":"patient-3","group":"patient","x":105,"y":369},{"id":"ATM","label":"ATM","group":"gene","x":289,"y":242},{"id":"BARD1","label":"BARD1","group":"gene","x":44,"y":250},{"id":"BRCA1","label":"BRCA1","group":"gene","x":466,"y":576},{"id":"BRCA2","label":"BRCA2","group":"gene","x":507,"y":285},{"id":"BRIP1","label":"BRIP1","group":"gene","x":54,"y":474},{"id":"CHEK2","label":"CHEK2","group":"gene","x":216,"y":590},{"id":"CDH1","label":"CDH1","group":"gene","x":320,"y":-57},{"id":"NF1","label":"NF1","group":"gene","x":481,"y":111},{"id":"NBN","label":"NBN","group":"gene","x":-57,"y":314},{"id":"PALB2","label":"PALB2","group":"gene","x":450,"y":190},{"id":"PTEN","label":"PTEN","group":"important","x":305,"y":494},{"id":"RAD51C","label":"RAD51C","group":"gene","x":182,"y":-90},{"id":"RAD51D","label":"RAD51D","group":"gene","x":368,"y":73},{"id":"STK11","label":"STK11","group":"gene","x":686,"y":330},{"id":"TP53","label":"TP53","group":"important","x":333,"y":316},{"id":"subtype-1","label":"Subtype 1","group":"condition","x":556,"y":171},{"id":"subtype-2","label":"Subtype 2","group":"condition","x":-87,"y":221}],"edges":[{"from":"BRCA1","to":"BRCA2","group":"ggi"},{"from":"ATM","to":"BARD1","group":"ggi"},{"from":"BRCA1","to":"CHEK2","group":"ggi"},{"from":"RAD51C","to":"RAD51D","group":"ggi"},{"from":"STK11","to":"TP53","group":"ggi"},{"from":"TP53","to":"PALB2","group":"ggi"},{"from":"TP53","to":"RAD51D","group":"ggi"},{"from":"TP53","to":"NF1","group":"ggi"},{"from":"TP53","to":"BRCA1","group":"ggi"},{"from":"TP53","to":"BRCA2","group":"ggi"},{"from":"PTEN","to":"BRCA1","group":"ggi"},{"from":"PTEN","to":"BRCA2","group":"ggi"},{"from":"TP53","to":"PTEN","group":"ggi"},{"from":"ATM","to":"PTEN","group":"ggi"},{"from":"CDH1","to":"RAD51D","group":"ggi"},{"from":"CDH1","to":"PALB2","group":"ggi"},{"from":"NBN","to":"BRIP1","group":"ggi"},{"from":"BRIP1","to":"PTEN","group":"ggi"},{"from":"patient-1","to":"BRCA1","group":"genotype"},{"from":"patient-1","to":"TP53","group":"genotype"},{"from":"patient-1","to":"BRCA2","group":"genotype"},{"from":"patient-1","to":"PTEN","group":"genotype"},{"from":"patient-2","to":"TP53","group":"genotype"},{"from":"patient-2","to":"NF1","group":"genotype"},{"from":"patient-2","to":"BARD1","group":"genotype"},{"from":"patient-3","to":"TP53","group":"genotype"},{"from":"patient-3","to":"PTEN","group":"genotype"},{"from":"patient-3","to":"NBN","group":"genotype"},{"from":"patient-1","to":"subtype-1","group":"has-condition"},{"from":"patient-2","to":"subtype-1","group":"has-condition"},{"from":"patient-3","to":"subtype-2","group":"has-condition"}]}'> </network-expander> </div> </body> diff --git a/package.json b/package.json index cc5bd7b800686e1716c17e0ff87d83f9a6c1f0d2..f6091dfb7c6ef2c148b6d5125bf3a4710d869bea 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "lint": "ng lint && htmlhint", "e2e": "ng e2e", "build-prod": "ng build --configuration=production --output-hashing=none", + "build-uhh": "ng build --configuration=uhh-production --output-hashing=none", "build-dev": "ng build --configuration=development --output-hashing=none", "build-remote": "ng build --configuration=remote --output-hashing=none", "package-es5": "cd dist/netex && cat runtime-es5.js polyfills-es5.js main-es5.js > bundle-es5.js", @@ -18,7 +19,9 @@ "bundle": "npm run build-prod netex && npm run package-es5 && npm run package-es2015", "build:netex": "npm run build-prod netex && node build-netex.js", "build:netex-dev": "npm run build-dev netex && node build-netex.js", - "build:netex-remote": "npm run build-remote netex && node build-netex.js && npm run prefixcss", + "build:netex-uhh": "npm run build-uhh netex && node build-netex.js", + "build:netex-remote": "npm run build-remote netex && node build-netex.js", + "prefix": "bash prefix_styles.sh" , "prefixcss": "postcss -r drugsTone-build/styles.css" }, "private": true, diff --git a/postcss.config.js b/postcss.config.js index bb73fbefe490714de8654fe62d6a64c3479c9422..f0f365170346a787596a16168c597bdb95ce7cd8 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,6 +1,6 @@ module.exports = { plugins: [ // require('postcss-prefixer')({prefix: "drgstn--"}), - require('postcss-prefix-selector')({prefix: "network-expander"}) + require('postcss-prefix-selector')({prefix: "#appWindow"}) ], } diff --git a/releases/release_tag.sh b/releases/release_tag.sh index 307d2a3941e44ee4c7de9f204c1e9004a046e54b..1edfae826a9a6f22ba0068ba993b5a14e1a30a2c 100755 --- a/releases/release_tag.sh +++ b/releases/release_tag.sh @@ -21,24 +21,30 @@ echo "Cloning Release Repo..." git clone git@github.com:AndiMajore/drugstone-releases.git echo "Updating Repo..." -echo "Building release..." +#echo "Building release..." +#cd frontend || exit +#npm run build:netex +#cd ../ +#cp frontend/drugsTone-build/* drugstone-releases/releases/ +# +#echo "Building dev..." +#cd frontend || exit +#npm run build:netex-dev +#cd ../ +#cp frontend/drugsTone-build/* drugstone-releases/dev/ +# +#echo "Building remote..." +#cd frontend || exit +#npm run build:netex-remote +#cd ../ +#cp frontend/drugsTone-build/* drugstone-releases/remote/ + + +echo "Building v-server..." cd frontend || exit -npm run build:netex +npm run build:netex-uhh cd ../ -cp frontend/drugsTone-build/* drugstone-releases/releases/ - -echo "Building dev..." -cd frontend || exit -npm run build:netex-dev -cd ../ -cp frontend/drugsTone-build/* drugstone-releases/dev/ - -echo "Building remote..." -cd frontend || exit -npm run build:netex-remote -cd ../ -cp frontend/drugsTone-build/* drugstone-releases/remote/ - +cp frontend/drugsTone-build/* drugstone-releases/uhh/ cd drugstone-releases || echo "Error!" exit git commit -am "$VERSION commit: $MESSAGE" diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 4d8811f189bb276eff8d9d21f58ff525cbc34649..68ceaf13417cf11bfa31e91a73e533e4a517ac77 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -33,7 +33,7 @@ import {faTimes, faAngleUp, faAngleLeft, faCapsules, faCrosshairs, faFlask, faCh faExpand, faInfo, faRocket, faAngleDown, faSearch, faFastForward, faExternalLinkAlt, faTasks, faFilter, faMinus, faUpload, faAngleDoubleDown, faSync, faBroom, faAngleDoubleUp } from '@fortawesome/free-solid-svg-icons'; -import {TooltipModule} from "primeng/tooltip"; +import {TooltipModule} from 'primeng/tooltip'; @NgModule({ declarations: [ diff --git a/src/app/pages/explorer-page/explorer-page.component.html b/src/app/pages/explorer-page/explorer-page.component.html index 962cbb89803301728bac704c57ab12151b9e4e09..439c09fd5de24f6a2d296d64c2a778fdff6ad3b1 100644 --- a/src/app/pages/explorer-page/explorer-page.component.html +++ b/src/app/pages/explorer-page/explorer-page.component.html @@ -1,85 +1,85 @@ -<div id="appWindow" class="is-hidden-mobile fullheight" [style.color]="textColor" (window:resize)="onResize($event)"> - - - <app-launch-analysis [(show)]="showAnalysisDialog" - [target]="analysisDialogTarget" - [config]="myConfig" - [inputNetwork]="{nodes:proteins, edges:edges}"> - </app-launch-analysis> - - <app-custom-proteins [(show)]="showCustomProteinsDialog" [visibleNodes]="currentViewNodes"> - </app-custom-proteins> - - <app-add-expressed-proteins [(show)]="showThresholdDialog" - [selectedTissue]="currentViewSelectedTissue" - [visibleNodes]="currentViewNodes" - [currentViewProteins]="currentViewProteins" - [expressionMap]="expressionMap" - > - </app-add-expressed-proteins> - - <!-- Start explorer --> - <div class="covex explorer"> - - <!-- Start left sidebar --> - <div *ngIf="myConfig.showLeftSidebar" class="covex sidebar bar-left"> - - <div *ngIf="myConfig.showOverview" class="card bar-large" [ngClass]="{'b-text-small':smallStyle}"> - <header class="card-header"> - <p class="card-header-title"> +<div id="appWindow" [style.color]="textColor" (window:resize)="onResize($event)"> + <div class="is-hidden-mobile fullheight"> + + <app-launch-analysis [(show)]="showAnalysisDialog" + [target]="analysisDialogTarget" + [config]="myConfig" + [inputNetwork]="{nodes:proteins, edges:edges}"> + </app-launch-analysis> + + <app-custom-proteins [(show)]="showCustomProteinsDialog" [visibleNodes]="currentViewNodes"> + </app-custom-proteins> + + <app-add-expressed-proteins [(show)]="showThresholdDialog" + [selectedTissue]="currentViewSelectedTissue" + [visibleNodes]="currentViewNodes" + [currentViewProteins]="currentViewProteins" + [expressionMap]="expressionMap" + > + </app-add-expressed-proteins> + + <!-- Start explorer --> + <div class="covex explorer"> + + <!-- Start left sidebar --> + <div *ngIf="myConfig.showLeftSidebar" class="covex sidebar bar-left"> + + <div *ngIf="myConfig.showOverview" class="card bar-large" [ngClass]="{'b-text-small':smallStyle}"> + <header class="card-header"> + <p class="card-header-title"> <span class="icon"> <i class="fas fa-info" aria-hidden="true"></i> </span> Network Overview - </p> - <a (click)="collapseOverview= !collapseOverview" data-action="collapse" - class="card-header-icon is-hidden-fullscreen" aria-label="more options"> + </p> + <a (click)="collapseOverview= !collapseOverview" data-action="collapse" + class="card-header-icon is-hidden-fullscreen" aria-label="more options"> <span *ngIf="collapseOverview" class="icon"> <i class="fas fa-angle-down" aria-hidden="true"></i> </span> - <span *ngIf="!collapseOverview" class="icon"> + <span *ngIf="!collapseOverview" class="icon"> <i class="fas fa-angle-left" aria-hidden="true"></i> </span> - </a> - </header> - <div *ngIf="collapseOverview"> - <div class="card-content"> - <nav class="level" *ngIf="proteinData"> - - <!-- TO DO : CHANGE THIS LATER - <div class="level-item has-text-centered"> - <div> - <p class="heading">Viral<br>Proteins</p> - <p class="title"> {{ proteinData.effects.length }}</p> + </a> + </header> + <div *ngIf="collapseOverview"> + <div class="card-content"> + <nav class="level" *ngIf="proteinData"> + + <!-- TO DO : CHANGE THIS LATER + <div class="level-item has-text-centered"> + <div> + <p class="heading">Viral<br>Proteins</p> + <p class="title"> {{ proteinData.effects.length }}</p> + </div> </div> - </div> - --> + --> - <div class="level-item has-text-centered"> - <div> - <p class="heading">Proteins</p> - <p class="title">{{ proteinData.proteins.length }}</p> + <div class="level-item has-text-centered"> + <div> + <p class="heading">Proteins</p> + <p class="title">{{ proteinData.proteins.length }}</p> + </div> </div> - </div> - <div class="level-item has-text-centered"> - <div> - <p class="heading">Interactions</p> - <p class="title">{{ proteinData.edges.length }}</p> + <div class="level-item has-text-centered"> + <div> + <p class="heading">Interactions</p> + <p class="title">{{ proteinData.edges.length }}</p> + </div> </div> - </div> - </nav> + </nav> + </div> </div> </div> - </div> - <div *ngIf="myConfig.showQuery" class="card bar-large" [ngClass]="{'b-text-small':smallStyle}"> - <header class="card-header"> - <p class="card-header-title"> + <div *ngIf="myConfig.showQuery" class="card bar-large" [ngClass]="{'b-text-small':smallStyle}"> + <header class="card-header"> + <p class="card-header-title"> <span class="icon"> <i class="fas fa-search" aria-hidden="true"></i> </span> Query Protein/Gene - </p> - <a (click)="collapseQuery = !collapseQuery" data-action="collapse" - class="card-header-icon is-hidden-fullscreen" aria-label="more options"> + </p> + <a (click)="collapseQuery = !collapseQuery" data-action="collapse" + class="card-header-icon is-hidden-fullscreen" aria-label="more options"> <span class="icon"> <span *ngIf="collapseQuery" class="icon"> <i class="fas fa-angle-down" aria-hidden="true"></i> @@ -88,351 +88,355 @@ <i class="fas fa-angle-left" aria-hidden="true"></i> </span> </span> - </a> - </header> - <div *ngIf="collapseQuery"> - <div class="card-content"> - <div class="field"> - <div class="control"> - <app-query-tile-component (selectItem)="queryAction($event)" - [queryItems]="queryItems"></app-query-tile-component> + </a> + </header> + <div *ngIf="collapseQuery"> + <div class="card-content"> + <div class="field"> + <div class="control"> + <app-query-tile-component (selectItem)="queryAction($event)" + [queryItems]="queryItems"></app-query-tile-component> + </div> </div> </div> </div> </div> </div> - </div> - <!-- Start network block --> - <div class="covex network center-panel" id="main-column"> + <!-- Start network block --> + <div class="covex network center-panel" id="main-column"> - <div class="analysis-view" *ngIf="selectedAnalysisToken"> - <app-analysis-panel [(token)]="selectedAnalysisToken" - (showDetailsChange)="selectedWrapper = $event" - (visibleItems)="analysisWindowChanged($event)" [config]="myConfig" - [smallStyle]="smallStyle"></app-analysis-panel> - </div> + <div class="analysis-view" *ngIf="selectedAnalysisToken"> + <app-analysis-panel [(token)]="selectedAnalysisToken" + (showDetailsChange)="selectedWrapper = $event" + (visibleItems)="analysisWindowChanged($event)" [config]="myConfig" + [smallStyle]="smallStyle"></app-analysis-panel> + </div> - <div class="card network"> - - <header class="card-header network-header"> - <p class="card-header-title"> - {{myConfig.title}} - </p> - </header> - <div class="card-content explorer-network-view-settings"> - <div class="card-image canvas-content" #networkWithLegend> - <div *ngIf="myConfig.showLegend"> - <app-network-legend [config]="myConfig" [context]="legendContext"></app-network-legend> - </div> - <div class="center image1 fullheight" #network> - <button class="button is-loading center" alt="loading...">Loading</button> + <div class="card network"> + + <header class="card-header network-header"> + <p class="card-header-title"> + {{myConfig.title}} + </p> + </header> + <div class="card-content explorer-network-view-settings"> + <div class="card-image canvas-content" #networkWithLegend> + <div *ngIf="myConfig.showLegend"> + <app-network-legend [config]="myConfig" [context]="legendContext"></app-network-legend> + </div> + <div class="center image1 fullheight" #network> + <button class="button is-loading center" alt="loading...">Loading</button> + </div> </div> - </div> - <footer *ngIf="myConfig.showFooter" class="card-footer toolbar network-footer-toolbar"> + <footer *ngIf="myConfig.showFooter" class="card-footer toolbar network-footer-toolbar"> - <div class="network-footer-toolbar-inner-container"> + <div class="network-footer-toolbar-inner-container"> - <ng-container *ngIf="myConfig.showFooterButtonScreenshot"> - <button (click)="toImage()" class="button is-primary is-rounded has-tooltip network-footer-toolbar-element" - pTooltip="Take a screenshot of the current network." tooltipPosition="top"> + <ng-container *ngIf="myConfig.showFooterButtonScreenshot"> + <button (click)="toImage()" + class="button is-primary is-rounded has-tooltip network-footer-toolbar-element" + pTooltip="Take a screenshot of the current network." tooltipPosition="top"> <span class="icon"> <i class="fas fa-camera" aria-hidden="true"></i> </span> - <span [ngClass]="{'text-normal':smallStyle}">Screenshot</span> - </button> - </ng-container> - - <ng-container *ngIf="myConfig.showFooterButtonExpression"> - <div class="footer-buttons dropdown is-up network-footer-toolbar-element" [class.is-active]="expressionExpanded"> - - <div class="dropdown-trigger"> - <button (click)="expressionExpanded=!expressionExpanded" - class="button is-rounded is-primary" [class.is-outlined]="!selectedTissue" - aria-haspopup="true" aria-controls="dropdown-menu" - pTooltip="Tissue expression data is provided by the GTEx project." tooltipPosition="top" - [ngClass]="{'button-small':smallStyle}"> - <span *ngIf="!selectedTissue" [ngClass]="{'text-small':smallStyle}">Tissue</span> - <span *ngIf="selectedTissue">{{selectedTissue.name}}</span> - <span *ngIf="expressionExpanded" class="icon is-small"> + <span [ngClass]="{'text-normal':smallStyle}">Screenshot</span> + </button> + </ng-container> + + <ng-container *ngIf="myConfig.showFooterButtonExpression"> + <div class="footer-buttons dropdown is-up network-footer-toolbar-element" + [class.is-active]="expressionExpanded"> + + <div class="dropdown-trigger"> + <button (click)="expressionExpanded=!expressionExpanded" + class="button is-rounded is-primary" [class.is-outlined]="!selectedTissue" + aria-haspopup="true" aria-controls="dropdown-menu" + pTooltip="Tissue expression data is provided by the GTEx project." tooltipPosition="top" + [ngClass]="{'button-small':smallStyle}"> + <span *ngIf="!selectedTissue" [ngClass]="{'text-small':smallStyle}">Tissue</span> + <span *ngIf="selectedTissue">{{selectedTissue.name}}</span> + <span *ngIf="expressionExpanded" class="icon is-small"> <i class="fas fa-angle-up" aria-hidden="true"></i> </span> - <span *ngIf="!expressionExpanded" class="icon is-small"> + <span *ngIf="!expressionExpanded" class="icon is-small"> <i class="fas fa-angle-left" aria-hidden="true"></i> </span> - </button> - </div> - <div class="dropdown-menu" id="dropdown-menu" role="menu"> - <div class="dropdown-content tissue-dropdown"> - <div class="scroll-area"> - <a (click)="selectTissue(null)" - [class.is-active]="!selectedTissue" - class="dropdown-item"> - None - </a> - <a *ngFor="let tissue of analysis.getTissues()" - (click)="selectTissue(tissue)" - [class.is-active]="selectedTissue && tissue.netexId === selectedTissue.netexId" - class="dropdown-item"> - {{tissue.name}} - </a> + </button> + </div> + <div class="dropdown-menu" id="dropdown-menu" role="menu"> + <div class="dropdown-content tissue-dropdown"> + <div class="scroll-area"> + <a (click)="selectTissue(null)" + [class.is-active]="!selectedTissue" + class="dropdown-item"> + None + </a> + <a *ngFor="let tissue of analysis.getTissues()" + (click)="selectTissue(tissue)" + [class.is-active]="selectedTissue && tissue.netexId === selectedTissue.netexId" + class="dropdown-item"> + {{tissue.name}} + </a> + </div> </div> </div> </div> - </div> - </ng-container> - - <app-toggle class="footer-buttons network-footer-toolbar-element" textOn="Drugs" textOff="Off" - tooltipOn="Display adjacent drugs ON." - tooltipOff="Display adjacent drugs OFF." - [smallStyle]="smallStyle" - [value]="adjacentDrugs" (valueChange)="updateAdjacentDrugs($event)"></app-toggle> - - <app-toggle class="footer-buttons network-footer-toolbar-element" textOn="Animation On" textOff="Off" - tooltipOn="Enable the network animation." - tooltipOff="Disable the network animation and freeze nodes." - [smallStyle]="smallStyle" - [value]="physicsEnabled" (valueChange)="updatePhysicsEnabled($event)"></app-toggle> + </ng-container> + + <app-toggle class="footer-buttons network-footer-toolbar-element" textOn="Drugs" textOff="Off" + tooltipOn="Display adjacent drugs ON." + tooltipOff="Display adjacent drugs OFF." + [smallStyle]="smallStyle" + [value]="adjacentDrugs" (valueChange)="updateAdjacentDrugs($event)"></app-toggle> + + <app-toggle class="footer-buttons network-footer-toolbar-element" textOn="Animation On" textOff="Off" + tooltipOn="Enable the network animation." + tooltipOff="Disable the network animation and freeze nodes." + [smallStyle]="smallStyle" + [value]="physicsEnabled" (valueChange)="updatePhysicsEnabled($event)"></app-toggle> + </div> + </footer> </div> - </footer> + </div> </div> - </div> - </div> - <!-- End network block --> + <!-- End network block --> - <div *ngIf="myConfig.showRightSidebar" class="covex sidebar bar-right"> - <div *ngIf="myConfig.showItemSelector" class="card bar-large"> - <header class="card-header" [ngClass]="{'b-text-small':smallStyle}"> - <p class="card-header-title"> + <div *ngIf="myConfig.showRightSidebar" class="covex sidebar bar-right"> + <div *ngIf="myConfig.showItemSelector" class="card bar-large"> + <header class="card-header" [ngClass]="{'b-text-small':smallStyle}"> + <p class="card-header-title"> <span *ngIf="!selectedWrapper" class="icon"> <i class="fas fa-info" aria-hidden="true"></i> </span> - <!-- <i *ngIf="selectedWrapper && selectedWrapper.data.netexId && selectedWrapper.data.netexId.startsWith('p')" class="fas fa-dna" aria-hidden="true"></i> - <i *ngIf="selectedWrapper && selectedWrapper.data.netexId && selectedWrapper.data.netexId.startsWith('d')" class="fas fa-capsules" - aria-hidden="true"></i> --> - <span *ngIf="!selectedWrapper">No item selected</span> - <span *ngIf="selectedWrapper"> + <!-- <i *ngIf="selectedWrapper && selectedWrapper.data.netexId && selectedWrapper.data.netexId.startsWith('p')" class="fas fa-dna" aria-hidden="true"></i> + <i *ngIf="selectedWrapper && selectedWrapper.data.netexId && selectedWrapper.data.netexId.startsWith('d')" class="fas fa-capsules" + aria-hidden="true"></i> --> + <span *ngIf="!selectedWrapper">No item selected</span> + <span *ngIf="selectedWrapper"> <span>{{ selectedWrapper.data.type }}</span> </span> - </p> - <a (click)="collapseDetails = !collapseDetails" data-action="collapse" - class="card-header-icon is-hidden-fullscreen" aria-label="more options"> + </p> + <a (click)="collapseDetails = !collapseDetails" data-action="collapse" + class="card-header-icon is-hidden-fullscreen" aria-label="more options"> <span *ngIf="collapseDetails" class="icon"> <i class="fas fa-angle-down" aria-hidden="true"></i> </span> - <span *ngIf="!collapseDetails" class="icon"> + <span *ngIf="!collapseDetails" class="icon"> <i class="fas fa-angle-left" aria-hidden="true"></i> </span> - </a> - </header> - <div *ngIf="collapseDetails"> - <div class="card-content"> - <app-info-tile [wrapper]="selectedWrapper" [smallStyle]="smallStyle"></app-info-tile> + </a> + </header> + <div *ngIf="collapseDetails"> + <div class="card-content"> + <app-info-tile [wrapper]="selectedWrapper" [smallStyle]="smallStyle"></app-info-tile> + </div> + </div> </div> - </div> - </div> - <div *ngIf="myConfig.showSimpleAnalysis" class="card bar-large"> - <header class="card-header" [ngClass]="{'b-text-small':smallStyle}"> - <p class="card-header-title"> + <div *ngIf="myConfig.showSimpleAnalysis" class="card bar-large"> + <header class="card-header" [ngClass]="{'b-text-small':smallStyle}"> + <p class="card-header-title"> <span class="icon"> <i class="fas fa-flask" aria-hidden="true"></i> </span> - Simple Analysis - </p> - <a (click)="collapseAnalysisQuick = !collapseAnalysisQuick" data-action="collapse" - class="card-header-icon is-hidden-fullscreen" aria-label="more options"> + Simple Analysis + </p> + <a (click)="collapseAnalysisQuick = !collapseAnalysisQuick" data-action="collapse" + class="card-header-icon is-hidden-fullscreen" aria-label="more options"> <span *ngIf="collapseAnalysisQuick" class="icon"> <i class="fas fa-angle-down" aria-hidden="true"></i> </span> - <span *ngIf="!collapseAnalysisQuick" class="icon"> + <span *ngIf="!collapseAnalysisQuick" class="icon"> <i class="fas fa-angle-left" aria-hidden="true"></i> </span> - </a> - </header> - <div *ngIf="collapseAnalysisQuick"> - <div class="card-content quick-find"> - <div class="field"> - <div class="control"> - <div class="tile notification is-danger"> - <div class="align-vmiddle"> - <div class="digit"><i class="fa fa-fast-forward"></i></div> - <button (click)="analysis.startQuickAnalysis(true, null)" - [disabled]="analysis.isLaunchingQuick()" - class="button is-white is-rounded has-tooltip" pTooltip="Find drugs for all proteins." tooltipPosition="top"> + </a> + </header> + <div *ngIf="collapseAnalysisQuick"> + <div class="card-content quick-find"> + <div class="field"> + <div class="control"> + <div class="tile notification is-danger"> + <div class="align-vmiddle"> + <div class="digit"><i class="fa fa-fast-forward"></i></div> + <button (click)="analysis.startQuickAnalysis(true, null)" + [disabled]="analysis.isLaunchingQuick()" + class="button is-white is-rounded has-tooltip" pTooltip="Find drugs for all proteins." + tooltipPosition="top"> <span class="icon"> <i class="fa fa-capsules" *ngIf="!analysis.isLaunchingQuick()"></i> <i class="fa fa-spin fa-spinner" *ngIf="analysis.isLaunchingQuick()"></i> </span> - <span [ngClass]="{'text-normal':smallStyle}"> + <span [ngClass]="{'text-normal':smallStyle}"> Quick Start </span> - </button> - </div> - </div> - <div class="divisor-rapid"> - — or — - </div> - <div class="tile notification is-info"> - <div class="align-vmiddle"> - <div class="digit" *ngIf="analysis.getCount() == 0">1</div> - <div class="digit" *ngIf="analysis.getCount() > 0"><i class="fa fa-check"></i></div> - <div> - <span [ngClass]="{'text-normal':smallStyle}">Select Proteins</span> + </button> + </div> </div> - </div> - </div> - <div class="tile notification is-info"> - <div class="align-vmiddle"> - <div class="digit">2</div> - <button (click)="analysis.startQuickAnalysis(false, null)" - [disabled]="analysis.getCount() === 0 || analysis.isLaunchingQuick()" - class="button is-white is-rounded has-tooltip" - pTooltip="Find drugs for the selected proteins." tooltipPosition="top"> + <div class="divisor-rapid"> + — or — + </div> + <div class="tile notification is-info"> + <div class="align-vmiddle"> + <div class="digit" *ngIf="analysis.getCount() == 0">1</div> + <div class="digit" *ngIf="analysis.getCount() > 0"><i class="fa fa-check"></i></div> + <div> + <span [ngClass]="{'text-normal':smallStyle}">Select Proteins</span> + </div> + </div> + </div> + <div class="tile notification is-info"> + <div class="align-vmiddle"> + <div class="digit">2</div> + <button (click)="analysis.startQuickAnalysis(false, null)" + [disabled]="analysis.getCount() === 0 || analysis.isLaunchingQuick()" + class="button is-white is-rounded has-tooltip" + pTooltip="Find drugs for the selected proteins." tooltipPosition="top"> <span class="icon"> <i class="fa fa-capsules" *ngIf="!analysis.isLaunchingQuick()"></i> <i class="fa fa-spin fa-spinner" *ngIf="analysis.isLaunchingQuick()"></i> </span> - <span [ngClass]="{'text-normal':smallStyle}"> + <span [ngClass]="{'text-normal':smallStyle}"> {{ myConfig.taskName }} </span> - </button> + </button> + </div> + </div> </div> </div> </div> </div> </div> - </div> - </div> - <div *ngIf="myConfig.showAdvAnalysis" class="card bar-large"> - <header class="card-header" [ngClass]="{'b-text-small':smallStyle}"> - <p class="card-header-title"> + <div *ngIf="myConfig.showAdvAnalysis" class="card bar-large"> + <header class="card-header" [ngClass]="{'b-text-small':smallStyle}"> + <p class="card-header-title"> <span class="icon"> <i class="fas fa-flask" aria-hidden="true"></i> </span> - Analysis - </p> - <a (click)="collapseAnalysis = !collapseAnalysis" data-action="collapse" - class="card-header-icon is-hidden-fullscreen" aria-label="more options"> + Analysis + </p> + <a (click)="collapseAnalysis = !collapseAnalysis" data-action="collapse" + class="card-header-icon is-hidden-fullscreen" aria-label="more options"> <span *ngIf="collapseAnalysis" class="icon"> <i class="fas fa-angle-down" aria-hidden="true"></i> </span> - <span *ngIf="!collapseAnalysis" class="icon"> + <span *ngIf="!collapseAnalysis" class="icon"> <i class="fas fa-angle-left" aria-hidden="true"></i> </span> - </a> - </header> - <div *ngIf="collapseAnalysis"> - <div class="card-content"> - <div class="field"> - <div class="control" pTooltip="Find drug targets for the selected proteins." tooltipPosition="top"> - <button (click)="analysisDialogTarget = 'drug-target'; showAnalysisDialog = true;" - class="button is-primary is-fullwidth is-rounded has-tooltip" - [disabled]="analysis.getCount() === 0" [ngClass]="{'text-small':smallStyle}"> + </a> + </header> + <div *ngIf="collapseAnalysis"> + <div class="card-content"> + <div class="field"> + <div class="control" pTooltip="Find drug targets for the selected proteins." tooltipPosition="top"> + <button (click)="analysisDialogTarget = 'drug-target'; showAnalysisDialog = true;" + class="button is-primary is-fullwidth is-rounded has-tooltip" + [disabled]="analysis.getCount() === 0" [ngClass]="{'text-small':smallStyle}"> <span class="icon"> <i class="fa fa-crosshairs"></i> </span> - <span> + <span> Find Drug Targets </span> - </button> - </div> - </div> - <div class="field"> - <div class="control" pTooltip="Find drugs for the selected proteins." tooltipPosition="top"> - <button (click)="analysisDialogTarget = 'drug'; showAnalysisDialog = true;" - class="button is-primary is-fullwidth is-rounded has-tooltip" - [disabled]="analysis.getCount() === 0" [ngClass]="{'text-small':smallStyle}"> + </button> + </div> + </div> + <div class="field"> + <div class="control" pTooltip="Find drugs for the selected proteins." tooltipPosition="top"> + <button (click)="analysisDialogTarget = 'drug'; showAnalysisDialog = true;" + class="button is-primary is-fullwidth is-rounded has-tooltip" + [disabled]="analysis.getCount() === 0" [ngClass]="{'text-small':smallStyle}"> <span class="icon"> <i class="fa fa-capsules"></i> </span> - <span> + <span> {{myConfig.taskName}} </span> - </button> - </div> - </div> - <div class="field"> - <div class="control"> - <a *ngIf="analysis.getCount() > 0" [href]="gProfilerLink()" target="_blank" - class="button is-primary is-fullwidth is-rounded has-tooltip" - pTooltip="Use enrichment analysis via g:Profiler (external)." tooltipPosition="top"> + </button> + </div> + </div> + <div class="field"> + <div class="control"> + <a *ngIf="analysis.getCount() > 0" [href]="gProfilerLink()" target="_blank" + class="button is-primary is-fullwidth is-rounded has-tooltip" + pTooltip="Use enrichment analysis via g:Profiler (external)." tooltipPosition="top"> <span class="icon"> <i class="fa fa-external-link-alt"></i> </span> - <span [ngClass]="{'text-small':smallStyle}"> + <span [ngClass]="{'text-small':smallStyle}"> Enrichment Analysis </span> - </a> - <a *ngIf="analysis.getCount() === 0" disabled - class="button is-primary is-fullwidth is-rounded has-tooltip" - pTooltip="Use enrichment analysis via g:Profiler (external)." tooltipPosition="top"> + </a> + <a *ngIf="analysis.getCount() === 0" disabled + class="button is-primary is-fullwidth is-rounded has-tooltip" + pTooltip="Use enrichment analysis via g:Profiler (external)." tooltipPosition="top"> <span class="icon"> <i class="fa fa-external-link-alt"></i> </span> - <span [ngClass]="{'text-small':smallStyle}"> + <span [ngClass]="{'text-small':smallStyle}"> Enrichment Analysis </span> - </a> + </a> + </div> + </div> </div> </div> </div> - </div> - </div> - <div *ngIf="myConfig.showTasks" class="card bar-large"> - <header class="card-header" [ngClass]="{'b-text-small':smallStyle}"> - <p class="card-header-title"> + <div *ngIf="myConfig.showTasks" class="card bar-large"> + <header class="card-header" [ngClass]="{'b-text-small':smallStyle}"> + <p class="card-header-title"> <span class="icon"> <i class="fas fa-tasks" aria-hidden="true"></i> </span> - Tasks ({{analysis.tasks.length}}) - </p> - <a (click)="collapseTask = !collapseTask" data-action="collapse" class="card-header-icon is-hidden-fullscreen" - aria-label="more options"> + Tasks ({{analysis.tasks.length}}) + </p> + <a (click)="collapseTask = !collapseTask" data-action="collapse" + class="card-header-icon is-hidden-fullscreen" + aria-label="more options"> <span *ngIf="collapseTask" class="icon"> <i class="fas fa-angle-down" aria-hidden="true"></i> </span> - <span *ngIf="!collapseTask" class="icon"> + <span *ngIf="!collapseTask" class="icon"> <i class="fas fa-angle-left" aria-hidden="true"></i> </span> - </a> - </header> - <div *ngIf="collapseTask"> - <div class="card-content overflow task-list-container" *ngIf="analysis.tasks && analysis.tasks.length > 0"> - <app-task-list [(token)]="selectedAnalysisToken"></app-task-list> - </div> - <footer class="card-footer"> - <a *ngIf="analysis.tasks && analysis.tasks.length > 0" - (click)="analysis.removeAllTasks(); selectedAnalysisToken = null;" - class="card-footer-item text-danger" pTooltip="Delete all tasks." tooltipPosition="top"> + </a> + </header> + <div *ngIf="collapseTask"> + <div class="card-content overflow task-list-container" *ngIf="analysis.tasks && analysis.tasks.length > 0"> + <app-task-list [(token)]="selectedAnalysisToken"></app-task-list> + </div> + <footer class="card-footer"> + <a *ngIf="analysis.tasks && analysis.tasks.length > 0" + (click)="analysis.removeAllTasks(); selectedAnalysisToken = null;" + class="card-footer-item text-danger" pTooltip="Delete all tasks." tooltipPosition="top"> <span class="icon"> <i class="fa fa-trash"></i> </span> - <span> + <span> Delete all </span> - </a> - </footer> - </div> - </div> + </a> + </footer> + </div> + </div> - <div *ngIf="myConfig.showSelection" class="card bar-large"> - <header class="card-header" [ngClass]="{'b-text-small':smallStyle}"> - <p class="card-header-title"> + <div *ngIf="myConfig.showSelection" class="card bar-large"> + <header class="card-header" [ngClass]="{'b-text-small':smallStyle}"> + <p class="card-header-title"> <span class="icon"> <i class="fas fa-filter" aria-hidden="true"></i> </span> Selection ({{analysis.getCount()}}) - </p> - <a (click)="collapseSelection = !collapseSelection" data-action="collapse" - class="card-header-icon is-hidden-fullscreen" aria-label="more options"> + </p> + <a (click)="collapseSelection = !collapseSelection" data-action="collapse" + class="card-header-icon is-hidden-fullscreen" aria-label="more options"> <span *ngIf="collapseSelection" class="icon"> <i class="fas fa-angle-down" aria-hidden="true"></i> </span> - <span *ngIf="!collapseSelection" class="icon"> + <span *ngIf="!collapseSelection" class="icon"> <i class="fas fa-angle-left" aria-hidden="true"></i> </span> @@ -464,80 +468,81 @@ </i> </div> - <footer class="card-footer" *ngIf="selectedAnalysisToken"> - <a (click)="analysis.addSeeds(currentViewNodes)" - class="card-footer-item has-text-success" tooltipPosition="top" pTooltip="Add all visible seeds."> + <footer class="card-footer" *ngIf="selectedAnalysisToken"> + <a (click)="analysis.addSeeds(currentViewNodes)" + class="card-footer-item has-text-success" tooltipPosition="top" pTooltip="Add all visible seeds."> <span class="icon"> <i class="fa fa-plus"></i> </span> - <span> + <span> Add seeds </span> - </a> - <a (click)="analysis.removeSeeds(currentViewNodes)" - class="card-footer-item text-danger" tooltipPosition="top" pTooltip="Remove all seeds."> + </a> + <a (click)="analysis.removeSeeds(currentViewNodes)" + class="card-footer-item text-danger" tooltipPosition="top" pTooltip="Remove all seeds."> <span class="icon"> <i class="fa fa-minus"></i> </span> - <span> + <span> Remove seeds </span> - </a> - </footer> + </a> + </footer> - <footer class="card-footer"> - <a (click)="showCustomProteinsDialog = true" - class="card-footer-item text-primary" - tooltipPosition="top" pTooltip="Add a custom list of proteins."> + <footer class="card-footer"> + <a (click)="showCustomProteinsDialog = true" + class="card-footer-item text-primary" + tooltipPosition="top" pTooltip="Add a custom list of proteins."> <span class="icon"> <i class="fa fa-upload"></i> </span> - <span> + <span> Custom proteins </span> - </a> - <a (click)="showThresholdDialog = true" - class="card-footer-item text-primary" - pTooltip="Add proteins expressed in the tissue." tooltipPosition="top"> + </a> + <a (click)="showThresholdDialog = true" + class="card-footer-item text-primary" + pTooltip="Add proteins expressed in the tissue." tooltipPosition="top"> <span class="icon"> <i class="fas fa-angle-double-up"></i> </span> - <span> + <span> Tissue proteins </span> </a> </footer> --> - <footer class="card-footer"> - <a (click)="analysis.invertSelection(currentViewNodes)" class="card-footer-item text-primary" - tooltipPosition="top" pTooltip="Invert the current selection."> + <footer class="card-footer"> + <a (click)="analysis.invertSelection(currentViewNodes)" class="card-footer-item text-primary" + tooltipPosition="top" pTooltip="Invert the current selection."> <span class="icon"> <i class="fa fa-sync"></i> </span> - <span> + <span> Invert </span> - </a> - <a (click)="analysis.resetSelection()" class="card-footer-item text-danger" - tooltipPosition="top" pTooltip="Remove all entries from the selection."> + </a> + <a (click)="analysis.resetSelection()" class="card-footer-item text-danger" + tooltipPosition="top" pTooltip="Remove all entries from the selection."> <span class="icon"> <i class="fa fa-broom"></i> </span> - <span> + <span> Reset </span> - </a> - </footer> + </a> + </footer> + </div> + </div> </div> </div> </div> -</div> -</div> -<div class="is-hidden-tablet mobile-fallback"> - Sorry, CoVex is not available for mobile phones. - To find information about CoVex, please check the <a routerLink="/about">About</a> page or visit this page - with another device with a larger screen. + <div class="is-hidden-tablet mobile-fallback"> + Sorry, CoVex is not available for mobile phones. + To find information about CoVex, please check the <a routerLink="/about">About</a> page or visit this page + with another device with a larger screen. + </div> </div> diff --git a/src/app/pages/explorer-page/explorer-page.component.scss b/src/app/pages/explorer-page/explorer-page.component.scss index 050dc200d05e0779665529b788a8ce237e02105d..bd938d67523e42afe60390d869c698034859baef 100644 --- a/src/app/pages/explorer-page/explorer-page.component.scss +++ b/src/app/pages/explorer-page/explorer-page.component.scss @@ -24,7 +24,7 @@ } .explorer-network-view-settings { - // remove margin from tab header when network is displayed, so that network + // remove margin from tab header when network is displayed, so that network // does not disappear in empty border padding: 0; height: calc(100% - #{$network-header-height}); @@ -74,3 +74,4 @@ padding: 0.5rem; } + diff --git a/src/app/pages/explorer-page/explorer-page.component.ts b/src/app/pages/explorer-page/explorer-page.component.ts index ac2bb1d0f69ce0dc82955b1fc2c9757c541c5fbf..c458434285d1d0e0c0185a8cee3b01d426ef7ac4 100644 --- a/src/app/pages/explorer-page/explorer-page.component.ts +++ b/src/app/pages/explorer-page/explorer-page.component.ts @@ -1,20 +1,22 @@ import { AfterViewInit, Component, - ElementRef, HostListener, Input, + ElementRef, + HostListener, + Input, OnInit, - ViewChild + ViewChild, + ViewEncapsulation } from '@angular/core'; import { - NodeInteraction, - Node, - Wrapper, + getDrugNodeId, getWrapperFromNode, - Tissue, + legendContext, + Node, NodeAttributeMap, - getDrugNodeId, - Drug, - legendContext + NodeInteraction, + Tissue, + Wrapper } from '../../interfaces'; import {mapCustomEdge, mapCustomNode, ProteinNetwork} from '../../main-network'; import {AnalysisService} from '../../services/analysis/analysis.service'; @@ -23,9 +25,8 @@ import domtoimage from 'dom-to-image'; import {NetworkSettings} from '../../network-settings'; import {defaultConfig, EdgeGroup, IConfig, InteractionDatabase, NodeGroup} from '../../config'; import {NetexControllerService} from 'src/app/services/netex-controller/netex-controller.service'; -import {removeDuplicateObjectsFromList, rgbaToHex, rgbToHex, standardize_color} from '../../utils' +import {removeDuplicateObjectsFromList} from '../../utils' import * as merge from 'lodash/fp/merge'; -import { config } from 'rxjs'; // import * as 'vis' from 'vis-network'; // import {DataSet} from 'vis-data'; @@ -280,7 +281,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { // at this point, we have nodes synched with the backend // use netexIds where posssible, but use original id as node name if no label given const nodeIdMap = {}; - + network.nodes.forEach((node) => { // set node label to original id before node id will be set to netex id node.label = node.label ? node.label : node.id; @@ -289,7 +290,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { node.id = nodeIdMap[node.id]; }); - // adjust edge labels accordingly and filter + // adjust edge labels accordingly and filter const edges = new Array(); network.edges.forEach(edge => { edge.from = nodeIdMap[edge.from]; diff --git a/src/environments/environment.prod.uhh.ts b/src/environments/environment.prod.uhh.ts new file mode 100644 index 0000000000000000000000000000000000000000..e892d5ee6e33ca3ae92732d8dc749f0da53759cb --- /dev/null +++ b/src/environments/environment.prod.uhh.ts @@ -0,0 +1,4 @@ +export const environment = { + production: true, + backend: 'http://ml-s-zbhdock2.ad.uni-hamburg.de/drugstone_api/', +};