From c011eeb2257e8af2bda8be6adab5078e1cd17a67 Mon Sep 17 00:00:00 2001
From: baigner <benedikt.aigner@rwth-aachen.de>
Date: Mon, 2 Jul 2018 08:57:39 +0200
Subject: [PATCH] Fixed issue with "Show usage"

Former-commit-id: fe59cd449583241b8b8ccdd72d93c400551d7093
---
 kadmos/vistoms/templates/VISTOMS.html         | 125 +++++++++++-------
 .../vistoms/templates/VISTOMS_sessions.html   | 125 +++++++++++-------
 2 files changed, 150 insertions(+), 100 deletions(-)

diff --git a/kadmos/vistoms/templates/VISTOMS.html b/kadmos/vistoms/templates/VISTOMS.html
index 230dfcb35..704c21815 100644
--- a/kadmos/vistoms/templates/VISTOMS.html
+++ b/kadmos/vistoms/templates/VISTOMS.html
@@ -18756,7 +18756,6 @@
 			//#####################################################################//
 			function startXDSM(data, graphID) 
 			{	
-
 				//Highlight function, that shows usage of a node in the XDSM
 				function highlight(data)
 				{
@@ -18771,18 +18770,23 @@
                             xdsm_tmp.svg.selectAll(".edge").each(function(p) 
                             {
                                 var firstElement_tmp = p.name.split("/")[1]
-                                var text_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
-                                if (include(p.name,text_fromFirst))
+                                var xPath_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
+                                var this_edge  = this
+                                var p_name_list = p.name.split(",")
+                                p_name_list.forEach(function(p_name) 
                                 {
-                                    var highlightEdge = d3.select(this).select("polygon");
-                                    highlightEdge
-                                        .style("stroke-width",5.)
-                                        .style("stroke","#CC0000")
-                                    d3.selectAll(".treeFrame")
-                                        .attr("fill-opacity", 0.5)
-                                        .attr("stroke-opacity", 0.5);
-                                    d3.selectAll(".nodeText").style("fill-opacity",0.5);
-                                }
+                                    if (include(p_name+"__",xPath_fromFirst+"__") || include(p_name,xPath_fromFirst+"/"))
+                                    {
+                                        var highlightEdge = d3.select(this_edge).select("polygon");
+                                        highlightEdge
+                                            .style("stroke-width",5.)
+                                            .style("stroke","#CC0000")
+                                        d3.selectAll(".treeFrame")
+                                            .attr("fill-opacity", 0.5)
+                                            .attr("stroke-opacity", 0.5);
+                                        d3.selectAll(".nodeText").style("fill-opacity",0.5);
+                                    }
+                                })
                             })
                         }
                     })
@@ -18803,18 +18807,23 @@
                             xdsm_tmp.svg.selectAll(".edge").each(function(p) 
                             {
                                 var firstElement_tmp = p.name.split("/")[1]
-                                var text_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
-                                if (include(p.name,text_fromFirst))
+                                var xPath_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
+                                var this_edge  = this
+                                var p_name_list = p.name.split(",")
+                                p_name_list.forEach(function(p_name) 
                                 {
-                                    var highlightEdge = d3.select(this).select("polygon");
-                                    highlightEdge
-                                        .style("stroke-width",1.)
-                                        .style("stroke","black");
-                                    d3.selectAll(".treeFrame")
-                                        .attr("fill-opacity", 0.8)
-                                        .attr("stroke-opacity", 0.8);
-                                    d3.selectAll(".nodeText").style("fill-opacity",1);
-                                }
+                                    if (include(p_name+"__",xPath_fromFirst+"__") || include(p_name,xPath_fromFirst+"/"))
+                                    {
+                                        var highlightEdge = d3.select(this_edge).select("polygon");
+                                        highlightEdge
+                                            .style("stroke-width",1.)
+                                            .style("stroke","black");
+                                        d3.selectAll(".treeFrame")
+                                            .attr("fill-opacity", 0.8)
+                                            .attr("stroke-opacity", 0.8);
+                                        d3.selectAll(".nodeText").style("fill-opacity",1);
+                                    }
+                                })
                             })
                         }
                     })
@@ -23555,15 +23564,22 @@
                             aLink.__data__.name += aLink.__data__.pipeDataName_out
                         }
                     })
