Permalink
Browse files

Working on JS graphs.

  • Loading branch information...
1 parent be4dce0 commit 63fa4d8da3bda1b275103acb66f33eb8cc380938 Nick DiRienzo committed Mar 22, 2012
Showing with 23 additions and 6 deletions.
  1. +0 −3 app.yaml
  2. +22 −1 index.html
  3. +1 −2 main.py
View
@@ -3,9 +3,6 @@ version: 1
runtime: python
api_version: 1
-#builtins:
-# - appstats: on
-
handlers:
- url: /css
static_dir: css
View
@@ -17,7 +17,7 @@
<div class="row-fluid">
<div class="span12">
<div class="well" style="height: 150px;">
- <h1>We'll put graphs here.</h1>
+ <div id="graph" style="width: 100%; height: 100%;"></div>
</div>
</div>
</div>
@@ -96,6 +96,8 @@
<script type="text/javascript" src="/_ah/channel/jsapi"></script>
<script type="text/javascript" src="/js/chosen.jquery.min.js"></script>
<script type="text/javascript" src="/js/flipcounter.min.js"></script>
+<script type="text/javascript" src="/js/jquery.flot.min.js"></script>
+<script type="text/javascript" src="/js/jquery.flot.pie.min.js"></script>
<script>
function onOpened() {
@@ -128,6 +130,25 @@
socket.onclose = onClose
commitCounter = new flipCounter('commit-counter', {value:0, inc:1, pace:600, auto:false});;
cursesCounter = new flipCounter('curses-counter', {value:0, inc:1, pace:600, auto:false});
+ var data = [
+ { data: 10},
+ { data: 30},
+ { data: 90},
+ { data: 70},
+ { data: 80},
+ { data: 110}
+ ];
+ var data = [
+ {data: [[1,300], [2,300], [3,300], [4,300], [5,300]]},
+ ];
+ var options = {
+ series: {stack: 0,
+ lines: {show: false, steps: false },
+ bars: {show: true, barWidth: 0.9, align: 'center',},},
+ xaxis: {ticks: [[1,'One'], [2,'Two'], [3,'Three'], [4,'Four'], [5,'Five']]},
+ };
+
+ $.plot($("#graph"), data, options);
});
</script>
View
@@ -137,7 +137,7 @@ def fromJSON(repo, json):
class GlobalMetric(db.Model):
nature = db.StringProperty() # commit or curse
count = db.IntegerProperty()
-
+
class RepoMetric(db.Model):
url = db.StringProperty()
count = db.IntegerProperty()
@@ -223,7 +223,6 @@ def post(self):
cmt.num_curses = total_curses_used
updated_entries.append(cmt)
-
query = GlobalMetric.all().filter("nature = ", "commit").get()
if not query:
query = GlobalMetric(nature="commit", count=1)

0 comments on commit 63fa4d8

Please sign in to comment.