{"id":25866099,"url":"https://github.com/shahriar-siham/roundrect","last_synced_at":"2025-10-08T05:17:27.246Z","repository":{"id":279494571,"uuid":"938706081","full_name":"shahriar-siham/roundrect","owner":"shahriar-siham","description":"An improved version of the `grid` package's rounded rectangles, allowing each corner to have a different radius instead of a uniform one. This package also provides more intuitive parameter names for easier usage. Customize fill color, border properties, opacity, and more with a simple function call.","archived":false,"fork":false,"pushed_at":"2025-08-20T21:04:44.000Z","size":43,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-30T18:32:41.651Z","etag":null,"topics":["custom","geometry","ggplot2","graphics","grid","indiv","plotting","r","rounded","roundre","rpacka","rpackages","visua"],"latest_commit_sha":null,"homepage":"","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/shahriar-siham.png","metadata":{"files":{"readme":"README.md","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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-25T11:25:47.000Z","updated_at":"2025-08-20T21:04:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"e81ed322-d83a-4b7f-a61d-74d15747a303","html_url":"https://github.com/shahriar-siham/roundrect","commit_stats":null,"previous_names":["shahriar-siham/roundrect"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shahriar-siham/roundrect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahriar-siham%2Froundrect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahriar-siham%2Froundrect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahriar-siham%2Froundrect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahriar-siham%2Froundrect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shahriar-siham","download_url":"https://codeload.github.com/shahriar-siham/roundrect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahriar-siham%2Froundrect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278891753,"owners_count":26063858,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["custom","geometry","ggplot2","graphics","grid","indiv","plotting","r","rounded","roundre","rpacka","rpackages","visua"],"created_at":"2025-03-02T02:21:48.375Z","updated_at":"2025-10-08T05:17:27.241Z","avatar_url":"https://github.com/shahriar-siham.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://raw.githubusercontent.com/Tarikul-Islam-Anik/Animated-Fluent-Emojis/master/Emojis/Symbols/Red%20Square.png\" alt=\"Logo\" width=\"100\" height=\"100\"\u003e\n\n# `roundrect` - Custom Rounded Rectangle Drawing in R\n\n`roundrect` is an R package that allows you to easily draw custom rounded rectangles with individually adjustable corner radii. Unlike the `grid` package's `grid.roundrect()` that applies the same radius to all corners, this package enables you to set different radii for each corner of the rectangle, making it more flexible for various graphical needs.\n\n## Features\n\n- Draw a rounded rectangle with customizable corner radii.\n- Easily adjust rectangle position, size, border color, and fill color.\n- Control opacity, border width, and border style.\n- Straightforward parameter names for easier understanding and use.\n\n## Installation\n\nYou can install the package from GitHub using the `devtools` package:\n\n```R\n# Install devtools if not already installed\ninstall.packages(\"devtools\")\n\n# Install roundrect from GitHub\ndevtools::install_github(\"shahriar-siham/roundrect\")\n```\n\n## Example\n\n```R\nlibrary(roundrect)\n\nround_rect(\n  fill = \"#e43a59\", \n  border = NA, \n  scale = c(0.5, 0.5), \n  corners = c(0.25, 0.05, 0.25, 0.05)\n)\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/shahriar-siham/roundrect/blob/main/example_image/roundrect_example_ouput.png\" alt=\"Example: Rounded Rectangle\" width=\"500\"\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\n## Integration with ggplot2\n\n`roundrect` also integrates with **ggplot2**, allowing you to draw rounded rectangles directly in plots. Simply use `geom_roundrect()` as a drop-in replacement for `geom_col()`.\n\n```R\nlibrary(roundrect)\nlibrary(ggplot2)\nlibrary(grid)\n\ndf \u003c- data.frame(x = c(\"A\", \"B\", \"C\"), y = c(3, 5, 2))\n\nggplot(df, aes(x, y)) + \n  geom_roundrect(fill = grid::linearGradient(c('#ff304e', '#ef407c')), r = 0.075) +\n  theme_minimal()\n```\n\u003cbr\u003e\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/shahriar-siham/roundrect/blob/main/example_image/roundrect_geom_roundrect_preview.png\" alt=\"Example: geom_roundrect() with ggplot2\" width=\"500\"\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n## Parameters:\n- `position`: A vector specifying the x and y positions of the rectangle (default: `c(0.5, 0.5)`).\n- `scale`: A vector specifying the width and height of the rectangle (default: `c(1, 1)`).\n- `corners`: A vector specifying the radii of the corners (clockwise) (default: `c(0.15, 0.15, 0.15, 0.15)`).\n- `opacity`: Opacity of the rectangle (default: `1`).\n- `fill`: The fill color of the rectangle (default: `NA`).\n- `border`: The border color of the rectangle (default: `\"black\"`).\n- `border_width`: The width of the border (default: `1`).\n- `border_type`: The type of the border (e.g., \"solid\", \"dashed\") (default: `\"solid\"`).\n- `border_cap`: The style of the border cap (e.g., \"round\", \"butt\") (default: `\"round\"`).\n- `output_as_grob`: Whether to return the grob object instead of drawing it (default: `FALSE`).\n- `name`: The name of the grob object (optional).\n\n## License\n\nThis package is licensed under the MIT License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahriar-siham%2Froundrect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshahriar-siham%2Froundrect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahriar-siham%2Froundrect/lists"}