Skip to content

Commit 9c1ca04

Browse files
committed
Address comments
1 parent fd3e91e commit 9c1ca04

23 files changed

+50
-56
lines changed

ui/src/components/interfaces.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

ui/src/features/annotator/annotation-shape.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { describe, expect, it } from 'vitest';
66

77
import { getMockedAnnotation } from '../../../tests/test-utils/mocked-annotation';
88
import { AnnotationShape } from './annotation-shape';
9-
import { Annotation, Polygon, Rect } from './shapes/interfaces';
9+
import { Annotation, Polygon, Rect } from './interfaces';
1010

1111
type AnnotationBoundingBox = Annotation & { shape: Rect };
1212
type AnnotationPolygon = Annotation & { shape: Polygon };

ui/src/features/annotator/annotation-shape.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (C) 2025 Intel Corporation
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { Annotation, Point } from './shapes/interfaces';
4+
import { Annotation, Point } from './interfaces';
55

66
type AnnotationShapeProps = {
77
annotation: Annotation;

ui/src/features/annotator/annotation/annotation.component.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Copyright (C) 2025 Intel Corporation
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { Annotation as AnnotationInterface } from '../shapes/interfaces';
5-
import { ShapeFactory } from './shape-factory.component';
4+
import { AnnotationShape } from '../annotation-shape';
5+
import { Annotation as AnnotationInterface } from '../interfaces';
66

77
interface AnnotationProps {
88
annotation: AnnotationInterface;
99
maskId?: string;
1010
}
1111

1212
export const Annotation = ({ maskId, annotation }: AnnotationProps): JSX.Element => {
13-
const { id, labels, shape } = annotation;
13+
const { id, labels } = annotation;
1414

1515
return (
1616
<>
@@ -27,7 +27,7 @@ export const Annotation = ({ maskId, annotation }: AnnotationProps): JSX.Element
2727
}
2828
: {})}
2929
>
30-
<ShapeFactory shape={shape} styles={{}} ariaLabel={''} />
30+
<AnnotationShape annotation={annotation} />
3131
</g>
3232
</>
3333
);

ui/src/features/annotator/annotation/shape-factory.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (C) 2025 Intel Corporation
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { Shape } from '../shapes/interfaces';
4+
import { Shape } from '../interfaces';
55
import { Polygon } from '../shapes/polygon.component';
66
import { Rectangle } from '../shapes/rectangle.component';
77

ui/src/features/annotator/annotations.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import { CSSProperties } from 'react';
55

66
import { AnnotationShape } from './annotation-shape';
7+
import { Annotation } from './interfaces';
78
import { MaskAnnotations } from './mask-annotations';
8-
import { Annotation } from './shapes/interfaces';
99

1010
type AnnotationsProps = {
1111
annotations: Array<Annotation>;

ui/src/features/annotator/shapes/interfaces.ts renamed to ui/src/features/annotator/interfaces.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (C) 2025 Intel Corporation
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { Label } from '../../../components/interfaces';
5-
64
export interface RegionOfInterest {
75
x: number;
86
y: number;
@@ -54,4 +52,6 @@ export type AnnotationState = {
5452
isLocked: boolean;
5553
};
5654

55+
export type Label = { id: string; name: string; color: string; isPrediction: boolean; score?: number };
56+
5757
export type Shape = Rect | Polygon;

ui/src/features/annotator/mask-annotations.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { ReactNode, useId } from 'react';
55

66
import { AnnotationShape } from './annotation-shape';
7-
import { Annotation } from './shapes/interfaces';
7+
import { Annotation } from './interfaces';
88

99
type MaskAnnotationsProps = {
1010
annotations: Array<Annotation>;

ui/src/features/annotator/shapes/circle.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (C) 2025 Intel Corporation
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { Circle as CircleInterface } from './interfaces';
4+
import { Circle as CircleInterface } from '../interfaces';
55

66
interface CircleProps {
77
circle: CircleInterface;

ui/src/features/annotator/shapes/polygon.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import { useMemo } from 'react';
55

6-
import { Point, Polygon as PolygonInterface } from './interfaces';
6+
import { Point, Polygon as PolygonInterface } from '../interfaces';
77

88
const getFormattedPoints = (points: Point[]): string => points.map(({ x, y }) => `${x},${y}`).join(' ');
99

0 commit comments

Comments
 (0)