{"id":14062813,"url":"https://github.com/timelyportfolio/exportwidget","last_synced_at":"2025-10-29T01:31:56.398Z","repository":{"id":141154485,"uuid":"33570241","full_name":"timelyportfolio/exportwidget","owner":"timelyportfolio","description":"R htmlwidget to export other htmlwidgets and SVG as png","archived":false,"fork":false,"pushed_at":"2016-10-26T18:41:35.000Z","size":126,"stargazers_count":17,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-01T21:05:44.389Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timelyportfolio.png","metadata":{"files":{"readme":"Readme.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-07T21:52:56.000Z","updated_at":"2024-07-01T19:29:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a30ef40-5fad-41b1-90cf-7177444339c5","html_url":"https://github.com/timelyportfolio/exportwidget","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timelyportfolio%2Fexportwidget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timelyportfolio%2Fexportwidget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timelyportfolio%2Fexportwidget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timelyportfolio%2Fexportwidget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timelyportfolio","download_url":"https://codeload.github.com/timelyportfolio/exportwidget/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238758192,"owners_count":19525723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-13T07:02:29.945Z","updated_at":"2025-10-29T01:31:56.084Z","avatar_url":"https://github.com/timelyportfolio.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# exportwidget - htmlwidget to export htmlwidgets\n\nThis is **pre-alpha and experimental** `v0.2.0` but should work.  **Note, this currently does not work in RStudio Viewer**.  `export_widget` was the widget of the week at [Building Widgets](http://buildingwidgets.com), so you can see it in action in this [blog post](http://www.buildingwidgets.com/blog/2015/4/9/week-14-exporting-widget).\n\nThanks so much to the following libraries and their authors.\n\n1. [`fabric.js`](http://fabricjs.com)\n3. [`Download-File-JS`](https://github.com/PixelsCommander/Download-File-JS)\n\n\n### Install\n\n```r\ndevtools::install_github(\"timelyportfolio/exportwidget\")\n```\n\n\n### Example with an htmlwidget | DiagrammeR\n\n```r\nlibrary(pipeR)\nlibrary(htmltools)\nlibrary(DiagrammeR)\nlibrary(exportwidget)\n\ntagList(\n  grViz(\" digraph { a-\u003eb; b-\u003ec; c-\u003ea; }\")\n  ,export_widget( )\n) %\u003e\u003e% html_print( viewer = utils::browseURL ) #export not working in RStudio Viewer\n```\n\n\n### Example with multiple htmlwidgets\n\n```r\nlibrary(pipeR)\nlibrary(htmltools)\nlibrary(DiagrammeR)\nlibrary(rcdimple)\nlibrary(networkD3)\nlibrary(exportwidget)\n\ntagList(\n  grViz(\" digraph { a-\u003eb; b-\u003ec; c-\u003ea; }\")\n  ,dimple(\n    mtcars\n    , mpg ~ cyl\n    , groups = \"cyl\"\n    , type = \"bubble\"\n  )\n  ,simpleNetwork(\n    data.frame(\n      Source = c(\"A\", \"A\", \"A\", \"A\", \"B\", \"B\", \"C\", \"C\", \"D\")\n      ,Target = c(\"B\", \"C\", \"D\", \"J\", \"E\", \"F\", \"G\", \"H\", \"I\")\n    )\n    ,height = 400\n    ,width = 400\n  )\n  ,export_widget( )\n) %\u003e\u003e% html_print( viewer = utils::browseURL ) #export not working in RStudio Viewer\n```\n\n\n```r\nlibrary(streamgraph)\nlibrary(dplyr)\nlibrary(exportwidget)\nlibrary(webshot)\nlibrary(ggplot2movies)\n\nmovies %\u003e%\n    select(year, Action, Animation, Comedy, Drama, Documentary, Romance, Short) %\u003e%\n    tidyr::gather(genre, value, -year) %\u003e%\n    group_by(year, genre) %\u003e%\n    tally(wt=value) %\u003e%\n    ungroup %\u003e%\n    mutate(year=as.Date(sprintf(\"%d-01-01\", year))) -\u003e dat\n\nhtml_print(tagList(\n  streamgraph(dat, \"genre\", \"n\", \"year\")\n  ,export_widget( )\n)) %\u003e%\n  normalizePath(.,winslash=\"/\") %\u003e%\n  gsub(x=.,pattern = \":/\",replacement=\"://\") %\u003e%\n  paste0(\"file:///\",.) %\u003e%\n  webshot( file = \"stream_screen.png\", delay = 10 )\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimelyportfolio%2Fexportwidget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimelyportfolio%2Fexportwidget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimelyportfolio%2Fexportwidget/lists"}