From 2e5ffabf0873082872ec71f9086b43b3c8bf2ee9 Mon Sep 17 00:00:00 2001 From: e26chiu Date: Sun, 11 Dec 2022 22:11:27 -0500 Subject: [PATCH] Get rid of unused vars + center legend --- components/LineGraph.module.css | 1 + components/LineGraph.tsx | 29 +---------------------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/components/LineGraph.module.css b/components/LineGraph.module.css index 8fedff0..fb9cd27 100644 --- a/components/LineGraph.module.css +++ b/components/LineGraph.module.css @@ -18,4 +18,5 @@ .legend { display: flex; margin: calc(16rem / 8); + justify-content: center; } \ No newline at end of file diff --git a/components/LineGraph.tsx b/components/LineGraph.tsx index 770b6f2..4df2ebd 100644 --- a/components/LineGraph.tsx +++ b/components/LineGraph.tsx @@ -46,38 +46,16 @@ interface LineGraphProps { }; /** List of hexademical colours for each line, length of colorRange should match the length of data. */ colorRange: string[]; - className?: string; /** Font size of the category tick labels, in pixels. Default is 16px. */ xTickLabelSize?: number; /** Font size of the value tick labels, in pixels. Default is 16px. */ yTickLabelSize?: number; - /** Font size of the value that appears when hovering over a bar, in pixels. */ - hoverLabelSize?: number; - /** Label text for the category axis. */ - xAxisLabel?: string; - /** Font size of the label for the cateogry axis, in pixels. */ - xAxisLabelSize?: number; - /** Controls the distance between the category axis label and the category axis. */ - xAxisLabelOffset?: number; - /** Label text for the value axis. */ - yAxisLabel?: string; - /** Font size of the label for the value axis, in pixels. */ - yAxisLabelSize?: number; - /** Controls the distance between the value axis label and the value axis. */ - yAxisLabelOffset?: number; - /** Distance between the right side of the graph and the legend, in px. */ - legendLeftOffset?: number; - /** Distance between the top of the graph and the legend, in px. */ - legendTopOffset?: number; /** Margin for each item in the legend */ itemMargin?: string; } const DEFAULT_LABEL_SIZE = 16; -// TODO: Address unused props in this file -/* eslint-disable unused-imports/no-unused-vars*/ - type TooltipData = string; export const LineGraph = withTooltip( @@ -95,8 +73,6 @@ export const LineGraph = withTooltip( tooltipData, hideTooltip, showTooltip, - legendLeftOffset = 40, - legendTopOffset = 40, itemMargin = "0 0 0 15px", }) => { const xLength = data.xValues.length; @@ -151,10 +127,7 @@ export const LineGraph = withTooltip( return (
-
+