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

react-simple-charts

v0.0.19

Published

Simple react charts in plain svg. Also part of Salad-UI.

Downloads

102

Readme

React Simple Charts

npm version

A collection of React Components usefull for creating dashboards or other type of number formatting. Currently there are 3 components: Area, BarMetric, and CirclePie.

demo demo

Usage

npm install --save react-simple-charts

import {Area, CirclePie, BarMetric} from 'react-simple-charts'

Area

A pure React/SVG charting library.

Input data

Data input is specified as follow: [{time: Unix MS timestamp, value: yValue, label: Text shown for this value}]

Default Props

{
    width: 640,
    height: 320,
    border: 'none',
    strokeWidth: 2,
    useDynamicYMin: false,
    strokeColor: '#408AE5',
    pointsRadius: 5,
    tipsWidth: 240,
    tipsHeight: 22,
    tipsPadding: 10,
    tipStrokeWidth: 1,
    tipStrokeColor: '#BBBBBB',
    tipsFill: 'white',
    gridColor: 'rgba(230,230,230,.5)',
    labelFontSize: 12,
    labelTextShadow: '1px 1px #fff',
    labelColor: '#555',
    fillColor: 'rgba(191, 216, 246, 0.3)',
    maxOverflow: 20,
    yLabelsOutside: false,
    yLabelsPosition: 'left',
    yPadding: 10,
    data: [],
}

Sample use:

import Area from 'react-area-chart'

let data = [
    {time:1422766800000, value: 0, label: "active users"},
    {time:1422853200000, value: 10, label: "active users"},
    {time:1422939600000, value: 5, label: "active users"}
];
<Area width={900} height={300} data={data}/>

Bar Metric

A micro bar metric component.

Default Props

{
    metricName: 'points',
    value: 0,
    percent: 100,
    label: 'N/A'
}

Sample use:

import BarMetric from 'react-bar-metric'

<BarMetric label="Share of IE" percent={5} metricName="Nearing Zero"/>

Circle Pie

A micro component for rendering a percentage value as an SVG circle.

Default Props

{
    width: 150,
    height: 150,
    border: 'none',
    strokeWidth: 10,
    labelColor: '#111111',
    labelFontSize: '18px',
    strokeColor: '#408AE5',
    railColor: '#f5f5f5',
    fillColor: 'none',
    percent: 70,
    padding: 0,
}

Sample use:

import CirclePie from 'react-circle-pie'

<CirclePie percent={5}/>

Dependencies

The following libraries are peer dependencies and are expected to be included in your own package:

  • Moment.js >= 2.0.0
  • React >= 0.14.0
  • ReactDom >= 0.14.0

Credits

Made with love at Dailymotion in NYC. Designed by Leury Hidalgo and created by Samuel Delesque.