Skip to content

Commit 1884a55

Browse files
committed
format files with prettier
1 parent 190e7f5 commit 1884a55

File tree

10 files changed

+33
-44
lines changed

10 files changed

+33
-44
lines changed

src/Annotator/index.story.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,12 @@ storiesOf("Annotator", module)
183183
showTags={false}
184184
images={[
185185
{
186-
src:
187-
"https://s3.amazonaws.com/jobstorage.workaround.online/Atheer/video-frames/VID_20190111_161054.mp4_frame017.png",
186+
src: "https://s3.amazonaws.com/jobstorage.workaround.online/Atheer/video-frames/VID_20190111_161054.mp4_frame017.png",
188187
name: "Bounding Box Test",
189188
regions: [],
190189
},
191190
{
192-
src:
193-
"https://s3.amazonaws.com/jobstorage.workaround.online/Atheer/video-frames/VID_20190111_161054.mp4_frame001.png",
191+
src: "https://s3.amazonaws.com/jobstorage.workaround.online/Atheer/video-frames/VID_20190111_161054.mp4_frame001.png",
194192
name: "Bounding Box Test",
195193
regions: [],
196194
},
@@ -207,8 +205,7 @@ storiesOf("Annotator", module)
207205
allowedArea={{ x: 0, y: 0.6, w: 0.3, h: 0.3 }}
208206
images={[
209207
{
210-
src:
211-
"https://s3.amazonaws.com/jobstorage.workaround.online/Atheer/video-frames/VID_20190111_161054.mp4_frame017.png",
208+
src: "https://s3.amazonaws.com/jobstorage.workaround.online/Atheer/video-frames/VID_20190111_161054.mp4_frame017.png",
212209
name: "Bounding Box Test",
213210
regions: [],
214211
},
@@ -440,14 +437,12 @@ storiesOf("Annotator", module)
440437
]}
441438
images={[
442439
{
443-
src:
444-
"https://s3.amazonaws.com/asset.workaround.online/SampleVideo_1280x720_1mb.mp4",
440+
src: "https://s3.amazonaws.com/asset.workaround.online/SampleVideo_1280x720_1mb.mp4",
445441
frameTime: 0,
446442
name: "Frame 1",
447443
},
448444
{
449-
src:
450-
"https://s3.amazonaws.com/asset.workaround.online/SampleVideo_1280x720_1mb.mp4",
445+
src: "https://s3.amazonaws.com/asset.workaround.online/SampleVideo_1280x720_1mb.mp4",
451446
frameTime: 4500,
452447
name: "Frame 2",
453448
},

src/Annotator/reducers/combine-reducers.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
export default (...reducers) => (state, action) => {
2-
for (const reducer of reducers) {
3-
state = reducer(state, action)
1+
export default (...reducers) =>
2+
(state, action) => {
3+
for (const reducer of reducers) {
4+
state = reducer(state, action)
5+
}
6+
return state
47
}
5-
return state
6-
}

src/Annotator/reducers/general-reducer.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ export default (state: MainLayoutState, action: Action) => {
4444
state = setIn(state, ["lastAction"], action)
4545
}
4646

47-
const { currentImageIndex, pathToActiveImage, activeImage } = getActiveImage(
48-
state
49-
)
47+
const { currentImageIndex, pathToActiveImage, activeImage } =
48+
getActiveImage(state)
5049

5150
const getRegionIndex = (region) => {
5251
const regionId =
@@ -634,9 +633,8 @@ export default (state: MainLayoutState, action: Action) => {
634633
}
635634
case "create-keypoints": {
636635
state = saveToHistory(state, "Create Keypoints")
637-
const [
638-
[keypointsDefinitionId, { landmarks, connections }],
639-
] = (Object.entries(state.keypointDefinitions): any)
636+
const [[keypointsDefinitionId, { landmarks, connections }]] =
637+
(Object.entries(state.keypointDefinitions): any)
640638

641639
newRegion = {
642640
type: "keypoints",

src/Annotator/reducers/image-reducer.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ import { setIn } from "seamless-immutable"
88
import getActiveImage from "./get-active-image"
99

1010
export default (state: MainLayoutImageAnnotationState, action: Action) => {
11-
const { currentImageIndex, pathToActiveImage, activeImage } = getActiveImage(
12-
state
13-
)
11+
const { currentImageIndex, pathToActiveImage, activeImage } =
12+
getActiveImage(state)
1413

1514
switch (action.type) {
1615
case "IMAGE_OR_VIDEO_LOADED": {

src/DemoSite/Editor.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,11 @@ export const examples = {
5151
// showTags: true,
5252
images: [
5353
{
54-
src:
55-
"https://images.unsplash.com/photo-1496905583330-eb54c7e5915a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=634&q=80",
54+
src: "https://images.unsplash.com/photo-1496905583330-eb54c7e5915a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=634&q=80",
5655
name: "hot-dogs-1",
5756
},
5857
{
59-
src:
60-
"https://www.bianchi.com/wp-content/uploads/2019/07/YPB17I555K.jpg",
58+
src: "https://www.bianchi.com/wp-content/uploads/2019/07/YPB17I555K.jpg",
6159
name: "bianchi-oltre-xr4",
6260
},
6361
],
@@ -70,8 +68,7 @@ export const examples = {
7068
enabledTools: ["select", "create-polygon"],
7169
images: [
7270
{
73-
src:
74-
"https://images.unsplash.com/photo-1561518776-e76a5e48f731?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80",
71+
src: "https://images.unsplash.com/photo-1561518776-e76a5e48f731?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80",
7572
name: "car-image-1",
7673
},
7774
],

src/FullImageSegmentationAnnotator/index.story.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ storiesOf("FullImageSegmentationAnnotator.Basic", module)
6464
images={[
6565
{
6666
name: "Seve's Desk",
67-
src:
68-
"https://s3.amazonaws.com/datasets.workaround.online/faces/010041.jpg",
67+
src: "https://s3.amazonaws.com/datasets.workaround.online/faces/010041.jpg",
6968
regions: [
7069
[0, 100, 125],
7170
[0, 100, 150],

src/MainLayout/use-implied-video-regions.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export default (state: MainLayoutVideoAnnotationState) => {
1010
if (state.annotationType !== "video") return emptyArr
1111
const { keyframes, currentVideoTime = 0 } = state
1212
// TODO memoize
13-
return useMemo(() => getImpliedVideoRegions(keyframes, currentVideoTime), [
14-
keyframes,
15-
currentVideoTime,
16-
])
13+
return useMemo(
14+
() => getImpliedVideoRegions(keyframes, currentVideoTime),
15+
[keyframes, currentVideoTime]
16+
)
1717
}

src/RegionShapes/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@ const RegionComponents = {
6666
`No definition for keypoint configuration "${keypointsDefinitionId}"`
6767
)
6868
}
69-
const { landmarks, connections } = keypointDefinitions[
70-
keypointsDefinitionId
71-
]
69+
const { landmarks, connections } =
70+
keypointDefinitions[keypointsDefinitionId]
7271
return (
7372
<g>
7473
{Object.entries(points).map(([keypointId, { x, y }], i) => (

src/TagsSidebarBox/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ export const TagsSidebarBox = ({
3232
const onChangeTags = useEventCallback((o) =>
3333
onChangeImage({ tags: o.map((a) => a.value) })
3434
)
35-
const selectValue = useMemo(() => (cls ? { value: cls, label: cls } : null), [
36-
cls,
37-
])
35+
const selectValue = useMemo(
36+
() => (cls ? { value: cls, label: cls } : null),
37+
[cls]
38+
)
3839
const memoImgClsList = useMemo(
3940
() => asMutable(imageClsList.map((c) => ({ value: c, label: c }))),
4041
[imageClsList]

src/utils/get-hotkey-help-text.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { getApplicationKeyMap } from "react-hotkeys"
22

33
export const getHotkeyHelpText = (commandName) => {
4-
const firstSequence = getApplicationKeyMap()[commandName]?.sequences?.[0]
5-
?.sequence
4+
const firstSequence =
5+
getApplicationKeyMap()[commandName]?.sequences?.[0]?.sequence
66

77
if (!firstSequence) return ""
88
return ` (${firstSequence})`

0 commit comments

Comments
 (0)