From 586de871619c5c3b4e053d2e30402edd837429a7 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Thu, 28 Nov 2024 17:28:14 +0000 Subject: [PATCH] Rationalize options --- lang/ui.en.json | 8 ++------ src/components/LiveGraph.tsx | 3 +-- src/messages/ui.en.json | 10 ++-------- src/recording-graph.ts | 3 +-- src/settings.tsx | 10 +++------- 5 files changed, 9 insertions(+), 25 deletions(-) diff --git a/lang/ui.en.json b/lang/ui.en.json index 88ec21836..f64ddb862 100644 --- a/lang/ui.en.json +++ b/lang/ui.en.json @@ -747,18 +747,14 @@ "defaultMessage": "Graph line thickness", "description": "Graph line weight setting label" }, - "graph-line-weight-medium": { - "defaultMessage": "Medium", + "graph-line-weight-default": { + "defaultMessage": "Default", "description": "Graph line weight option" }, "graph-line-weight-thick": { "defaultMessage": "Thick", "description": "Graph line weight option" }, - "graph-line-weight-thin": { - "defaultMessage": "Thin", - "description": "Graph line weight option" - }, "help-label": { "defaultMessage": "Help", "description": "Help icon aria label" diff --git a/src/components/LiveGraph.tsx b/src/components/LiveGraph.tsx index d9c91743a..dfd4d7121 100644 --- a/src/components/LiveGraph.tsx +++ b/src/components/LiveGraph.tsx @@ -30,8 +30,7 @@ const LiveGraph = () => { // When we update the chart we re-run the effect that syncs it with the connection state. const [chart, setChart] = useState(undefined); - const lineWidth = - graphLineWeight === "medium" ? 2 : graphLineWeight === "thin" ? 1 : 3; + const lineWidth = graphLineWeight === "default" ? 2 : 3; const liveGraphContainerRef = useRef(null); const { width, height } = useSize(liveGraphContainerRef) ?? { diff --git a/src/messages/ui.en.json b/src/messages/ui.en.json index 26016341c..79353fa8c 100644 --- a/src/messages/ui.en.json +++ b/src/messages/ui.en.json @@ -1273,10 +1273,10 @@ "value": "Graph line thickness" } ], - "graph-line-weight-medium": [ + "graph-line-weight-default": [ { "type": 0, - "value": "Medium" + "value": "Default" } ], "graph-line-weight-thick": [ @@ -1285,12 +1285,6 @@ "value": "Thick" } ], - "graph-line-weight-thin": [ - { - "type": 0, - "value": "Thin" - } - ], "help-label": [ { "type": 0, diff --git a/src/recording-graph.ts b/src/recording-graph.ts index 727080226..cb5536500 100644 --- a/src/recording-graph.ts +++ b/src/recording-graph.ts @@ -60,8 +60,7 @@ export const getConfig = ( const y = processDimensionData(rawY); const z = processDimensionData(rawZ); const common = { - borderWidth: - graphLineWeight === "medium" ? 1.5 : graphLineWeight === "thin" ? 1 : 2.5, + borderWidth: graphLineWeight === "default" ? 1 : 2, pointRadius: 0, pointHoverRadius: 0, }; diff --git a/src/settings.tsx b/src/settings.tsx index 687b5298a..c0d4aa825 100644 --- a/src/settings.tsx +++ b/src/settings.tsx @@ -44,7 +44,7 @@ export const defaultSettings: Settings = { showGraphs: true, graphColorScheme: "default", graphLineScheme: "solid", - graphLineWeight: "medium", + graphLineWeight: "default", }; export type GraphColorScheme = "default" | "color-blind-1" | "color-blind-2"; @@ -60,12 +60,8 @@ export const graphLineSchemeOptions: GraphLineScheme[] = [ "accessible", ]; -export type GraphLineWeight = "thin" | "medium" | "thick"; -export const graphLineWeightOptions: GraphLineWeight[] = [ - "thin", - "medium", - "thick", -]; +export type GraphLineWeight = "default" | "thick"; +export const graphLineWeightOptions: GraphLineWeight[] = ["default", "thick"]; export interface Settings { languageId: string;