@turf/ellipse 6.5.0 → 7.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,19 +6,20 @@
6
6
 
7
7
  Takes a [Point][1] and calculates the ellipse polygon given two semi-axes expressed in variable units and steps for precision.
8
8
 
9
- **Parameters**
9
+ ### Parameters
10
10
 
11
- - `center` **[Coord][2]** center point
12
- - `xSemiAxis` **[number][3]** semi (major) axis of the ellipse along the x-axis
13
- - `ySemiAxis` **[number][3]** semi (minor) axis of the ellipse along the y-axis
14
- - `options` **[Object][4]** Optional parameters (optional, default `{}`)
15
- - `options.angle` **[number][3]** angle of rotation (along the vertical axis), from North in decimal degrees, negative clockwise (optional, default `0`)
16
- - `options.pivot` **[Coord][2]** point around which the rotation will be performed (optional, default `'origin'`)
17
- - `options.steps` **[number][3]** number of steps (optional, default `64`)
18
- - `options.units` **[string][5]** unit of measurement for axes (optional, default `'kilometers'`)
19
- - `options.properties` **[Object][4]** properties (optional, default `{}`)
11
+ * `center` **[Coord][2]** center point
12
+ * `xSemiAxis` **[number][3]** semi (major) axis of the ellipse along the x-axis
13
+ * `ySemiAxis` **[number][3]** semi (minor) axis of the ellipse along the y-axis
14
+ * `options` **[Object][4]** Optional parameters (optional, default `{}`)
20
15
 
21
- **Examples**
16
+ * `options.angle` **[number][3]** angle of rotation in decimal degrees, positive clockwise (optional, default `0`)
17
+ * `options.pivot` **[Coord][2]** point around which the rotation will be performed (optional, default `'origin'`)
18
+ * `options.steps` **[number][3]** number of steps (optional, default `64`)
19
+ * `options.units` **[string][5]** unit of measurement for axes (optional, default `'kilometers'`)
20
+ * `options.properties` **[Object][4]** properties (optional, default `{}`)
21
+
22
+ ### Examples
22
23
 
23
24
  ```javascript
24
25
  var center = [-75, 40];
@@ -30,7 +31,7 @@ var ellipse = turf.ellipse(center, xSemiAxis, ySemiAxis);
30
31
  var addToMap = [turf.point(center), ellipse]
31
32
  ```
32
33
 
33
- Returns **[Feature][6]<[Polygon][7]>** ellipse polygon
34
+ Returns **[Feature][6]<[Polygon][7]>** ellipse polygon
34
35
 
35
36
  [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2
36
37
 
package/dist/es/index.js CHANGED
File without changes
package/dist/js/index.js CHANGED
File without changes
package/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { Feature, Coord, Polygon, Units, Properties } from "@turf/helpers";
1
+ import { Feature, Polygon, GeoJsonProperties } from "geojson";
2
+ import { Coord, Units } from "@turf/helpers";
2
3
 
3
4
  /**
4
5
  * http://turfjs.org/docs/#ellipse
@@ -8,8 +9,21 @@ export default function (
8
9
  xSemiAxis: number,
9
10
  ySemiAxis: number,
10
11
  options?: {
12
+ /** default 64 */
11
13
  steps?: number;
14
+ /** default kilometers */
12
15
  units?: Units;
13
- properties?: Properties;
16
+ properties?: GeoJsonProperties;
17
+ /**
18
+ * Angle of rotation in decimal degrees, positive clockwise
19
+ * default 0
20
+ */
21
+ angle?: number;
22
+
23
+ /**
24
+ * point around which the rotation will be performed
25
+ * default is the point specified by center
26
+ */
27
+ pivot?: Coord;
14
28
  }
15
29
  ): Feature<Polygon>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turf/ellipse",
3
- "version": "6.5.0",
3
+ "version": "7.0.0-alpha.1",
4
4
  "description": "turf ellipse module",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
@@ -28,6 +28,7 @@
28
28
  "exports": {
29
29
  "./package.json": "./package.json",
30
30
  ".": {
31
+ "types": "./index.d.ts",
31
32
  "import": "./dist/es/index.js",
32
33
  "require": "./dist/js/index.js"
33
34
  }
@@ -39,31 +40,32 @@
39
40
  "index.d.ts"
40
41
  ],
41
42
  "scripts": {
42
- "bench": "node -r esm bench.js",
43
+ "bench": "tsx bench.js",
43
44
  "build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
44
- "docs": "node ../../scripts/generate-readmes",
45
+ "docs": "tsx ../../scripts/generate-readmes",
45
46
  "test": "npm-run-all test:*",
46
- "test:tape": "node -r esm test.js"
47
+ "test:tape": "tsx test.js"
47
48
  },
48
49
  "devDependencies": {
49
50
  "@mapbox/geojsonhint": "*",
50
- "@turf/bbox-polygon": "^6.5.0",
51
- "@turf/circle": "^6.5.0",
52
- "@turf/destination": "^6.5.0",
53
- "@turf/truncate": "^6.5.0",
51
+ "@turf/bbox-polygon": "^7.0.0-alpha.1",
52
+ "@turf/circle": "^7.0.0-alpha.1",
53
+ "@turf/destination": "^7.0.0-alpha.1",
54
+ "@turf/truncate": "^7.0.0-alpha.1",
54
55
  "benchmark": "*",
55
56
  "glob": "*",
56
57
  "load-json-file": "*",
57
58
  "npm-run-all": "*",
58
59
  "rollup": "*",
59
60
  "tape": "*",
61
+ "tsx": "*",
60
62
  "write-json-file": "*"
61
63
  },
62
64
  "dependencies": {
63
- "@turf/helpers": "^6.5.0",
64
- "@turf/invariant": "^6.5.0",
65
- "@turf/rhumb-destination": "^6.5.0",
66
- "@turf/transform-rotate": "^6.5.0"
65
+ "@turf/helpers": "^7.0.0-alpha.1",
66
+ "@turf/invariant": "^7.0.0-alpha.1",
67
+ "@turf/rhumb-destination": "^7.0.0-alpha.1",
68
+ "@turf/transform-rotate": "^7.0.0-alpha.1"
67
69
  },
68
- "gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
70
+ "gitHead": "cf7a0c507b017ca066acffd0ce23bda5b393fb5a"
69
71
  }