npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

asingh-graph-library

v1.0.7

Published

A Graph Library using recharts

Downloads

43

Readme

asingh-graph-library for React

This is a simple and easy-to-use library for creating tailwind powered responsive bar charts in your React applications.

Installation

  1. If you don't already have a React application, you can create one using npx create-react-app
  2. Install the tailwind css in your React Application Installation Guide
  3. Install the library using npm i asingh-graph-library
  4. Import the BarChart component from the library: import {BarChart} from "asingh-graph-library"

Usage

To use the BarChart component, simply pass in the required props and see the chart come to life!

Props

  • labels: An array of label for the data points on the x-axis.
  • data: An array of numerical data value corresponding to the labels.
  • barColor: The color code in hex of the bars in the chart.
  • showCartesianGrid: Whether to show the Cartesian grid lines.
  • showTooltip: Whether to show tooltips on hover.

Example

import {BarChart} from "asingh-graph-library";

const App = ()=>{

    return(
    <>
        <div>
            <BarChart/>
        </div>
    </>
    )
    
}

export default App;

Default Bar Chart

import {BarChart} from "asingh-graph-library";

const App = ()=>{

    return(
    <>
        <div>
            <BarChart
                labels={['Jan', 'Feb', 'Mar', 'Apr', 'May']}
                data={[10, 20, 30, 40, 50]}
                barColor="#4caf50"
                showCartesianGrid
                showTooltip
            />
        </div>
    </>
    )
    
}

export default App;

Bar Chart

This will create a bar chart with the following specifications:

  • Labels: Jan, Feb, Mar, Apr, May
  • Data: 10, 20, 30, 40, 50
  • Bar color: "#4CAF50" (green)
  • Cartesian grid lines: Shown
  • Tooltips: Shown
import {BarChart} from "asingh-graph-library";

const App = ()=>{

    const Months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]

    const data = [87, 22, 34, 11, 33, 98, 68, 45, 55, 90]
    

    return(
    <>
        <div style={{width: 600, height: 200}}>
          <BarChart labels={Months} data={data}/>
        </div>
    </>
    )
    
}

export default App;

Parent Width And Height - Bar Chart

Enjoy creating beautiful and easy-to-understand bar charts in your React applications with the Asingh Graph Library.