Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ajaymore/poly-rating

A polygon based user rating component built using React
https://github.com/ajaymore/poly-rating

Last synced: 12 days ago
JSON representation

A polygon based user rating component built using React

Awesome Lists containing this project

README

        

# poly-rating

**A polygon based user rating component built using React**

Demo: [https://ajaymore.github.io/poly-rating](https://ajaymore.github.io/poly-rating)

## Installation

Install `poly-rating` with [npm](https://www.npmjs.com/):

```
$ npm install poly-rating --save
```

For [CommonJS](http://wiki.commonjs.org/wiki/CommonJS) users:

```javascript
import { SinglePolygon, SummaryPolygon } from 'poly-rating';
```
Please use context_blender.js from [https://github.com/Phrogz/context-blender](https://raw.githubusercontent.com/Phrogz/context-blender/master/context_blender.js) for SummaryPolygon to work.

Include the file in section of the index.html like

```

```

## Usage:

```
const ratingArray = [{ name: 'AB', rating: 2 }, { name: 'CD', rating: 2 }, { name: 'EF', rating: 3 },
{ name: 'GH', rating: 4 }, { name: 'HI', rating: 5 }];
const polygonStyles = {
polygonSides: 5,
width: 500
}

```