Skip to content

Commit

Permalink
doc(readme): remove doc from readme to promote dedicated website
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Benitte committed Apr 23, 2016
1 parent 0f9544b commit c859e50
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 159 deletions.
160 changes: 1 addition & 159 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,166 +5,8 @@
[![NPM version][npm-image]][npm-url]
[![Dependencies][gemnasium-image]][gemnasium-url]

**nivo** provides supercharged React components to easily build dataviz apps, it's built on d3.
**nivo** provides supercharged React components to easily build dataviz apps, it's built on top of d3.

- [Layouts](#layouts)
- [Pie](#pie)
- [Legends](#pie-legends)
- [Column](#piecolumnlegends)
- [Radial](#pieradiallegends)
- [Slice](#pieslicelegends)
- [Combining](#combining-pie-legends)
- [Stack](#stack)
- [Colors](#colors)

## Layouts

### Pie

<img alt="Pie" src="https://raw.githubusercontent.com/plouc/nivo/master/doc/nivo-pie.png" width="240" height="80" />

Use [d3 Pie layout](https://github.com/mbostock/d3/wiki/Pie-Layout).

```javascript
import { Chart, Pie } from 'nivo';

// ...

React.render((
<Chart>
<Pie data={data} />
</Chart>
), document.getElementById('pie'));
```

#### properties

key | required | default | description
-----------------------|----------|-----------|----------------------------
**sort** | no | `null` |
**data** | yes | — |
**keyProp** | yes | `'label'` |
**valueProp** | yes | `'value'` |
**startAngle** | yes | `0` |
**endAngle** | yes | `360` |
**padAngle** | yes | `0` |
**transitionDuration** | yes | |
**transitionEasing** | yes | |
**innerRadius** | yes | `0 |

#### Pie Legends

##### PieColumnLegends

<img alt="PieColumnLegends" src="https://raw.githubusercontent.com/plouc/nivo/master/doc/nivo-pie-legends-column.png" width="80" height="80" />

Distribute legends on left/right side of the pie with a link to the corresponding slice.

```javascript
import { Chart, Pie, PieColumnLegends } from 'nivo';

// ...

React.render((
<Chart>
<Pie data={data}>
<PieColumnLegends />
</Pie>
</Chart>
), document.getElementById('pie'));
```

###### properties

key | required | default | description
---------------------|----------|-------------|----------------------------
**labelFn** | no | `undefined` |
**radiusOffset** | yes | `16` |
**horizontalOffset** | yes | `30` |
**textOffset** | yes | `10` |
**lineColor** | yes | `'none'` | see [colors](#colors)
**textColor** | yes | `'none'` | see [colors](#colors)



##### PieRadialLegends

<img alt="PieRadialLegends" src="https://raw.githubusercontent.com/plouc/nivo/master/doc/nivo-pie-legends-radial.png" width="80" height="80" />

Radial legend distribution around your pie.

```javascript
import { Chart, Pie, PieRadialLegends } from 'nivo';

// ...

React.render((
<Chart>
<Pie data={data}>
<PieRadialLegends />
</Pie>
</Chart>
), document.getElementById('pie'));
```

##### PieSliceLegends

<img alt="PieSliceLegends" src="https://raw.githubusercontent.com/plouc/nivo/master/doc/nivo-pie-legends-slice.png" width="80" height="80" />

Distribute legends inside each pie slice. This component is useful to display data value on each pie slice,
but won't work well with labels.

```javascript
import { Chart, Pie, PieSliceLegends } from 'nivo';

// ...

React.render((
<Chart>
<Pie data={data}>
<PieSliceLegends />
</Pie>
</Chart>
), document.getElementById('pie'));
```

##### Combining Pie legends

<img alt="PieSliceLegends" src="https://raw.githubusercontent.com/plouc/nivo/master/doc/nivo-pie-legends-radial-slice.png" width="80" height="80" />

You can combine different legends on a single pie, for example, you can have the value displayed on each pie slice plus a label outside it.
Note that the `labelFn` of the `PieSliceLegends` is overridden in order to use data value instead of label.

```javascript
import { Chart, Pie, PieRadialLegends, PieSliceLegends } from 'nivo';

// ...

React.render((
<Chart>
<Pie data={data}>
<PieRadialLegends />
<PieSliceLegends labelFn={d => d.data.value} />
</Pie>
</Chart>
), document.getElementById('pie'));
```

### Stack

Use [d3 Stack layout](https://github.com/mbostock/d3/wiki/Stack-Layout)

## Colors

Beside highlighting data insights, your dataviz should be pretty, right ?
**nivo** provides an easy way to deal with colors, very useful when dealing with nested components.

A lot of components have a `*Color` property, but what can we pass to it ?

- `none` will do nothing, it's often the default, it's useful if you manage chart styles via external **css**
- `inherit` will use color from parent context/component
- `inherit:darker(.5)` will use parent context/component color, and apply [`darker`](https://github.com/mbostock/d3/wiki/Colors#rgb_darker) function on it with an amount of `.5`
- `inherit:brighter(1)` will use parent context/component color, and apply [`brighter`](https://github.com/mbostock/d3/wiki/Colors#rgb_brighter) function on it with an amount of `1`

[license-image]: https://img.shields.io/github/license/plouc/nivo.svg?style=flat-square
[license-url]: https://github.com/plouc/nivo/blob/master/LICENSE.md
Expand Down
Binary file removed doc/nivo-pie-legends-column.png
Binary file not shown.
Binary file removed doc/nivo-pie-legends-radial-slice.png
Binary file not shown.
Binary file removed doc/nivo-pie-legends-radial.png
Binary file not shown.
Binary file removed doc/nivo-pie-legends-slice.png
Binary file not shown.
Binary file removed doc/nivo-pie.png
Binary file not shown.

0 comments on commit c859e50

Please sign in to comment.