@the-grid/caliper
Advanced tools
Comparing version 0.6.3 to 0.6.4
@@ -6,3 +6,3 @@ { | ||
"repo": "the-grid/caliper", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"keywords": [], | ||
@@ -67,3 +67,4 @@ "dependencies": { | ||
"graphs/FetchAndResize.json", | ||
"graphs/RotateAndCrop.json" | ||
"graphs/RotateAndCrop.json", | ||
"components/CheckUserCrop.coffee" | ||
], | ||
@@ -124,2 +125,3 @@ "json": [ | ||
"CheckType": "components/CheckType.coffee", | ||
"CheckUserCrop": "components/CheckUserCrop.coffee", | ||
"CollectExtra": "components/CollectExtra.coffee", | ||
@@ -126,0 +128,0 @@ "CollectMandatory": "components/CollectMandatory.coffee", |
@@ -235,4 +235,4 @@ { | ||
"label": "Split", | ||
"x": 432, | ||
"y": 288, | ||
"x": 72, | ||
"y": 432, | ||
"width": 72, | ||
@@ -763,4 +763,17 @@ "height": 72 | ||
} | ||
}, | ||
{ | ||
"src": { | ||
"process": "core/Split_5ghn4", | ||
"port": "out" | ||
}, | ||
"tgt": { | ||
"process": "caliper/RotateAndCrop", | ||
"port": "metadata" | ||
}, | ||
"metadata": { | ||
"route": 6 | ||
} | ||
} | ||
] | ||
} |
@@ -14,4 +14,4 @@ { | ||
"metadata": { | ||
"x": -144, | ||
"y": 0, | ||
"x": -432, | ||
"y": -36, | ||
"width": 72, | ||
@@ -25,7 +25,17 @@ "height": 72 | ||
"metadata": { | ||
"x": -144, | ||
"y": 216, | ||
"x": -432, | ||
"y": 108, | ||
"width": 72, | ||
"height": 72 | ||
} | ||
}, | ||
"metadata": { | ||
"process": "caliper/CheckUserCrop_vu3s0", | ||
"port": "metadata", | ||
"metadata": { | ||
"x": -432, | ||
"y": 252, | ||
"width": 72, | ||
"height": 72 | ||
} | ||
} | ||
@@ -35,7 +45,7 @@ }, | ||
"getborderlessbox_rectangle": { | ||
"process": "image/GetBorderlessBox_lmj1q", | ||
"port": "rectangle", | ||
"process": "core/Merge_pk00o", | ||
"port": "out", | ||
"metadata": { | ||
"x": 1152, | ||
"y": 72, | ||
"y": 288, | ||
"width": 72, | ||
@@ -60,3 +70,3 @@ "height": 72 | ||
"x": 1152, | ||
"y": 216, | ||
"y": 108, | ||
"width": 72, | ||
@@ -83,4 +93,4 @@ "height": 72 | ||
"label": "image/BufferToCanvas", | ||
"x": 396, | ||
"y": 144, | ||
"x": 108, | ||
"y": 72, | ||
"width": 72, | ||
@@ -94,4 +104,4 @@ "height": 72 | ||
"label": "image/GetBorderlessBox", | ||
"x": 576, | ||
"y": 72, | ||
"x": 360, | ||
"y": 396, | ||
"width": 72, | ||
@@ -105,4 +115,4 @@ "height": 72 | ||
"label": "caliper/CheckCoverPrefs", | ||
"x": 72, | ||
"y": 216, | ||
"x": -216, | ||
"y": 108, | ||
"width": 72, | ||
@@ -116,4 +126,4 @@ "height": 72 | ||
"label": "sharp/Rotate", | ||
"x": 216, | ||
"y": 0, | ||
"x": -72, | ||
"y": -36, | ||
"width": 72, | ||
@@ -127,4 +137,4 @@ "height": 72 | ||
"label": "image/Crop", | ||
"x": 576, | ||
"y": 216, | ||
"x": 504, | ||
"y": 108, | ||
"width": 72, | ||
@@ -138,4 +148,4 @@ "height": 72 | ||
"label": "image/CanvasToBuffer", | ||
"x": 792, | ||
"y": 216, | ||
"x": 864, | ||
"y": 108, | ||
"width": 72, | ||
@@ -154,2 +164,22 @@ "height": 72 | ||
} | ||
}, | ||
"caliper/CheckUserCrop_vu3s0": { | ||
"component": "caliper/CheckUserCrop", | ||
"metadata": { | ||
"label": "CheckUserCrop", | ||
"x": 216, | ||
"y": 252, | ||
"width": 72, | ||
"height": 72 | ||
} | ||
}, | ||
"core/Merge_pk00o": { | ||
"component": "core/Merge", | ||
"metadata": { | ||
"label": "Merge", | ||
"x": 864, | ||
"y": 288, | ||
"width": 72, | ||
"height": 72 | ||
} | ||
} | ||
@@ -160,15 +190,2 @@ }, | ||
"src": { | ||
"process": "image/BufferToCanvas_tqdh", | ||
"port": "canvas" | ||
}, | ||
"tgt": { | ||
"process": "image/GetBorderlessBox_lmj1q", | ||
"port": "canvas" | ||
}, | ||
"metadata": { | ||
"route": 9 | ||
} | ||
}, | ||
{ | ||
"src": { | ||
"process": "caliper/CheckCoverPrefs_jlab", | ||
@@ -184,15 +201,2 @@ "port": "angle" | ||
"src": { | ||
"process": "image/BufferToCanvas_tqdh", | ||
"port": "canvas" | ||
}, | ||
"tgt": { | ||
"process": "image/Crop_pjx3p", | ||
"port": "canvas" | ||
}, | ||
"metadata": { | ||
"route": 9 | ||
} | ||
}, | ||
{ | ||
"src": { | ||
"process": "image/GetBorderlessBox_lmj1q", | ||
@@ -232,3 +236,3 @@ "port": "rectangle" | ||
"metadata": { | ||
"route": 10 | ||
"route": 3 | ||
} | ||
@@ -300,4 +304,91 @@ }, | ||
} | ||
}, | ||
{ | ||
"src": { | ||
"process": "caliper/CheckUserCrop_vu3s0", | ||
"port": "crop" | ||
}, | ||
"tgt": { | ||
"process": "image/GetBorderlessBox_lmj1q", | ||
"port": "canvas" | ||
}, | ||
"metadata": { | ||
"route": 3 | ||
} | ||
}, | ||
{ | ||
"src": { | ||
"process": "caliper/CheckUserCrop_vu3s0", | ||
"port": "crop" | ||
}, | ||
"tgt": { | ||
"process": "image/Crop_pjx3p", | ||
"port": "canvas" | ||
}, | ||
"metadata": { | ||
"route": 3 | ||
} | ||
}, | ||
{ | ||
"src": { | ||
"process": "image/BufferToCanvas_tqdh", | ||
"port": "canvas" | ||
}, | ||
"tgt": { | ||
"process": "caliper/CheckUserCrop_vu3s0", | ||
"port": "canvas" | ||
}, | ||
"metadata": {} | ||
}, | ||
{ | ||
"src": { | ||
"process": "caliper/CheckCoverPrefs_jlab", | ||
"port": "rectangle" | ||
}, | ||
"tgt": { | ||
"process": "caliper/CheckUserCrop_vu3s0", | ||
"port": "crop" | ||
}, | ||
"metadata": {} | ||
}, | ||
{ | ||
"src": { | ||
"process": "caliper/CheckUserCrop_vu3s0", | ||
"port": "dontcrop" | ||
}, | ||
"tgt": { | ||
"process": "image/CanvasToBuffer_e0a3y", | ||
"port": "canvas" | ||
}, | ||
"metadata": { | ||
"route": 7 | ||
} | ||
}, | ||
{ | ||
"src": { | ||
"process": "image/GetBorderlessBox_lmj1q", | ||
"port": "rectangle" | ||
}, | ||
"tgt": { | ||
"process": "core/Merge_pk00o", | ||
"port": "in" | ||
}, | ||
"metadata": { | ||
"route": 3 | ||
} | ||
}, | ||
{ | ||
"src": { | ||
"process": "caliper/CheckUserCrop_vu3s0", | ||
"port": "rectangle" | ||
}, | ||
"tgt": { | ||
"process": "core/Merge_pk00o", | ||
"port": "in" | ||
}, | ||
"metadata": { | ||
"route": 7 | ||
} | ||
} | ||
] | ||
} |
{ | ||
"name": "@the-grid/caliper", | ||
"description": "Measurement library", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"license": "proprietary", | ||
@@ -33,6 +33,6 @@ "author": { | ||
"noflo-canvas": "0.2.5", | ||
"noflo-ccv": "0.2.5", | ||
"noflo-ccv": "0.3.1", | ||
"noflo-exif": "0.1.6", | ||
"noflo-filetype": "0.1.3", | ||
"noflo-image": "0.2.15", | ||
"noflo-image": "0.2.16", | ||
"noflo-objects": "0.2.0", | ||
@@ -98,2 +98,3 @@ "noflo-sharp": "0.2.3", | ||
"CheckType": "components/CheckType.coffee", | ||
"CheckUserCrop": "components/CheckUserCrop.coffee", | ||
"CollectExtra": "components/CollectExtra.coffee", | ||
@@ -100,0 +101,0 @@ "CollectMandatory": "components/CollectMandatory.coffee", |
149
README.md
# Caliper [![Build Status](https://magnum.travis-ci.com/the-grid/caliper.svg?token=WDkQeNPpkzYVgXksK7sh&branch=master)](https://magnum.travis-ci.com/the-grid/caliper) | ||
Measurement library for Poly, handling different media types. | ||
Measurement library for The Grid content, handling different media and | ||
non-media types. | ||
## Local testing | ||
First make sure you have all dependencies installed: | ||
First make sure you have all dependencies installed (check .travis.yml | ||
file to a list of dependencies on Ubuntu): | ||
npm install | ||
Use the following command to run tests locally: | ||
Make sure you have the environment variables set: | ||
grunt | ||
- AMAZON_API_BUCKET: AWS bucket we use for uploading processed images for tests | ||
- AMAZON_API_ID: Our ID on AWS | ||
- AMAZON_API_REGION: Our region on AWS | ||
- AMAZON_API_TOKEN: Access token on AWS | ||
# Specifications | ||
(Please ask some Caliper maintainer about env vars if you want to use it for | ||
local development). | ||
Caliper deals with the following blocks: | ||
Use the following command to run tests locally: | ||
## Headline | ||
grunt | ||
```coffeescript | ||
headline: | ||
id: 'one' | ||
type: 'headline' | ||
html: '<h1>This is a headline</h1>' | ||
text: 'This is a headline' | ||
length: 18 | ||
} | ||
``` | ||
It is also helpful to run tests for only a pattern, e.g. for running | ||
image related tests: | ||
## Paragraph | ||
grunt test --grep "measuring images" | ||
```coffeescript | ||
paragraph: | ||
id: 'two' | ||
type: 'text' | ||
html: '<p>Hello world, <b>this</b> is some text</p>' | ||
text: 'Hello world, this is some text' | ||
length: 30 | ||
``` | ||
## Specifications | ||
## CTA | ||
Caliper deals with many media and non-media (e.g. text only html blocks). | ||
You can find more information about | ||
[schemas](https://github.com/the-grid/apidocs/tree/gh-pages/full-schema) [for those | ||
types](https://github.com/the-grid/apidocs/blob/gh-pages/full-schema/contentblock.json) and | ||
[their calculated | ||
measurements](https://github.com/the-grid/apidocs/blob/gh-pages/full-schema/imagemeasurements.json) in The Grid's API docs. | ||
```coffeescript | ||
cta: | ||
id: '1234cta' | ||
type: 'cta' | ||
uuid: '71bfc2e0-4a96-11e4-916c-0800200c9a66' | ||
verb: 'purchase' | ||
price: '96' | ||
html: '<button data-uuid=71bfc2e0-4a96-11e4-916c-0800200c9a66 data-role="cta" data-verb="purchase" data-price="96">Buy now</button>' | ||
text: 'Buy now' | ||
length: 7 | ||
``` | ||
## List | ||
```coffeescript | ||
list: | ||
id: 'ordered' | ||
type: 'list' | ||
html: '<ul><li>Foo</li><li>Bar</li></ul>' | ||
items: 2 | ||
``` | ||
## Image | ||
```coffeescript | ||
image: | ||
id: 'foo' | ||
type: 'article' | ||
src: 'http://foo/fullscale.png' | ||
cover: | ||
orientation: 'landscape' | ||
src: 'http://foo/fullscale.png' | ||
altsrc: 'http://foo/original.png' | ||
ratio: '1004:777' | ||
width: 2008 | ||
height: 1554 | ||
faces: [ | ||
{ x: 608.1907291149191 | ||
y: 189.99097584365575 | ||
width: 229.20877742760769 | ||
height: 229.20877742760769 | ||
neighbors: 2 | ||
confidence: -1.7360807700000014 } | ||
] | ||
colors: [[197, 135, 87], ...] | ||
saliency: | ||
polygon: [[2006, 1552], ...] | ||
center: [1258, 1233] | ||
radius: 836.904 | ||
bounding_rect: [[483, 817], [2007, 1553]] | ||
negative_space: | ||
rectangles: [ | ||
{ x: 0 | ||
y: 0 | ||
width: 1943 | ||
height: 780 | ||
text: | ||
large: 1184 | ||
medium: 3947 | ||
small: 6647 } | ||
] | ||
colors: [ | ||
[[24,15,8], | ||
[43,34,27], | ||
[94,10,30], | ||
[139,25,48], | ||
[89,67,53], | ||
[151,90,68], | ||
[187,128,98], | ||
[220,165,145], | ||
[146,124,92], | ||
[216,202,196]] | ||
] | ||
scene: | ||
bbox: | ||
x: number | ||
y: number | ||
width: number | ||
height: number | ||
``` | ||
- `altsrc` is optional and should be the original `src` when available | ||
- `src` should be the fullscale `src` when available | ||
- we should extract measurements from the fullscale `src` (for now, we should extract from the scaled down src in the near future) | ||
- `faces` length can be equal to zero | ||
- 'saliency' equals to `null` in `noflo-browser` | ||
## Video | ||
```coffeescript | ||
video: | ||
id: 'youtube' | ||
type: 'video' | ||
html: '<iframe src="//www.youtube.com/embed/P5cdlLTqb24?list=UUnPE7t9tqwcsO0LLyw5zuPQ"></iframe>' | ||
video: | ||
src: '//www.youtube.com/embed/P5cdlLTqb24?list=UUnPE7t9tqwcsO0LLyw5zuPQ' | ||
src: 'http://img.youtube.com/vi/P5cdlLTqb24/hqdefault.jpg' | ||
cover: | ||
... the same of image type ... | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
13179110
116
6854
41
+ Addednoflo-ccv@0.3.1(transitive)
+ Addednoflo-image@0.2.16(transitive)
- Removednoflo-ccv@0.2.5(transitive)
- Removednoflo-image@0.2.15(transitive)
Updatednoflo-ccv@0.3.1
Updatednoflo-image@0.2.16