New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

corner-rounder

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

corner-rounder

Corner rounder with SVG support

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
48
-56.36%
Maintainers
1
Weekly downloads
 
Created
Source

Corner Rounder

Corner rounder with SVG integration

license npm version

Overview

Corner Rounder rounds the corners of a path (or "route") of points. It provides the option to convert the result to SVG elements or SVG path commands.

Usage Overview

npm i -S corner-rounder

import roundCorners from 'corner-rounder'

const result = roundCorners({
  // Simple "L"-shape route
  route: [
    [0, 0],
    [0, 50],
    [50, 50]
  ],
  r: 10,
})

// E.g. "M 0 0 L 0 40 A 10 10 0 0 0 10 50 L 50 50"
const d = result.toSvgPathDParameter()
// E.g. (SVGLineElement | SVGPathElement)[]
const svgLineAndArcElements = result.toSvgLinesAndArcs({ color: 'orange', ... })

Preview (SVG)

The result of this looks as follows (r = 10):

l-shape-example

Examples

Corner Rounder uses Exhibitor to demo itself with some example routes, modifiable stroke widths, colors, radii, etc.. To view these, clone the repository, run npm i && npm run exh, then navigate to http://localhost:4001.

The examples are within /src/test/, which provide a comprehensive look into how Corner Rounder can be used.

Development

See ./contributing/development.md

If you would like to support my open-source development, feel free to sponsor me on GitHub or buy me a coffee

Keywords

rounded

FAQs

Package last updated on 09 Apr 2023

Did you know?

Socket

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