{"action":"created","comment":{"url":"https://api.github.com/repos/SOCR/SOCRAT/pulls/comments/50041221","id":50041221,"diff_hunk":"@@ -1,86 +1,671 @@\n-###\n-  @dependencies: None\n-  @author: Selvam Palanimalai\n-###\n-charts = angular.module 'app_analysis_charts', []\n-\n-###\n-  @description: Constructor for this module.\n-  @type: factory\n-###\n-charts.factory 'app_analysis_charts_constructor', [\n-  'app_analysis_charts_eventMngr'\n-  (chartsEventMngr)->\n+'use strict'\n+\n+charts = angular.module('app_analysis_charts', [])\n+\n+.factory('app_analysis_charts_constructor', [\n+  'app_analysis_charts_manager'\n+  (manager)->\n     (sb)->\n-      msgList = chartsEventMngr.getMsgList()\n-      chartsEventMngr.setSb sb unless !sb?\n+\n+      manager.setSb sb unless !sb?\n+      _msgList = manager.getMsgList()\n \n       init: (opt) ->\n-        console.log 'db init called'\n-        chartsEventMngr.listenToIncomeEvents()\n+        console.log 'charts init called'\n \n       destroy: () ->\n \n-      msgList: msgList\n-]\n+      msgList: _msgList\n+])\n \n-###\n-  @description: Manager for all communication b/w modules.\n-    Only this service inside this module, has access to sandbox.\n-  @type: service\n-###\n-charts.service 'app_analysis_charts_eventMngr', [\n-  'app_analysis_charts_compute'\n-  (app_analysis_charts_compute)->\n-    sb = null\n-\n-    msgList =\n-      outcome: ['chart plotted']\n-      income:\n-        'plot chart':\n-          method: app_analysis_charts_compute\n-          outcome: 'chart plotted'\n+.factory( 'app_analysis_charts_manager', [\n+  ()->\n+    _sb = null\n+\n+    _msgList =\n+      outgoing: ['get table']\n+      incoming: ['take table']\n       scope: ['charts']\n \n-    eventManager = (msg, data) ->\n-      try\n-        _data = msgList.income[msg].method.apply null,data\n-        #last item in data is a promise.\n-        data[data.length - 1].resolve _data if _data isnt false\n-      catch e\n-        console.log e.message\n-        alert 'error in database'\n-\n-      sb.publish\n-        msg: msgList.income[msg].outcome\n-        data: _data\n-        msgScope: msgList.scope\n-\n-    setSb: (_sb) ->\n-      return false if _sb is undefined\n-      sb = _sb\n-\n-    getMsgList: () ->\n-      msgList\n-\n-    listenToIncomeEvents: () ->\n-      app_analysis_charts_compute()\n-      for msg of msgList.income\n-        console.log 'subscribed for ' + msg\n-        sb.subscribe\n-          msg: msg\n-          listener: eventManager\n-          msgScope: msgList.scope\n-          context: console\n-]\n+    _setSb = (sb) ->\n+      _sb = sb\n \n-charts.factory 'app_analysis_charts_compute',[\n-    '$q'\n-    ($q)->\n-        (args...)->\n-            #check for tname.\n+    _getSb = () ->\n+      _sb\n \n-        #console.log '%c chartsMainCtrl:'+typeof chartsMainCtrl , 'color:yellow'\n+    _getMsgList = () ->\n+      _msgList\n \n-]\n+    getSb: _getSb\n+    setSb: _setSb\n+    getMsgList: _getMsgList\n+])\n+\n+.controller('mainchartsCtrl', [","path":"app/scripts/analysis/charts/charts.coffee","position":117,"original_position":117,"commit_id":"cff3c451b4d2bb0f8f79e7a27fae7786a5d492cb","original_commit_id":"cff3c451b4d2bb0f8f79e7a27fae7786a5d492cb","user":{"login":"nponarul","id":11791549,"avatar_url":"https://avatars.githubusercontent.com/u/11791549?v=3","gravatar_id":"","url":"https://api.github.com/users/nponarul","html_url":"https://github.com/nponarul","followers_url":"https://api.github.com/users/nponarul/followers","following_url":"https://api.github.com/users/nponarul/following{/other_user}","gists_url":"https://api.github.com/users/nponarul/gists{/gist_id}","starred_url":"https://api.github.com/users/nponarul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nponarul/subscriptions","organizations_url":"https://api.github.com/users/nponarul/orgs","repos_url":"https://api.github.com/users/nponarul/repos","events_url":"https://api.github.com/users/nponarul/events{/privacy}","received_events_url":"https://api.github.com/users/nponarul/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2016-01-18T20:32:17Z","updated_at":"2016-01-18T20:32:17Z","html_url":"https://github.com/SOCR/SOCRAT/pull/52#discussion_r50041221","pull_request_url":"https://api.github.com/repos/SOCR/SOCRAT/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/SOCR/SOCRAT/pulls/comments/50041221"},"html":{"href":"https://github.com/SOCR/SOCRAT/pull/52#discussion_r50041221"},"pull_request":{"href":"https://api.github.com/repos/SOCR/SOCRAT/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/SOCR/SOCRAT/pulls/52","id":53423313,"html_url":"https://github.com/SOCR/SOCRAT/pull/52","diff_url":"https://github.com/SOCR/SOCRAT/pull/52.diff","patch_url":"https://github.com/SOCR/SOCRAT/pull/52.patch","issue_url":"https://api.github.com/repos/SOCR/SOCRAT/issues/52","number":52,"state":"open","locked":false,"title":"update master","user":{"login":"nponarul","id":11791549,"avatar_url":"https://avatars.githubusercontent.com/u/11791549?v=3","gravatar_id":"","url":"https://api.github.com/users/nponarul","html_url":"https://github.com/nponarul","followers_url":"https://api.github.com/users/nponarul/followers","following_url":"https://api.github.com/users/nponarul/following{/other_user}","gists_url":"https://api.github.com/users/nponarul/gists{/gist_id}","starred_url":"https://api.github.com/users/nponarul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nponarul/subscriptions","organizations_url":"https://api.github.com/users/nponarul/orgs","repos_url":"https://api.github.com/users/nponarul/repos","events_url":"https://api.github.com/users/nponarul/events{/privacy}","received_events_url":"https://api.github.com/users/nponarul/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-11T17:53:42Z","updated_at":"2016-01-18T20:32:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e55d648d33250fe5cc16646243b5f96eb5d824d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SOCR/SOCRAT/pulls/52/commits","review_comments_url":"https://api.github.com/repos/SOCR/SOCRAT/pulls/52/comments","review_comment_url":"https://api.github.com/repos/SOCR/SOCRAT/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SOCR/SOCRAT/issues/52/comments","statuses_url":"https://api.github.com/repos/SOCR/SOCRAT/statuses/cff3c451b4d2bb0f8f79e7a27fae7786a5d492cb","head":{"label":"nponarul:charts","ref":"charts","sha":"cff3c451b4d2bb0f8f79e7a27fae7786a5d492cb","user":{"login":"nponarul","id":11791549,"avatar_url":"https://avatars.githubusercontent.com/u/11791549?v=3","gravatar_id":"","url":"https://api.github.com/users/nponarul","html_url":"https://github.com/nponarul","followers_url":"https://api.github.com/users/nponarul/followers","following_url":"https://api.github.com/users/nponarul/following{/other_user}","gists_url":"https://api.github.com/users/nponarul/gists{/gist_id}","starred_url":"https://api.github.com/users/nponarul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nponarul/subscriptions","organizations_url":"https://api.github.com/users/nponarul/orgs","repos_url":"https://api.github.com/users/nponarul/repos","events_url":"https://api.github.com/users/nponarul/events{/privacy}","received_events_url":"https://api.github.com/users/nponarul/received_events","type":"User","site_admin":false},"repo":{"id":45264789,"name":"SOCRAT","full_name":"nponarul/SOCRAT","owner":{"login":"nponarul","id":11791549,"avatar_url":"https://avatars.githubusercontent.com/u/11791549?v=3","gravatar_id":"","url":"https://api.github.com/users/nponarul","html_url":"https://github.com/nponarul","followers_url":"https://api.github.com/users/nponarul/followers","following_url":"https://api.github.com/users/nponarul/following{/other_user}","gists_url":"https://api.github.com/users/nponarul/gists{/gist_id}","starred_url":"https://api.github.com/users/nponarul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nponarul/subscriptions","organizations_url":"https://api.github.com/users/nponarul/orgs","repos_url":"https://api.github.com/users/nponarul/repos","events_url":"https://api.github.com/users/nponarul/events{/privacy}","received_events_url":"https://api.github.com/users/nponarul/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nponarul/SOCRAT","description":"A scalable and highly flexible HTML5/JS platform to build and run in-browser applications for interactive data analysis and visualization.","fork":true,"url":"https://api.github.com/repos/nponarul/SOCRAT","forks_url":"https://api.github.com/repos/nponarul/SOCRAT/forks","keys_url":"https://api.github.com/repos/nponarul/SOCRAT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nponarul/SOCRAT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nponarul/SOCRAT/teams","hooks_url":"https://api.github.com/repos/nponarul/SOCRAT/hooks","issue_events_url":"https://api.github.com/repos/nponarul/SOCRAT/issues/events{/number}","events_url":"https://api.github.com/repos/nponarul/SOCRAT/events","assignees_url":"https://api.github.com/repos/nponarul/SOCRAT/assignees{/user}","branches_url":"https://api.github.com/repos/nponarul/SOCRAT/branches{/branch}","tags_url":"https://api.github.com/repos/nponarul/SOCRAT/tags","blobs_url":"https://api.github.com/repos/nponarul/SOCRAT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nponarul/SOCRAT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nponarul/SOCRAT/git/refs{/sha}","trees_url":"https://api.github.com/repos/nponarul/SOCRAT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nponarul/SOCRAT/statuses/{sha}","languages_url":"https://api.github.com/repos/nponarul/SOCRAT/languages","stargazers_url":"https://api.github.com/repos/nponarul/SOCRAT/stargazers","contributors_url":"https://api.github.com/repos/nponarul/SOCRAT/contributors","subscribers_url":"https://api.github.com/repos/nponarul/SOCRAT/subscribers","subscription_url":"https://api.github.com/repos/nponarul/SOCRAT/subscription","commits_url":"https://api.github.com/repos/nponarul/SOCRAT/commits{/sha}","git_commits_url":"https://api.github.com/repos/nponarul/SOCRAT/git/commits{/sha}","comments_url":"https://api.github.com/repos/nponarul/SOCRAT/comments{/number}","issue_comment_url":"https://api.github.com/repos/nponarul/SOCRAT/issues/comments{/number}","contents_url":"https://api.github.com/repos/nponarul/SOCRAT/contents/{+path}","compare_url":"https://api.github.com/repos/nponarul/SOCRAT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nponarul/SOCRAT/merges","archive_url":"https://api.github.com/repos/nponarul/SOCRAT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nponarul/SOCRAT/downloads","issues_url":"https://api.github.com/repos/nponarul/SOCRAT/issues{/number}","pulls_url":"https://api.github.com/repos/nponarul/SOCRAT/pulls{/number}","milestones_url":"https://api.github.com/repos/nponarul/SOCRAT/milestones{/number}","notifications_url":"https://api.github.com/repos/nponarul/SOCRAT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nponarul/SOCRAT/labels{/name}","releases_url":"https://api.github.com/repos/nponarul/SOCRAT/releases{/id}","created_at":"2015-10-30T17:02:28Z","updated_at":"2016-01-14T23:15:42Z","pushed_at":"2016-01-15T05:28:56Z","git_url":"git://github.com/nponarul/SOCRAT.git","ssh_url":"git@github.com:nponarul/SOCRAT.git","clone_url":"https://github.com/nponarul/SOCRAT.git","svn_url":"https://github.com/nponarul/SOCRAT","homepage":"","size":2980,"stargazers_count":1,"watchers_count":1,"language":"CoffeeScript","has_issues":false,"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":1,"default_branch":"charts"}},"base":{"label":"SOCR:master","ref":"master","sha":"7ecf50819b1cc14a62795e49d9dbf89ce1ee3a4e","user":{"login":"SOCR","id":11710709,"avatar_url":"https://avatars.githubusercontent.com/u/11710709?v=3","gravatar_id":"","url":"https://api.github.com/users/SOCR","html_url":"https://github.com/SOCR","followers_url":"https://api.github.com/users/SOCR/followers","following_url":"https://api.github.com/users/SOCR/following{/other_user}","gists_url":"https://api.github.com/users/SOCR/gists{/gist_id}","starred_url":"https://api.github.com/users/SOCR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SOCR/subscriptions","organizations_url":"https://api.github.com/users/SOCR/orgs","repos_url":"https://api.github.com/users/SOCR/repos","events_url":"https://api.github.com/users/SOCR/events{/privacy}","received_events_url":"https://api.github.com/users/SOCR/received_events","type":"Organization","site_admin":false},"repo":{"id":8862996,"name":"SOCRAT","full_name":"SOCR/SOCRAT","owner":{"login":"SOCR","id":11710709,"avatar_url":"https://avatars.githubusercontent.com/u/11710709?v=3","gravatar_id":"","url":"https://api.github.com/users/SOCR","html_url":"https://github.com/SOCR","followers_url":"https://api.github.com/users/SOCR/followers","following_url":"https://api.github.com/users/SOCR/following{/other_user}","gists_url":"https://api.github.com/users/SOCR/gists{/gist_id}","starred_url":"https://api.github.com/users/SOCR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SOCR/subscriptions","organizations_url":"https://api.github.com/users/SOCR/orgs","repos_url":"https://api.github.com/users/SOCR/repos","events_url":"https://api.github.com/users/SOCR/events{/privacy}","received_events_url":"https://api.github.com/users/SOCR/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SOCR/SOCRAT","description":"A scalable and highly flexible HTML5/JS platform to build and run in-browser applications for interactive data analysis and visualization.","fork":false,"url":"https://api.github.com/repos/SOCR/SOCRAT","forks_url":"https://api.github.com/repos/SOCR/SOCRAT/forks","keys_url":"https://api.github.com/repos/SOCR/SOCRAT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SOCR/SOCRAT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SOCR/SOCRAT/teams","hooks_url":"https://api.github.com/repos/SOCR/SOCRAT/hooks","issue_events_url":"https://api.github.com/repos/SOCR/SOCRAT/issues/events{/number}","events_url":"https://api.github.com/repos/SOCR/SOCRAT/events","assignees_url":"https://api.github.com/repos/SOCR/SOCRAT/assignees{/user}","branches_url":"https://api.github.com/repos/SOCR/SOCRAT/branches{/branch}","tags_url":"https://api.github.com/repos/SOCR/SOCRAT/tags","blobs_url":"https://api.github.com/repos/SOCR/SOCRAT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SOCR/SOCRAT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SOCR/SOCRAT/git/refs{/sha}","trees_url":"https://api.github.com/repos/SOCR/SOCRAT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SOCR/SOCRAT/statuses/{sha}","languages_url":"https://api.github.com/repos/SOCR/SOCRAT/languages","stargazers_url":"https://api.github.com/repos/SOCR/SOCRAT/stargazers","contributors_url":"https://api.github.com/repos/SOCR/SOCRAT/contributors","subscribers_url":"https://api.github.com/repos/SOCR/SOCRAT/subscribers","subscription_url":"https://api.github.com/repos/SOCR/SOCRAT/subscription","commits_url":"https://api.github.com/repos/SOCR/SOCRAT/commits{/sha}","git_commits_url":"https://api.github.com/repos/SOCR/SOCRAT/git/commits{/sha}","comments_url":"https://api.github.com/repos/SOCR/SOCRAT/comments{/number}","issue_comment_url":"https://api.github.com/repos/SOCR/SOCRAT/issues/comments{/number}","contents_url":"https://api.github.com/repos/SOCR/SOCRAT/contents/{+path}","compare_url":"https://api.github.com/repos/SOCR/SOCRAT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SOCR/SOCRAT/merges","archive_url":"https://api.github.com/repos/SOCR/SOCRAT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SOCR/SOCRAT/downloads","issues_url":"https://api.github.com/repos/SOCR/SOCRAT/issues{/number}","pulls_url":"https://api.github.com/repos/SOCR/SOCRAT/pulls{/number}","milestones_url":"https://api.github.com/repos/SOCR/SOCRAT/milestones{/number}","notifications_url":"https://api.github.com/repos/SOCR/SOCRAT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SOCR/SOCRAT/labels{/name}","releases_url":"https://api.github.com/repos/SOCR/SOCRAT/releases{/id}","created_at":"2013-03-18T20:06:05Z","updated_at":"2016-01-13T10:50:36Z","pushed_at":"2016-01-15T05:28:56Z","git_url":"git://github.com/SOCR/SOCRAT.git","ssh_url":"git@github.com:SOCR/SOCRAT.git","clone_url":"https://github.com/SOCR/SOCRAT.git","svn_url":"https://github.com/SOCR/SOCRAT","homepage":"","size":2962,"stargazers_count":5,"watchers_count":5,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SOCR/SOCRAT/pulls/52"},"html":{"href":"https://github.com/SOCR/SOCRAT/pull/52"},"issue":{"href":"https://api.github.com/repos/SOCR/SOCRAT/issues/52"},"comments":{"href":"https://api.github.com/repos/SOCR/SOCRAT/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/SOCR/SOCRAT/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/SOCR/SOCRAT/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SOCR/SOCRAT/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/SOCR/SOCRAT/statuses/cff3c451b4d2bb0f8f79e7a27fae7786a5d492cb"}}}}