@@ -473,8 +473,8 @@ function GeneralFilterButton({
const trigger = (
);
const content = (
@@ -546,7 +546,7 @@ export function GeneralFilterContent({
);
}
+
+const GRAPH_COLORS = ["#5C7CFA", "#ED5CFA", "#FAD75C"];
+
+type CameraLineGraphProps = {
+ graphId: string;
+ unit: string;
+ dataLabels: string[];
+ updateTimes: number[];
+ data: ApexAxisChartSeries;
+};
+export function CameraLineGraph({
+ graphId,
+ unit,
+ dataLabels,
+ updateTimes,
+ data,
+}: CameraLineGraphProps) {
+ const { data: config } = useSWR
("config", {
+ revalidateOnFocus: false,
+ });
+
+ const lastValues = useMemo(() => {
+ if (!dataLabels || !data || data.length == 0) {
+ return undefined;
+ }
+
+ return dataLabels.map(
+ (_, labelIdx) =>
+ // @ts-expect-error y is valid
+ data[labelIdx].data[data[labelIdx].data.length - 1]?.y ?? 0,
+ ) as number[];
+ }, [data, dataLabels]);
+
+ const { theme, systemTheme } = useTheme();
+
+ const formatTime = useCallback(
+ (val: unknown) => {
+ if (val == 0) {
+ return;
+ }
+
+ const date = new Date(updateTimes[Math.round(val as number)] * 1000);
+ return date.toLocaleTimeString([], {
+ hour12: config?.ui.time_format != "24hour",
+ hour: "2-digit",
+ minute: "2-digit",
+ });
+ },
+ [config, updateTimes],
+ );
+
+ const options = useMemo(() => {
+ return {
+ chart: {
+ id: graphId,
+ selection: {
+ enabled: false,
+ },
+ toolbar: {
+ show: false,
+ },
+ zoom: {
+ enabled: false,
+ },
+ },
+ colors: GRAPH_COLORS,
+ grid: {
+ show: false,
+ },
+ legend: {
+ show: false,
+ },
+ dataLabels: {
+ enabled: false,
+ },
+ stroke: {
+ width: 1,
+ },
+ tooltip: {
+ theme: systemTheme || theme,
+ },
+ markers: {
+ size: 0,
+ },
+ xaxis: {
+ tickAmount: 4,
+ tickPlacement: "between",
+ labels: {
+ offsetX: -30,
+ formatter: formatTime,
+ },
+ axisBorder: {
+ show: false,
+ },
+ axisTicks: {
+ show: false,
+ },
+ },
+ yaxis: {
+ show: false,
+ min: 0,
+ },
+ } as ApexCharts.ApexOptions;
+ }, [graphId, systemTheme, theme, formatTime]);
+
+ useEffect(() => {
+ ApexCharts.exec(graphId, "updateOptions", options, true, true);
+ }, [graphId, options]);
+
+ return (
+
+ {lastValues && (
+
+ {dataLabels.map((label, labelIdx) => (
+
+
+
{label}
+
+ {lastValues[labelIdx]}
+ {unit}
+
+
+ ))}
+
+ )}
+
+
+ );
+}
diff --git a/web/src/components/graph/TimelineGraph.tsx b/web/src/components/graph/TimelineGraph.tsx
deleted file mode 100644
index 73b9b5fb6..000000000
--- a/web/src/components/graph/TimelineGraph.tsx
+++ /dev/null
@@ -1,101 +0,0 @@
-import { GraphData } from "@/types/graph";
-import Chart from "react-apexcharts";
-
-type TimelineGraphProps = {
- id: string;
- data: GraphData[];
- start: number;
- end: number;
- objects: number[];
-};
-
-/**
- * A graph meant to be overlaid on top of a timeline
- */
-export default function TimelineGraph({
- id,
- data,
- start,
- end,
- objects,
-}: TimelineGraphProps) {
- return (
- {
- if (objects.includes(dataPointIndex)) {
- return "#06b6d4";
- } else {
- return "#991b1b";
- }
- },
- ],
- chart: {
- id: id,
- selection: {
- enabled: false,
- },
- toolbar: {
- show: false,
- },
- zoom: {
- enabled: false,
- },
- },
- dataLabels: { enabled: false },
- grid: {
- show: false,
- padding: {
- bottom: 2,
- top: -12,
- left: -20,
- right: 0,
- },
- },
- legend: {
- show: false,
- position: "top",
- },
- plotOptions: {
- bar: {
- columnWidth: "100%",
- barHeight: "100%",
- hideZeroBarsWhenGrouped: true,
- },
- },
- stroke: {
- width: 0,
- },
- tooltip: {
- enabled: false,
- },
- xaxis: {
- type: "datetime",
- axisBorder: {
- show: false,
- },
- axisTicks: {
- show: false,
- },
- labels: {
- show: false,
- },
- min: start,
- max: end,
- },
- yaxis: {
- axisBorder: {
- show: false,
- },
- labels: {
- show: false,
- },
- },
- }}
- series={data}
- height="100%"
- />
- );
-}
diff --git a/web/src/components/icons/LiveIcons.tsx b/web/src/components/icons/LiveIcons.tsx
index dc491b612..fbac271ef 100644
--- a/web/src/components/icons/LiveIcons.tsx
+++ b/web/src/components/icons/LiveIcons.tsx
@@ -32,10 +32,10 @@ export function LiveListIcon({ layout }: LiveIconProps) {
return (
);
diff --git a/web/src/components/navigation/NavItem.tsx b/web/src/components/navigation/NavItem.tsx
index 37436ffde..1b42e5f7b 100644
--- a/web/src/components/navigation/NavItem.tsx
+++ b/web/src/components/navigation/NavItem.tsx
@@ -12,11 +12,11 @@ import { TooltipPortal } from "@radix-ui/react-tooltip";
const variants = {
primary: {
active: "font-bold text-white bg-selected",
- inactive: "text-muted-foreground bg-secondary",
+ inactive: "text-secondary-foreground bg-secondary",
},
secondary: {
active: "font-bold text-selected",
- inactive: "text-muted-foreground",
+ inactive: "text-secondary-foreground",
},
};
diff --git a/web/src/components/overlay/ExportDialog.tsx b/web/src/components/overlay/ExportDialog.tsx
index 5475dd00c..6468c2d16 100644
--- a/web/src/components/overlay/ExportDialog.tsx
+++ b/web/src/components/overlay/ExportDialog.tsx
@@ -122,8 +122,8 @@ export default function ExportDialog({
setMode("select");
}}
>
-
- {isDesktop && "Export"}
+
+ {isDesktop && Export
}
diff --git a/web/src/components/overlay/MobileReviewSettingsDrawer.tsx b/web/src/components/overlay/MobileReviewSettingsDrawer.tsx
index 0a3319918..26c6d9bbc 100644
--- a/web/src/components/overlay/MobileReviewSettingsDrawer.tsx
+++ b/web/src/components/overlay/MobileReviewSettingsDrawer.tsx
@@ -137,7 +137,7 @@ export default function MobileReviewSettingsDrawer({
className="w-full flex justify-center items-center gap-2"
onClick={() => setDrawerMode("export")}
>
-
+
Export
)}
@@ -146,7 +146,7 @@ export default function MobileReviewSettingsDrawer({
className="w-full flex justify-center items-center gap-2"
onClick={() => setDrawerMode("calendar")}
>
-
+
Calendar
)}
@@ -155,7 +155,7 @@ export default function MobileReviewSettingsDrawer({
className="w-full flex justify-center items-center gap-2"
onClick={() => setDrawerMode("filter")}
>
-
+
Filter
)}
@@ -282,7 +282,7 @@ export default function MobileReviewSettingsDrawer({
variant="secondary"
onClick={() => setDrawerMode("select")}
>
-
+
diff --git a/web/src/components/overlay/MobileTimelineDrawer.tsx b/web/src/components/overlay/MobileTimelineDrawer.tsx
index b29fde559..806651f1a 100644
--- a/web/src/components/overlay/MobileTimelineDrawer.tsx
+++ b/web/src/components/overlay/MobileTimelineDrawer.tsx
@@ -23,7 +23,7 @@ export default function MobileTimelineDrawer({
diff --git a/web/src/pages/SubmitPlus.tsx b/web/src/pages/SubmitPlus.tsx
index bf9f344f8..39e0646e4 100644
--- a/web/src/pages/SubmitPlus.tsx
+++ b/web/src/pages/SubmitPlus.tsx
@@ -237,8 +237,8 @@ function PlusFilterGroup({
>