Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@vx/point

0.0.198 • Public • Published

@vx/point

npm install --save @vx/point

A simple class to represent an x, y coordinate.

Example Usage

import { Point } from '@vx/point';
 
const point = new Point({ x: 2, y: 3 });
const { x, y } = point.value(); // Get the coords as an object
const [x, y] = point.toArray(); // or 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].

Install

npm i @vx/point

DownloadsWeekly Downloads

56,644

Version

0.0.198

License

MIT

Unpacked Size

4.42 kB

Total Files

9

Last publish

Collaborators

  • avatar
  • avatar
  • avatar