Svelte5 Heatmap

screenshot of Svelte5 Heatmap
svelte
vite

A Svelte 5 heatmap component inspired by GitHub’s contribution graph

Overview

The Svelte 5 heatmap component is an impressive tool for visualizing data in a clear and intuitive format, taking inspiration from GitHub's contribution graph. This component allows developers to integrate heatmap functionalities into their applications effortlessly, showcasing how data varies over time with color-coded intensity. With its customizable features, it provides a perfect solution for anyone looking to enhance their data presentation.

Designed to be user-friendly, the Svelte 5 heatmap can easily accommodate various data inputs and offers flexibility in how the information is displayed. Whether you're tracking project contributions, user activity, or any other metric, this component stands ready to provide visual insights that are both informative and engaging.

Features

  • Data Prop: Requires an object containing chart data where each key is a date in ISO format (YYYY-MM-DD) and the value represents a numerical value.
  • Color Customization: Allows the use of an array of color values for the heatmap cells, with the default settings mirroring GitHub's contributions graph colors.
  • Custom CSS Class: Offers a className option for applying custom CSS styling to fit the heatmap seamlessly into your app's design.
  • Year Control: You can specify the year to be displayed in the heatmap, with the current year set as the default.
  • Day-of-Week Labels: Supports the option to display day-of-week labels on the left side of the heatmap, enhancing readability.
  • Month Labels: Allows you to include month labels above the calendar for better context, with the default setting enabled.
  • Interactive Callbacks: Comes with built-in event handlers that trigger functions on cell clicks and mouse hover events, enhancing interactivity.
  • Responsive Sizing: The heatmap size adjusts automatically based on the parent element's font size, ensuring optimal fit and appearance in your layout.
svelte
Svelte

Svelte is a modern front-end framework that compiles your code at build time, resulting in smaller and faster applications. It uses a reactive approach to update the DOM, allowing for high performance and a smoother user experience.

vite
Vite

Vite is a build tool that aims to provide a faster and leaner development experience for modern web projects

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.