@visx/point
TypeScript icon, indicating that this package has built-in type declarations

3.3.0 • Public • Published

@visx/point

A simple class to represent an x, y coordinate.

Installation

npm install --save @visx/point

Example Usage

import { Point } from '@visx/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].

Package Sidebar

Install

npm i @visx/point

Weekly Downloads

514,017

Version

3.3.0

License

MIT

Unpacked Size

6.79 kB

Total Files

19

Last publish

Collaborators

  • vx-hshoff
  • hshoff
  • christopher.card.williams
  • lencioni