From c55b48924b50f49dd9be2ec16f8cd577a10d8e60 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Wed, 21 Jan 2015 11:09:11 +0200 Subject: client/view/graph_view: add debugging helper to show diffs --- src/client/view/graph_view.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/client/view') 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 = '
debug view
'; + debugView.append = function (diff) { + debugView.innerHTML = debugView.innerHTML + '
' + diff + '
'; + } + 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 -- cgit v1.3.1