Skip to content

Commit

Permalink
fix(viewer): delete unused lineHeadMode prop and type
Browse files Browse the repository at this point in the history
  • Loading branch information
LTakhyunKim committed Apr 20, 2023
1 parent 5d7e07c commit 31daebd
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 31 deletions.
3 changes: 0 additions & 3 deletions libs/insight-viewer/src/Annotation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ export type ViewerStyle = {
[styleType in ViewerStyleType]?: CSSProperties
}

/** @deprecated use arrow line instead */
export type LineHeadMode = 'normal' | 'arrow'

export type AnnotationMode = 'line' | 'freeLine' | 'polygon' | 'text' | 'arrowLine' | 'ruler' | 'area'

export interface AnnotationBase {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SVGProps } from 'react'
import { Annotation, AnnotationMode, LineHeadMode } from '../../types'
import { Annotation, AnnotationMode } from '../../types'

export interface AnnotationDrawerProps extends SVGProps<SVGSVGElement> {
selectedAnnotation: Annotation | null
Expand All @@ -19,6 +19,4 @@ export interface AnnotationDrawerProps extends SVGProps<SVGSVGElement> {
onSelectAnnotation: (annotation: Annotation | null) => void

mode?: AnnotationMode
/** @deprecated use arrow line instead */
lineHead?: LineHeadMode
}
3 changes: 0 additions & 3 deletions libs/insight-viewer/src/Viewer/AnnotationDrawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export function AnnotationDrawer({
hoveredAnnotation,
onSelectAnnotation,
className,
lineHead = 'normal',
mode = 'polygon',
onAdd,
}: AnnotationDrawerProps): JSX.Element {
Expand All @@ -39,7 +38,6 @@ export function AnnotationDrawer({
isDrawing,
isEditing,
mode,
lineHead,
annotations,
selectedAnnotation,
onSelectAnnotation,
Expand Down Expand Up @@ -90,7 +88,6 @@ export function AnnotationDrawer({
isSelectedMode={isSelectedAnnotation}
showAnnotationLabel={showAnnotationLabel}
isPolygonSelected={selectedAnnotation?.type === 'polygon'}
lineHead={lineHead}
selectedAnnotationLabel={selectedAnnotation ? selectedAnnotation.label ?? selectedAnnotation.id : null}
setAnnotationEditMode={setAnnotationEditMode}
cursorStatus={cursorStatus}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import { Annotation, AnnotationMode, LineHeadMode } from '../../types'
import { Annotation, AnnotationMode } from '../../types'
import { AnnotationViewerProps } from '../AnnotationViewer/AnnotationViewer.types'

export interface AnnotationOverlayProps extends AnnotationViewerProps {
isDrawing?: boolean
mode?: AnnotationMode
selectedAnnotation: Annotation | null
/**
* normal has no head
* For arrow, an arrow head is added.
* @deprecated use arrow line instead
*/
lineHead?: LineHeadMode
onFocus?: (annotation: Annotation | null) => void
onAdd?: (annotation: Annotation) => void
onRemove?: (annotation: Annotation) => void
Expand Down
2 changes: 0 additions & 2 deletions libs/insight-viewer/src/Viewer/AnnotationOverlay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export function AnnotationOverlay({
showOutline,
showAnnotationLabel,
mode,
lineHead,
isDrawing = false,
isEditing,
annotationAttrs,
Expand Down Expand Up @@ -57,7 +56,6 @@ export function AnnotationOverlay({
isDrawing={isDrawing}
isEditing={isEditing}
mode={mode}
lineHead={lineHead}
onAdd={onAdd}
onSelectAnnotation={onSelect}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type {
LineHeadMode,
EditMode,
PolygonAnnotation,
FreeLineAnnotation,
Expand All @@ -11,8 +10,6 @@ import type {
export interface PolylineDrawerProps {
annotation: PolygonAnnotation | FreeLineAnnotation | LineAnnotation | ArrowLineAnnotation
isSelectedMode: boolean
/** @deprecated use arrow line instead */
lineHead: LineHeadMode
showAnnotationLabel: boolean
selectedAnnotationLabel: string | number | null
setAnnotationEditMode: (mode: EditMode) => void
Expand Down
3 changes: 1 addition & 2 deletions libs/insight-viewer/src/Viewer/PolylineDrawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const PolylineElement = ({

export function PolylineDrawer({
annotation,
lineHead,
isSelectedMode,
selectedAnnotationLabel,
showAnnotationLabel,
Expand Down Expand Up @@ -56,7 +55,7 @@ export function PolylineDrawer({
{points && points.length > 0 && (
<>
<PolylineElement isPolygon={isPolygonSelected} style={svgWrapperStyle.outline} points={polylinePoints} />
{(lineHead === 'arrow' || type === 'arrowLine') && (
{type === 'arrowLine' && (
<>
<PolylineElement
className={`annotation-polyline ${cursorClassName} `}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export default function useAnnotationPointsHandler({
mode,
isDrawing,
isEditing,
lineHead,
svgElement,
annotations,
selectedAnnotation,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import type { AnnotationMode, Annotation, LineHeadMode, EditMode, CursorStatus } from '../../types'
import type { AnnotationMode, Annotation, EditMode, CursorStatus } from '../../types'
import type { EditPoints } from '../../utils/common/getEditPointPosition'

export interface UseAnnotationPointsHandlerParams {
isDrawing: boolean
isEditing: boolean
mode: AnnotationMode
/** @deprecated use arrow line instead */
lineHead: LineHeadMode
annotations: Annotation[]
selectedAnnotation: Annotation | null
hoveredAnnotation: Annotation | null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import polylabel from 'polylabel'
import { LINE_TEXT_POSITION_SPACING } from '../../../const'

import type { Image } from '../../../Viewer/types'
import type { Point, LineHeadMode, AnnotationMode, Annotation } from '../../../types'
import type { Point, AnnotationMode, Annotation } from '../../../types'

import { getCircleRadiusByMeasuringUnit } from '../../../utils/common/getCircleRadius'

Expand Down
1 change: 0 additions & 1 deletion libs/insight-viewer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export type {
Contours,
Annotation,
Point,
LineHeadMode,
AnnotationBase,
PolygonAnnotation,
LineAnnotation,
Expand Down
2 changes: 0 additions & 2 deletions libs/insight-viewer/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ export type ViewerStyle = {
[styleType in ViewerStyleType]?: CSSProperties
}

/** @deprecated use arrow line instead */
export type LineHeadMode = 'normal' | 'arrow'
export type AnnotationMode = 'line' | 'freeLine' | 'polygon' | 'circle' | 'text' | 'arrowLine'

export interface AnnotationBase {
Expand Down

0 comments on commit 31daebd

Please sign in to comment.