{"action":"created","comment":{"url":"https://api.github.com/repos/seadsystem/website/pulls/comments/46088307","id":46088307,"diff_hunk":"@@ -0,0 +1,752 @@\n+{% extends \"base.html\" %}\n+{% load staticfiles %}\n+{% block content %}\n+\n+<html>\n+<meta charset=\"utf-8\">\n+  <head>\n+    <style>\n+\n+    .wrap{\n+      text-align: center;\n+    }\n+    .btn-lg{\n+      display: inline;\n+\n+    }\n+    .option{\n+      display:inline;\n+    }\n+\n+    body {\n+      font: 10px sans-serif;\n+    }\n+\n+    .axis path,\n+    .axis line {\n+      fill: none;\n+      stroke: #000;\n+      shape-rendering: crispEdges;\n+    }\n+\n+    .x.axis path {\n+      display: none;\n+    }\n+\n+    .line {\n+      fill: none;\n+      stroke: steelblue;\n+      stroke-width: 1.5px;\n+    }\n+    .d3-tip {\n+  line-height: 1;\n+  font-weight: bold;\n+  padding: 12px;\n+  background: rgba(0, 0, 0, 0.8);\n+  color: #fff;\n+  border-radius: 2px;\n+}\n+    </style>\n+  </head>\n+\n+  <body>\n+\n+\n+  <div class=\"wrap\">\n+    <div class = \"btn-lg\" id=\"device-1\">\n+        <input name=\"device 1\"\n+               type=\"button\"\n+               value=\"device 1\"\n+               onclick=\"Start()\" />\n+    </div>\n+\n+    <div class = \"btn-lg\" id=\"device-2\">\n+        <input name=\"device 2\"\n+               type=\"button\"\n+               value=\"device 2\"\n+               onclick=\"Start()\" />\n+    </div>\n+\n+    <br>\n+\n+    <div class = \"btn\" id=\"daily\" title=\"View Daily Energy Usage\">\n+        <input name=\"Daily Usage\"\n+               type=\"button\"\n+               value=\"Daily Usage\"\n+               onclick=\"Daily()\" />\n+    </div>\n+\n+    <div class = \"btn\" id=\"continuous\" title=\"View Minute-by-Minute Energy Usage\">\n+        <input name=\"Daily Usage\"\n+               type=\"button\"\n+               value=\"Continuous Usage\"\n+               onclick=\"Continuous()\" />\n+    </div>\n+\n+  </div>\n+\n+    <br>\n+    <br>\n+\n+\n+<div class=\"wrap\">\n+    <label for=\"from\">From</label>\n+    <input type=\"text\" class=\"form-inline\" id=\"from\" name=\"from\">\n+    <label for=\"to\">to</label>\n+    <input type=\"text\" class=\"form-inline\" id=\"to\" name=\"to\">\n+\n+    <div class = \"DateRange\" id=\"DateRange\">\n+        <input name=\"getRange\"\n+               type=\"button\"\n+               value=\"Graph Daily Data\"\n+               onclick=\"BStart()\" />\n+    </div>\n+    <div class = \"DateRangeCont\" id=\"DateRangeCont\">\n+        <input name=\"getRangeCont\"\n+               type=\"button\"\n+               value=\"Graph Continuous Data\"\n+               onclick=\"CStart()\" />\n+    </div>\n+</div>\n+\n+    <script src=\"http://d3js.org/d3.v3.js\"></script>\n+    <script src=\"http://labratrevenge.com/d3-tip/javascripts/d3.tip.v0.6.3.js\"></script>\n+    <script>\n+\n+    $('label[for=\"from\"]').hide();\n+    $('label[for=\"to\"]').hide();\n+    $('#from').hide();\n+    $('#to').hide();\n+    $('#DateRange').hide();\n+    $('#DateRangeCont').hide();\n+\n+    $('#daily').hide();\n+    $('#continuous').hide();\n+\n+    var daily = false;\n+    var continuous = false;\n+\n+    function Start(){\n+        var url_min = Get_Minute();\n+      //var url = Refresh();\n+      //console.log(url);\n+      $('label[for=\"from\"]').hide(500);\n+      $('label[for=\"to\"]').hide(500);\n+      $('#from').hide(500);\n+      $('#to').hide(500);\n+      $('#DateRange').hide(500);\n+      $('#DateRangeCont').hide(500);\n+\n+      $('#daily').show(500);\n+      $('#continuous').show(500);\n+\n+      var svg = d3.select(\"body\");\n+      svg.selectAll(\"svg\").remove();\n+\n+      daily = false;\n+      continuous = false;\n+\n+      d3.json(url_min, function(error, min_data){\n+         console.log(min_data);\n+      });\n+    }\n+\n+    function BStart(){\n+        var url_gen = Get_Generated();\n+        var url_cons = Get_Consumed();\n+        var url_min = Get_Minute();\n+\n+        var margin = {top: 20, right: 20, bottom: 70, left: 40},\n+            width = 600 - margin.left - margin.right,\n+            height = 300 - margin.top - margin.bottom;\n+\n+        // Parse the date / time\n+        var\tparseDate = d3.time.format(\"%Y-%m-%d %H:%M:%S\").parse;\n+\n+        var x = d3.scale.ordinal().rangeRoundBands([0, width], .05);\n+        var y = d3.scale.linear().range([height, 0]);\n+\n+        var xAxis = d3.svg.axis()\n+            .scale(x)\n+            .orient(\"bottom\")\n+            .tickFormat(d3.time.format(\"%Y-%m-%d\"));\n+\n+        var yAxis = d3.svg.axis()\n+            .scale(y)\n+            .orient(\"left\")\n+            .ticks(10);\n+\n+        var svg = d3.select(\"body\");\n+\n+/*","path":"seadssite/templates/graph.html","position":181,"original_position":181,"commit_id":"18f3c458bd8f567ba3b14fd4ffa0f70c7f02bb55","original_commit_id":"18f3c458bd8f567ba3b14fd4ffa0f70c7f02bb55","user":{"login":"iangudger","id":7056530,"avatar_url":"https://avatars.githubusercontent.com/u/7056530?v=3","gravatar_id":"","url":"https://api.github.com/users/iangudger","html_url":"https://github.com/iangudger","followers_url":"https://api.github.com/users/iangudger/followers","following_url":"https://api.github.com/users/iangudger/following{/other_user}","gists_url":"https://api.github.com/users/iangudger/gists{/gist_id}","starred_url":"https://api.github.com/users/iangudger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iangudger/subscriptions","organizations_url":"https://api.github.com/users/iangudger/orgs","repos_url":"https://api.github.com/users/iangudger/repos","events_url":"https://api.github.com/users/iangudger/events{/privacy}","received_events_url":"https://api.github.com/users/iangudger/received_events","type":"User","site_admin":false},"body":"Please removed commented out code.","created_at":"2015-11-29T06:48:03Z","updated_at":"2015-11-29T06:48:03Z","html_url":"https://github.com/seadsystem/website/pull/5#discussion_r46088307","pull_request_url":"https://api.github.com/repos/seadsystem/website/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/seadsystem/website/pulls/comments/46088307"},"html":{"href":"https://github.com/seadsystem/website/pull/5#discussion_r46088307"},"pull_request":{"href":"https://api.github.com/repos/seadsystem/website/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/seadsystem/website/pulls/5","id":52053245,"html_url":"https://github.com/seadsystem/website/pull/5","diff_url":"https://github.com/seadsystem/website/pull/5.diff","patch_url":"https://github.com/seadsystem/website/pull/5.patch","issue_url":"https://api.github.com/repos/seadsystem/website/issues/5","number":5,"state":"open","locked":false,"title":"Visualizations","user":{"login":"mstirchak","id":11304565,"avatar_url":"https://avatars.githubusercontent.com/u/11304565?v=3","gravatar_id":"","url":"https://api.github.com/users/mstirchak","html_url":"https://github.com/mstirchak","followers_url":"https://api.github.com/users/mstirchak/followers","following_url":"https://api.github.com/users/mstirchak/following{/other_user}","gists_url":"https://api.github.com/users/mstirchak/gists{/gist_id}","starred_url":"https://api.github.com/users/mstirchak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mstirchak/subscriptions","organizations_url":"https://api.github.com/users/mstirchak/orgs","repos_url":"https://api.github.com/users/mstirchak/repos","events_url":"https://api.github.com/users/mstirchak/events{/privacy}","received_events_url":"https://api.github.com/users/mstirchak/received_events","type":"User","site_admin":false},"body":"Usage: run the django project, and go to localhost:8000/graph.\r\n\r\nGenerates D3 graphs of db.sead.systems data. Currently, there are two Device buttons, but there is only one working seads device so they both connect to it. Clicking on either Device 1 or Device 2 will allow you to see Daily or Continuous data from the device. Clicking Daily will generate a bar graph with daily power usage/generation, and clicking Continuous will generate a line chart with minute-by-minute power data. The date range for both options can be manually set.\r\n\r\nKnown bugs: data is taken directly from db.sead.systems, and the server has been on the fritz lately. You may get a network_timed_out error.\r\n\r\nAlso, the transitions for the Daily bar graphs is bugged. Expanding the date range will not create bars for the new date points. This will be fixed in the next commit. Hopefully.","created_at":"2015-11-29T02:40:59Z","updated_at":"2015-11-29T06:48:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f7a48d3c9561188ca0f449386d8ad77e8a737191","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/seadsystem/website/pulls/5/commits","review_comments_url":"https://api.github.com/repos/seadsystem/website/pulls/5/comments","review_comment_url":"https://api.github.com/repos/seadsystem/website/pulls/comments{/number}","comments_url":"https://api.github.com/repos/seadsystem/website/issues/5/comments","statuses_url":"https://api.github.com/repos/seadsystem/website/statuses/18f3c458bd8f567ba3b14fd4ffa0f70c7f02bb55","head":{"label":"seadsystem:visualizations","ref":"visualizations","sha":"18f3c458bd8f567ba3b14fd4ffa0f70c7f02bb55","user":{"login":"seadsystem","id":7507257,"avatar_url":"https://avatars.githubusercontent.com/u/7507257?v=3","gravatar_id":"","url":"https://api.github.com/users/seadsystem","html_url":"https://github.com/seadsystem","followers_url":"https://api.github.com/users/seadsystem/followers","following_url":"https://api.github.com/users/seadsystem/following{/other_user}","gists_url":"https://api.github.com/users/seadsystem/gists{/gist_id}","starred_url":"https://api.github.com/users/seadsystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seadsystem/subscriptions","organizations_url":"https://api.github.com/users/seadsystem/orgs","repos_url":"https://api.github.com/users/seadsystem/repos","events_url":"https://api.github.com/users/seadsystem/events{/privacy}","received_events_url":"https://api.github.com/users/seadsystem/received_events","type":"Organization","site_admin":false},"repo":{"id":44074043,"name":"website","full_name":"seadsystem/website","owner":{"login":"seadsystem","id":7507257,"avatar_url":"https://avatars.githubusercontent.com/u/7507257?v=3","gravatar_id":"","url":"https://api.github.com/users/seadsystem","html_url":"https://github.com/seadsystem","followers_url":"https://api.github.com/users/seadsystem/followers","following_url":"https://api.github.com/users/seadsystem/following{/other_user}","gists_url":"https://api.github.com/users/seadsystem/gists{/gist_id}","starred_url":"https://api.github.com/users/seadsystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seadsystem/subscriptions","organizations_url":"https://api.github.com/users/seadsystem/orgs","repos_url":"https://api.github.com/users/seadsystem/repos","events_url":"https://api.github.com/users/seadsystem/events{/privacy}","received_events_url":"https://api.github.com/users/seadsystem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/seadsystem/website","description":"","fork":false,"url":"https://api.github.com/repos/seadsystem/website","forks_url":"https://api.github.com/repos/seadsystem/website/forks","keys_url":"https://api.github.com/repos/seadsystem/website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seadsystem/website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seadsystem/website/teams","hooks_url":"https://api.github.com/repos/seadsystem/website/hooks","issue_events_url":"https://api.github.com/repos/seadsystem/website/issues/events{/number}","events_url":"https://api.github.com/repos/seadsystem/website/events","assignees_url":"https://api.github.com/repos/seadsystem/website/assignees{/user}","branches_url":"https://api.github.com/repos/seadsystem/website/branches{/branch}","tags_url":"https://api.github.com/repos/seadsystem/website/tags","blobs_url":"https://api.github.com/repos/seadsystem/website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seadsystem/website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seadsystem/website/git/refs{/sha}","trees_url":"https://api.github.com/repos/seadsystem/website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seadsystem/website/statuses/{sha}","languages_url":"https://api.github.com/repos/seadsystem/website/languages","stargazers_url":"https://api.github.com/repos/seadsystem/website/stargazers","contributors_url":"https://api.github.com/repos/seadsystem/website/contributors","subscribers_url":"https://api.github.com/repos/seadsystem/website/subscribers","subscription_url":"https://api.github.com/repos/seadsystem/website/subscription","commits_url":"https://api.github.com/repos/seadsystem/website/commits{/sha}","git_commits_url":"https://api.github.com/repos/seadsystem/website/git/commits{/sha}","comments_url":"https://api.github.com/repos/seadsystem/website/comments{/number}","issue_comment_url":"https://api.github.com/repos/seadsystem/website/issues/comments{/number}","contents_url":"https://api.github.com/repos/seadsystem/website/contents/{+path}","compare_url":"https://api.github.com/repos/seadsystem/website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seadsystem/website/merges","archive_url":"https://api.github.com/repos/seadsystem/website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seadsystem/website/downloads","issues_url":"https://api.github.com/repos/seadsystem/website/issues{/number}","pulls_url":"https://api.github.com/repos/seadsystem/website/pulls{/number}","milestones_url":"https://api.github.com/repos/seadsystem/website/milestones{/number}","notifications_url":"https://api.github.com/repos/seadsystem/website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seadsystem/website/labels{/name}","releases_url":"https://api.github.com/repos/seadsystem/website/releases{/id}","created_at":"2015-10-11T23:41:56Z","updated_at":"2015-10-12T00:12:11Z","pushed_at":"2015-11-29T02:40:59Z","git_url":"git://github.com/seadsystem/website.git","ssh_url":"git@github.com:seadsystem/website.git","clone_url":"https://github.com/seadsystem/website.git","svn_url":"https://github.com/seadsystem/website","homepage":null,"size":3576,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"seadsystem:master","ref":"master","sha":"f5b3d295d550d4ed58933b1a270a1619f5842464","user":{"login":"seadsystem","id":7507257,"avatar_url":"https://avatars.githubusercontent.com/u/7507257?v=3","gravatar_id":"","url":"https://api.github.com/users/seadsystem","html_url":"https://github.com/seadsystem","followers_url":"https://api.github.com/users/seadsystem/followers","following_url":"https://api.github.com/users/seadsystem/following{/other_user}","gists_url":"https://api.github.com/users/seadsystem/gists{/gist_id}","starred_url":"https://api.github.com/users/seadsystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seadsystem/subscriptions","organizations_url":"https://api.github.com/users/seadsystem/orgs","repos_url":"https://api.github.com/users/seadsystem/repos","events_url":"https://api.github.com/users/seadsystem/events{/privacy}","received_events_url":"https://api.github.com/users/seadsystem/received_events","type":"Organization","site_admin":false},"repo":{"id":44074043,"name":"website","full_name":"seadsystem/website","owner":{"login":"seadsystem","id":7507257,"avatar_url":"https://avatars.githubusercontent.com/u/7507257?v=3","gravatar_id":"","url":"https://api.github.com/users/seadsystem","html_url":"https://github.com/seadsystem","followers_url":"https://api.github.com/users/seadsystem/followers","following_url":"https://api.github.com/users/seadsystem/following{/other_user}","gists_url":"https://api.github.com/users/seadsystem/gists{/gist_id}","starred_url":"https://api.github.com/users/seadsystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seadsystem/subscriptions","organizations_url":"https://api.github.com/users/seadsystem/orgs","repos_url":"https://api.github.com/users/seadsystem/repos","events_url":"https://api.github.com/users/seadsystem/events{/privacy}","received_events_url":"https://api.github.com/users/seadsystem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/seadsystem/website","description":"","fork":false,"url":"https://api.github.com/repos/seadsystem/website","forks_url":"https://api.github.com/repos/seadsystem/website/forks","keys_url":"https://api.github.com/repos/seadsystem/website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seadsystem/website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seadsystem/website/teams","hooks_url":"https://api.github.com/repos/seadsystem/website/hooks","issue_events_url":"https://api.github.com/repos/seadsystem/website/issues/events{/number}","events_url":"https://api.github.com/repos/seadsystem/website/events","assignees_url":"https://api.github.com/repos/seadsystem/website/assignees{/user}","branches_url":"https://api.github.com/repos/seadsystem/website/branches{/branch}","tags_url":"https://api.github.com/repos/seadsystem/website/tags","blobs_url":"https://api.github.com/repos/seadsystem/website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seadsystem/website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seadsystem/website/git/refs{/sha}","trees_url":"https://api.github.com/repos/seadsystem/website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seadsystem/website/statuses/{sha}","languages_url":"https://api.github.com/repos/seadsystem/website/languages","stargazers_url":"https://api.github.com/repos/seadsystem/website/stargazers","contributors_url":"https://api.github.com/repos/seadsystem/website/contributors","subscribers_url":"https://api.github.com/repos/seadsystem/website/subscribers","subscription_url":"https://api.github.com/repos/seadsystem/website/subscription","commits_url":"https://api.github.com/repos/seadsystem/website/commits{/sha}","git_commits_url":"https://api.github.com/repos/seadsystem/website/git/commits{/sha}","comments_url":"https://api.github.com/repos/seadsystem/website/comments{/number}","issue_comment_url":"https://api.github.com/repos/seadsystem/website/issues/comments{/number}","contents_url":"https://api.github.com/repos/seadsystem/website/contents/{+path}","compare_url":"https://api.github.com/repos/seadsystem/website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seadsystem/website/merges","archive_url":"https://api.github.com/repos/seadsystem/website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seadsystem/website/downloads","issues_url":"https://api.github.com/repos/seadsystem/website/issues{/number}","pulls_url":"https://api.github.com/repos/seadsystem/website/pulls{/number}","milestones_url":"https://api.github.com/repos/seadsystem/website/milestones{/number}","notifications_url":"https://api.github.com/repos/seadsystem/website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seadsystem/website/labels{/name}","releases_url":"https://api.github.com/repos/seadsystem/website/releases{/id}","created_at":"2015-10-11T23:41:56Z","updated_at":"2015-10-12T00:12:11Z","pushed_at":"2015-11-29T02:40:59Z","git_url":"git://github.com/seadsystem/website.git","ssh_url":"git@github.com:seadsystem/website.git","clone_url":"https://github.com/seadsystem/website.git","svn_url":"https://github.com/seadsystem/website","homepage":null,"size":3576,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/seadsystem/website/pulls/5"},"html":{"href":"https://github.com/seadsystem/website/pull/5"},"issue":{"href":"https://api.github.com/repos/seadsystem/website/issues/5"},"comments":{"href":"https://api.github.com/repos/seadsystem/website/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/seadsystem/website/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/seadsystem/website/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/seadsystem/website/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/seadsystem/website/statuses/18f3c458bd8f567ba3b14fd4ffa0f70c7f02bb55"}}}}