Use a distinct color palette for Frames / Detections graphs (#2)

The CPU and Frames / Detections graphs on the system metrics page both
rendered through CameraLineGraph with a single shared palette, making
the two graphs hard to tell apart at a glance.

Add an optional `colors` prop to CameraLineGraph (defaulting to the
existing palette so CPU graphs are unchanged) and give the Frames /
Detections graphs their own green/orange/cyan palette. The colors are
routed through both the chart lines and the legend dots so they stay
in sync.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
leccelecce
2026-06-25 22:42:50 +01:00
co-authored by Claude Opus 4.8
parent ec3fb00494
commit 7739a330d8
2 changed files with 14 additions and 4 deletions
+6 -1
View File
@@ -1,5 +1,8 @@
import { useFrigateStats } from "@/api/ws";
import { CameraLineGraph } from "@/components/graph/LineGraph";
import {
CameraLineGraph,
FPS_GRAPH_COLORS,
} from "@/components/graph/LineGraph";
import CameraInfoDialog from "@/components/overlay/CameraInfoDialog";
import { ConnectionQualityIndicator } from "@/components/camera/ConnectionQualityIndicator";
import { EmptyCard } from "@/components/card/EmptyCard";
@@ -308,6 +311,7 @@ export default function CameraMetrics({
updateTimes={updateTimes}
data={overallFpsSeries}
isActive={isActive}
colors={FPS_GRAPH_COLORS}
/>
</div>
) : (
@@ -411,6 +415,7 @@ export default function CameraMetrics({
cameraFpsSeries[camera.name] || {},
)}
isActive={isActive}
colors={FPS_GRAPH_COLORS}
/>
</div>
) : (