https://github.com/jsdf/react-commits-graph
react component to render an svg graph of git commits
https://github.com/jsdf/react-commits-graph
Last synced: over 1 year ago
JSON representation
react component to render an svg graph of git commits
- Host: GitHub
- URL: https://github.com/jsdf/react-commits-graph
- Owner: jsdf
- License: mit
- Created: 2014-08-27T15:44:09.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2016-04-08T18:41:43.000Z (about 10 years ago)
- Last Synced: 2025-03-15T04:55:47.156Z (over 1 year ago)
- Language: CoffeeScript
- Size: 227 KB
- Stars: 37
- Watchers: 3
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-commits-graph
a react component to render an svg graph of git commits
adapted from [tclh123/commits-graph](https://github.com/tclh123/commits-graph)

## example
code to generate the graph above
```js
var React = require('react')
var CommitsGraph = require('react-commits-graph')
var commits = require('./commits.json')
var selected = null
function handleClick(sha) {
selected = sha
render()
}
function render() {
React.render(
), document.body)
}
render()
```
expected structure of `commits` prop:
```js
[
{
"parents": [
"82aa2102c8291f56f8dfefce1dce40d8a0dd686b",
"175dfbbdbf8734069efaafced5a531dbf77c3a57"
],
"sha": "5a7e04df76e21f9ba4a48098b6b26f19b51b99b1"
},
{
"parents": [
"90113cac59463df2e182e48444b8395658ebf840"
],
"sha": "175dfbbdbf8734069efaafced5a531dbf77c3a57"
},
...
]
```