{"action":"created","comment":{"url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/pulls/comments/74044030","id":74044030,"diff_hunk":"@@ -37,36 +99,117 @@ function BadChartError(message) {\n }\n \n BadChartError.prototype = Object.create(Error.prototype);\n-BadChartError.prototype.name = \"BadChartError\";\n BadChartError.prototype.constructor = BadChartError;\n \n function size(ar){\n     var row_count = ar.length;\n     var row_sizes = []\n     for(var i=0;i<row_count;i++){\n-        row_sizes.push(ar[i].length)\n+        row_sizes.push(ar[i].length);\n     }\n-    if(Math.min.apply(null, row_sizes) != Math.max.apply(null, row_sizes)) throw new BadChartError(\"\")\n-    return [row_count, Math.min.apply(null, row_sizes)]\n+    if(Math.min.apply(null, row_sizes) != Math.max.apply(null, row_sizes))\n+        throw new BadChartError(\"All chart rows are not equal length.\");\n+    return [row_count, Math.min.apply(null, row_sizes)];\n }\n-*/\n \n function ValidateData(inputString) {\n-    //TODO\n     try {\n         parsedString = JSON.parse(inputString);\n     } catch (e) {\n         throw e;\n     }\n+    chartDimensions = size(parsedString);\n+    if (chartDimensions[0] < 2) throw new BadChartError(\"The chart requires more than one row.\")\n     return inputString;\n }\n \n-function ValidateType(inputString) {\n-    //TODO\n+function ValidateType(inputString, chartTypes) {\n+    if(chartTypes.indexOf(inputString) == -1 ) throw new BadChartError(\"Using an unsupported chart type.\");\n     return inputString;\n }\n \n function ValidateName(inputString) {\n-    //TODO\n+    if(inputString.length < 1) throw new BadChartError(\"Chart name is empty.\");\n     return inputString;\n }\n+\n+function ChartTable(targetDiv, inputJSON){\n+    this.data = JSON.parse(inputJSON);\n+    this.rows = this.data.length;\n+    this.columns = this.data[0].length;\n+    this.div = targetDiv;\n+\n+    this.draw = function() {\n+    // Draws the table in a div\n+        for (i = 0; i < this.data.length; i++) {","path":"chartsxblock/static/js/src/chartsxblock-studio.js","position":157,"original_position":157,"commit_id":"32d5d49382d03f26b9983838493f3d7d0fb12ab7","original_commit_id":"32d5d49382d03f26b9983838493f3d7d0fb12ab7","user":{"login":"vkaracic","id":2808092,"avatar_url":"https://avatars.githubusercontent.com/u/2808092?v=3","gravatar_id":"","url":"https://api.github.com/users/vkaracic","html_url":"https://github.com/vkaracic","followers_url":"https://api.github.com/users/vkaracic/followers","following_url":"https://api.github.com/users/vkaracic/following{/other_user}","gists_url":"https://api.github.com/users/vkaracic/gists{/gist_id}","starred_url":"https://api.github.com/users/vkaracic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkaracic/subscriptions","organizations_url":"https://api.github.com/users/vkaracic/orgs","repos_url":"https://api.github.com/users/vkaracic/repos","events_url":"https://api.github.com/users/vkaracic/events{/privacy}","received_events_url":"https://api.github.com/users/vkaracic/received_events","type":"User","site_admin":false},"body":"Zašto ne ``this.rows`` ?\r\n","created_at":"2016-08-09T12:00:42Z","updated_at":"2016-08-09T12:00:42Z","html_url":"https://github.com/TinMarkovic/ChartsXBlock/pull/1#discussion_r74044030","pull_request_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/pulls/comments/74044030"},"html":{"href":"https://github.com/TinMarkovic/ChartsXBlock/pull/1#discussion_r74044030"},"pull_request":{"href":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/pulls/1","id":79897230,"html_url":"https://github.com/TinMarkovic/ChartsXBlock/pull/1","diff_url":"https://github.com/TinMarkovic/ChartsXBlock/pull/1.diff","patch_url":"https://github.com/TinMarkovic/ChartsXBlock/pull/1.patch","issue_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/issues/1","number":1,"state":"open","locked":false,"title":"Added visual interface for data","user":{"login":"TinMarkovic","id":12511696,"avatar_url":"https://avatars.githubusercontent.com/u/12511696?v=3","gravatar_id":"","url":"https://api.github.com/users/TinMarkovic","html_url":"https://github.com/TinMarkovic","followers_url":"https://api.github.com/users/TinMarkovic/followers","following_url":"https://api.github.com/users/TinMarkovic/following{/other_user}","gists_url":"https://api.github.com/users/TinMarkovic/gists{/gist_id}","starred_url":"https://api.github.com/users/TinMarkovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TinMarkovic/subscriptions","organizations_url":"https://api.github.com/users/TinMarkovic/orgs","repos_url":"https://api.github.com/users/TinMarkovic/repos","events_url":"https://api.github.com/users/TinMarkovic/events{/privacy}","received_events_url":"https://api.github.com/users/TinMarkovic/received_events","type":"User","site_admin":false},"body":"@vkaracic comments please","created_at":"2016-08-03T12:28:33Z","updated_at":"2016-08-09T12:00:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5b3ecb72b453bef6ec8b00cb99ff7ea2733fecd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/pulls/1/commits","review_comments_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/pulls/1/comments","review_comment_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/issues/1/comments","statuses_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/statuses/32d5d49382d03f26b9983838493f3d7d0fb12ab7","head":{"label":"TinMarkovic:development","ref":"development","sha":"32d5d49382d03f26b9983838493f3d7d0fb12ab7","user":{"login":"TinMarkovic","id":12511696,"avatar_url":"https://avatars.githubusercontent.com/u/12511696?v=3","gravatar_id":"","url":"https://api.github.com/users/TinMarkovic","html_url":"https://github.com/TinMarkovic","followers_url":"https://api.github.com/users/TinMarkovic/followers","following_url":"https://api.github.com/users/TinMarkovic/following{/other_user}","gists_url":"https://api.github.com/users/TinMarkovic/gists{/gist_id}","starred_url":"https://api.github.com/users/TinMarkovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TinMarkovic/subscriptions","organizations_url":"https://api.github.com/users/TinMarkovic/orgs","repos_url":"https://api.github.com/users/TinMarkovic/repos","events_url":"https://api.github.com/users/TinMarkovic/events{/privacy}","received_events_url":"https://api.github.com/users/TinMarkovic/received_events","type":"User","site_admin":false},"repo":{"id":64780918,"name":"ChartsXBlock","full_name":"TinMarkovic/ChartsXBlock","owner":{"login":"TinMarkovic","id":12511696,"avatar_url":"https://avatars.githubusercontent.com/u/12511696?v=3","gravatar_id":"","url":"https://api.github.com/users/TinMarkovic","html_url":"https://github.com/TinMarkovic","followers_url":"https://api.github.com/users/TinMarkovic/followers","following_url":"https://api.github.com/users/TinMarkovic/following{/other_user}","gists_url":"https://api.github.com/users/TinMarkovic/gists{/gist_id}","starred_url":"https://api.github.com/users/TinMarkovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TinMarkovic/subscriptions","organizations_url":"https://api.github.com/users/TinMarkovic/orgs","repos_url":"https://api.github.com/users/TinMarkovic/repos","events_url":"https://api.github.com/users/TinMarkovic/events{/privacy}","received_events_url":"https://api.github.com/users/TinMarkovic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TinMarkovic/ChartsXBlock","description":"A simple XBlock displaying google-powered charts.","fork":false,"url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock","forks_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/forks","keys_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/teams","hooks_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/hooks","issue_events_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/issues/events{/number}","events_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/events","assignees_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/assignees{/user}","branches_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/branches{/branch}","tags_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/tags","blobs_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/git/refs{/sha}","trees_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/statuses/{sha}","languages_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/languages","stargazers_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/stargazers","contributors_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/contributors","subscribers_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/subscribers","subscription_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/subscription","commits_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/commits{/sha}","git_commits_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/git/commits{/sha}","comments_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/comments{/number}","issue_comment_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/issues/comments{/number}","contents_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/contents/{+path}","compare_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/merges","archive_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/downloads","issues_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/issues{/number}","pulls_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/pulls{/number}","milestones_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/milestones{/number}","notifications_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/labels{/name}","releases_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/releases{/id}","deployments_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/deployments","created_at":"2016-08-02T18:12:43Z","updated_at":"2016-08-02T18:17:18Z","pushed_at":"2016-08-08T13:10:24Z","git_url":"git://github.com/TinMarkovic/ChartsXBlock.git","ssh_url":"git@github.com:TinMarkovic/ChartsXBlock.git","clone_url":"https://github.com/TinMarkovic/ChartsXBlock.git","svn_url":"https://github.com/TinMarkovic/ChartsXBlock","homepage":null,"size":38,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"TinMarkovic:master","ref":"master","sha":"3b64d0bb2d76486452c014a3921d9f3a67eccc58","user":{"login":"TinMarkovic","id":12511696,"avatar_url":"https://avatars.githubusercontent.com/u/12511696?v=3","gravatar_id":"","url":"https://api.github.com/users/TinMarkovic","html_url":"https://github.com/TinMarkovic","followers_url":"https://api.github.com/users/TinMarkovic/followers","following_url":"https://api.github.com/users/TinMarkovic/following{/other_user}","gists_url":"https://api.github.com/users/TinMarkovic/gists{/gist_id}","starred_url":"https://api.github.com/users/TinMarkovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TinMarkovic/subscriptions","organizations_url":"https://api.github.com/users/TinMarkovic/orgs","repos_url":"https://api.github.com/users/TinMarkovic/repos","events_url":"https://api.github.com/users/TinMarkovic/events{/privacy}","received_events_url":"https://api.github.com/users/TinMarkovic/received_events","type":"User","site_admin":false},"repo":{"id":64780918,"name":"ChartsXBlock","full_name":"TinMarkovic/ChartsXBlock","owner":{"login":"TinMarkovic","id":12511696,"avatar_url":"https://avatars.githubusercontent.com/u/12511696?v=3","gravatar_id":"","url":"https://api.github.com/users/TinMarkovic","html_url":"https://github.com/TinMarkovic","followers_url":"https://api.github.com/users/TinMarkovic/followers","following_url":"https://api.github.com/users/TinMarkovic/following{/other_user}","gists_url":"https://api.github.com/users/TinMarkovic/gists{/gist_id}","starred_url":"https://api.github.com/users/TinMarkovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TinMarkovic/subscriptions","organizations_url":"https://api.github.com/users/TinMarkovic/orgs","repos_url":"https://api.github.com/users/TinMarkovic/repos","events_url":"https://api.github.com/users/TinMarkovic/events{/privacy}","received_events_url":"https://api.github.com/users/TinMarkovic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TinMarkovic/ChartsXBlock","description":"A simple XBlock displaying google-powered charts.","fork":false,"url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock","forks_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/forks","keys_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/teams","hooks_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/hooks","issue_events_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/issues/events{/number}","events_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/events","assignees_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/assignees{/user}","branches_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/branches{/branch}","tags_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/tags","blobs_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/git/refs{/sha}","trees_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/statuses/{sha}","languages_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/languages","stargazers_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/stargazers","contributors_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/contributors","subscribers_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/subscribers","subscription_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/subscription","commits_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/commits{/sha}","git_commits_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/git/commits{/sha}","comments_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/comments{/number}","issue_comment_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/issues/comments{/number}","contents_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/contents/{+path}","compare_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/merges","archive_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/downloads","issues_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/issues{/number}","pulls_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/pulls{/number}","milestones_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/milestones{/number}","notifications_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/labels{/name}","releases_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/releases{/id}","deployments_url":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/deployments","created_at":"2016-08-02T18:12:43Z","updated_at":"2016-08-02T18:17:18Z","pushed_at":"2016-08-08T13:10:24Z","git_url":"git://github.com/TinMarkovic/ChartsXBlock.git","ssh_url":"git@github.com:TinMarkovic/ChartsXBlock.git","clone_url":"https://github.com/TinMarkovic/ChartsXBlock.git","svn_url":"https://github.com/TinMarkovic/ChartsXBlock","homepage":null,"size":38,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/pulls/1"},"html":{"href":"https://github.com/TinMarkovic/ChartsXBlock/pull/1"},"issue":{"href":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/issues/1"},"comments":{"href":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/TinMarkovic/ChartsXBlock/statuses/32d5d49382d03f26b9983838493f3d7d0fb12ab7"}}}}
{"actor":{"display_login":"vkaracic"}}