summaryrefslogtreecommitdiff
path: root/src/client/view
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-01-21 11:09:11 +0200
committerAlon Levy <alon@pobox.com>2015-01-21 11:09:11 +0200
commitc55b48924b50f49dd9be2ec16f8cd577a10d8e60 (patch)
tree11322c1187b387e02cc19d284f36942a0d220aae /src/client/view
parentd13fc826d1d422855979cb5a9d795cf4769fd486 (diff)
client/view/graph_view: add debugging helper to show diffs
Diffstat (limited to 'src/client/view')
-rw-r--r--src/client/view/graph_view.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/client/view/graph_view.js b/src/client/view/graph_view.js
index 075848fe..c9a63739 100644
--- a/src/client/view/graph_view.js
+++ b/src/client/view/graph_view.js
@@ -28,6 +28,25 @@
define(['d3', 'Bacon', 'util', 'view/selection', 'view/helpers', 'model/diff', 'view/view'],
function(d3 , Bacon , util , selection , view_helpers, model_diff , view) {
+/* debugging helper */
+function enableDebugViewOfDiffs(graph)
+{
+ var debugView = document.createElement('div');
+ document.body.appendChild(debugView);
+ debugView.style['pointer-events'] = 'none';
+ debugView.style.id = 'graphviewdiffdebug';
+ debugView.style.position = 'absolute';
+ debugView.style.left = '100px';
+ debugView.style.top = '100px';
+ debugView.innerHTML = '<div>debug view</div>';
+ debugView.append = function (diff) {
+ debugView.innerHTML = debugView.innerHTML + '<div>' + diff + '</div>';
+ }
+ graph.diffBus.onValue(function (diff) {
+ debugView.append(diff);
+ });
+}
+
/*
* Creates a new view on the given graph contained in an appended last child
* to the given parent node, parent