{"id":13711997,"url":"https://github.com/hrbrmstr/ggsolar","last_synced_at":"2025-06-25T07:05:51.943Z","repository":{"id":152831250,"uuid":"626764505","full_name":"hrbrmstr/ggsolar","owner":"hrbrmstr","description":"🪐 Generate \"solar system\" plots with {ggplot2}","archived":false,"fork":false,"pushed_at":"2023-04-26T07:31:28.000Z","size":513,"stargazers_count":23,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"batman","last_synced_at":"2025-04-04T16:09:50.774Z","etag":null,"topics":["ggplot2","r","rstats"],"latest_commit_sha":null,"homepage":"https://rud.is/b/2023/04/12/make-solar-system-plots-with-ggsolar/","language":"R","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/hrbrmstr.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":"2023-04-12T05:47:15.000Z","updated_at":"2025-03-22T10:25:58.000Z","dependencies_parsed_at":"2023-07-02T02:30:28.348Z","dependency_job_id":null,"html_url":"https://github.com/hrbrmstr/ggsolar","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hrbrmstr/ggsolar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fggsolar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fggsolar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fggsolar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fggsolar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrbrmstr","download_url":"https://codeload.github.com/hrbrmstr/ggsolar/tar.gz/refs/heads/batman","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fggsolar/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261823757,"owners_count":23215142,"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":["ggplot2","r","rstats"],"created_at":"2024-08-02T23:01:13.836Z","updated_at":"2025-06-25T07:05:51.901Z","avatar_url":"https://github.com/hrbrmstr.png","language":"R","funding_links":[],"categories":["Plot layers"],"sub_categories":[],"readme":"---\noutput: rmarkdown::github_document\neditor_options: \n  chunk_output_type: console\n---\n```{r pkg-knitr-opts, include=FALSE}\nhrbrpkghelpr::global_opts()\n```\n\n```{r badges, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::stinking_badges()\n```\n\n```{r description, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::yank_title_and_description()\n```\n\n## What's Inside The Tin\n\nThe following functions are implemented:\n\n```{r ingredients, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::describe_ingredients()\n```\n\n## Installation\n\n```{r install-ex, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::install_block()\n```\n\n## Usage\n\n```{r lib-ex}\nlibrary(ggsolar)\nlibrary(ggplot2)\n\n# current version\npackageVersion(\"ggsolar\")\n\n```\n\n## Sol\n\n```{r sol, fig.width=6, fig.height=6, dev.args=list(bg=\"transparent\")}\nsol_orbits \u003c- generate_orbits(sol_planets)\n\nset.seed(1323) # this produced decent placements\n\nplaced_planets \u003c- randomize_planet_positions(sol_orbits)\n\nplot_orbits(\n  orbits = sol_orbits, \n  planet_positions = placed_planets,\n  label_planets = TRUE,\n  label_family = hrbrthemes::font_es_bold\n) +\n  hrbrthemes::theme_ipsum_es(grid=\"\") +\n  coord_equal() +\n  labs(\n    title = \"Sol\",\n    caption = \"Pluto is 100% a planet\"\n  ) +\n  theme_enhance_solar()\n```\n\n## Non-uniform Radii\n\nWe'll plot Sol's system with the square root of the actual radius AU's (which are `0.39`, `0.72`, `1.00`, `1.52`, `5.20`, `9.58`, `19.18`, `30.07`, `39.48`):\n\n```{r sol-sqrt, fig.width=7, fig.height=7, dev.args=list(bg=\"transparent\")}\nsol_dist \u003c- sqrt(c(0.39, 0.72, 1.00, 1.52, 5.20, 9.58, 19.18, 30.07, 39.48))\nsol_orbits \u003c- generate_orbits(sol_planets, radii = sol_dist, num_polygon_points = 1000)\n\nset.seed(42)\nsol_placements \u003c- randomize_planet_positions(sol_orbits)\n\nplot_orbits(\n  orbits = sol_orbits, \n  planet_positions = sol_placements,\n  label_planets = TRUE,\n  label_family = hrbrthemes::font_es_bold\n) +\n  hrbrthemes::theme_ipsum_es(grid=\"\") +\n  coord_equal() +\n  labs(\n    title = \"Sol System (Orbits AU Sqrt.)\",\n    subtitle = \"Non-uniform Radii\",\n    caption = \"Pluto is 100% a planet\"\n  ) +\n  theme_enhance_solar()\n```\n\n## Custom Planet Placements!\n\nWe'll plot Sol's system with the square root of the actual radius AU's (which are `0.39`, `0.72`, `1.00`, `1.52`, `5.20`, `9.58`, `19.18`, `30.07`, `39.48`):\n\n```{r sol-precise-sqrt, fig.width=7, fig.height=7, dev.args=list(bg=\"transparent\")}\nsol_dist \u003c- sqrt(c(0.39, 0.72, 1.00, 1.52, 5.20, 9.58, 19.18, 30.07, 39.48))\nsol_orbits \u003c- generate_orbits(sol_planets, radii = sol_dist, num_polygon_points = 1000)\n\nmy_pos \u003c- function(n) {\n  seq(from = 0, to = 1, length.out = 9)\n}\n\nsol_placements \u003c- randomize_planet_positions(sol_orbits, randomizer = my_pos)\n\nplot_orbits(\n  orbits = sol_orbits, \n  planet_positions = sol_placements,\n  label_planets = TRUE,\n  label_family = hrbrthemes::font_es_bold\n) +\n  hrbrthemes::theme_ipsum_es(grid=\"\") +\n  coord_equal() +\n  labs(\n    title = \"Sol System (Orbits AU Sqrt.)\",\n    subtitle = \"Custom placements\",\n    caption = \"Pluto is 100% a planet\"\n  ) +\n  theme_enhance_solar()\n```\n\n\n## Rando!\n\n```{r rando, fig.width=6, fig.height=6, dev.args=list(bg=\"transparent\")}\nset.seed(42)\n(rando_planets \u003c- generate_random_planets(12))\n\nrando_orbits \u003c- generate_orbits(rando_planets)\n\nset.seed(123) # this produced decent placements\n\nplaced_planets \u003c- randomize_planet_positions(rando_orbits)\n\nplot_orbits(\n  orbits = rando_orbits, \n  planet_positions = placed_planets,\n  label_planets = TRUE,\n  label_family = hrbrthemes::font_es_bold\n) +\n  hrbrthemes::theme_ipsum_es(grid=\"\") +\n  coord_equal() +\n  labs(\n    title = \"Rando System\"\n  ) +\n  theme_enhance_solar()\n```\n\n## ggsolar Metrics\n\n```{r cloc, echo=FALSE}\ncloc::cloc_pkg_md()\n```\n\n## Code of Conduct\n\nPlease note that this project is released with a Contributor Code of Conduct. \nBy participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbrmstr%2Fggsolar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrbrmstr%2Fggsolar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbrmstr%2Fggsolar/lists"}