Gathering detailed insights and metrics for d3-tricontour
Gathering detailed insights and metrics for d3-tricontour
Gathering detailed insights and metrics for d3-tricontour
Gathering detailed insights and metrics for d3-tricontour
npm install d3-tricontour
98.2
Supply Chain
100
Quality
75.4
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
38 Stars
39 Commits
5 Forks
4 Watching
2 Branches
2 Contributors
Updated on 07 Nov 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-5.2%
6,465
Compared to previous day
Last week
1.7%
34,358
Compared to previous week
Last month
-8.1%
180,860
Compared to previous month
Last year
-21.4%
1,923,311
Compared to previous year
2
5
This library computes contour polygons by applying meandering triangles to an array of points with arbitrary 2D coordinates (x, y) holding numeric values z. To compute contours on gridded coordinates, see d3-contour instead. To compute contours on geographic data, see d3.geoContour.
For examples, see the tricontours collection on Observable.
If you use npm, npm install d3-tricontour
. You can also download the latest release on GitHub. For vanilla HTML in modern browsers, import d3-tricontour from Skypack:
1<script type="module"> 2import {tricontour} from "https://cdn.skypack.dev/d3-tricontour@1"; 3</script>
For legacy environments, you can load d3-tricontour’s UMD bundle from an npm-based CDN such as jsDelivr; a d3
global is exported:
1<script src="https://cdn.jsdelivr.net/npm/d3-scale@4"></script> 2<script src="https://cdn.jsdelivr.net/npm/d3-delaunay@6"></script> 3<script src="https://cdn.jsdelivr.net/npm/d3-tricontour@1"></script> 4<script> 5 6const tric = d3.tricontour(); 7const contours = tric([[0, 0, 1], [1, 1, 0], [2, 0, 1]]); 8> Array(11) [ {type: "MultiPolygon", coordinates: Array(1), value: 0} … ] 9 10</script>
The API of tricontour is similar to that of d3-contour:
# d3.tricontour() · Source, Examples
Constructs a new tricontour generator with the default settings.
# tricontour(data) · Examples
Returns an array of contours, one for each threshold. The contours are MultiPolygons in GeoJSON format, that contain all the points with a value larger than the threshold. The value is indicated as geometry.value.
The data is passed as an array of points, by default with the format [x, y, value].
# tricontour.contour(data[, threshold])
Returns a contour, as a MultiPolygon in GeoJSON format, containing all points with a value larger or equal to threshold. The threshold is indicated as geometry.value
# tricontour.contours(data)
Returns an iterable over the contours.
# tricontour.isobands(data)
Returns an iterable over the isobands: contours between pairs of consecutive threshold values v0 (inclusive) and v1 (exclusive). geometry.value is equal to v0, geometry.valueMax to v1.
# tricontour.x([x])
Sets the x accessor. Defaults to `d => d[0]`. If x is not given, returns the current x accessor.
# tricontour.y([y])
Sets the y accessor. Defaults to `d => d[1]`. If y is not given, returns the current y accessor.
# tricontour.value([value])
Sets the value accessor. Defaults to `d => d[2]`. Values must be defined and finite. If value is not given, returns the current value accessor.
# tricontour.thresholds([thresholds])
Sets the thresholds, either explicitly as an array of values, or as a count that will be passed to d3.ticks. If empty, returns the current thresholds.
The following are experimental
These methods are used in d3-geo-voronoi’s geoContour.
# tricontour.triangulate([triangulate])
Sets the triangulate function. Defaults to d3.Delaunay.from. See Reusing a tricontour triangulation and UK tricontour for detailed examples.
# tricontour.pointInterpolate([pointInterpolate])
Sets the pointInterpolate function. Arguments: i, j, 0≤a<1. Defaults to linear interpolation between the coordinates of points i and j.
# tricontour.ringsort([ringsort])
Sets the ringsort function.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/23 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
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
Project has not signed or included provenance with any releases.
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