Skip to content

Commit

Permalink
Instead of lines between edges, use paths.
Browse files Browse the repository at this point in the history
For each link/edge between nodes, calculate a linknum. This is used to
adjust the arc between nodes so that multiple edges between nodes don't
overlap.

in graphConf there's a use_curved_edges variable. Setting to true will
enable curved edges.

Tweaked the CSS so that paths display and aren't filled.

I also auto-linted graph_viz.js at some point which made a bunch of
spacing changes, didn't realize at the time that this might be an issue.
  • Loading branch information
agussman committed Oct 21, 2018
1 parent 9a8eecc commit 48a98c6
Show file tree
Hide file tree
Showing 4 changed files with 218 additions and 175 deletions.
8 changes: 7 additions & 1 deletion css/graphStyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,18 @@
fill: none;
pointer-events: all;
}
/*

.links line {
stroke: #999;
stroke-opacity: 0.6;
}

path {
fill: none;
}

/*
.nodes circle {
stroke: #fff;
stroke-width: 1.5px;
Expand Down
1 change: 1 addition & 0 deletions scripts/graphConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ const node_position_y = 'graphexpy'
const default_edge_stroke_width = 3;
const default_edge_color = "#CCC";
const edge_label_color = "#111";
const use_curved_edges = true;
2 changes: 1 addition & 1 deletion scripts/graphShapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ var graphShapes = (function(){

function decorate_link(edges,edgepaths,edgelabels){

var edges_deco = edges.append("line").attr("class", "edge").classed("active_edge",true)
var edges_deco = edges.append("path").attr("class", "edge").classed("active_edge",true)
.attr("source_ID",function(d) { return d.source;})
.attr("target_ID",function(d) { return d.target;})
.attr("ID",function(d) { return d.id;});
Expand Down
Loading

0 comments on commit 48a98c6

Please sign in to comment.