-                                    
-                    //var allLinks_tmp = allLinks[0];
+                    
                     allLinks[0].forEach(function(p) {
                         var firstElement_tmp = p.__data__.name.split("/")[1]
-                        var text_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
-                        if (include(p.__data__.name,text_fromFirst))
+                        var xPath_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
+                        var p_name_list = p.__data__.name.split(",")
+                        var highlight_on = false
+                        p_name_list.forEach(function(p_name) 
+                        {
+                            if (include(p_name+"__",xPath_fromFirst+"__") || include(p_name,xPath_fromFirst+"/"))
+                            {                                
+                                highlight_on = true
+                            }
+                        })
+                        if (highlight_on)
                         {
-                            d3.select(p)
-                                .style("stroke-opacity", 1.0)
+                            d3.select(p).style("stroke-opacity", 1.5)
                         }
                         else
                         {
@@ -26588,25 +26604,25 @@
 			  });
 			  
                 
-                //Highlight function, that shows usage of a node in the XDSM
-                function highlight(data)
-                {
-                    xPath = data.xPath;
-                    var allLinks = d3.selectAll(".link");
-                    var allLinks_tmp = allLinks[0];
-                    allLinks_tmp.forEach(function(p) {
-                        var firstElement_tmp = p.__data__.name.split("/")[1]
-                        var text_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
-                        if (include(p.__data__.name,text_fromFirst))
-                        {
-                            d3.select(p).style("opacity", .8);			
-                        }
-                        else
-                        {
-                            d3.select(p).style("opacity", 0);			
-                        }
-                    });
-                }
+                <!-- //Highlight function, that shows usage of a node in the XDSM -->
+                <!-- function highlight(data) -->
+                <!-- { -->
+                    <!-- xPath = data.xPath; -->
+                    <!-- var allLinks = d3.selectAll(".link"); -->
+                    <!-- var allLinks_tmp = allLinks[0]; -->
+                    <!-- allLinks_tmp.forEach(function(p) { -->
+                        <!-- var firstElement_tmp = p.__data__.name.split("/")[1] -->
+                        <!-- var text_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1] -->
+                        <!-- if (include(p.__data__.name,text_fromFirst)) -->
+                        <!-- { -->
+                            <!-- d3.select(p).style("opacity", .8);			 -->
+                        <!-- } -->
+                        <!-- else -->
+                        <!-- { -->
+                            <!-- d3.select(p).style("opacity", 0);			 -->
+                        <!-- } -->
+                    <!-- }); -->
+                <!-- } -->
                 
                 function showVariableTable(aVariable)
                 {											
@@ -28086,8 +28102,17 @@
                     var allLinks_tmp = allLinks[0];
                     allLinks_tmp.forEach(function(p) {
                         var firstElement_tmp = p.__data__.name.split("/")[1]
-                        var text_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
-                        if (include(p.__data__.name,text_fromFirst))
+                        var xPath_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
+                        var p_name_list = p.__data__.name.split(",")
+                        var highlight_on = false
+                        p_name_list.forEach(function(p_name) 
+                        {
+                            if (include(p_name+"__",xPath_fromFirst+"__") || include(p_name,xPath_fromFirst+"/"))
+                            {
+                                highlight_on = true;
+                            }
+                        })
+                        if (highlight_on)
                         {
                             d3.select(p).style("opacity", .8);			
                         }
diff --git a/kadmos/vistoms/templates/VISTOMS_sessions.html b/kadmos/vistoms/templates/VISTOMS_sessions.html
index ab7c672da..70762c897 100644
--- a/kadmos/vistoms/templates/VISTOMS_sessions.html
+++ b/kadmos/vistoms/templates/VISTOMS_sessions.html
@@ -18758,7 +18758,6 @@
 			//#####################################################################//
 			function startXDSM(data, graphID) 
 			{	
-
 				//Highlight function, that shows usage of a node in the XDSM
 				function highlight(data)
 				{
@@ -18773,18 +18772,23 @@
                             xdsm_tmp.svg.selectAll(".edge").each(function(p) 
                             {
                                 var firstElement_tmp = p.name.split("/")[1]
-                                var text_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
-                                if (include(p.name,text_fromFirst))
+                                var xPath_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
+                                var this_edge  = this
+                                var p_name_list = p.name.split(",")
+                                p_name_list.forEach(function(p_name) 
                                 {
-                                    var highlightEdge = d3.select(this).select("polygon");
-                                    highlightEdge
-                                        .style("stroke-width",5.)
-                                        .style("stroke","#CC0000")
-                                    d3.selectAll(".treeFrame")
-                                        .attr("fill-opacity", 0.5)
-                                        .attr("stroke-opacity", 0.5);
-                                    d3.selectAll(".nodeText").style("fill-opacity",0.5);
-                                }
+                                    if (include(p_name+"__",xPath_fromFirst+"__") || include(p_name,xPath_fromFirst+"/"))
+                                    {
+                                        var highlightEdge = d3.select(this_edge).select("polygon");
+                                        highlightEdge
+                                            .style("stroke-width",5.)
+                                            .style("stroke","#CC0000")
+                                        d3.selectAll(".treeFrame")
+                                            .attr("fill-opacity", 0.5)
+                                            .attr("stroke-opacity", 0.5);
+                                        d3.selectAll(".nodeText").style("fill-opacity",0.5);
+                                    }
+                                })
                             })
                         }
                     })
@@ -18805,18 +18809,23 @@
                             xdsm_tmp.svg.selectAll(".edge").each(function(p) 
                             {
                                 var firstElement_tmp = p.name.split("/")[1]
-                                var text_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
-                                if (include(p.name,text_fromFirst))
+                                var xPath_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
+                                var this_edge  = this
+                                var p_name_list = p.name.split(",")
+                                p_name_list.forEach(function(p_name) 
                                 {
-                                    var highlightEdge = d3.select(this).select("polygon");
-                                    highlightEdge
-                                        .style("stroke-width",1.)
-                                        .style("stroke","black");
-                                    d3.selectAll(".treeFrame")
-                                        .attr("fill-opacity", 0.8)
-                                        .attr("stroke-opacity", 0.8);
-                                    d3.selectAll(".nodeText").style("fill-opacity",1);
-                                }
+                                    if (include(p_name+"__",xPath_fromFirst+"__") || include(p_name,xPath_fromFirst+"/"))
+                                    {
+                                        var highlightEdge = d3.select(this_edge).select("polygon");
+                                        highlightEdge
+                                            .style("stroke-width",1.)
+                                            .style("stroke","black");
+                                        d3.selectAll(".treeFrame")
+                                            .attr("fill-opacity", 0.8)
+                                            .attr("stroke-opacity", 0.8);
+                                        d3.selectAll(".nodeText").style("fill-opacity",1);
+                                    }
+                                })
                             })
                         }
                     })
