{"action":"created","comment":{"url":"https://api.github.com/repos/USGS-R/repgen/pulls/comments/31453461","id":31453461,"diff_hunk":"@@ -1,133 +1,141 @@\n \n #'@export\n uvhydrographPlot <- function(data){\n-  uv_pts <- getUvHydro(data, \"primarySeries\" )\n-  layout_uvhydro()\n-  \n-  primary_lbl <- getUvLabel(data, \"primarySeries\")\n-  \n-  add_uvhydro_axes(getUvhLims(uv_pts), ylab = primary_lbl, ylog = TRUE)\n-  \n-  dv_pts <- getUvHydro(data, \"derivedSeriesMean\" )\n-  dv_pts$x = dv_pts$x + 86400/2 # manual shift for now...\n-  \n-  # discharge measurements and errors\n-  if(isSeriesOfType(data, \"primarySeries\", \"Discharge\")) {\n-    add_q_measurements(data)\n-  }\n-  \n-  add_computed_uv(uv_pts)\n-  add_approved_dv(dv_pts)\n-  \n-  secondary_lbl <- getUvLabel(data, \"secondarySeries\")\n-  tertiary_lbl <- getUvLabel(data, \"effectiveShifts\")\n-  \n-  uv2_pts <- getUvHydro(data, \"secondarySeries\")\n-  shift_pts <- getUvHydro(data, \"effectiveShifts\")\n-  \n-  secondary_lims <- getUvhLims(uv2_pts)\n-  add_uvhydro_axes(secondary_lims, ylab = secondary_lbl, ylog = FALSE)\n+  #for pagination by month, get all of the month strings for the primary series\n+  all_primary_pts <- getUvHydro(data, \"primarySeries\" )\n+  months <- unique(all_primary_pts$month, incomparables = FALSE)\n   \n-  add_computed_uv(uv2_pts)\n-  shifted_pts <- uv2_pts\n-  shifted_pts[['y']] <- shifted_pts[['y']] + shift_pts[['y']]\n-  add_edited_uv(shifted_pts)\n+  layout_uvhydro()\n   \n-  # gageHeight\n-  if(isSeriesOfType(data, \"secondarySeries\", \"Gage height\")) {\n-    add_stage_measurements(data)\n-    \n-    #add effective shift axis, timeseries, and shift measurements\n-    # NOTE: this is a third plot, so this has to come at the end of this method.\n-    #third axis\n-    measuredShifts <- getFieldVisitErrorBarsShifts(data)\n-    add_third_axes(secondary_lims = secondary_lims, tertiary_pts = shift_pts, tertiary_lbl = tertiary_lbl, measured_shift_pts = measuredShifts)\n-    add_shift_measurements(measuredShifts)\n+  for (month in months){  \n+    #legend vector, needs to be dynamically built up with plots\n+    primary_legend <- getNewLegendFrame()\n+    addToPrimaryLegend <- function(newText, newSymbol, newColor, newLine) { \n+      primary_legend <<- rbind(primary_legend, data.frame(text = newText, symbol = newSymbol, color = newColor, line = newLine, stringsAsFactors = FALSE))","path":"R/uvhydrograph-fnc.R","position":54,"original_position":54,"commit_id":"bfde72699e34cfdfe521bffa68680fc3eb46f460","original_commit_id":"bfde72699e34cfdfe521bffa68680fc3eb46f460","user":{"login":"jiwalker-usgs","id":1173041,"avatar_url":"https://avatars.githubusercontent.com/u/1173041?v=3","gravatar_id":"","url":"https://api.github.com/users/jiwalker-usgs","html_url":"https://github.com/jiwalker-usgs","followers_url":"https://api.github.com/users/jiwalker-usgs/followers","following_url":"https://api.github.com/users/jiwalker-usgs/following{/other_user}","gists_url":"https://api.github.com/users/jiwalker-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/jiwalker-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiwalker-usgs/subscriptions","organizations_url":"https://api.github.com/users/jiwalker-usgs/orgs","repos_url":"https://api.github.com/users/jiwalker-usgs/repos","events_url":"https://api.github.com/users/jiwalker-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/jiwalker-usgs/received_events","type":"User","site_admin":false},"body":"That isn't actually what that does.  It works its way up in scope and assigns it when it finds it.  If it doesn't find that variable declared anywhere, it will then assign it to global.  This is the way to accumulate the legend in a more functional way.","created_at":"2015-06-01T18:15:08Z","updated_at":"2015-06-01T18:15:08Z","html_url":"https://github.com/USGS-R/repgen/pull/50#discussion_r31453461","pull_request_url":"https://api.github.com/repos/USGS-R/repgen/pulls/50","_links":{"self":{"href":"https://api.github.com/repos/USGS-R/repgen/pulls/comments/31453461"},"html":{"href":"https://github.com/USGS-R/repgen/pull/50#discussion_r31453461"},"pull_request":{"href":"https://api.github.com/repos/USGS-R/repgen/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/USGS-R/repgen/pulls/50","id":36518307,"html_url":"https://github.com/USGS-R/repgen/pull/50","diff_url":"https://github.com/USGS-R/repgen/pull/50.diff","patch_url":"https://github.com/USGS-R/repgen/pull/50.patch","issue_url":"https://api.github.com/repos/USGS-R/repgen/issues/50","number":50,"state":"open","locked":false,"title":"Added dynamically colored points based on approvals and dynamic legends","user":{"login":"thongsav-usgs","id":3835711,"avatar_url":"https://avatars.githubusercontent.com/u/3835711?v=3","gravatar_id":"","url":"https://api.github.com/users/thongsav-usgs","html_url":"https://github.com/thongsav-usgs","followers_url":"https://api.github.com/users/thongsav-usgs/followers","following_url":"https://api.github.com/users/thongsav-usgs/following{/other_user}","gists_url":"https://api.github.com/users/thongsav-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/thongsav-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thongsav-usgs/subscriptions","organizations_url":"https://api.github.com/users/thongsav-usgs/orgs","repos_url":"https://api.github.com/users/thongsav-usgs/repos","events_url":"https://api.github.com/users/thongsav-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/thongsav-usgs/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-29T15:46:52Z","updated_at":"2015-06-01T18:15:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"854fb835b3452a5364d470dbcd18c14ef3e2c633","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/USGS-R/repgen/pulls/50/commits","review_comments_url":"https://api.github.com/repos/USGS-R/repgen/pulls/50/comments","review_comment_url":"https://api.github.com/repos/USGS-R/repgen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/USGS-R/repgen/issues/50/comments","statuses_url":"https://api.github.com/repos/USGS-R/repgen/statuses/bfde72699e34cfdfe521bffa68680fc3eb46f460","head":{"label":"thongsav-usgs:master","ref":"master","sha":"bfde72699e34cfdfe521bffa68680fc3eb46f460","user":{"login":"thongsav-usgs","id":3835711,"avatar_url":"https://avatars.githubusercontent.com/u/3835711?v=3","gravatar_id":"","url":"https://api.github.com/users/thongsav-usgs","html_url":"https://github.com/thongsav-usgs","followers_url":"https://api.github.com/users/thongsav-usgs/followers","following_url":"https://api.github.com/users/thongsav-usgs/following{/other_user}","gists_url":"https://api.github.com/users/thongsav-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/thongsav-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thongsav-usgs/subscriptions","organizations_url":"https://api.github.com/users/thongsav-usgs/orgs","repos_url":"https://api.github.com/users/thongsav-usgs/repos","events_url":"https://api.github.com/users/thongsav-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/thongsav-usgs/received_events","type":"User","site_admin":false},"repo":{"id":32328528,"name":"repgen","full_name":"thongsav-usgs/repgen","owner":{"login":"thongsav-usgs","id":3835711,"avatar_url":"https://avatars.githubusercontent.com/u/3835711?v=3","gravatar_id":"","url":"https://api.github.com/users/thongsav-usgs","html_url":"https://github.com/thongsav-usgs","followers_url":"https://api.github.com/users/thongsav-usgs/followers","following_url":"https://api.github.com/users/thongsav-usgs/following{/other_user}","gists_url":"https://api.github.com/users/thongsav-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/thongsav-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thongsav-usgs/subscriptions","organizations_url":"https://api.github.com/users/thongsav-usgs/orgs","repos_url":"https://api.github.com/users/thongsav-usgs/repos","events_url":"https://api.github.com/users/thongsav-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/thongsav-usgs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thongsav-usgs/repgen","description":"report generation in R","fork":true,"url":"https://api.github.com/repos/thongsav-usgs/repgen","forks_url":"https://api.github.com/repos/thongsav-usgs/repgen/forks","keys_url":"https://api.github.com/repos/thongsav-usgs/repgen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thongsav-usgs/repgen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thongsav-usgs/repgen/teams","hooks_url":"https://api.github.com/repos/thongsav-usgs/repgen/hooks","issue_events_url":"https://api.github.com/repos/thongsav-usgs/repgen/issues/events{/number}","events_url":"https://api.github.com/repos/thongsav-usgs/repgen/events","assignees_url":"https://api.github.com/repos/thongsav-usgs/repgen/assignees{/user}","branches_url":"https://api.github.com/repos/thongsav-usgs/repgen/branches{/branch}","tags_url":"https://api.github.com/repos/thongsav-usgs/repgen/tags","blobs_url":"https://api.github.com/repos/thongsav-usgs/repgen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thongsav-usgs/repgen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thongsav-usgs/repgen/git/refs{/sha}","trees_url":"https://api.github.com/repos/thongsav-usgs/repgen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thongsav-usgs/repgen/statuses/{sha}","languages_url":"https://api.github.com/repos/thongsav-usgs/repgen/languages","stargazers_url":"https://api.github.com/repos/thongsav-usgs/repgen/stargazers","contributors_url":"https://api.github.com/repos/thongsav-usgs/repgen/contributors","subscribers_url":"https://api.github.com/repos/thongsav-usgs/repgen/subscribers","subscription_url":"https://api.github.com/repos/thongsav-usgs/repgen/subscription","commits_url":"https://api.github.com/repos/thongsav-usgs/repgen/commits{/sha}","git_commits_url":"https://api.github.com/repos/thongsav-usgs/repgen/git/commits{/sha}","comments_url":"https://api.github.com/repos/thongsav-usgs/repgen/comments{/number}","issue_comment_url":"https://api.github.com/repos/thongsav-usgs/repgen/issues/comments{/number}","contents_url":"https://api.github.com/repos/thongsav-usgs/repgen/contents/{+path}","compare_url":"https://api.github.com/repos/thongsav-usgs/repgen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thongsav-usgs/repgen/merges","archive_url":"https://api.github.com/repos/thongsav-usgs/repgen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thongsav-usgs/repgen/downloads","issues_url":"https://api.github.com/repos/thongsav-usgs/repgen/issues{/number}","pulls_url":"https://api.github.com/repos/thongsav-usgs/repgen/pulls{/number}","milestones_url":"https://api.github.com/repos/thongsav-usgs/repgen/milestones{/number}","notifications_url":"https://api.github.com/repos/thongsav-usgs/repgen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thongsav-usgs/repgen/labels{/name}","releases_url":"https://api.github.com/repos/thongsav-usgs/repgen/releases{/id}","created_at":"2015-03-16T13:57:27Z","updated_at":"2015-03-16T18:18:02Z","pushed_at":"2015-05-29T20:33:20Z","git_url":"git://github.com/thongsav-usgs/repgen.git","ssh_url":"git@github.com:thongsav-usgs/repgen.git","clone_url":"https://github.com/thongsav-usgs/repgen.git","svn_url":"https://github.com/thongsav-usgs/repgen","homepage":null,"size":1776,"stargazers_count":0,"watchers_count":0,"language":"R","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"USGS-R:master","ref":"master","sha":"5462f678bc11fbd56339ec1eab1f3ff5d53e6369","user":{"login":"USGS-R","id":3188813,"avatar_url":"https://avatars.githubusercontent.com/u/3188813?v=3","gravatar_id":"","url":"https://api.github.com/users/USGS-R","html_url":"https://github.com/USGS-R","followers_url":"https://api.github.com/users/USGS-R/followers","following_url":"https://api.github.com/users/USGS-R/following{/other_user}","gists_url":"https://api.github.com/users/USGS-R/gists{/gist_id}","starred_url":"https://api.github.com/users/USGS-R/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/USGS-R/subscriptions","organizations_url":"https://api.github.com/users/USGS-R/orgs","repos_url":"https://api.github.com/users/USGS-R/repos","events_url":"https://api.github.com/users/USGS-R/events{/privacy}","received_events_url":"https://api.github.com/users/USGS-R/received_events","type":"Organization","site_admin":false},"repo":{"id":31678130,"name":"repgen","full_name":"USGS-R/repgen","owner":{"login":"USGS-R","id":3188813,"avatar_url":"https://avatars.githubusercontent.com/u/3188813?v=3","gravatar_id":"","url":"https://api.github.com/users/USGS-R","html_url":"https://github.com/USGS-R","followers_url":"https://api.github.com/users/USGS-R/followers","following_url":"https://api.github.com/users/USGS-R/following{/other_user}","gists_url":"https://api.github.com/users/USGS-R/gists{/gist_id}","starred_url":"https://api.github.com/users/USGS-R/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/USGS-R/subscriptions","organizations_url":"https://api.github.com/users/USGS-R/orgs","repos_url":"https://api.github.com/users/USGS-R/repos","events_url":"https://api.github.com/users/USGS-R/events{/privacy}","received_events_url":"https://api.github.com/users/USGS-R/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/USGS-R/repgen","description":"report generation in R","fork":false,"url":"https://api.github.com/repos/USGS-R/repgen","forks_url":"https://api.github.com/repos/USGS-R/repgen/forks","keys_url":"https://api.github.com/repos/USGS-R/repgen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/USGS-R/repgen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/USGS-R/repgen/teams","hooks_url":"https://api.github.com/repos/USGS-R/repgen/hooks","issue_events_url":"https://api.github.com/repos/USGS-R/repgen/issues/events{/number}","events_url":"https://api.github.com/repos/USGS-R/repgen/events","assignees_url":"https://api.github.com/repos/USGS-R/repgen/assignees{/user}","branches_url":"https://api.github.com/repos/USGS-R/repgen/branches{/branch}","tags_url":"https://api.github.com/repos/USGS-R/repgen/tags","blobs_url":"https://api.github.com/repos/USGS-R/repgen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/USGS-R/repgen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/USGS-R/repgen/git/refs{/sha}","trees_url":"https://api.github.com/repos/USGS-R/repgen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/USGS-R/repgen/statuses/{sha}","languages_url":"https://api.github.com/repos/USGS-R/repgen/languages","stargazers_url":"https://api.github.com/repos/USGS-R/repgen/stargazers","contributors_url":"https://api.github.com/repos/USGS-R/repgen/contributors","subscribers_url":"https://api.github.com/repos/USGS-R/repgen/subscribers","subscription_url":"https://api.github.com/repos/USGS-R/repgen/subscription","commits_url":"https://api.github.com/repos/USGS-R/repgen/commits{/sha}","git_commits_url":"https://api.github.com/repos/USGS-R/repgen/git/commits{/sha}","comments_url":"https://api.github.com/repos/USGS-R/repgen/comments{/number}","issue_comment_url":"https://api.github.com/repos/USGS-R/repgen/issues/comments{/number}","contents_url":"https://api.github.com/repos/USGS-R/repgen/contents/{+path}","compare_url":"https://api.github.com/repos/USGS-R/repgen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/USGS-R/repgen/merges","archive_url":"https://api.github.com/repos/USGS-R/repgen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/USGS-R/repgen/downloads","issues_url":"https://api.github.com/repos/USGS-R/repgen/issues{/number}","pulls_url":"https://api.github.com/repos/USGS-R/repgen/pulls{/number}","milestones_url":"https://api.github.com/repos/USGS-R/repgen/milestones{/number}","notifications_url":"https://api.github.com/repos/USGS-R/repgen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/USGS-R/repgen/labels{/name}","releases_url":"https://api.github.com/repos/USGS-R/repgen/releases{/id}","created_at":"2015-03-04T20:24:02Z","updated_at":"2015-05-04T17:24:45Z","pushed_at":"2015-05-29T20:33:20Z","git_url":"git://github.com/USGS-R/repgen.git","ssh_url":"git@github.com:USGS-R/repgen.git","clone_url":"https://github.com/USGS-R/repgen.git","svn_url":"https://github.com/USGS-R/repgen","homepage":null,"size":2291,"stargazers_count":0,"watchers_count":0,"language":"R","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":8,"forks":5,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/USGS-R/repgen/pulls/50"},"html":{"href":"https://github.com/USGS-R/repgen/pull/50"},"issue":{"href":"https://api.github.com/repos/USGS-R/repgen/issues/50"},"comments":{"href":"https://api.github.com/repos/USGS-R/repgen/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/USGS-R/repgen/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/USGS-R/repgen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/USGS-R/repgen/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/USGS-R/repgen/statuses/bfde72699e34cfdfe521bffa68680fc3eb46f460"}}}}