Skip to content

Commit

Permalink
Metabolic pathways visualisation (#731):
Browse files Browse the repository at this point in the history
- #issuecomment-1080851310;
- #issuecomment-1081402608;
- #issuecomment-1081405879;
  • Loading branch information
DmitriiKrasnov authored and rodichenko committed Mar 29, 2022
1 parent 3184d50 commit 9ae2bd0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ export default class ngbCytoscapePathwayController {
const savedState = JSON.parse(localStorage.getItem(this.storageName) || '{}');
const savedLayout = savedState.layout ? savedState.layout[this.elements.id] : undefined;
let elements;
this.elements.nodes = this.saveDefaultPositions(this.elements.nodes, this.isCollage());
if (savedLayout) {
elements = {
nodes: this.wrapNodes(
Expand All @@ -255,7 +256,6 @@ export default class ngbCytoscapePathwayController {
edges: savedLayout.edges
};
} else {
this.elements.nodes = this.saveDefaultPositions(this.elements.nodes, this.isCollage());
elements = {
nodes: this.wrapNodes(
this.getPlainNodes(this.positionedNodes(this.elements.nodes)),
Expand Down Expand Up @@ -316,14 +316,14 @@ export default class ngbCytoscapePathwayController {
zoomIn() {
const zoom = this.zoom() + this.ZOOM_STEP;
viewerContext.viewer.zoom(zoom);
// viewerContext.centerCytoscape();
viewerContext.centerCytoscape();
this.canZoomIn = zoom < viewerContext.viewer.maxZoom();
this.canZoomOut = zoom > viewerContext.viewer.minZoom();
},
zoomOut() {
const zoom = this.zoom() - this.ZOOM_STEP;
viewerContext.viewer.zoom(zoom);
// viewerContext.centerCytoscape();
viewerContext.centerCytoscape();
this.canZoomIn = zoom < viewerContext.viewer.maxZoom();
this.canZoomOut = zoom > viewerContext.viewer.minZoom();
},
Expand All @@ -336,6 +336,8 @@ export default class ngbCytoscapePathwayController {
viewerContext.viewer.layout(this.settings.loadedLayout).run();
});
viewerContext.saveLayout();
this.actionsManager.canZoomIn = this.actionsManager.zoom() < viewerContext.viewer.maxZoom();
this.actionsManager.canZoomOut = this.actionsManager.zoom() > viewerContext.viewer.minZoom();
},
canZoomIn: true,
canZoomOut: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ export default class ngbInternalPathwaysResultController extends baseController
if (this.ngbPathwaysService.currentInternalPathway) {
this.annotationList = this.ngbPathwaysAnnotationService.getPathwayAnnotationList(this.ngbPathwaysService.currentInternalPathway.id);
this.applyAnnotations();
if (this.annotationList && this.annotationList.length !== 0) {
this.annotationsPanelVisible = true;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<md-input-container class="add-annotation-dlb-input">
<md-checkbox aria-label="select heatmap" class="md-primary"
ng-change="$ctrl.onAnnotationTypeChange()"
ng-false-value="undefined"
ng-false-value="null"
ng-model="$ctrl.annotation.type"
ng-true-value="{{$ctrl.annotationTypeList.HEATMAP}}">
Select heatmap file
Expand Down Expand Up @@ -119,7 +119,7 @@
<md-input-container class="add-annotation-dlb-input add-annotation-dlb-file-checkbox">
<md-checkbox aria-label="upload TSV\CSV" class="md-primary"
ng-change="$ctrl.onAnnotationTypeChange()"
ng-false-value="undefined"
ng-false-value="null"
ng-model="$ctrl.annotation.type"
ng-true-value="{{$ctrl.annotationTypeList.CSV}}">
Upload TSV/CSV
Expand Down Expand Up @@ -164,7 +164,7 @@
<md-input-container class="add-annotation-dlb-input">
<md-checkbox aria-label="manual colors config" class="md-primary"
ng-change="$ctrl.onAnnotationTypeChange()"
ng-false-value="undefined"
ng-false-value="null"
ng-model="$ctrl.annotation.type"
ng-true-value="{{$ctrl.annotationTypeList.MANUAL}}">
Manual colors config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export default class ngbPathwaysAnnotationAddDlgController {
this.annotation = {
...annotation
};
this.colorScheme = this.annotation.colorScheme.copy();
if (this.annotation.type === this.ngbPathwaysAnnotationService.annotationTypeList.HEATMAP
|| this.annotation.type === this.ngbPathwaysAnnotationService.annotationTypeList.CSV) {
this.colorScheme = this.annotation.colorScheme.copy();
}
} else {
this.annotation = {
name: undefined,
Expand Down

0 comments on commit 9ae2bd0

Please sign in to comment.