@@ -23562,15 +23571,22 @@
                             aLink.__data__.name += aLink.__data__.pipeDataName_out
                         }
                     })
-                                    
-                    //var allLinks_tmp = allLinks[0];
+                    
                     allLinks[0].forEach(function(p) {
                         var firstElement_tmp = p.__data__.name.split("/")[1]
-                        var text_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
-                        if (include(p.__data__.name,text_fromFirst))
+                        var xPath_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
+                        var p_name_list = p.__data__.name.split(",")
+                        var highlight_on = false
+                        p_name_list.forEach(function(p_name) 
+                        {
+                            if (include(p_name+"__",xPath_fromFirst+"__") || include(p_name,xPath_fromFirst+"/"))
+                            {                                
+                                highlight_on = true
+                            }
+                        })
+                        if (highlight_on)
                         {
-                            d3.select(p)
-                                .style("stroke-opacity", 1.0)
+                            d3.select(p).style("stroke-opacity", 1.5)
                         }
                         else
                         {
@@ -26595,25 +26611,25 @@
 			  });
 			  
                 
-                //Highlight function, that shows usage of a node in the XDSM
-                function highlight(data)
-                {
-                    xPath = data.xPath;
-                    var allLinks = d3.selectAll(".link");
-                    var allLinks_tmp = allLinks[0];
-                    allLinks_tmp.forEach(function(p) {
-                        var firstElement_tmp = p.__data__.name.split("/")[1]
-                        var text_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
-                        if (include(p.__data__.name,text_fromFirst))
-                        {
-                            d3.select(p).style("opacity", .8);			
-                        }
-                        else
-                        {
-                            d3.select(p).style("opacity", 0);			
-                        }
-                    });
-                }
+                <!-- //Highlight function, that shows usage of a node in the XDSM -->
+                <!-- function highlight(data) -->
+                <!-- { -->
+                    <!-- xPath = data.xPath; -->
+                    <!-- var allLinks = d3.selectAll(".link"); -->
+                    <!-- var allLinks_tmp = allLinks[0]; -->
+                    <!-- allLinks_tmp.forEach(function(p) { -->
+                        <!-- var firstElement_tmp = p.__data__.name.split("/")[1] -->
+                        <!-- var text_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1] -->
+                        <!-- if (include(p.__data__.name,text_fromFirst)) -->
+                        <!-- { -->
+                            <!-- d3.select(p).style("opacity", .8);			 -->
+                        <!-- } -->
+                        <!-- else -->
+                        <!-- { -->
+                            <!-- d3.select(p).style("opacity", 0);			 -->
+                        <!-- } -->
+                    <!-- }); -->
+                <!-- } -->
                 
                 function showVariableTable(aVariable)
                 {											
@@ -28093,8 +28109,17 @@
                     var allLinks_tmp = allLinks[0];
                     allLinks_tmp.forEach(function(p) {
                         var firstElement_tmp = p.__data__.name.split("/")[1]
-                        var text_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
-                        if (include(p.__data__.name,text_fromFirst))
+                        var xPath_fromFirst = "/"+firstElement_tmp+xPath.split(firstElement_tmp)[1]
+                        var p_name_list = p.__data__.name.split(",")
+                        var highlight_on = false
+                        p_name_list.forEach(function(p_name) 
+                        {
+                            if (include(p_name+"__",xPath_fromFirst+"__") || include(p_name,xPath_fromFirst+"/"))
+                            {
+                                highlight_on = true;
+                            }
+                        })
+                        if (highlight_on)
                         {
                             d3.select(p).style("opacity", .8);			
                         }
-- 
GitLab