diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-12-15 21:32:51 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-12-15 21:32:51 +0100 |
| commit | e0b0b2f976c61225a178c7715caf2656a1f6741f (patch) | |
| tree | 78a0e5c861462822d212c065f0825c906209bfe9 /client/common/detectionBoxes.component.js | |
| parent | c5b02ffab8d388e8a2925e51736b902a48a95e71 (diff) | |
moving stuff
Diffstat (limited to 'client/common/detectionBoxes.component.js')
| -rw-r--r-- | client/common/detectionBoxes.component.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/client/common/detectionBoxes.component.js b/client/common/detectionBoxes.component.js new file mode 100644 index 00000000..c4872ea8 --- /dev/null +++ b/client/common/detectionBoxes.component.js @@ -0,0 +1,15 @@ +import React from 'react' + +import { px } from '../util' + +export default function DetectionBoxes({ detections, width, height }) { + return detections.map(({ rect }, i) => ( + rect && + <div className='rect' key={i} style={{ + left: px(rect[0], width), + top: px(rect[1], height), + width: px(rect[2] - rect[0], width), + height: px(rect[3] - rect[1], height), + }} /> + )) +} |
