object path plotter per camera with time selection dropdown (#16676)

This commit is contained in:
Josh Hawkins
2025-02-18 20:55:16 -07:00
committed by GitHub
parent 7abf28bcbc
commit 2b3ab02ebf
7 changed files with 570 additions and 7 deletions
@@ -15,6 +15,7 @@ type ObjectPathProps = {
pointRadius?: number;
imgRef: React.RefObject<HTMLImageElement>;
onPointClick?: (index: number) => void;
visible?: boolean;
};
const typeColorMap: Partial<
@@ -37,6 +38,7 @@ export function ObjectPath({
pointRadius = 4,
imgRef,
onPointClick,
visible = true,
}: ObjectPathProps) {
const getAbsolutePositions = useCallback(() => {
if (!imgRef.current || !positions) return [];
@@ -69,7 +71,7 @@ export function ObjectPath({
return `rgb(${baseColor.map((c) => Math.max(0, c - 10)).join(",")})`;
};
if (!imgRef.current) return null;
if (!imgRef.current || !visible) return null;
const absolutePositions = getAbsolutePositions();
const lineColor = `rgb(${color.join(",")})`;