Comparing version 1.1.0 to 1.1.1
26
index.js
@@ -0,1 +1,25 @@ | ||
/** | ||
* Takes a bounding box and returns a new bounding box with a size expanded or contracted | ||
* by a factor of X. | ||
* | ||
* @module turf/size | ||
* @category measurement | ||
* @param {Array<number>} bbox a bounding box | ||
* @param {number} factor the ratio of the new bbox to the input bbox | ||
* @return {Array<number>} the resized bbox | ||
* @example | ||
* var bbox = [0, 0, 10, 10] | ||
* | ||
* var resized = turf.size(bbox, 2); | ||
* | ||
* var features = { | ||
* "type": "FeatureCollection", | ||
* "features": [ | ||
* turf.bboxPolygon(bbox), | ||
* turf.bboxPolygon(resized) | ||
* ] | ||
* }; | ||
* | ||
* //=features | ||
*/ | ||
module.exports = function(bbox, factor){ | ||
@@ -16,2 +40,2 @@ var currentXDistance = (bbox[2] - bbox[0]); | ||
return sized; | ||
} | ||
} |
{ | ||
"name": "turf-size", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "turf size module", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "node test.js" | ||
"test": "node test.js", | ||
"doc": "dox -r < index.js | doxme --readme > README.md" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/morganherlocker/turf-size.git" | ||
"url": "https://github.com/Turfjs/turf-size.git" | ||
}, | ||
@@ -23,9 +24,11 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/morganherlocker/turf-size/issues" | ||
"url": "https://github.com/Turfjs/turf-size/issues" | ||
}, | ||
"homepage": "https://github.com/morganherlocker/turf-size", | ||
"homepage": "https://github.com/Turfjs/turf-size", | ||
"devDependencies": { | ||
"benchmark": "^1.0.0", | ||
"tape": "^3.0.3" | ||
"tape": "^3.5.0", | ||
"dox": "^0.6.1", | ||
"doxme": "^1.4.3" | ||
} | ||
} |
@@ -1,34 +0,47 @@ | ||
turf-size | ||
========= | ||
[![Build Status](https://travis-ci.org/Turfjs/turf-size.svg)](https://travis-ci.org/Turfjs/turf-size) | ||
# turf-size | ||
Takes a bbox and returns a new bbox with a size expanded or contracted by a factor of X. | ||
[![build status](https://secure.travis-ci.org/Turfjs/turf-size.png)](http://travis-ci.org/Turfjs/turf-size) | ||
###Install | ||
turf size module | ||
```sh | ||
npm install turf-size | ||
``` | ||
###Parameters | ||
### `turf.size(bbox, factor)` | ||
|name|description| | ||
|---|---| | ||
|bbox|[xmin, ymin, xmay, ymax]| | ||
|factor|the factor to increase or decrease size by| | ||
Takes a bbox and returns a new bbox with a size expanded or contracted | ||
by a factor of X. | ||
###Usage | ||
```js | ||
size(bbox, factor) | ||
``` | ||
### Parameters | ||
###Example | ||
| parameter | type | description | | ||
| --------- | -------------- | ------------------------------------------- | | ||
| `bbox` | Array.<number> | a bounding box | | ||
| `factor` | number | the ratio of the new bbox to the input bbox | | ||
### Example | ||
```js | ||
var bbox = [0, 0, 10, 10] | ||
var resized = turf.size(bbox, 2); | ||
var features = turf.featurecollection([ | ||
turf.bboxPolygon(bbox), | ||
turf.bboxPolygon(resized)]); | ||
var doubled = size(bbox, 2) | ||
//=features | ||
``` | ||
console.log(doubled) // [-10, -10, 20, 20] | ||
``` | ||
## Installation | ||
Requires [nodejs](http://nodejs.org/). | ||
```sh | ||
$ npm install turf-size | ||
``` | ||
## Tests | ||
```sh | ||
$ npm test | ||
``` | ||
Possible typosquat attack
Supply chain riskThere is a package with a similar name that is downloaded much more often.
Did you mean |
---|
term-size |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5916
80
48
4
1