{"action":"created","comment":{"url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/pulls/comments/41252449","id":41252449,"diff_hunk":"@@ -0,0 +1,130 @@\n+require 'json'\n+\n+class Morris\n+  attr_accessor :experiment\n+  attr_accessor :parameters\n+\n+  attr_reader :series_to_plot\n+  attr_reader :parameters_names\n+  attr_reader :sorted_parameters_names\n+  attr_reader :name_of_output\n+  attr_reader :series_names\n+\n+  def prepare_morris_chart_content\n+    output = \"<script>(function() { \\nvar i=\" + parameters[\"chart_id\"] + \";\"\n+    output += \"\\nvar sorted_parameters_names = \" + @sorted_parameters_names.to_json + \";\"\n+    output += \"\\nvar series_to_plot = \" +  @series_to_plot.to_json + \";\"\n+    output += \"\\nmorris_main(i, series_to_plot, sorted_parameters_names);\"\n+    output += \"\\n})();</script>\"\n+    output\n+  end\n+\n+  ##\n+  # We assume that the result json have specific format:\n+  # '{\n+  #   \"sensitivity_analysis_method\":\"morris\",\n+  #   \"moes\":{\n+  #     \"moe1\":{\n+  #       \"parameter1\":{\n+  #         \"mean\":3,\n+  #         \"st.deviation \":2\n+  #       },\n+  #       \"parameter2\":{\n+  #         \"mean\":-1,\n+  #         \"st.deviation \":4\n+  #       }\n+  #     },\n+  #     \"moe2\":{\n+  #       \"parameter1\":{\n+  #         \"mean\":5,\n+  #         \"st.deviation \":1\n+  #        },\n+  #        \"parameter2\":{\n+  #         \"mean\":0,\n+  #         \"st.deviation \":2\n+  #        }\n+  #     }\n+  #   }\n+  #  }'\n+  def handler()\n+    if parameters[\"id\"] && parameters[\"chart_id\"] && parameters[\"output\"]\n+      @name_of_output = parameters[\"output\"]\n+      output_hash = @experiment.results\n+\n+      if output_hash[\"sensitivity_analysis_method\"] != 'morris'\n+          raise(\"Error in plugin appeared\")\n+      end\n+\n+      if @experiment.error_reason != nil\n+        raise (\"Error appeared #{@experiment.error_reason}\")\n+      end\n+\n+      output_hash_results = output_hash['moes'][@name_of_output]\n+\n+      if !output_hash_results\n+        raise(\"No #{@name_of_output} in moes results from supervised experiment\")\n+      end\n+\n+      extract_categories_xAxis(output_hash_results)","path":"app/visualisation_methods/morris/plugin.rb","position":null,"original_position":68,"commit_id":"ba1db59008ba8b662f45dc721cea4bde87c95155","original_commit_id":"aa6de24be0c9c144383d892b321e7ba0a3279a0c","user":{"login":"laganows","id":12443720,"avatar_url":"https://avatars.githubusercontent.com/u/12443720?v=3","gravatar_id":"","url":"https://api.github.com/users/laganows","html_url":"https://github.com/laganows","followers_url":"https://api.github.com/users/laganows/followers","following_url":"https://api.github.com/users/laganows/following{/other_user}","gists_url":"https://api.github.com/users/laganows/gists{/gist_id}","starred_url":"https://api.github.com/users/laganows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laganows/subscriptions","organizations_url":"https://api.github.com/users/laganows/orgs","repos_url":"https://api.github.com/users/laganows/repos","events_url":"https://api.github.com/users/laganows/events{/privacy}","received_events_url":"https://api.github.com/users/laganows/received_events","type":"User","site_admin":false},"body":"Poprawione. Niedopatrzenie :)","created_at":"2015-10-06T11:27:34Z","updated_at":"2015-10-06T11:27:34Z","html_url":"https://github.com/Scalarm/scalarm_data_explorer/pull/30#discussion_r41252449","pull_request_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/pulls/comments/41252449"},"html":{"href":"https://github.com/Scalarm/scalarm_data_explorer/pull/30#discussion_r41252449"},"pull_request":{"href":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/pulls/30","id":46887474,"html_url":"https://github.com/Scalarm/scalarm_data_explorer/pull/30","diff_url":"https://github.com/Scalarm/scalarm_data_explorer/pull/30.diff","patch_url":"https://github.com/Scalarm/scalarm_data_explorer/pull/30.patch","issue_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/issues/30","number":30,"state":"open","locked":false,"title":"Scal 898 morris visualization","user":{"login":"laganows","id":12443720,"avatar_url":"https://avatars.githubusercontent.com/u/12443720?v=3","gravatar_id":"","url":"https://api.github.com/users/laganows","html_url":"https://github.com/laganows","followers_url":"https://api.github.com/users/laganows/followers","following_url":"https://api.github.com/users/laganows/following{/other_user}","gists_url":"https://api.github.com/users/laganows/gists{/gist_id}","starred_url":"https://api.github.com/users/laganows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laganows/subscriptions","organizations_url":"https://api.github.com/users/laganows/orgs","repos_url":"https://api.github.com/users/laganows/repos","events_url":"https://api.github.com/users/laganows/events{/privacy}","received_events_url":"https://api.github.com/users/laganows/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-06T10:49:33Z","updated_at":"2015-10-06T11:27:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"003e444b1a9ff966cdecd6a4eb176a8202cb28ad","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/pulls/30/commits","review_comments_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/pulls/30/comments","review_comment_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/issues/30/comments","statuses_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/statuses/ba1db59008ba8b662f45dc721cea4bde87c95155","head":{"label":"Scalarm:SCAL-898-morris-visualization","ref":"SCAL-898-morris-visualization","sha":"ba1db59008ba8b662f45dc721cea4bde87c95155","user":{"login":"Scalarm","id":4244361,"avatar_url":"https://avatars.githubusercontent.com/u/4244361?v=3","gravatar_id":"","url":"https://api.github.com/users/Scalarm","html_url":"https://github.com/Scalarm","followers_url":"https://api.github.com/users/Scalarm/followers","following_url":"https://api.github.com/users/Scalarm/following{/other_user}","gists_url":"https://api.github.com/users/Scalarm/gists{/gist_id}","starred_url":"https://api.github.com/users/Scalarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scalarm/subscriptions","organizations_url":"https://api.github.com/users/Scalarm/orgs","repos_url":"https://api.github.com/users/Scalarm/repos","events_url":"https://api.github.com/users/Scalarm/events{/privacy}","received_events_url":"https://api.github.com/users/Scalarm/received_events","type":"Organization","site_admin":false},"repo":{"id":36283554,"name":"scalarm_data_explorer","full_name":"Scalarm/scalarm_data_explorer","owner":{"login":"Scalarm","id":4244361,"avatar_url":"https://avatars.githubusercontent.com/u/4244361?v=3","gravatar_id":"","url":"https://api.github.com/users/Scalarm","html_url":"https://github.com/Scalarm","followers_url":"https://api.github.com/users/Scalarm/followers","following_url":"https://api.github.com/users/Scalarm/following{/other_user}","gists_url":"https://api.github.com/users/Scalarm/gists{/gist_id}","starred_url":"https://api.github.com/users/Scalarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scalarm/subscriptions","organizations_url":"https://api.github.com/users/Scalarm/orgs","repos_url":"https://api.github.com/users/Scalarm/repos","events_url":"https://api.github.com/users/Scalarm/events{/privacy}","received_events_url":"https://api.github.com/users/Scalarm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Scalarm/scalarm_data_explorer","description":"Provides data exploration tools and views for Scalarm platform","fork":false,"url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer","forks_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/forks","keys_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/teams","hooks_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/hooks","issue_events_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/issues/events{/number}","events_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/events","assignees_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/assignees{/user}","branches_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/branches{/branch}","tags_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/tags","blobs_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/git/refs{/sha}","trees_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/statuses/{sha}","languages_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/languages","stargazers_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/stargazers","contributors_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/contributors","subscribers_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/subscribers","subscription_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/subscription","commits_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/commits{/sha}","git_commits_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/git/commits{/sha}","comments_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/comments{/number}","issue_comment_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/issues/comments{/number}","contents_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/contents/{+path}","compare_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/merges","archive_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/downloads","issues_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/issues{/number}","pulls_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/pulls{/number}","milestones_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/milestones{/number}","notifications_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/labels{/name}","releases_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/releases{/id}","created_at":"2015-05-26T08:48:44Z","updated_at":"2015-06-23T12:39:19Z","pushed_at":"2015-10-06T11:26:28Z","git_url":"git://github.com/Scalarm/scalarm_data_explorer.git","ssh_url":"git@github.com:Scalarm/scalarm_data_explorer.git","clone_url":"https://github.com/Scalarm/scalarm_data_explorer.git","svn_url":"https://github.com/Scalarm/scalarm_data_explorer","homepage":null,"size":1347,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"Scalarm:development","ref":"development","sha":"c7a15505e8cc426bfb8934fcc4b08af50ee040a2","user":{"login":"Scalarm","id":4244361,"avatar_url":"https://avatars.githubusercontent.com/u/4244361?v=3","gravatar_id":"","url":"https://api.github.com/users/Scalarm","html_url":"https://github.com/Scalarm","followers_url":"https://api.github.com/users/Scalarm/followers","following_url":"https://api.github.com/users/Scalarm/following{/other_user}","gists_url":"https://api.github.com/users/Scalarm/gists{/gist_id}","starred_url":"https://api.github.com/users/Scalarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scalarm/subscriptions","organizations_url":"https://api.github.com/users/Scalarm/orgs","repos_url":"https://api.github.com/users/Scalarm/repos","events_url":"https://api.github.com/users/Scalarm/events{/privacy}","received_events_url":"https://api.github.com/users/Scalarm/received_events","type":"Organization","site_admin":false},"repo":{"id":36283554,"name":"scalarm_data_explorer","full_name":"Scalarm/scalarm_data_explorer","owner":{"login":"Scalarm","id":4244361,"avatar_url":"https://avatars.githubusercontent.com/u/4244361?v=3","gravatar_id":"","url":"https://api.github.com/users/Scalarm","html_url":"https://github.com/Scalarm","followers_url":"https://api.github.com/users/Scalarm/followers","following_url":"https://api.github.com/users/Scalarm/following{/other_user}","gists_url":"https://api.github.com/users/Scalarm/gists{/gist_id}","starred_url":"https://api.github.com/users/Scalarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scalarm/subscriptions","organizations_url":"https://api.github.com/users/Scalarm/orgs","repos_url":"https://api.github.com/users/Scalarm/repos","events_url":"https://api.github.com/users/Scalarm/events{/privacy}","received_events_url":"https://api.github.com/users/Scalarm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Scalarm/scalarm_data_explorer","description":"Provides data exploration tools and views for Scalarm platform","fork":false,"url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer","forks_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/forks","keys_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/teams","hooks_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/hooks","issue_events_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/issues/events{/number}","events_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/events","assignees_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/assignees{/user}","branches_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/branches{/branch}","tags_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/tags","blobs_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/git/refs{/sha}","trees_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/statuses/{sha}","languages_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/languages","stargazers_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/stargazers","contributors_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/contributors","subscribers_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/subscribers","subscription_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/subscription","commits_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/commits{/sha}","git_commits_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/git/commits{/sha}","comments_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/comments{/number}","issue_comment_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/issues/comments{/number}","contents_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/contents/{+path}","compare_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/merges","archive_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/downloads","issues_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/issues{/number}","pulls_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/pulls{/number}","milestones_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/milestones{/number}","notifications_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/labels{/name}","releases_url":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/releases{/id}","created_at":"2015-05-26T08:48:44Z","updated_at":"2015-06-23T12:39:19Z","pushed_at":"2015-10-06T11:26:28Z","git_url":"git://github.com/Scalarm/scalarm_data_explorer.git","ssh_url":"git@github.com:Scalarm/scalarm_data_explorer.git","clone_url":"https://github.com/Scalarm/scalarm_data_explorer.git","svn_url":"https://github.com/Scalarm/scalarm_data_explorer","homepage":null,"size":1347,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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/Scalarm/scalarm_data_explorer/pulls/30"},"html":{"href":"https://github.com/Scalarm/scalarm_data_explorer/pull/30"},"issue":{"href":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/issues/30"},"comments":{"href":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/Scalarm/scalarm_data_explorer/statuses/ba1db59008ba8b662f45dc721cea4bde87c95155"}}}}