{"id":13711070,"url":"https://github.com/coolbutuseless/ggblur","last_synced_at":"2025-03-21T12:31:03.766Z","repository":{"id":95359575,"uuid":"239249946","full_name":"coolbutuseless/ggblur","owner":"coolbutuseless","description":"Blurry Point Geom for ggplot2","archived":false,"fork":false,"pushed_at":"2020-02-15T07:31:19.000Z","size":508,"stargazers_count":34,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-02-13T10:06:29.841Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","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/coolbutuseless.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"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}},"created_at":"2020-02-09T05:05:25.000Z","updated_at":"2024-01-31T08:16:12.000Z","dependencies_parsed_at":"2023-07-11T05:01:49.463Z","dependency_job_id":null,"html_url":"https://github.com/coolbutuseless/ggblur","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/coolbutuseless%2Fggblur","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coolbutuseless%2Fggblur/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coolbutuseless%2Fggblur/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coolbutuseless%2Fggblur/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coolbutuseless","download_url":"https://codeload.github.com/coolbutuseless/ggblur/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244799271,"owners_count":20512218,"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-02T23:01:04.136Z","updated_at":"2025-03-21T12:31:03.334Z","avatar_url":"https://github.com/coolbutuseless.png","language":"R","funding_links":[],"categories":["Plot layers","R","ggplot"],"sub_categories":["Additional Plot Types"],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n\nlibrary(ggplot2)\nlibrary(ggblur)\n```\n\n\n\n\n\n```{r echo = FALSE, eval = FALSE}\n# Quick logo generation. Borrowed heavily from Nick Tierney's Syn logo process\nlibrary(magick)\nlibrary(showtext)\nfont_add_google(\"Racing Sans One\", \"gf\")\n\n\n# pkgdown::build_site(override = list(destination = \"../coolbutuseless.github.io/package/ggblur\"))\n```\n\n\n```{r echo = FALSE, eval = FALSE}\nimg \u003c- image_read(\"man/figures/white.png\")\n\n\nhexSticker::sticker(subplot  = img,\n                    s_x      = 0.92,\n                    s_y      = 1.2,\n                    s_width  = 1.5,\n                    s_height = 0.95,\n                    package  = \"ggblur\",\n                    p_x      = 1,\n                    p_y      = 1,\n                    p_color  = \"#223344\",\n                    p_family = \"gf\",\n                    p_size   = 9,\n                    h_size   = 1.2,\n                    h_fill   = \"#ffffff\",\n                    h_color  = \"#223344\",\n                    filename = \"man/figures/logo.png\")\n\nimage_read(\"man/figures/logo.png\")\n```\n\n\n\n\n\n# ggblur   \u003cimg src=\"man/figures/logo-blurred.png\" align=\"right\" height=230/\u003e\n\n\u003c!-- badges: start --\u003e\n![](http://img.shields.io/badge/cool-useless-green.svg)\n\u003c!-- badges: end --\u003e\n\n`ggblur` provides `geom_point_blur()` for use in `ggplot` - this geom allows you \nto control the blurriness of the drawn points, but is otherwise\nidentical to the standard `geom_point()`.\n\n\n#### What's in the box?\n\n* `geom_point_blur()`\n    * same as `geom_point()` but now accepts `blur_size` as an aesthetic\n    * also allows for control of the smoothness of the blur (`blur_steps`)\n* `scale_blur_size_continuous()`, `scale_blur_size_discrete()` and `scale_blur_size_manual()` \n   for controlling `blur_size` when used as a mapped aesthetic/\n\n\n#### Similar packages\n\n* [ggecho](https://github.com/coolbutuseless/ggecho) is an earlier experiment of\n  mine from 2019 where I echo components using a custom stat `stat_echo`.  This \n  solution works across multiple geoms, but didn't allow for adjusting the\n  echo for individual points.\n* [ggfx](https://github.com/thomasp85/ggfx) adds blur at the layer level i.e. \n  no individual control over the amount of blur for each point.\n\n\n#### How it works\n\nBlur is simulated by keeping the original point, and drawing a sequence of \nlarger, faded points behind it (illustrated below).\n\nThe number of \npoints rendered is controlled by `blur_steps` and the distance to which the \nblur extends beyond the edge of the original point is controlled by `blur_size`.\n\nNote: Paul Murrell has some experiments to add radial gradients to grid graphics\n(see [his github](https://github.com/pmur002/r-defs-proposal)) and if this \n  becomes part of grid it may be a better method of simulating blur.\n\n\n\u003cdiv\u003e\n\u003cimg src=\"man/figures/point.png\" width=\"45%\" align=\"left\"\u003e\n\u003cimg src=\"man/figures/how.png\" width=\"45%\" align=\"left\"\u003e\n\u003c/div\u003e\n\n\u003cdiv style=\"clear: both;\" /\u003e\n\n## Installation\n\nYou can install the development version from [GitHub](https://github.com/coolbutuseless/ggblur) with:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"coolbutuseless/ggblur\")\n```\n\n## Example 1 - constant `blur_size` \n\nWhen not used as a mapped aesthetic within `aes()`, the same `blur_size` is\napplied to every point.\n\n```{r example1}\nlibrary(ggplot2)\nlibrary(ggblur)\n\nggplot(mtcars) +\n  geom_point_blur(aes(mpg, wt), blur_size = 10) +\n  theme_bw() + \n  labs(title = \"Same blur for each point\")\n```\n\n## Example 2 - mapping `blur_size` as an aesthetic\n\nWhen used as a mapped aesthetic within `aes()`, the `blur_size` is calculated\nindividually for each point.\n\n```{r example2}\nlibrary(ggplot2)\nlibrary(ggblur)\n\nggplot(mtcars) +\n  geom_point_blur(aes(mpg, wt, blur_size = disp)) +\n  theme_bw() + \n  labs(title = \"Larger blur indicates larger engine displacement\")\n```\n\n\n## Example 3 - control over blur parameters\n\n`blur_steps` and `scale_blue_size_continuous/discrete/manual()`\ncan be used to further customise the appearance.\n\n\n```{r example3}\nggplot(mtcars) +\n  geom_point_blur(aes(mpg, wt, blur_size = disp), blur_steps = 3) +\n  scale_blur_size_continuous(range = c(1, 15)) +\n  theme_bw() + \n  labs(title = \"Larger blur indicates larger engine displacement\")\n```\n\n\n\n\n## Example 4 - blur with colour\n\n\n```{r example4}\nggplot(mtcars) +\n  geom_point_blur(aes(mpg, wt, blur_size = disp, colour = as.factor(cyl))) +\n  scale_blur_size_continuous(range = c(1, 15)) +\n  theme_bw() + \n  labs(title = \"Larger blur indicates larger engine displacement\")\n```\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoolbutuseless%2Fggblur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoolbutuseless%2Fggblur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoolbutuseless%2Fggblur/lists"}