{"id":13424392,"url":"https://github.com/Appsilon/r2d3","last_synced_at":"2025-03-15T18:34:57.415Z","repository":{"id":48412004,"uuid":"81075538","full_name":"Appsilon/r2d3","owner":"Appsilon","description":"R domain specific language for D3.js","archived":false,"fork":false,"pushed_at":"2023-12-15T05:52:15.000Z","size":19658,"stargazers_count":10,"open_issues_count":2,"forks_count":1,"subscribers_count":29,"default_branch":"master","last_synced_at":"2024-10-26T23:55:11.003Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://appsilon.github.io/r2d3/","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Appsilon.png","metadata":{"files":{"readme":"README.Rmd","changelog":"CHANGELOG.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}},"created_at":"2017-02-06T10:26:38.000Z","updated_at":"2021-01-24T09:10:26.000Z","dependencies_parsed_at":"2024-01-31T07:53:06.208Z","dependency_job_id":"6a1bf563-1773-478b-8fe3-6f0f315e80f3","html_url":"https://github.com/Appsilon/r2d3","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/Appsilon%2Fr2d3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsilon%2Fr2d3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsilon%2Fr2d3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsilon%2Fr2d3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Appsilon","download_url":"https://codeload.github.com/Appsilon/r2d3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243775842,"owners_count":20346274,"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-07-31T00:00:53.734Z","updated_at":"2025-03-15T18:34:54.208Z","avatar_url":"https://github.com/Appsilon.png","language":"CoffeeScript","funding_links":[],"categories":["CoffeeScript"],"sub_categories":[],"readme":"---\ntitle:\noutput: html_document\nparams:\n   website_url: http://appsilondatascience.com\n   logo_url: https://cdn.rawgit.com/Appsilon/website-cdn/gh-pages/logo-white.png\n   \n   repo_name: r2d3\n   repo_url: https://github.com/Appsilon/r2d3\n   demo_url: http://appsilondatascience.com/demo\n   chagelog_url: http://appsilondatascience.com/repo_changelog\n---\n\n\u003clink href=\"http://fonts.googleapis.com/css?family=Lato:300,700,300italic|Inconsolata\" rel=\"stylesheet\" type=\"text/css\"\u003e\n\u003clink href='docs/style.css' rel='stylesheet' type='text/css'\u003e\n\n`r params$repo_name`\n===========\n\n\u003cdiv class=\"subheader\"\u003e R domain specific language for D3.js \u003c/div\u003e\n\n\u003cdiv class=\"section level2\"\u003e\nData driven documents in R without predefined wrappers. With this package you can create any visualisation possible in D3 directly with R language.\n\nNote: _We are aware of package with a similar _ [_https://github.com/hadley/r2d3_](https://github.com/hadley/r2d3) _, but it is no longer maintained. Only name is the same. Our package is doing a completely different thing than wrapping a D3 for ggplot2. _ \n\n\u003c/div\u003e\n\nDemo {.darkorange}\n-------\n\n\n```{r, eval = F}\nlibrary(r2d3)\nlibrary(texturer)\nlibrary(magrittr)\n\nr2d3({\n  svg \u003c- d3() %\u003e% select(\"body\") %\u003e% append(\"svg\") %\u003e% attr(\"width\", 500) %\u003e% attr(\"height\", 500)\n  dashed \u003c- textures() %\u003e% lines() %\u003e% thicker()\n  dots \u003c- textures() %\u003e% circles() %\u003e% size(5) %\u003e% radius(2)\n \n  svg$call(dashed)\n  svg$call(dots)\n  \n  svg %\u003e%\n    selectAll(\"circle\") %\u003e%\n    data(mtcars) %\u003e%\n    enter() %\u003e%\n    append(\"circle\") %\u003e%\n    attr(\"cx\", ~ .$hp) %\u003e%\n    attr(\"cy\", ~ .$disp) %\u003e%\n    attr(\"r\", ~ .$mpg) %\u003e%\n    attr('pointer-events', 'all') %\u003e%\n    style(\"fill\", dots) %\u003e%\n    on(\"mouseover\", ~ d3() %\u003e% select(this) %\u003e% style(\"fill\", dashed)) %\u003e%\n    on(\"mouseout\", ~ d3() %\u003e% select(this) %\u003e% style(\"fill\", dots))\n})\n```\n\n```{r, echo=F, screenshot.opts = list(zoom = 0.01)}\nsuppressMessages(base::source(\"examples/texturer_demo.R\"))\nsuppressMessages(execute(i))\n```\n\n\u003cbr/\u003e\n\u003cbr/\u003e\nNote: code above will not work with the current version of the package. It is code compatible with our design. Current [working version is here](https://github.com/Appsilon/r2d3/blob/master/examples/texturer_demo.R).\n\n\nThe problem and motivation \n-----------\n\nIt's natural for a data scientist to look for a better data visualisation methods in R. Although there are many greatly supported R packages that allow to create plots (ggplot2, plotly, rbokeh), when it comes to non-standard visualisations like network graphs, bubble or radial charts you have to look for something created by the community. \n\nIf you know JavaScript (JS) you might think about wrapping a D3 component into **htmlwidget** and use it in your RMarkdown report or Shiny app. In fact there are many libraries that were already written to wrap a specific D3 components, for instance: [NetworkGraphs](http://christophergandrud.github.io/networkD3/), [BubbleChart](https://github.com/jcheng5/bubbles), [CoffeeWheel](https://github.com/armish/coffeewheel), etc. . \n\nHowever only some of them generate truly interactive visualisations, other only allow for image or SVG generation. And when it comes to customisations they are very limited, time-consuming and often difficult to do without an appropraite JS knowledge. Since not many data scientists know JS, for the sake of their work, they often resort to manual editing of produced SVG files or static images in PhotoShop. In other case they order visualisations from D3 specialists. Either way it's diffucult, time and cost consuming to use what's currently available on the market.\n\nSo in order to tackle the problems of customised, interactive and pleasent data visualisations we are proposing a standardised package wrapping D3, which will allow data scientises to recreate any data visualisation possible in D3 directly with R language. With a D3-like syntax anyone would be able to create visualisations like those below. \n\n\u003c!-- ![](https://s3-us-west-2.amazonaws.com/notion-static/03b7a7a7d48e4298b98157ea9a9cda97/Untitled) --\u003e\n\n\u003c!-- ![](https://s3-us-west-2.amazonaws.com/notion-static/c45064a1ae1f40d7ab0f880a6886239a/Untitled) --\u003e\n\n\u003c!-- ![](https://s3-us-west-2.amazonaws.com/notion-static/bc7c50a46f4a4594b86f3d014f666048/Untitled) --\u003e\n\nHow to install? {.firebrick}\n---------------\n**Note! This library is still in its infancy. Api might change in the future.**\n\nAt the moment it's possible to install this library through [devtools](https://github.com/hadley/devtools).\n```\ndevtools::install_github(\"Appsilon/`r params$repo_name`\")\n```\n\nTo install [previous version](`r params$changelog_url`) you can run:\n```\ndevtools::install_github(\"Appsilon/`r params$repo_name`\", ref = \"0.1.0\")\n```\n\n\nHow to contribute? \n-----------------\nIf you want to contribute to this project please submit a regular PR, once you're done with new feature or bug fix.\u003cbr\u003e\n\n**Changes in documentation**\n\nBoth repository **README.md** file and an official documentation page are generated with Rmarkdown, so if there is a need to update them, please modify accordingly a **README.Rmd** file  and run a **build_readme.R** script to compile it.\n\nSource code {.darkslide}\n-----------\n\nThis library source code can be found on [Appsilon Data Science's](`r params$website_url`) Github:\n\u003cbr\u003e\n[`r params$repo_url`](`r params$repo_url`)\n\n\u003cscript\u003e\ndocument.write('\u003cdiv class=\"logo\"\u003e\u003ca href=\"`r params$website_url`\"\u003e\u003cimg alt=\"Appsilon Data Science\" src=\"`r params$logo_url`\"/\u003e\u003c/a\u003e\u003c/div\u003e')\n\u003c/script\u003e\n\nTroubleshooting \n-----------------\nWe used the latest versions of dependencies for this library, so please update your R environment before installation.\n\nFuture enhacements {.darkorange}\n------------------\n- translating basic R expressions to JS\n- polishing D3 like syntax R-to-JS runtime \n- support for other D3 based plugins\n- handling exceptions with nice Documentation Urls(e.g. using R specific functions in R2D3)\n- create a documentation\n- write unity tests and basic examples coverage tets\n- CRAN release\n\nAppsilon Data Science {.footer}\n=====================\n\n\u003cdiv class=\"subheader\"\u003e We Provide End-to-End Data Science Solutions \u003c/div\u003e  \n\u003cdiv class=\"logo\"\u003e\u003ca href=\"`r params$website_url`\"\u003e\u003cimg alt=\"Appsilon Data Science\" src=\"`r params$logo_url`\" /\u003e\u003c/a\u003e\u003c/div\u003e\n\nGet in touch [dev@appsilondatascience.com](dev@appsilondatascience.com)\n\n\u003cscript\u003e\ndocument.write('\u003ca href=\"`r params$repo_url`\"\u003e\u003cimg style=\"position: absolute; margin: 0; top: 0; right: 0; border: 0;\" src=\"https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67\" alt=\"Fork me on GitHub\" data-canonical-src=\"https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png\"\u003e\u003c/a\u003e')\n\u003c/script\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAppsilon%2Fr2d3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAppsilon%2Fr2d3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAppsilon%2Fr2d3/lists"}