From ba14852b4ba7a1fb5cc1a9ded34a29a9691ce11f Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 6 Jun 2012 15:18:09 +0200 Subject: [PATCH] simple auto update --- html/force.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/html/force.js b/html/force.js index 60d2332..963f413 100644 --- a/html/force.js +++ b/html/force.js @@ -18,6 +18,8 @@ var w = window.innerWidth - offset.left, var cp = d3.select("#chart").append("div") .attr("id", "controlpanel") +var updated_at = cp.append("p") + cp.append("button") .attr("class", "btn") .attr("value", "reload") @@ -247,6 +249,8 @@ function reload() { data = json + updated_at.text(d3.time.format("%X")(new Date())) + update() }) } @@ -402,3 +406,5 @@ function update() { } reload() + +var timer = window.setInterval(reload, 30000)