{"action":"created","comment":{"url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/pulls/comments/154524290","pull_request_review_id":80701503,"id":154524290,"diff_hunk":"@@ -1,76 +1,75 @@\n 'use strict';\n \n window.renderStatistics = function (ctx, names, times) {\n-  var widthBlockResults = 420;\n-  var initialXBlockResults = 100;\n+  var WIDTH_BLOCK_RESULTS = 420;\n+  var HEIGHT_BLOCK_RESULTS = 270;\n+  var INITIAL_X_BLOCK_RESULTS = 100;\n+  var INITIAL_Y_BLOCK_RESULTS = 10;\n+  var OFFSET_X = 10;\n+  var OFFSET_Y = 10;\n+  var INITIAL_X = 120;\n+  var INITIAL_Y = 90;\n+  var LINE_HEIGHT = 20;\n+  var BAR_WIDTH = 40;\n+  var HISTOGRAM_HEIGHT = 150;\n+  var INITIAL_X_TEXT = 120;\n+  var INITIAL_Y_TEXT = 40;\n \n-  // тень для блока\n-  ctx.fillStyle = 'rgba(0, 0, 0, 0.7)';\n-  ctx.fillRect(110, 20, widthBlockResults, 270);\n+  var getRandomNumber = function (min, max) {\n+    if (min === undefined) {\n+      min = 0;\n+    }\n \n-  // блок с рез-ми\n-  ctx.fillStyle = 'rgb(255, 255, 255)';\n-  ctx.fillRect(initialXBlockResults, 10, widthBlockResults, 270);\n+    if (max === undefined) {\n+      max = 1;\n+    }\n \n-  // текст для блока\n-  ctx.fillStyle = '#222222';\n-  ctx.font = '16px PT Mono';\n-  ctx.fillText('Ура вы победили!', 120, 40);\n-  ctx.fillText('Список результатов:', 120, 60);\n+    return Math.random() * (max - min) + min;\n+  }\n \n-  var max = -1;\n+  var drawRectangle = function() {\n+    for (var i = 0; i < times.length; i++) {\n+      names[i] === 'Вы' ?","path":"js/stat.js","position":null,"original_position":46,"commit_id":"544ef173ab0d8632b96bf98ea92594b17c5ce0ed","original_commit_id":"544ef173ab0d8632b96bf98ea92594b17c5ce0ed","user":{"login":"skad0","id":974119,"avatar_url":"https://avatars2.githubusercontent.com/u/974119?v=4","gravatar_id":"","url":"https://api.github.com/users/skad0","html_url":"https://github.com/skad0","followers_url":"https://api.github.com/users/skad0/followers","following_url":"https://api.github.com/users/skad0/following{/other_user}","gists_url":"https://api.github.com/users/skad0/gists{/gist_id}","starred_url":"https://api.github.com/users/skad0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skad0/subscriptions","organizations_url":"https://api.github.com/users/skad0/orgs","repos_url":"https://api.github.com/users/skad0/repos","events_url":"https://api.github.com/users/skad0/events{/privacy}","received_events_url":"https://api.github.com/users/skad0/received_events","type":"User","site_admin":false},"body":"И само по себе выражение это не стоит так писать, у тебя получается 2 присваивания, а можно сделать 1 присваивание, а что присваивать решать уже тернарным оператором.","created_at":"2017-12-03T13:41:41Z","updated_at":"2017-12-03T13:50:06Z","html_url":"https://github.com/htmlacademy-javascript/158040-code-and-magick/pull/2#discussion_r154524290","pull_request_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/pulls/2","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/pulls/comments/154524290"},"html":{"href":"https://github.com/htmlacademy-javascript/158040-code-and-magick/pull/2#discussion_r154524290"},"pull_request":{"href":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/pulls/2"}},"in_reply_to_id":154524147},"pull_request":{"url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/pulls/2","id":155341310,"html_url":"https://github.com/htmlacademy-javascript/158040-code-and-magick/pull/2","diff_url":"https://github.com/htmlacademy-javascript/158040-code-and-magick/pull/2.diff","patch_url":"https://github.com/htmlacademy-javascript/158040-code-and-magick/pull/2.patch","issue_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/issues/2","number":2,"state":"open","locked":false,"title":"Учебный проект: Холст","user":{"login":"mosk","id":16485443,"avatar_url":"https://avatars3.githubusercontent.com/u/16485443?v=4","gravatar_id":"","url":"https://api.github.com/users/mosk","html_url":"https://github.com/mosk","followers_url":"https://api.github.com/users/mosk/followers","following_url":"https://api.github.com/users/mosk/following{/other_user}","gists_url":"https://api.github.com/users/mosk/gists{/gist_id}","starred_url":"https://api.github.com/users/mosk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mosk/subscriptions","organizations_url":"https://api.github.com/users/mosk/orgs","repos_url":"https://api.github.com/users/mosk/repos","events_url":"https://api.github.com/users/mosk/events{/privacy}","received_events_url":"https://api.github.com/users/mosk/received_events","type":"User","site_admin":false},"body":"\n\n---\n:mortar_board: [Учебный проект: Холст](https://up.htmlacademy.ru/javascript/11/user/158040/tasks/8)\n\n:boom: https://htmlacademy-javascript.github.io/158040-code-and-magick/2/","created_at":"2017-11-29T13:35:16Z","updated_at":"2017-12-03T13:50:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c5fab53129ad81d241863fe7a10a1c6c2561f1d6","assignee":{"login":"skad0","id":974119,"avatar_url":"https://avatars2.githubusercontent.com/u/974119?v=4","gravatar_id":"","url":"https://api.github.com/users/skad0","html_url":"https://github.com/skad0","followers_url":"https://api.github.com/users/skad0/followers","following_url":"https://api.github.com/users/skad0/following{/other_user}","gists_url":"https://api.github.com/users/skad0/gists{/gist_id}","starred_url":"https://api.github.com/users/skad0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skad0/subscriptions","organizations_url":"https://api.github.com/users/skad0/orgs","repos_url":"https://api.github.com/users/skad0/repos","events_url":"https://api.github.com/users/skad0/events{/privacy}","received_events_url":"https://api.github.com/users/skad0/received_events","type":"User","site_admin":false},"assignees":[{"login":"skad0","id":974119,"avatar_url":"https://avatars2.githubusercontent.com/u/974119?v=4","gravatar_id":"","url":"https://api.github.com/users/skad0","html_url":"https://github.com/skad0","followers_url":"https://api.github.com/users/skad0/followers","following_url":"https://api.github.com/users/skad0/following{/other_user}","gists_url":"https://api.github.com/users/skad0/gists{/gist_id}","starred_url":"https://api.github.com/users/skad0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skad0/subscriptions","organizations_url":"https://api.github.com/users/skad0/orgs","repos_url":"https://api.github.com/users/skad0/repos","events_url":"https://api.github.com/users/skad0/events{/privacy}","received_events_url":"https://api.github.com/users/skad0/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/pulls/2/commits","review_comments_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/pulls/2/comments","review_comment_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/issues/2/comments","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/statuses/544ef173ab0d8632b96bf98ea92594b17c5ce0ed","head":{"label":"mosk:module2-task1","ref":"module2-task1","sha":"544ef173ab0d8632b96bf98ea92594b17c5ce0ed","user":{"login":"mosk","id":16485443,"avatar_url":"https://avatars3.githubusercontent.com/u/16485443?v=4","gravatar_id":"","url":"https://api.github.com/users/mosk","html_url":"https://github.com/mosk","followers_url":"https://api.github.com/users/mosk/followers","following_url":"https://api.github.com/users/mosk/following{/other_user}","gists_url":"https://api.github.com/users/mosk/gists{/gist_id}","starred_url":"https://api.github.com/users/mosk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mosk/subscriptions","organizations_url":"https://api.github.com/users/mosk/orgs","repos_url":"https://api.github.com/users/mosk/repos","events_url":"https://api.github.com/users/mosk/events{/privacy}","received_events_url":"https://api.github.com/users/mosk/received_events","type":"User","site_admin":false},"repo":{"id":110823991,"name":"code-and-magick","full_name":"mosk/code-and-magick","owner":{"login":"mosk","id":16485443,"avatar_url":"https://avatars3.githubusercontent.com/u/16485443?v=4","gravatar_id":"","url":"https://api.github.com/users/mosk","html_url":"https://github.com/mosk","followers_url":"https://api.github.com/users/mosk/followers","following_url":"https://api.github.com/users/mosk/following{/other_user}","gists_url":"https://api.github.com/users/mosk/gists{/gist_id}","starred_url":"https://api.github.com/users/mosk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mosk/subscriptions","organizations_url":"https://api.github.com/users/mosk/orgs","repos_url":"https://api.github.com/users/mosk/repos","events_url":"https://api.github.com/users/mosk/events{/privacy}","received_events_url":"https://api.github.com/users/mosk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mosk/code-and-magick","description":"Михаил Москалев","fork":true,"url":"https://api.github.com/repos/mosk/code-and-magick","forks_url":"https://api.github.com/repos/mosk/code-and-magick/forks","keys_url":"https://api.github.com/repos/mosk/code-and-magick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mosk/code-and-magick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mosk/code-and-magick/teams","hooks_url":"https://api.github.com/repos/mosk/code-and-magick/hooks","issue_events_url":"https://api.github.com/repos/mosk/code-and-magick/issues/events{/number}","events_url":"https://api.github.com/repos/mosk/code-and-magick/events","assignees_url":"https://api.github.com/repos/mosk/code-and-magick/assignees{/user}","branches_url":"https://api.github.com/repos/mosk/code-and-magick/branches{/branch}","tags_url":"https://api.github.com/repos/mosk/code-and-magick/tags","blobs_url":"https://api.github.com/repos/mosk/code-and-magick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mosk/code-and-magick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mosk/code-and-magick/git/refs{/sha}","trees_url":"https://api.github.com/repos/mosk/code-and-magick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mosk/code-and-magick/statuses/{sha}","languages_url":"https://api.github.com/repos/mosk/code-and-magick/languages","stargazers_url":"https://api.github.com/repos/mosk/code-and-magick/stargazers","contributors_url":"https://api.github.com/repos/mosk/code-and-magick/contributors","subscribers_url":"https://api.github.com/repos/mosk/code-and-magick/subscribers","subscription_url":"https://api.github.com/repos/mosk/code-and-magick/subscription","commits_url":"https://api.github.com/repos/mosk/code-and-magick/commits{/sha}","git_commits_url":"https://api.github.com/repos/mosk/code-and-magick/git/commits{/sha}","comments_url":"https://api.github.com/repos/mosk/code-and-magick/comments{/number}","issue_comment_url":"https://api.github.com/repos/mosk/code-and-magick/issues/comments{/number}","contents_url":"https://api.github.com/repos/mosk/code-and-magick/contents/{+path}","compare_url":"https://api.github.com/repos/mosk/code-and-magick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mosk/code-and-magick/merges","archive_url":"https://api.github.com/repos/mosk/code-and-magick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mosk/code-and-magick/downloads","issues_url":"https://api.github.com/repos/mosk/code-and-magick/issues{/number}","pulls_url":"https://api.github.com/repos/mosk/code-and-magick/pulls{/number}","milestones_url":"https://api.github.com/repos/mosk/code-and-magick/milestones{/number}","notifications_url":"https://api.github.com/repos/mosk/code-and-magick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mosk/code-and-magick/labels{/name}","releases_url":"https://api.github.com/repos/mosk/code-and-magick/releases{/id}","deployments_url":"https://api.github.com/repos/mosk/code-and-magick/deployments","created_at":"2017-11-15T11:19:28Z","updated_at":"2017-11-16T13:17:23Z","pushed_at":"2017-12-03T13:29:51Z","git_url":"git://github.com/mosk/code-and-magick.git","ssh_url":"git@github.com:mosk/code-and-magick.git","clone_url":"https://github.com/mosk/code-and-magick.git","svn_url":"https://github.com/mosk/code-and-magick","homepage":null,"size":1080,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"htmlacademy-javascript:master","ref":"master","sha":"ffb4455ac7d94dae3018d4db41e1b1ce7679b8f6","user":{"login":"htmlacademy-javascript","id":14179712,"avatar_url":"https://avatars2.githubusercontent.com/u/14179712?v=4","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-javascript","html_url":"https://github.com/htmlacademy-javascript","followers_url":"https://api.github.com/users/htmlacademy-javascript/followers","following_url":"https://api.github.com/users/htmlacademy-javascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-javascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-javascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-javascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-javascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-javascript/repos","events_url":"https://api.github.com/users/htmlacademy-javascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-javascript/received_events","type":"Organization","site_admin":false},"repo":{"id":110736407,"name":"158040-code-and-magick","full_name":"htmlacademy-javascript/158040-code-and-magick","owner":{"login":"htmlacademy-javascript","id":14179712,"avatar_url":"https://avatars2.githubusercontent.com/u/14179712?v=4","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-javascript","html_url":"https://github.com/htmlacademy-javascript","followers_url":"https://api.github.com/users/htmlacademy-javascript/followers","following_url":"https://api.github.com/users/htmlacademy-javascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-javascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-javascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-javascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-javascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-javascript/repos","events_url":"https://api.github.com/users/htmlacademy-javascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-javascript/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/htmlacademy-javascript/158040-code-and-magick","description":"Михаил Москалев","fork":false,"url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick","forks_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/forks","keys_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/teams","hooks_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/hooks","issue_events_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/issues/events{/number}","events_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/events","assignees_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/assignees{/user}","branches_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/branches{/branch}","tags_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/tags","blobs_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/git/refs{/sha}","trees_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/statuses/{sha}","languages_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/languages","stargazers_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/stargazers","contributors_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/contributors","subscribers_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/subscribers","subscription_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/subscription","commits_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/commits{/sha}","git_commits_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/git/commits{/sha}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/comments{/number}","issue_comment_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/issues/comments{/number}","contents_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/contents/{+path}","compare_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/merges","archive_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/downloads","issues_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/issues{/number}","pulls_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/pulls{/number}","milestones_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/milestones{/number}","notifications_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/labels{/name}","releases_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/releases{/id}","deployments_url":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/deployments","created_at":"2017-11-14T19:41:09Z","updated_at":"2017-11-15T18:44:41Z","pushed_at":"2017-12-03T13:29:53Z","git_url":"git://github.com/htmlacademy-javascript/158040-code-and-magick.git","ssh_url":"git@github.com:htmlacademy-javascript/158040-code-and-magick.git","clone_url":"https://github.com/htmlacademy-javascript/158040-code-and-magick.git","svn_url":"https://github.com/htmlacademy-javascript/158040-code-and-magick","homepage":"https://github.com/mosk/158040-code-and-magick","size":1072,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/pulls/2"},"html":{"href":"https://github.com/htmlacademy-javascript/158040-code-and-magick/pull/2"},"issue":{"href":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/issues/2"},"comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/htmlacademy-javascript/158040-code-and-magick/statuses/544ef173ab0d8632b96bf98ea92594b17c5ce0ed"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"skad0"}}