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

cg-tech-radar-chart

v1.0.0

Published

A simple radar chart React component

Downloads

4

Readme

React Radar Chart

react-radar-chart is intended to be a simple solution for those seeking a standalone radar chart for use in their project.

Installation

The easiest way to use react-radar-chart is to install it from npm and build it into your app with Webpack.

npm install react-radar-chart

Then just import react-radar-chart into your project and you're all set!

import RadarChart from 'react-radar-chart';

You may also want to use the standalone UMD build. If so, just include react-radar-chart.min.js and react-radar-chart.min.css in your page, along with it's dependencies.

<script src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/prop-types/prop-types.min.js"></script>

Props

| Property | Type | Default |Description | | -------------- | --------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | axisNames | array | [] | Array of string values that will be used as the labels for each of the radar chart axes. | | classNames | object | {} | Object containing class names for the various components and sub components of the radar chart. See 'styling' section below for details. | | groups | object | {} | Object containing color and rating attributes for each group, by group name {[groupName]: {[color]: 'blue', [attributes]: {[skill]: 5}}} | | rungs | number | 10 | Number indicating the number of rungs the chart should have. | | scaleAlign | string | 'bottom-left' | A string indicating where to align the scale. See 'scale alignment' section below for details. | | scaleRenderer | function | see description | A function that can be used to render a custom chart scale. Renders a simple scale by default. |

Styling

Custom classNames can be passed via the classNames prop.

| Class Name | Use | | -------------- | -------------------------------------------------------------------------------------- | | axis | change the color / thickness of the Axes | | container | style the containing div | | key | change the text size or the position of the key | | label | change the size, color, font of the axis labels | | outline | change the opacity of the outline, size of the rating points, or width of the border | | rung | change the width / color for the chart rungs | | scale | change color / font size of the scale | | svgParent | style the svgParent element | | wrapper | style the wrapper div |

Scale Alignment

There are 8 areas that the scale can be aligned:

  • top (right / left)
  • bottom (right / left)
  • left (top / bottom)
  • right (top / bottom)

To align in one of these areas, use the following format and pass via the scaleAlign prop.

'[edge]-[alignment]' eg. 'top-right' or 'left-bottom'

Groups

This will be the most important prop you pass to the RadarChart component. Use the following as a reference.

{
	Player1: {
		color: 'blue',
		ratings: {
			speed: 3,
			attack: 5,
			defense: 8
		}
	},
	Player2: {
		color: 'green',
		ratings: {
			speed: 10,
			attack: 3,
			defense: 3
		}
	},
	Player3: {
		color: 'red',
		ratings: {
			speed: 5,
			attack: 5,
			defense: 5
		}
	}
}

make sure that each groups' ratings are represented in the axisNames array prop.

Contributing

Please read CONTRIBUTING.md for details on submitting a pull request.

Author

Zachary Dean vanleuvenze

License

This project is licensed under the ISC License.