Styles on links

This commit is contained in:
knsv
2014-11-26 20:47:22 +01:00
parent 8e591c0494
commit d52224194c
8 changed files with 239 additions and 205 deletions

View File

@@ -100,13 +100,20 @@ var addEdges = function (edges, g) {
aHead = 'vee';
}
var style = '';
if(typeof edge.style !== 'undefined'){
edge.style.forEach(function(s){
style = style + s +';';
});
}
// Add the edge to the graph
if (typeof edge.text === 'undefined') {
if(typeof edge.style === 'undefined'){
g.setEdge(edge.start, edge.end,{ style: "stroke: #333; stroke-width: 1.5px;fill:none", arrowheadStyle: "fill: #333", arrowhead: aHead},cnt);
}else{
g.setEdge(edge.start, edge.end, {
style: edge.style, arrowheadStyle: "fill: #333", arrowhead: aHead
style: style, arrowheadStyle: "fill: #333", arrowhead: aHead
},cnt);
}
}
@@ -116,9 +123,8 @@ var addEdges = function (edges, g) {
if(typeof edge.style === 'undefined'){
g.setEdge(edge.start, edge.end,{labelType: "html",style: "stroke: #333; stroke-width: 1.5px;fill:none", labelpos:'c', label: '<span style="background:#e8e8e8">'+edge.text+'</span>', arrowheadStyle: "fill: #333", arrowhead: aHead},cnt);
}else{
g.setEdge(edge.start, edge.end, {
labelType: "html",style: edge.style, arrowheadStyle: "fill: #333", label: edge.text, arrowhead: aHead
labelType: "html",style: style, arrowheadStyle: "fill: #333", label: edge.text, arrowhead: aHead
},cnt);
}
}