Installations
npm install curve-interpolator
Score
76.5
Supply Chain
91.6
Quality
76.2
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Developer
Developer Guide
Module System
CommonJS, UMD
Min. Node Version
Typescript Support
Yes
Node Version
16.19.1
NPM Version
9.6.5
Statistics
49 Stars
107 Commits
6 Forks
3 Watching
3 Branches
2 Contributors
Updated on 11 Oct 2024
Bundle Size
38.99 kB
Minified
12.17 kB
Minified + Gzipped
Languages
TypeScript (99.39%)
JavaScript (0.61%)
Total Downloads
Cumulative downloads
Total Downloads
160,851
Last day
-45.9%
86
Compared to previous day
Last week
-8.3%
1,068
Compared to previous week
Last month
0.3%
5,259
Compared to previous month
Last year
61.6%
59,282
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
20
Curve Interpolator
A lib for interpolating values over a cubic Cardinal/Catmull-Rom spline curve of n-dimenesions.
Installation
1npm install --save curve-interpolator
Basic usage
Reference the CurveInterpolator class:
1// commonjs 2const CurveInterpolator = require('curve-interpolator').CurveInterpolator; 3 4// es6 5import { CurveInterpolator } from 'curve-interpolator'; 6
Define controlpoints you want the curve to pass through and pass it to the constructor of the CurveInterpolator to create an instance:
1const points = [ 2 [0, 4], 3 [1, 2], 4 [3, 6.5], 5 [4, 8], 6 [5.5, 4], 7 [7, 3], 8 [8, 0], 9 ... 10]; 11 12const interp = new CurveInterpolator(points, { tension: 0.2, alpha: 0.5 }); 13 14// get single point 15const position = 0.3 // [0 - 1] 16const pt = interp.getPointAt(position) 17 18// get points evently distributed along the curve 19const segments = 1000; 20const pts = interp.getPoints(segments); 21 22// lookup values along x and y axises 23const axis = 1; 24const yintersects = interp.getIntersects(7, axis); 25 26/* 27max number of solutions (0 = all (default), 1 = first, -1 = last) 28A negative max value counts solutions from end of curve 29*/ 30const axis = 0; 31const max = -1; 32const xintersects = interp.getIntersects(3.2, axis, max); 33 34// get bounding box 35const bbox = interp.getBoundingBox();
Online example on ObservableHQ:
Docs
Docs are generated using typedoc in ./docs
. To create:
1npm run docs
Online: https://kjerandp.github.io/curve-interpolator/
License
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
6 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/kjerandp/curve-interpolator/nodejs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/kjerandp/curve-interpolator/nodejs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/kjerandp/curve-interpolator/npmpublish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/kjerandp/curve-interpolator/npmpublish.yml/master?enable=pin
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
- Info: 2 out of 2 npmCommand dependencies pinned
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1
- Warn: no topLevel permission defined: .github/workflows/npmpublish.yml:1
- Info: no jobLevel write permissions found
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 7 are checked with a SAST tool
Score
3.1
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More