aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--html/js/git-deps-data.coffee4
-rw-r--r--html/js/git-deps-graph.coffee12
-rw-r--r--html/js/git-deps-layout.coffee12
3 files changed, 14 insertions, 14 deletions
diff --git a/html/js/git-deps-data.coffee b/html/js/git-deps-data.coffee
index a8b0b51..1dbf0d1 100644
--- a/html/js/git-deps-data.coffee
+++ b/html/js/git-deps-data.coffee
@@ -28,7 +28,7 @@ add_node = (commit) ->
# Returns 1 iff a dependency was added, otherwise 0.
add_dependency = (parent_sha1, child_sha1) ->
deps[parent_sha1] = {} unless parent_sha1 of deps
-
+
# We've already got this link, presumably
# from a previous XHR.
return 0 if child_sha1 of deps[parent_sha1]
@@ -79,7 +79,7 @@ module.exports =
links: links
node_index: node_index
deps: deps
-
+
# Functions
add: add_data
node: node
diff --git a/html/js/git-deps-graph.coffee b/html/js/git-deps-graph.coffee
index 558d857..cb2044b 100644
--- a/html/js/git-deps-graph.coffee
+++ b/html/js/git-deps-graph.coffee
@@ -262,11 +262,11 @@ draw_nodes = (fg, node) ->
d.name
).each((d) ->
b = @getBBox()
-
+
# Calculate width/height of rectangle from text bounding box.
d.rect_width = b.width + 2 * PADDING
d.rect_height = b.height + 2 * PADDING
-
+
# Now set the node width/height as used by cola for
# positioning. This has to include the margin
# outside the rectangle.
@@ -280,7 +280,7 @@ position_nodes = (rect, label, tip) ->
.attr("height", (d, i) -> d.rect_height) \
.on("mouseover", tip.show) \
.on("mouseout", tip.hide)
-
+
# Centre label
label \
.attr("x", (d) -> d.rect_width / 2) \
@@ -317,7 +317,7 @@ tip_html = (d) ->
.attr("datetime", date.toISOString()) \
.text(date)
pre = top.find(".commit-body pre").text(d.body)
-
+
if options.debug
# deps = gdd.deps[d.sha1]
# if deps
@@ -328,7 +328,7 @@ tip_html = (d) ->
dagre_node = gdl.g.graph.node(d.sha1)
debug += "<br />dagre: (" + dagre_node.x + ", " + dagre_node.y + ")"
top.append debug
-
+
# Javascript *sucks*. There's no way to get the outerHTML of a
# document fragment, so you have to wrap the whole thing in a
# single parent and then look that up via children[0].
@@ -353,7 +353,7 @@ tick_handler = ->
@parentNode.insertBefore this, this if isIE()
path.attr "d", (d) ->
-
+
# Undocumented: https://github.com/tgdwyer/WebCola/issues/52
cola.vpsc.makeEdgeBetween \
d,
diff --git a/html/js/git-deps-layout.coffee b/html/js/git-deps-layout.coffee
index 8e88dde..26cf317 100644
--- a/html/js/git-deps-layout.coffee
+++ b/html/js/git-deps-layout.coffee
@@ -21,10 +21,10 @@ externs = {}
dagre_layout = ->
g = new dagre.graphlib.Graph()
externs.graph = g
-
+
# Set an object for the graph label
g.setGraph {}
-
+
# Default to assigning a new object as a label for each new edge.
g.setDefaultEdgeLabel -> {}
@@ -58,16 +58,16 @@ build_constraints = ->
row_groups = dagre_row_groups()
constraints.length = 0 # FIXME: only rebuild constraints which changed
-
+
# We want alignment constraints between all nodes which dagre
# assigned the same y value.
for y of row_groups
row_nodes = row_groups[y]
-
+
# No point having an alignment group with only one node in.
if row_nodes.length > 1
constraints.push build_alignment_constraint(row_nodes)
-
+
# We also need separation constraints ensuring that the
# top-to-bottom ordering assigned by dagre is preserved. Since
# all nodes within a single row are already constrained to the
@@ -110,7 +110,7 @@ module.exports =
# Variables
constraints: constraints
g: externs
-
+
# Functions
build_constraints: build_constraints
node: node