Skip to content

Commit 7b70d07

Browse files
committed
refactor: Rename
1 parent 956c978 commit 7b70d07

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

app/charts/shared/annotation-tooltip.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import { IconButton, Theme, Typography } from "@mui/material";
22
import { makeStyles } from "@mui/styles";
33
import { useCallback } from "react";
44

5-
import { AnnotationPosition } from "@/charts/shared/annotations";
5+
import { RenderAnnotation } from "@/charts/shared/annotations";
66
import { MarkdownInheritFonts } from "@/components/markdown";
77
import { Icon } from "@/icons";
88
import { useLocale } from "@/locales/use-locale";
99
import { useChartInteractiveFilters } from "@/stores/interactive-filters";
1010

1111
export const AnnotationTooltip = ({
12-
annotationPosition: { annotation, x, y },
12+
renderAnnotation: { annotation, x, y },
1313
}: {
14-
annotationPosition: AnnotationPosition;
14+
renderAnnotation: RenderAnnotation;
1515
}) => {
1616
const classes = useStyles();
1717
const annotations = useChartInteractiveFilters((d) => d.annotations);

app/charts/shared/annotations.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const Annotations = () => {
5858
[interactiveAnnotations, setInteractiveAnnotations]
5959
);
6060

61-
const annotationPositions = useMemo(() => {
61+
const renderAnnotations = useMemo(() => {
6262
// A "hack" to prevent using // eslint-disable-next-line @typescript-eslint/no-unused-vars
6363
// We need to re-compute the annotation positions when the chart width or height changes.
6464
width;
@@ -90,7 +90,7 @@ export const Annotations = () => {
9090
};
9191
});
9292
})
93-
.filter((d): d is AnnotationPosition => d !== null);
93+
.filter((d): d is RenderAnnotation => d !== null);
9494
}, [
9595
width,
9696
height,
@@ -103,8 +103,8 @@ export const Annotations = () => {
103103

104104
return (
105105
<>
106-
{annotationPositions.map((annotationPosition) => {
107-
const { annotation, x, y, color, focused } = annotationPosition;
106+
{renderAnnotations.map((renderAnnotation) => {
107+
const { annotation, x, y, color, focused } = renderAnnotation;
108108

109109
return (
110110
<>
@@ -116,15 +116,15 @@ export const Annotations = () => {
116116
focused={focused}
117117
onClick={() => handleAnnotationClick(annotation)}
118118
/>
119-
<AnnotationTooltip annotationPosition={annotationPosition} />
119+
<AnnotationTooltip renderAnnotation={renderAnnotation} />
120120
</>
121121
);
122122
})}
123123
</>
124124
);
125125
};
126126

127-
export type AnnotationPosition = {
127+
export type RenderAnnotation = {
128128
annotation: Annotation;
129129
x: number;
130130
y: number;

0 commit comments

Comments
 (0)