@lunit/is-polygon-area-greater-than-area
Advanced tools
Comparing version 1.0.1 to 1.0.2
15
index.js
@@ -94,13 +94,12 @@ (function(e, a) { for(var i in a) e[i] = a[i]; }(exports, /******/ (function(modules) { // webpackBootstrap | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPolygonAreaGreaterThanArea", function() { return isPolygonAreaGreaterThanArea; }); | ||
function isPolygonAreaGreaterThanArea(polygon) { | ||
var isGreaterThanArea = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100; | ||
function isPolygonAreaGreaterThanArea(polygon, isGreaterThanArea = 100) { | ||
// https://stackoverflow.com/questions/16285134/calculating-polygon-area | ||
// polygon의 면적을 계산해서 최소 면적 이상인 경우를 검증한다 | ||
var total = 0; | ||
let total = 0; | ||
for (var i = 0, l = polygon.length; i < l; i++) { | ||
var addX = polygon[i][0]; | ||
var addY = polygon[i === polygon.length - 1 ? 0 : i + 1][1]; | ||
var subX = polygon[i === polygon.length - 1 ? 0 : i + 1][0]; | ||
var subY = polygon[i][1]; | ||
for (let i = 0, l = polygon.length; i < l; i++) { | ||
const addX = polygon[i][0]; | ||
const addY = polygon[i === polygon.length - 1 ? 0 : i + 1][1]; | ||
const subX = polygon[i === polygon.length - 1 ? 0 : i + 1][0]; | ||
const subY = polygon[i][1]; | ||
total += addX * addY * 0.5; | ||
@@ -107,0 +106,0 @@ total -= subX * subY * 0.5; |
{ | ||
"name": "@lunit/is-polygon-area-greater-than-area", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Test is polygon area greater than area", | ||
@@ -9,3 +9,3 @@ "author": { | ||
}, | ||
"repository": "lunit-io/opt-tool-frontend", | ||
"repository": "lunit-io/frontend-components", | ||
"license": "MIT", | ||
@@ -12,0 +12,0 @@ "publishConfig": { |
@@ -29,3 +29,2 @@ # Install | ||
import { isPolygonAreaGreaterThanArea } from '@lunit/is-polygon-area-greater-than-area'; | ||
import { withOptTheme } from '@lunit/opt-theme'; | ||
import { storiesOf } from '@storybook/react'; | ||
@@ -37,3 +36,3 @@ import React, { ReactNode, useCallback, useState } from 'react'; | ||
const resetTime: number = Date.now(); | ||
const image: CornerstoneImage = new CornerstoneSingleImage(`wadouri:samples/series/CT000010.dcm`, {unload: unloadWADOImage}); | ||
const image: CornerstoneImage = new CornerstoneSingleImage(`wadouri:https://lunit-io.github.io/frontend-fixtures/dcm-files/series/CT000010.dcm`, {unload: unloadWADOImage}); | ||
@@ -102,3 +101,2 @@ function doNothing() { | ||
storiesOf('in-polygon-area-greater-than-area', module) | ||
.addDecorator(withOptTheme) | ||
.add('isPolygonAreaGreaterThanArea()', () => <Sample/>); | ||
@@ -105,0 +103,0 @@ ``` |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
15015
108
142