last edit
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Rebecca-Chou 2022-08-31 20:00:13 -04:00
parent e6c77c750f
commit 21e146d66d
2 changed files with 51 additions and 69 deletions

View File

@ -2,7 +2,7 @@
stroke-width: 4;
}
.lineSeries:hover {
.lineSeries hover {
filter: drop-shadow(0 0 calc(4rem / 16) var(--primary-accent));
}

View File

@ -42,7 +42,6 @@ export const LineGraph = ({
xLabelSize = DEFAULT_LABEL_SIZE,
yLabelSize = DEFAULT_LABEL_SIZE,
}: LineGraphProps) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
const customTheme = buildChartTheme({
// colors
backgroundColor: Color.secondaryBackground, // used by Tooltip, Annotation
@ -61,11 +60,9 @@ export const LineGraph = ({
const yAccessor = (d: LineGraphData) => d.y;
return (
<>
<XYChart
height={height}
width={width}
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
theme={customTheme}
margin={margin}
xScale={{ type: "band" }}
@ -113,21 +110,6 @@ export const LineGraph = ({
yAccessor={yAccessor}
/>
))}
<Tooltip
snapTooltipToDatumX
snapTooltipToDatumY
renderTooltip={({ tooltipData }) => (
<div className={styles.tooltip}>
<div>{tooltipData?.nearestDatum?.key}</div>
<br />
{/* {xAccessor(tooltipData.nearestDatum.datum)}
{": "} */}
{yAccessor(tooltipData?.nearestDatum?.datum as LineGraphData)}
</div>
)}
/>
</XYChart>
</>
);
};