Launch Week Day 5: Introducing Reachability for PHP.Learn More
Socket
Book a DemoSign in
Socket

flatten-offset

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flatten-offset - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+6
-4
docs/index.html

@@ -27,3 +27,3 @@ <!DOCTYPE html>

<nav>
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="Offset.html">Offset</a></span></li>
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="Offset.html">Offset</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Offset.html#.offset">offset</a></span></li>
</nav>

@@ -64,6 +64,8 @@

So we can use it in the way:</p>
<pre class="prettyprint source lang-javascript"><code> let offsetPolygon = polygon.offset(offset_value)</code></pre><p>Example:</p>
<pre class="prettyprint source lang-javascript"><code> let offsetPolygon = polygon.offset(offset_value)</code></pre><p>When using umd minified package:</p>
<pre class="prettyprint source lang-javascript"><code> let {offset} = Offset;
let offsetPolygon = offset(polygon, offset_value)</code></pre><p>Example:</p>
<pre class="prettyprint source lang-javascript"><code> let Flatten = require('flatten-js');
require('flatten-offset');
let {segment, point, Polygon} = Flatten;
// Create polygon

@@ -101,3 +103,3 @@ let shapes = [

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Jun 09 2018 14:08:45 GMT+0300 (Jerusalem Daylight Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 11 2018 20:36:13 GMT+0300 (Jerusalem Daylight Time) using the Minami theme.
</footer>

@@ -104,0 +106,0 @@

+12
-7

@@ -27,3 +27,3 @@ <!DOCTYPE html>

<nav>
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="Offset.html">Offset</a></span></li>
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="Offset.html">Offset</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Offset.html#.offset">offset</a></span></li>
</nav>

@@ -58,7 +58,12 @@

class Offset {
static offsetPolygon(polygon, value) {
/**
* Offset polygon by given value
* @param {Polygon} polygon - input polygon
* @param {number} value - offset value, may be positive or negative
*/
static offset(polygon, value) {
let w = value;
let edges = [...polygon.edges];
let offsetPolygon = polygon;
let offsetPolygon = polygon.clone();
let offsetEdge;

@@ -248,6 +253,6 @@

Flatten.Polygon.prototype.offset = function(value) {
return Offset.offsetPolygon(this, value);
}
return Offset.offset(this, value);
};
module.exports = {}
module.exports = Offset;

@@ -266,3 +271,3 @@ </code></pre>

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Jun 09 2018 14:08:45 GMT+0300 (Jerusalem Daylight Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 11 2018 20:36:13 GMT+0300 (Jerusalem Daylight Time) using the Minami theme.
</footer>

@@ -269,0 +274,0 @@

@@ -27,3 +27,3 @@ <!DOCTYPE html>

<nav>
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="Offset.html">Offset</a></span></li>
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="Offset.html">Offset</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Offset.html#.offset">offset</a></span></li>
</nav>

@@ -153,6 +153,171 @@

<h3 class="subsection-title">Methods</h3>
<div class="section-method">
<h4 class="name" id=".offset"><span class="type-signature">(static) </span>offset<span class="signature">(polygon, value)</span><span class="type-signature"></span></h4>
<div class="description">
Offset polygon by given value
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line21">line 21</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>polygon</code></td>
<td class="type">
<span class="param-type"><code>Polygon</code></span>
</td>
<td class="description last">
input polygon
</td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type"><code>number</code></span>
</td>
<td class="description last">
offset value, may be positive or negative
</td>
</tr>
</tbody>
</table>
</div>
</article>

@@ -170,3 +335,3 @@

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Jun 09 2018 14:08:45 GMT+0300 (Jerusalem Daylight Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 11 2018 20:36:13 GMT+0300 (Jerusalem Daylight Time) using the Minami theme.
</footer>

@@ -173,0 +338,0 @@

@@ -16,7 +16,12 @@

class Offset {
static offsetPolygon(polygon, value) {
/**
* Offset polygon by given value
* @param {Polygon} polygon - input polygon
* @param {number} value - offset value, may be positive or negative
*/
static offset(polygon, value) {
let w = value;
let edges = [...polygon.edges];
let offsetPolygon = polygon;
let offsetPolygon = polygon.clone();
let offsetEdge;

@@ -206,6 +211,6 @@

Flatten.Polygon.prototype.offset = function(value) {
return Offset.offsetPolygon(this, value);
}
return Offset.offset(this, value);
};
module.exports = {}
module.exports = Offset;
{
"name": "flatten-offset",
"version": "1.0.0",
"version": "1.0.1",
"description": "Offset polygon",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -28,2 +28,7 @@ [![npm version](https://badge.fury.io/js/flatten-offset.svg)](https://badge.fury.io/js/flatten-offset)

```
When using umd minified package:
```javascript
let {offset} = Offset;
let offsetPolygon = offset(polygon, offset_value)
```

@@ -34,3 +39,3 @@ Example:

require('flatten-offset');
let {segment, point, Polygon} = Flatten;
// Create polygon

@@ -37,0 +42,0 @@ let shapes = [

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display