daily-activity-graph
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Daily Activity Graph

Daily Graph is a lightweight JavaScript library to create a daily activity chart that looks and behaves similar to the GitHub contribution graph.

Table of Contents

Installation

Install the package via npm:

npm install daily-activity-graph

Usage

First, include the Daily Graph library in your JavaScript file:

import DailyGraph from "daily-activity-graph";

Next, create a new instance of DailyGraph:

const data = [...] // your data
const chart = new DailyGraph('.chart-container', data);

You can then call the render() method to display the chart:

chart.render();

API

new DailyGraph(selector, data)

Create a new DailyGraph instance.

  • selector (String): The CSS selector of the DOM element where the graph will be inserted.
  • data (Array): An array of objects, each representing one day of activity data. Each object should have a date (Date object or string) and a count (number).

DailyGraph.render()

Render the graph in the DOM.

DailyGraph.update(data)

Update the graph with new data.

  • data (Array): An array of objects, each representing one day of activity data. Each object should have a date (Date object or string) and a count (number).

Contributing

We appreciate all contributions! If you'd like to contribute, feel free to open a pull request.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i daily-activity-graph

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

16.2 kB

Total Files

8

Last publish

Collaborators

  • amitbadala