Gathering detailed insights and metrics for curve-interpolator
Gathering detailed insights and metrics for curve-interpolator
Gathering detailed insights and metrics for curve-interpolator
Gathering detailed insights and metrics for curve-interpolator
npm install curve-interpolator
76.5
Supply Chain
91.6
Quality
76.2
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
49 Stars
107 Commits
6 Forks
3 Watching
3 Branches
2 Contributors
Updated on 11 Oct 2024
Minified
Minified + Gzipped
TypeScript (99.39%)
JavaScript (0.61%)
Cumulative downloads
Total Downloads
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
20
A lib for interpolating values over a cubic Cardinal/Catmull-Rom spline curve of n-dimenesions.
1npm install --save curve-interpolator
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 are generated using typedoc in ./docs
. To create:
1npm run docs
Online: https://kjerandp.github.io/curve-interpolator/
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
6 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
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
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
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
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