svg-polygon-center
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

svg-polygon-center Build Status

Return the center for a given SVG polygon points.

Install

npm install --save svg-polygon-center

or

yarn add svg-polygon-center

Usage

var center = require('svg-polygon-center');
// or
import center from 'svg-polygon-center';
 
var points = polygon.getAttribute('points');
// e.g. "28,224 256,224 256,352 128,352"
 
var center = center(points);
// e.g. { x: 192, y: 288 }
 

License

MIT © Diego Jara

Package Sidebar

Install

npm i svg-polygon-center

Weekly Downloads

37

Version

1.0.2

License

MIT

Last publish

Collaborators

  • saintplay