svg-path-sdf

WebJar for svg-path-sdf

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

svg-path-sdf
Last Version

Last Version

1.1.3
Release Date

Release Date

Type

Type

jar
Description

Description

svg-path-sdf
WebJar for svg-path-sdf
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/dy/svg-path-sdf

Download svg-path-sdf

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/svg-path-sdf/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>svg-path-sdf</artifactId>
    <version>1.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/svg-path-sdf/
implementation 'org.webjars.npm:svg-path-sdf:1.1.3'
// https://jarcasting.com/artifacts/org.webjars.npm/svg-path-sdf/
implementation ("org.webjars.npm:svg-path-sdf:1.1.3")
'org.webjars.npm:svg-path-sdf:jar:1.1.3'
<dependency org="org.webjars.npm" name="svg-path-sdf" rev="1.1.3">
  <artifact name="svg-path-sdf" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='svg-path-sdf', version='1.1.3')
)
libraryDependencies += "org.webjars.npm" % "svg-path-sdf" % "1.1.3"
[org.webjars.npm/svg-path-sdf "1.1.3"]

Dependencies

compile (5)

Group / Artifact Type Version
org.webjars.npm : is-svg-path jar [1.0.1,2)
org.webjars.npm : svg-path-bounds jar [1.0.1,2)
org.webjars.npm : parse-svg-path jar [0.1.2,0.2)
org.webjars.npm : bitmap-sdf jar [1.0.0,2)
org.webjars.npm : draw-svg-path jar [1.0.0,2)

Project Modules

There are no modules declared in this project.

svg-path-sdf experimental

Create signed distance field for an svg path data.

svg-path-sdf

Usage

npm install svg-path-sdf

let pathSdf = require('svg-path-sdf')

let arr = pathSdf('M40,0A40,40 0 1,1 0,-40A40,40 0 0,1 40,0Z', {
	width: 200,
	height: 200
})

arr has 200×200 elements with value from 0..1 range, corresponding to distance. The path is drawn at the center of the sdf fitting to the minimum side.

distances = pathSdf(path, options|shape?)

Option Meaning
width,w, height,h or shape Output sdf size in px, defaults to 200×200.
cutoff, radius SDF parameters for bitmap-sdf, by default detected from shape to fit min side.
viewBox View box for the path data. If not defined, it is detected as path bounds via svg-path-bounds.
stroke Whether to stroke shape. Positive number will stroke outside the amount of pixels, negative number will stroke inside, 0-ish will disable stroke.

License

(c) 2017 Dima Yv. MIT License

Development supported by plot.ly.

Versions

Version
1.1.3
1.1.2
1.1.1