Get rid of unused vars + center legend
continuous-integration/drone/push Build is passing Details

This commit is contained in:
e26chiu 2022-12-11 22:11:27 -05:00
parent cccfac319e
commit 2e5ffabf08
2 changed files with 2 additions and 28 deletions

View File

@ -18,4 +18,5 @@
.legend {
display: flex;
margin: calc(16rem / 8);
justify-content: center;
}

View File

@ -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<LineGraphProps, TooltipData>(
@ -95,8 +73,6 @@ export const LineGraph = withTooltip<LineGraphProps, TooltipData>(
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<LineGraphProps, TooltipData>(
return (
<div className={styles.container}>
<div
className={styles.legend}
style={{ left: width + legendLeftOffset, top: legendTopOffset }}
>
<div className={styles.legend}>
<LegendOrdinal
scale={colorScale}
direction="row"