GithubHelp home page GithubHelp logo

marcelovicentegc / react-github-heatmap Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 0.0 4.01 MB

A plugable general purpose Github-like contribution graph.

Home Page: https://marcelovicentegc.github.io/react-github-heatmap/

License: MIT License

HTML 1.67% TypeScript 82.89% CSS 11.50% JavaScript 3.57% Shell 0.37%
react typescript rollup heatmap github github-calendar github-heatmap github-graph

react-github-heatmap's Introduction

react-github-heatmap

npm version

A plugable React component to display a general purpose GitHub-like contributions graph based on SVG.

๐Ÿ“ฆ Install

npm i react-github-heatmap

yarn add react-github-heatmap

๐Ÿ”จ Usage

Take a glance at the docs to see further examples ๐Ÿ˜‰.

import React from 'react';
import { Heatmap, HeatmapData } from 'react-github-heatmap';
import { api } from './api';

const App = () => {
  const [data, setData] = React.useState<HeatmapData>();
  const [isLoading, setIsLoading] = useState(false);
  React.useEffect(() => {
    fetchData();
  }, []);

  const fetchData = async () => {
    setIsLoading(true);
    await api
      .getData()
      .then(data => {
        setData(data);
      })
      .catch(error => {
        alert(error.message);
      })
      .finally(() => setIsLoading(false));
  };

  return (
    <>
      {isLoading && <span>Loading...</span>}
      {data && <Heatmap data={data} />}
    </>
  );
};

๐Ÿšง Development directions

  1. Clone this repo: git clone [email protected]:marcelovicentegc/react-github-heatmap.git
  2. Install dependencies: yarn
  3. Build the app: yarn build
  4. Change directory into example and install its dependencies: cd example && yarn
  5. From inside the example folder, start the app: yarn start

Buy Me A Coffee

react-github-heatmap's People

Contributors

dependabot[bot] avatar marcelovicentegc avatar mypersonalmachine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.