Skip to content

Commit 8e15455

Browse files
committed
update to work with latest upstream WebCola
- import latest git master tgdwyer/WebCola#203 (comment) - use hacky workaround for d3 import tgdwyer/WebCola#145 (comment) - update for new makeEdgeBetween API
1 parent b71f990 commit 8e15455

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

html/git-deps.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<meta charset="utf-8" />
66
<title>git commit dependency graph</title>
77

8-
<script language="javascript" type="text/javascript" src="node_modules/webcola/WebCola/cola.min.js"></script>
98
<script language="javascript" type="text/javascript" src="js/bundle.js"></script>
109

1110
<link rel="stylesheet" type="text/css" href="css/animate.css" />

html/js/git-deps-graph.coffee

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ d3 = require "d3"
44
d3tip = require "d3-tip"
55
d3tip d3
66

7+
# Hacky workaround:
8+
# https://github.com/tgdwyer/WebCola/issues/145#issuecomment-271316856
9+
window.d3 = d3
10+
11+
cola = require "webcola"
12+
713
global.gdn = require "./git-deps-noty.coffee"
814
global.gdd = require "./git-deps-data.coffee"
915
global.gdl = require "./git-deps-layout.coffee"
@@ -548,17 +554,16 @@ tick_handler = ->
548554

549555
paths.attr "d", (d) ->
550556
# Undocumented: https://github.com/tgdwyer/WebCola/issues/52
551-
cola.vpsc.makeEdgeBetween \
552-
d,
557+
route = cola.makeEdgeBetween \
553558
d.source.innerBounds,
554559
d.target.innerBounds,
555560
# This value is related to but not equal to the
556561
# distance of arrow tip from object it points at:
557562
5
558563

559564
lineData = [
560-
{x: d.sourceIntersection.x, y: d.sourceIntersection.y},
561-
{x: d.arrowStart.x, y: d.arrowStart.y}
565+
{x: route.sourceIntersection.x, y: route.sourceIntersection.y},
566+
{x: route.arrowStart.x, y: route.arrowStart.y}
562567
]
563568
return lineFunction lineData
564569

html/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"dependencies": {
2828
"d3-tip": "~0.6.6",
2929
"d3": "~3.5.3",
30-
"webcola": "aspiers/WebCola#fix-commonjs",
30+
"webcola": "aspiers/WebCola#git-deps-master",
3131
"jquery": "~2.1.3",
3232
"noty": "needim/noty",
3333
"browserify": "*",

0 commit comments

Comments
 (0)