From 67b0fc3ce30c702eeca22ed7533ab8b43692d502 Mon Sep 17 00:00:00 2001 From: Dany Fu Date: Mon, 23 Sep 2019 11:45:02 -0400 Subject: [PATCH] if an edge has more than one role, visualization should shown engineered region instead of the first role --- src/main/resources/static/js/target.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/resources/static/js/target.js b/src/main/resources/static/js/target.js index c1617f5c..ebce9d55 100644 --- a/src/main/resources/static/js/target.js +++ b/src/main/resources/static/js/target.js @@ -118,6 +118,7 @@ export default class Target{ return marker(isBlank); }); + const ENGINEERED_REGION = "http://identifiers.org/so/SO:0000804"; //place SBOL svg on links const sbolImgSize = 30; let images = linksEnter.append("svg:image") @@ -145,6 +146,9 @@ export default class Target{ }) .attr("href", (d) => { if (d.hasOwnProperty("componentRoles") && d["componentRoles"].length > 0) { + if(d["componentRoles"].length > 1) { + return getSBOLImage(ENGINEERED_REGION); + } return getSBOLImage(d["componentRoles"][0]); } return null; @@ -156,6 +160,9 @@ export default class Target{ .attr("href", (d) => { if (d.hasOwnProperty("componentRoles")) { if (d["componentRoles"].length > 0 && d.hasReverseOrient) { + if(d["componentRoles"].length > 1) { + return getSBOLImage(ENGINEERED_REGION); + } return getSBOLImage(d["componentRoles"][0]); } }