Socket
Socket
Sign inDemoInstall

@yr/monotone-cubic-spline

Package Overview
Dependencies
0
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @yr/monotone-cubic-spline

Convert a series of points to a monotone cubic spline


Version published
Weekly downloads
436K
decreased by-2.43%
Maintainers
3
Install size
10.8 kB
Created
Weekly downloads
 

Readme

Source

NPM Version Build Status

Convert a series of points to a monotone cubic spline (based on D3.js implementation)

Usage

const spline = require('@yr/monotone-cubic-spline');
const points = spline.points([[0,0], [1,1], [2,1], [3,0], [4,0]]);
const svgPath = spline.svgPath(points);

console.log(svgPath);
// => 'M0 0C0.08333333333333333, 0.08333333333333333, ...'

API

points(points): convert array of points (x,y) to array of bezier points (c1x,c1y,c2x,c2y,x,y)

slice(points, start, end): slice a segment of converted points

svgPath(points): convert array of bezier points to svg path (d) string

FAQs

Last updated on 07 Jun 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc