JSPM

  • Created
  • Published
  • Downloads 117435
  • Score
    100M100P100Q228981F
  • License MIT

vx point

Package Exports

  • @vx/point

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@vx/point) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@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].