diff options
-rw-r--r-- | html/js/git-deps-graph.js | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/html/js/git-deps-graph.js b/html/js/git-deps-graph.js index 45772f5..a50840b 100644 --- a/html/js/git-deps-graph.js +++ b/html/js/git-deps-graph.js @@ -161,17 +161,7 @@ function draw_graph(commitish) { .symmetricDiffLinkLengths(30); //.jaccardLinkLengths(100); - // define arrow markers for graph links - fg.append('svg:defs').append('svg:marker') - .attr('id', 'end-arrow') - .attr('viewBox', '0 -5 10 10') - .attr('refX', 6) - .attr('markerWidth', 8) - .attr('markerHeight', 8) - .attr('orient', 'auto') - .append('svg:path') - .attr('d', 'M0,-5L10,0L0,5') - .attr('fill', '#000'); + define_arrow_markers(fg); path = fg.selectAll(".link") .data(links, function (d) { @@ -192,6 +182,20 @@ function draw_graph(commitish) { }); } +function define_arrow_markers(fg) { + // define arrow markers for graph links + fg.append('svg:defs').append('svg:marker') + .attr('id', 'end-arrow') + .attr('viewBox', '0 -5 10 10') + .attr('refX', 6) + .attr('markerWidth', 8) + .attr('markerHeight', 8) + .attr('orient', 'auto') + .append('svg:path') + .attr('d', 'M0,-5L10,0L0,5') + .attr('fill', '#000'); +} + function draw_nodes(fg, node) { // Initialize tooltip tip = d3.tip().attr('class', 'd3-tip').html(tip_html); |