Draws the contributions that collect_stats() collects, the numbers of the contribution graph
of a GitHub profile, as a card: a row of key figures and up to three charts, as a PNG or an
SVG file, in a dark or a light mode.
Usage
plot_contributions_card(
stats = "rghcard-data",
file = "rghcard-contributions.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 colors of GitHub's dark or light mode.- panels
One to three charts:
"contributions","commit_languages"and"languages", or those of the other cards. By defaultc("contributions", "commit_languages", "languages").- 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 contributions since the user joined GitHub and in the 12 full months before the collection, the commits, and the current and the longest streak of days with contributions. A streak still runs on the day of the collection when that day has no contribution yet. By default the charts are:
"contributions": the contributions per month in the 12 full months before the collection, with the busiest month labeled."commit_languages": the commits per main language of their repositories, as a ring with a legend: five languages at most, and the rest together as "Other", each in the color that GitHub gives the language."languages": the repositories per main language, as the same kind of ring.
Contributions are what the contribution graph of a GitHub profile counts, in UTC days:
commits, issues, pull requests, reviews, discussions, and new and forked repositories, with
the private ones as bare numbers when the profile shows them. The commits and their languages
are those in public repositories, unless collect_stats() was asked for the private ones.
See also
view_card() shows the card in the Viewer or the Plots pane, plot_stats_card()
draws the repositories and their traffic, plot_activity_card() the kinds of
contributions, and use_rghcard_action() refreshes the cards on your profile.
Examples
plot_contributions_card(get_example_stats(), tempfile(fileext = ".png"))
card <- plot_contributions_card(get_example_stats(), tempfile(fileext = ".svg"), theme = "light")
view_card(card, "plots")