New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

svg-path-interpolator

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svg-path-interpolator - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

4

config/sample.config.json

@@ -9,3 +9,5 @@ {

"roundToNearest": 0.25,
"sampleFrequency": 0.001
"sampleFrequency": 0.001,
"pretty": false,
"prettyIndent": 0
}
{
"author": "Justin Wilaby",
"name": "svg-path-interpolator",
"version": "0.1.0",
"version": "0.1.1",
"license": "MIT",
"main": "src/index.js"
}

@@ -9,9 +9,11 @@ # SVG Path Interpolator

"files": [
"sample.svg"
"sample.svg"
],
"outputDirectory": "out/",
"trim": false,
"trim": true,
"minDistance": 0.5,
"roundToNearest": 0.25,
"sampleFrequency": 0.001
"sampleFrequency": 0.001,
"pretty": false,
"prettyIndent": 0
}

@@ -31,3 +33,10 @@ ```

### sampleFrequency
`sampleFrequency` determines the increment of `t` when sampling. If `sampleFrequency` is set to `.001` ,since `t` iterates from 0 to 1, there will be 1000 points sampled per command but only points that are greater than `minDistance`
`sampleFrequency` determines the increment of `t` when sampling. If `sampleFrequency` is set to `.001` , since `t` iterates from 0 to 1, there will be 1000 points sampled per command but only points that are greater than `minDistance` are captured.
### pretty
When `true`, `pretty` creates formatted json output
### prettyIndent
Then number of spaces to indent when `pretty` is `true`
## Examples
### Animating output
See [this pen](https://codepen.io/justinwilaby/pen/dMQdBo) for an example on animating a simple path.

@@ -16,2 +16,4 @@ "use strict";

let sampleFrequency;
let pretty;
let prettyIndent;

@@ -50,2 +52,4 @@ function read(file) {

outputDirectory = config.outputDirectory;
pretty = !!config.pretty;
prettyIndent = ~~config.prettyIndent;

@@ -65,3 +69,3 @@ if (outputDirectory) {

promises[i] = read(file).then(processPaths).then(interpolatedPaths => {
const jsonStr = JSON.stringify(interpolatedPaths, 2);
const jsonStr = JSON.stringify(interpolatedPaths, null, (pretty ? prettyIndent : 0));
if (outputDirectory) {

@@ -68,0 +72,0 @@ fs.writeFile(path.normalize(`${outputDirectory}/${fileInfo.name}.pathData.json`), jsonStr);

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc