A heatmap in the style of GitHub's contributions heatmap on each user profile.
This package uses Swift Charts under the hood, and has the following requirements:
- macOS 14
- iOS 17
- tvOS 17
- watchOS 10
- visionOS 2
Swift Package Manager:
dependencies: [
.package(url: "https://github.com/sgade/swiftui-contributionsheatmap", from: "1.0.0")
],
targets: [
.target(name: "YourTarget", dependencies: [
.product(name: "ContributionsHeatmap", package: "swiftui-contributionsheatmap")
])
]Or in Xcode: File → Add Package Dependencies… → paste the repo URL.
Adding a heatmap to your views:
ContributionsHeatmap(
data: [...]
)You can use the standard Charts modifiers to customize the heatmap.
Examples of this include chartXAxis(.hidden), chartYAxis(.hidden), .chartLegend(.hidden).
If you wish to customize the default Swift Charts colors, you can make it look like GitHub or GitLab:
ContributionsHeatmap(data: ...)
.chartForegroundStyleScale(.gitHub)See LICENSE.

