An open API service indexing awesome lists of open source software.

https://github.com/pantharshit00/recontrib

React Component that implements GitHub's commit chart.
https://github.com/pantharshit00/recontrib

chart github graph react

Last synced: 3 months ago
JSON representation

React Component that implements GitHub's commit chart.

Awesome Lists containing this project

README

          

# Recontrib

React Component that implements GiHub's commit graph UI. https://pantharshit00.github.io/recontrib

![image](https://user-images.githubusercontent.com/22195362/57941632-17990f80-78ed-11e9-86b3-939f7ac1209b.png)

## Usage

1. Add the Reach UI tooltip CSS

```js
import '@reach/tooltip/style.css';
```

2. Use the component and pass the data

```js
const App = () => {
return (




);
};
```

Data is structured as following. You can directly pass the data from the GitHub API(https://api.github.com/repos/:owner/:repo/stats/commit_activity):

```ts
interface WeekData {
days: number[]; // commits in individual days in the week
total: number; // total number commits in the week
week: number; // Timestamp in seconds of the seconds of the starting of the week
}
```

## Props

```ts
interface Props {
data: Array; // data
gridSize?: number; // size of the tile
fontSize?: string; // fontSize of months and weekdays
}
```

---

MIT️ ©️ [Harshit Pant](https://twitter.com/pantharshit00) 2019