Skip to contents

Each chart of the cards: its form, columns, bars or a ring, its title and subtitle, its data, the unit of its values, for one and for several, for the tooltips, and how its values read, when they are no plain counts.

Usage

panel_data(kind, d)

Arguments

kind

The chart, one of the panels of the card functions, such as "views" or "contribution_types".

d

The numbers of the card, from card_data().

Value

A list: type ("columns", "bars" or "ring"), title, subtitle, data (a data frame) and unit; by, what each column is, for columns not per day ("month", or "label" for named ones); fmt, a function that writes the values, for those not counted, such as bytes; and colors = "types" for the ring of the types of contributions.

Examples

str(rghcard:::panel_data("top_starred", rghcard:::card_data(example_stats(), 30)))
#> List of 5
#>  $ type    : chr "bars"
#>  $ title   : chr "Most starred repositories"
#>  $ subtitle: chr "stars"
#>  $ data    :'data.frame':	5 obs. of  2 variables:
#>   ..$ label: chr [1:5] "tidysurvey" "plotkit" "shiny-weather" "workshop-2026" ...
#>   ..$ value: num [1:5] 48 23 12 7 5
#>  $ unit    : chr [1:2] "star" "stars"
str(rghcard:::panel_data("weekdays", rghcard:::card_data(example_stats(), 30)))
#> List of 6
#>  $ type    : chr "columns"
#>  $ by      : chr "label"
#>  $ title   : chr "Contributions by weekday"
#>  $ subtitle: chr "per weekday, Dec 2025 – Nov 2026"
#>  $ data    :'data.frame':	7 obs. of  2 variables:
#>   ..$ label: chr [1:7] "Mon" "Tue" "Wed" "Thu" ...
#>   ..$ value: num [1:7] 180 210 234 184 214 85 103
#>  $ unit    : chr [1:2] "contribution" "contributions"