From 61065eba7f55f99b1c67bb182367de61c08d7ec3 Mon Sep 17 00:00:00 2001 From: gorbit99 Date: Tue, 30 Sep 2025 22:48:18 +0200 Subject: [PATCH] Apply round of suggestions --- gui/src/components/tracker/TrackerGraph.tsx | 149 ++++++++++-------- .../components/tracker/TrackerSettings.tsx | 7 +- 2 files changed, 85 insertions(+), 71 deletions(-) diff --git a/gui/src/components/tracker/TrackerGraph.tsx b/gui/src/components/tracker/TrackerGraph.tsx index 4bb52198d..9cf42db03 100644 --- a/gui/src/components/tracker/TrackerGraph.tsx +++ b/gui/src/components/tracker/TrackerGraph.tsx @@ -3,9 +3,11 @@ import { useEffect, useState } from 'react'; import { Line } from 'react-chartjs-2'; import { TrackerDataT } from 'solarxr-protocol'; import { Button } from '@/components/commons/Button'; +import { useConfig } from '@/hooks/config'; export function TrackerGraph({ tracker }: { tracker: TrackerDataT }) { const { l10n } = useLocalization(); + const { config } = useConfig(); type AxisData = { x: number; @@ -70,47 +72,6 @@ export function TrackerGraph({ tracker }: { tracker: TrackerDataT }) { } }, [showTrackerGraph]); - const options = { - responsive: true, - animation: false, - plugins: { - title: { - display: true, - text: l10n.getString( - tracker?.info?.isImu - ? 'tracker-settings-graph-acceleration-title' - : 'tracker-settings-graph-position-title' - ), - }, - tooltip: { - mode: 'index', - intersect: false, - animation: false, - callbacks: { - title: () => '', - }, - }, - }, - scales: { - x: { - type: 'linear', - min: 0, - max: secondDuration, - }, - y: { - min: -4, - max: 4, - }, - }, - elements: { - point: { - radius: 0, - }, - }, - parsing: false, - normalized: true, - } as const; - return ( <> )} - {config?.debug && tracker && ( - - )} + {tracker && }