Draws how a GitHub user contributes, from what collect_stats() collects: their
pull requests, issues, reviews and new repositories, the days of the week they work on, and
the repositories they commit to most, as a card for a GitHub profile, a PNG or an SVG file, in
a dark or a light mode.
Usage
activity_card(
stats = "rghcard-data",
file = "rghcard-activity.png",
theme = c("dark", "light"),
panels = NULL,
title = NULL,
width = 900
)Arguments
- stats
The statistics: what
collect_stats()orread_stats()return, or the folder of the history.- file
The card: a
.pngor an.svgfile.NULLreturns the SVG code instead.- theme
"dark"or"light": the colours of GitHub's dark or light mode.- panels
One to three charts:
"contribution_types","weekdays"and"top_committed", or those of the other cards. By default all three, in that order.- title
The title, by default the user name.
- width
Width of the card in pixels. A PNG has twice as many, to stay sharp on high-resolution screens.
Details
The key figures are the pull requests, issues, reviews and repositories that the user created since they joined GitHub, as their contribution graph counts them, and their followers. By default the charts are:
"contribution_types": the contributions since the user joined GitHub by type, as a ring with a legend: commits, pull requests, issues, reviews, new repositories, and the private contributions that the profile shows as bare numbers. Each type has a colour of its own."weekdays": the contributions of each day of the week in the 12 full months before the collection, as columns."top_committed": the five repositories with the most commits of the user since they joined GitHub, their own or those of others, whose names then start with their owner.
The days are UTC days, as GitHub counts them. The contributions of each type come from the same token as the contributions, so they are what the contributions card counts.
See also
view_card() shows the card in the Viewer or the Plots pane, contributions_card()
draws the contributions themselves, and use_rghcard_action() refreshes the cards on your
profile.
Examples
card <- activity_card(example_stats(), tempfile(fileext = ".svg"))
view_card(card, "plots")
activity_card(example_stats(), tempfile(fileext = ".png"), theme = "light")