From e4997e695d56a45535516539845505340405fb4a Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Wed, 31 Oct 2018 09:51:21 +0100 Subject: [PATCH] width of data overlay elemnt wasn't returned from api --- frontend-js/src/main/js/map/surface/ReactionSurface.js | 6 +++--- .../mapviewer/api/projects/overlays/OverlayRestImpl.java | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend-js/src/main/js/map/surface/ReactionSurface.js b/frontend-js/src/main/js/map/surface/ReactionSurface.js index b750368fcb..2ceeb217ea 100644 --- a/frontend-js/src/main/js/map/surface/ReactionSurface.js +++ b/frontend-js/src/main/js/map/surface/ReactionSurface.js @@ -87,7 +87,7 @@ ReactionSurface.prototype.setColor = function (color) { strokeColor: color }); } - this.customized = true; + this.setCustomized(true); }; /** @@ -163,7 +163,7 @@ ReactionSurface.prototype.changedToDefault = function () { strokeWeight: 5 }); } - this.customized = false; + this.setCustomized(false); }; /** @@ -177,7 +177,7 @@ ReactionSurface.prototype.changedToCustomized = function () { strokeWeight: this.getWidth() }); } - this.customized = true; + this.setCustomized(true); }; /** diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/projects/overlays/OverlayRestImpl.java b/rest-api/src/main/java/lcsb/mapviewer/api/projects/overlays/OverlayRestImpl.java index de4428df9f..c0540b1f76 100644 --- a/rest-api/src/main/java/lcsb/mapviewer/api/projects/overlays/OverlayRestImpl.java +++ b/rest-api/src/main/java/lcsb/mapviewer/api/projects/overlays/OverlayRestImpl.java @@ -143,7 +143,7 @@ public class OverlayRestImpl extends BaseRestImpl { if (columns != null && !columns.trim().isEmpty()) { columnSet = columns.split(","); } else { - columnSet = new String[] { "modelId", "idObject", "value", "color", "uniqueId" }; + columnSet = new String[] { "modelId", "idObject", "value", "color", "uniqueId", "width" }; } List<Map<String, Object>> result = new ArrayList<>(); @@ -426,6 +426,12 @@ public class OverlayRestImpl extends BaseRestImpl { } } else if (column.equals("description")) { value = colorSchema.getDescription(); + } else if (column.equals("width")) { + if (bioEntity instanceof Reaction) { + value = colorSchema.getLineWidth(); + } else { + continue; + } } else if (column.equals("type")) { if (colorSchema instanceof GeneVariationColorSchema) { value = ColorSchemaType.GENETIC_VARIANT; -- GitLab