aboutsummaryrefslogtreecommitdiffstats
path: root/html
diff options
context:
space:
mode:
authorAdam Spiers <git@adamspiers.org>2017-01-09 15:51:17 +0000
committerAdam Spiers <git@adamspiers.org>2017-01-09 16:01:20 +0000
commit8e1545564aaebbf95401db74a2d421f6d442c731 (patch)
treefbb9ebc70b1ed6319f5f2a21ec96c86cb4e5fb6e /html
parentb71f99002947fa1f66578e84c362427594324235 (diff)
downloadgit-deps-8e1545564aaebbf95401db74a2d421f6d442c731.tar.gz
update to work with latest upstream WebCola
- import latest git master https://github.com/tgdwyer/WebCola/issues/203#issuecomment-271311782 - use hacky workaround for d3 import https://github.com/tgdwyer/WebCola/issues/145#issuecomment-271316856 - update for new makeEdgeBetween API
Diffstat (limited to 'html')
-rw-r--r--html/git-deps.html1
-rw-r--r--html/js/git-deps-graph.coffee13
-rw-r--r--html/package.json2
3 files changed, 10 insertions, 6 deletions
diff --git a/html/git-deps.html b/html/git-deps.html
index 848ccad..6ced12b 100644
--- a/html/git-deps.html
+++ b/html/git-deps.html
@@ -5,7 +5,6 @@
<meta charset="utf-8" />
<title>git commit dependency graph</title>
- <script language="javascript" type="text/javascript" src="node_modules/webcola/WebCola/cola.min.js"></script>
<script language="javascript" type="text/javascript" src="js/bundle.js"></script>
<link rel="stylesheet" type="text/css" href="css/animate.css" />
diff --git a/html/js/git-deps-graph.coffee b/html/js/git-deps-graph.coffee
index 299ed0b..7ad6827 100644
--- a/html/js/git-deps-graph.coffee
+++ b/html/js/git-deps-graph.coffee
@@ -4,6 +4,12 @@ d3 = require "d3"
d3tip = require "d3-tip"
d3tip d3
+# Hacky workaround:
+# https://github.com/tgdwyer/WebCola/issues/145#issuecomment-271316856
+window.d3 = d3
+
+cola = require "webcola"
+
global.gdn = require "./git-deps-noty.coffee"
global.gdd = require "./git-deps-data.coffee"
global.gdl = require "./git-deps-layout.coffee"
@@ -548,8 +554,7 @@ tick_handler = ->
paths.attr "d", (d) ->
# Undocumented: https://github.com/tgdwyer/WebCola/issues/52
- cola.vpsc.makeEdgeBetween \
- d,
+ route = cola.makeEdgeBetween \
d.source.innerBounds,
d.target.innerBounds,
# This value is related to but not equal to the
@@ -557,8 +562,8 @@ tick_handler = ->
5
lineData = [
- {x: d.sourceIntersection.x, y: d.sourceIntersection.y},
- {x: d.arrowStart.x, y: d.arrowStart.y}
+ {x: route.sourceIntersection.x, y: route.sourceIntersection.y},
+ {x: route.arrowStart.x, y: route.arrowStart.y}
]
return lineFunction lineData
diff --git a/html/package.json b/html/package.json
index 0131fcc..4a7c10d 100644
--- a/html/package.json
+++ b/html/package.json
@@ -27,7 +27,7 @@
"dependencies": {
"d3-tip": "~0.6.6",
"d3": "~3.5.3",
- "webcola": "aspiers/WebCola#fix-commonjs",
+ "webcola": "aspiers/WebCola#git-deps-master",
"jquery": "~2.1.3",
"noty": "needim/noty",
"browserify": "*",