Giter Club home page Giter Club logo

ggrounded's Introduction

ggrounded

Lifecycle: experimental R-CMD-check Codecov test coverage CRAN status

ggrounded creates bar plots with rounded corners using ggplot2.

Installation

Install the released version of ggrounded from CRAN:

install.packages("ggrounded")

Or install the development version from GitHub with:

# install.packages("pak")
pak::pak("botan/ggrounded")

Usage

There are two types of bar charts in ggplot2: geom_bar() and geom_col(). geom_bar_rounded() and geom_col_rounded() are wrappers on them for rounding the top corners. geom_bar_rounded() makes the height of the bar proportional to the number of cases in each group (or if the weight aesthetic is supplied, the sum of the weights).

library(ggrounded)
library(ggplot2)

ggplot(mpg, aes(class)) +
  geom_bar_rounded()

If you want the heights of the bars to represent values in the data, use geom_col_rounded() instead.

ggplot(data.frame(x = letters[1:3], y = c(2.3, 1.9, 3.2)), aes(x, y)) +
  geom_col_rounded()

Code of Conduct

Please note that the ggrounded is released with a contributor code of conduct. By contributing in this project you agree to abide by its terms.

License

This package is released under the MIT License.

ggrounded's People

Contributors

botan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

zerogetsamgow

ggrounded's Issues

Release ggrounded 0.0.3

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push

Suggestion: set radius using 'npc' rather than 'pt'

Using radius = unit(...,"npc") rather than radius = unit(...,"pt") would result in more stable and intuitive charting.

"npc" is normalised parent coordinates. So, setting radius = radius = unit(...,"npc") creates a column with a perfectly rounded top - the radius is half the width of the column (the `parent').

Better still unit could be set to accept values from 0 to 1 and this value is passed to unit internally to normalize over values of
unit(0/2,"npc") - a rectangle with no rounding - to unit(1/2,"npc") - a column with a perfectly round top. Limiting values in this way prevents columns with "wings" at the top that result from values like unit(>1/2,"npc") or unit("a large number"1/2,"pt").

I am using this approach for a wrapper function we use internally to my organisation to match our style guide.

Enable the rounded `geom_histogram()`?

Hi,

Thanks for this package! Currently, it only supports geom_bar_rounded() and geom_col_rounded(). Is it possible to make the geom_histogram() plot a rounded bar?

Release ggrounded 0.0.2

First release:

Prepare for release:

  • git pull
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • usethis::use_news_md()
  • git push

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.