Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turf/hex-grid

Package Overview
Dependencies
Maintainers
4
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/hex-grid - npm Package Compare versions

Comparing version 6.0.1 to 6.0.2

12

package.json
{
"name": "@turf/hex-grid",
"version": "6.0.1",
"version": "6.0.2",
"description": "turf hex-grid module",
"main": "index",
"types": "index.d.ts",
"files": [
"index.js",
"index.ts"
"index.d.ts"
],

@@ -44,3 +45,2 @@ "scripts": {

"devDependencies": {
"@std/esm": "*",
"@turf/bbox-polygon": "*",

@@ -50,5 +50,7 @@ "@turf/truncate": "*",

"load-json-file": "*",
"rollup": "*",
"tape": "*",
"write-json-file": "*"
"write-json-file": "*",
"typescript": "*",
"tslint": "*",
"@types/tape": "*"
},

@@ -55,0 +57,0 @@ "dependencies": {

@@ -7,16 +7,16 @@ # @turf/hex-grid

Takes a bounding box and the diameter of the cell and returns a [FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) of flat-topped
hexagons or triangles ([Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6) features) aligned in an "odd-q" vertical grid as
described in [Hexagonal Grids](http://www.redblobgames.com/grids/hexagons/).
Takes a bounding box and the diameter of the cell and returns a [FeatureCollection][1] of flat-topped
hexagons or triangles ([Polygon][2] features) aligned in an "odd-q" vertical grid as
described in [Hexagonal Grids][3].
**Parameters**
- `bbox` **[BBox](https://tools.ietf.org/html/rfc7946#section-5)** extent in [minX, minY, maxX, maxY] order
- `cellSide` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** length of the side of the the hexagons or triangles, in units. It will also coincide with the
- `bbox` **[BBox][4]** extent in [minX, minY, maxX, maxY] order
- `cellSide` **[number][5]** length of the side of the the hexagons or triangles, in units. It will also coincide with the
radius of the circumcircle of the hexagons.
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Optional parameters (optional, default `{}`)
- `options.units` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** used in calculating cell size, can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`)
- `options.properties` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** passed to each hexagon or triangle of the grid (optional, default `{}`)
- `options.mask` **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)<([Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6) \| [MultiPolygon](https://tools.ietf.org/html/rfc7946#section-3.1.7))>?** if passed a Polygon or MultiPolygon, the grid Points will be created only inside it
- `options.triangles` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether to return as triangles instead of hexagons (optional, default `false`)
- `options` **[Object][6]** Optional parameters (optional, default `{}`)
- `options.units` **[string][7]** used in calculating cell size, can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`)
- `options.properties` **[Object][6]** passed to each hexagon or triangle of the grid (optional, default `{}`)
- `options.mask` **[Feature][8]<[Polygon][9]>?** if passed a Polygon or MultiPolygon, the grid Points will be created only inside it
- `options.triangles` **[boolean][10]** whether to return as triangles instead of hexagons (optional, default `false`)

@@ -36,4 +36,26 @@ **Examples**

Returns **[FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3)<[Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6)>** a hexagonal grid
Returns **[FeatureCollection][11]<[Polygon][9]>** a hexagonal grid
[1]: https://tools.ietf.org/html/rfc7946#section-3.3
[2]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[3]: http://www.redblobgames.com/grids/hexagons/
[4]: https://tools.ietf.org/html/rfc7946#section-5
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[8]: https://tools.ietf.org/html/rfc7946#section-3.2
[9]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
[11]: https://tools.ietf.org/html/rfc7946#section-3.3
<!-- This file is automatically generated. Please don't edit it directly:

@@ -40,0 +62,0 @@ if you find an error, edit the source file (likely index.js), and re-run

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