{"action":"closed","number":381,"pull_request":{"url":"https://api.github.com/repos/rstudio/ggvis/pulls/381","id":32461286,"html_url":"https://github.com/rstudio/ggvis/pull/381","diff_url":"https://github.com/rstudio/ggvis/pull/381.diff","patch_url":"https://github.com/rstudio/ggvis/pull/381.patch","issue_url":"https://api.github.com/repos/rstudio/ggvis/issues/381","number":381,"state":"closed","locked":false,"title":"Enable auto-resizing to container div","user":{"login":"wch","id":86978,"avatar_url":"https://avatars.githubusercontent.com/u/86978?v=3","gravatar_id":"","url":"https://api.github.com/users/wch","html_url":"https://github.com/wch","followers_url":"https://api.github.com/users/wch/followers","following_url":"https://api.github.com/users/wch/following{/other_user}","gists_url":"https://api.github.com/users/wch/gists{/gist_id}","starred_url":"https://api.github.com/users/wch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wch/subscriptions","organizations_url":"https://api.github.com/users/wch/orgs","repos_url":"https://api.github.com/users/wch/repos","events_url":"https://api.github.com/users/wch/events{/privacy}","received_events_url":"https://api.github.com/users/wch/received_events","type":"User","site_admin":false},"body":"Closes #316. Closes #374.\r\n\r\nExample app (container div is shaded yellow):\r\n\r\n```R\r\nlibrary(shiny)\r\nlibrary(ggvis)\r\n\r\nshinyApp(\r\n  ui = fluidPage(\r\n    div(style = \"width:300px; height:300px; background: #ffd;\",\r\n      ggvisOutput(\"plot\")\r\n    )\r\n  ),\r\n  server = function(input, output) {\r\n    mtcars %>% ggvis(~wt, ~mpg) %>% layer_points() %>%\r\n      set_options(width = \"auto\", height = \"auto\", resizable=FALSE) %>%\r\n      bind_shiny(\"plot\")\r\n  }\r\n)\r\n```\r\n\r\nThis app demonstrates how the height and width settings interact work when the wrapper div has a specified size:\r\n\r\n```R\r\nlibrary(shiny)\r\nlibrary(ggvis)\r\n\r\nshinyApp(\r\n  ui = fluidPage(sidebarLayout(\r\n    sidebarPanel(\r\n      radioButtons(\"width\", \"Width\", c(\"auto\", \"400\")),\r\n      radioButtons(\"height\", \"Height\", c(\"auto\", \"400\")),\r\n      radioButtons(\"resizable\", \"Resizable (enabled only if width and height are fixed)\",\r\n                   c(\"Yes\", \"No\"))\r\n    ),\r\n    mainPanel(\r\n      div(style = \"width:300px; height:300px; background: #ffd;\",\r\n        ggvisOutput(\"plot\")\r\n      )\r\n    )\r\n  )),\r\n  server = function(input, output) {\r\n    reactive({\r\n      resizable <- (input$resizable == \"Yes\")\r\n\r\n      mtcars %>% ggvis(~wt, ~mpg) %>% layer_points() %>%\r\n      set_options(width = input$width, height = input$height, resizable=resizable)\r\n    }) %>%\r\n      bind_shiny(\"plot\")\r\n  }\r\n)\r\n```\r\n","created_at":"2015-04-01T21:11:58Z","updated_at":"2015-04-01T21:19:43Z","closed_at":"2015-04-01T21:19:43Z","merged_at":"2015-04-01T21:19:43Z","merge_commit_sha":"1650915dc7e7a3e6c3877d879f1cbaa7b8d7b159","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rstudio/ggvis/pulls/381/commits","review_comments_url":"https://api.github.com/repos/rstudio/ggvis/pulls/381/comments","review_comment_url":"https://api.github.com/repos/rstudio/ggvis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rstudio/ggvis/issues/381/comments","statuses_url":"https://api.github.com/repos/rstudio/ggvis/statuses/a213c86fa10f3660bf197d8f9bc9f294df2e9894","head":{"label":"rstudio:resize","ref":"resize","sha":"a213c86fa10f3660bf197d8f9bc9f294df2e9894","user":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"repo":{"id":9779536,"name":"ggvis","full_name":"rstudio/ggvis","owner":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rstudio/ggvis","description":"Interactive grammar of graphics for R","fork":false,"url":"https://api.github.com/repos/rstudio/ggvis","forks_url":"https://api.github.com/repos/rstudio/ggvis/forks","keys_url":"https://api.github.com/repos/rstudio/ggvis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rstudio/ggvis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rstudio/ggvis/teams","hooks_url":"https://api.github.com/repos/rstudio/ggvis/hooks","issue_events_url":"https://api.github.com/repos/rstudio/ggvis/issues/events{/number}","events_url":"https://api.github.com/repos/rstudio/ggvis/events","assignees_url":"https://api.github.com/repos/rstudio/ggvis/assignees{/user}","branches_url":"https://api.github.com/repos/rstudio/ggvis/branches{/branch}","tags_url":"https://api.github.com/repos/rstudio/ggvis/tags","blobs_url":"https://api.github.com/repos/rstudio/ggvis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rstudio/ggvis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rstudio/ggvis/git/refs{/sha}","trees_url":"https://api.github.com/repos/rstudio/ggvis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rstudio/ggvis/statuses/{sha}","languages_url":"https://api.github.com/repos/rstudio/ggvis/languages","stargazers_url":"https://api.github.com/repos/rstudio/ggvis/stargazers","contributors_url":"https://api.github.com/repos/rstudio/ggvis/contributors","subscribers_url":"https://api.github.com/repos/rstudio/ggvis/subscribers","subscription_url":"https://api.github.com/repos/rstudio/ggvis/subscription","commits_url":"https://api.github.com/repos/rstudio/ggvis/commits{/sha}","git_commits_url":"https://api.github.com/repos/rstudio/ggvis/git/commits{/sha}","comments_url":"https://api.github.com/repos/rstudio/ggvis/comments{/number}","issue_comment_url":"https://api.github.com/repos/rstudio/ggvis/issues/comments{/number}","contents_url":"https://api.github.com/repos/rstudio/ggvis/contents/{+path}","compare_url":"https://api.github.com/repos/rstudio/ggvis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rstudio/ggvis/merges","archive_url":"https://api.github.com/repos/rstudio/ggvis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rstudio/ggvis/downloads","issues_url":"https://api.github.com/repos/rstudio/ggvis/issues{/number}","pulls_url":"https://api.github.com/repos/rstudio/ggvis/pulls{/number}","milestones_url":"https://api.github.com/repos/rstudio/ggvis/milestones{/number}","notifications_url":"https://api.github.com/repos/rstudio/ggvis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rstudio/ggvis/labels{/name}","releases_url":"https://api.github.com/repos/rstudio/ggvis/releases{/id}","created_at":"2013-04-30T20:30:24Z","updated_at":"2015-04-01T20:04:03Z","pushed_at":"2015-04-01T21:19:43Z","git_url":"git://github.com/rstudio/ggvis.git","ssh_url":"git@github.com:rstudio/ggvis.git","clone_url":"https://github.com/rstudio/ggvis.git","svn_url":"https://github.com/rstudio/ggvis","homepage":null,"size":8909,"stargazers_count":400,"watchers_count":400,"language":"R","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":105,"mirror_url":null,"open_issues_count":110,"forks":105,"open_issues":110,"watchers":400,"default_branch":"master"}},"base":{"label":"rstudio:master","ref":"master","sha":"0c6799cc5fd2883f0c75379a4a000ccbfbca83ba","user":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"repo":{"id":9779536,"name":"ggvis","full_name":"rstudio/ggvis","owner":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rstudio/ggvis","description":"Interactive grammar of graphics for R","fork":false,"url":"https://api.github.com/repos/rstudio/ggvis","forks_url":"https://api.github.com/repos/rstudio/ggvis/forks","keys_url":"https://api.github.com/repos/rstudio/ggvis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rstudio/ggvis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rstudio/ggvis/teams","hooks_url":"https://api.github.com/repos/rstudio/ggvis/hooks","issue_events_url":"https://api.github.com/repos/rstudio/ggvis/issues/events{/number}","events_url":"https://api.github.com/repos/rstudio/ggvis/events","assignees_url":"https://api.github.com/repos/rstudio/ggvis/assignees{/user}","branches_url":"https://api.github.com/repos/rstudio/ggvis/branches{/branch}","tags_url":"https://api.github.com/repos/rstudio/ggvis/tags","blobs_url":"https://api.github.com/repos/rstudio/ggvis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rstudio/ggvis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rstudio/ggvis/git/refs{/sha}","trees_url":"https://api.github.com/repos/rstudio/ggvis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rstudio/ggvis/statuses/{sha}","languages_url":"https://api.github.com/repos/rstudio/ggvis/languages","stargazers_url":"https://api.github.com/repos/rstudio/ggvis/stargazers","contributors_url":"https://api.github.com/repos/rstudio/ggvis/contributors","subscribers_url":"https://api.github.com/repos/rstudio/ggvis/subscribers","subscription_url":"https://api.github.com/repos/rstudio/ggvis/subscription","commits_url":"https://api.github.com/repos/rstudio/ggvis/commits{/sha}","git_commits_url":"https://api.github.com/repos/rstudio/ggvis/git/commits{/sha}","comments_url":"https://api.github.com/repos/rstudio/ggvis/comments{/number}","issue_comment_url":"https://api.github.com/repos/rstudio/ggvis/issues/comments{/number}","contents_url":"https://api.github.com/repos/rstudio/ggvis/contents/{+path}","compare_url":"https://api.github.com/repos/rstudio/ggvis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rstudio/ggvis/merges","archive_url":"https://api.github.com/repos/rstudio/ggvis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rstudio/ggvis/downloads","issues_url":"https://api.github.com/repos/rstudio/ggvis/issues{/number}","pulls_url":"https://api.github.com/repos/rstudio/ggvis/pulls{/number}","milestones_url":"https://api.github.com/repos/rstudio/ggvis/milestones{/number}","notifications_url":"https://api.github.com/repos/rstudio/ggvis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rstudio/ggvis/labels{/name}","releases_url":"https://api.github.com/repos/rstudio/ggvis/releases{/id}","created_at":"2013-04-30T20:30:24Z","updated_at":"2015-04-01T20:04:03Z","pushed_at":"2015-04-01T21:19:43Z","git_url":"git://github.com/rstudio/ggvis.git","ssh_url":"git@github.com:rstudio/ggvis.git","clone_url":"https://github.com/rstudio/ggvis.git","svn_url":"https://github.com/rstudio/ggvis","homepage":null,"size":8909,"stargazers_count":400,"watchers_count":400,"language":"R","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":105,"mirror_url":null,"open_issues_count":110,"forks":105,"open_issues":110,"watchers":400,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rstudio/ggvis/pulls/381"},"html":{"href":"https://github.com/rstudio/ggvis/pull/381"},"issue":{"href":"https://api.github.com/repos/rstudio/ggvis/issues/381"},"comments":{"href":"https://api.github.com/repos/rstudio/ggvis/issues/381/comments"},"review_comments":{"href":"https://api.github.com/repos/rstudio/ggvis/pulls/381/comments"},"review_comment":{"href":"https://api.github.com/repos/rstudio/ggvis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rstudio/ggvis/pulls/381/commits"},"statuses":{"href":"https://api.github.com/repos/rstudio/ggvis/statuses/a213c86fa10f3660bf197d8f9bc9f294df2e9894"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"wch","id":86978,"avatar_url":"https://avatars.githubusercontent.com/u/86978?v=3","gravatar_id":"","url":"https://api.github.com/users/wch","html_url":"https://github.com/wch","followers_url":"https://api.github.com/users/wch/followers","following_url":"https://api.github.com/users/wch/following{/other_user}","gists_url":"https://api.github.com/users/wch/gists{/gist_id}","starred_url":"https://api.github.com/users/wch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wch/subscriptions","organizations_url":"https://api.github.com/users/wch/orgs","repos_url":"https://api.github.com/users/wch/repos","events_url":"https://api.github.com/users/wch/events{/privacy}","received_events_url":"https://api.github.com/users/wch/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":7,"additions":407,"deletions":3534,"changed_files":36}}