Skip to content

Commit

Permalink
Populate dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
steveyen committed Jan 12, 2012
1 parent b938b92 commit 2e70d39
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions body.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,29 @@

<h1>hello world</h1>
<canvas id="c" width="800" height="400"></canvas>
<select id="key_select"></select>
<script>
function graph_all(path_stat) {
var seen = {};
var keys = [];
for (var path in path_stat) {
var stat = path_stat[path];
for (var key in stat.keys) {
var key_stat = stat.keys[key];
if (key_stat.type == "number") {
graph(path, key, stat);
if (key_stat.type == "number" && !seen[key]) {
seen[key] = true;
keys.push(key);
}
}
}
keys.sort();
for (var i in keys) {
keys[i] = "<option>" + keys[i] + "</option>";
}
$('#key_select').html(keys.join(''));
}

function graph(path, key) {
console.log(path + ' ' + key);

function graph(key) {
var cvs = document.getElementById("c");
var ctx = cvs.getContext("2d");

Expand Down

0 comments on commit 2e70d39

Please sign in to comment.