Skip to content

Commit

Permalink
Add docs for @vx/point. Issue airbnb#9
Browse files Browse the repository at this point in the history
  • Loading branch information
Flaque committed May 13, 2017
1 parent 282a28a commit 709e206
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/vx-point/Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# @vx/point

A simple class to represent an x, y coordinate.

## Example Usage

```
import Point from '@vx/point';
let point = new Point({x: 2, y: 3});
let {x, y} = point.value() // Get the cords from the point
let array = point.toArray() // Convert point to array
```

## Methods

### `point.value()`

Returns an `{x, y}` object with the x and y coordinates.

### `point.toArray()`

Returns the coordinates as an array `[x, y]`.

## vx packages

- [@vx/axis](https://github.com/hshoff/vx/tree/master/packages/vx-axis)
Expand Down

0 comments on commit 709e206

Please sign in to comment.