From 083b21546d7eb3abab2c3329ea39fe139eae8b84 Mon Sep 17 00:00:00 2001 From: Hanbyul Jo Date: Sun, 24 Mar 2024 19:14:27 +0900 Subject: [PATCH] Style polish --- .../components/datasets/dataset-chart.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/scripts/components/exploration/components/datasets/dataset-chart.tsx b/app/scripts/components/exploration/components/datasets/dataset-chart.tsx index 267d602c7..5ed14c3f8 100644 --- a/app/scripts/components/exploration/components/datasets/dataset-chart.tsx +++ b/app/scripts/components/exploration/components/datasets/dataset-chart.tsx @@ -30,19 +30,19 @@ interface DatasetChartProps { onUpdateSettings: (type: string, m: DataMetric[]) => void; } -const ChartAnalysisMenu = styled.div` +const ChartAnalysisMenu = styled.div<{axisWidth: number}>` width: inherit; position: relative; display: flex; justify-content: end; - margin-right: 6.5rem; + margin-right: calc(${props=> props.axisWidth}px + 0.5rem); z-index: 3000; `; -const AxisBackground = styled.div` +const AxisBackground = styled.div<{axisWidth: number}>` position: absolute; right: 0; top: 0; - width: ${props=> props.width}px; + width: ${props=> props.axisWidth}px; height: 100%; background-color: #F0F0F0; z-index: -1; @@ -73,7 +73,7 @@ export function DatasetChart(props: DatasetChartProps) { const extents = [ ...enhancedTimeseries.flatMap(d => extent(lineMetrics.map(m => d[m.id]))), ...areaMetrics.length && enhancedTimeseries.flatMap(d => extent([d[areaDataKey]].flat())), - ].filter(Boolean); // Filter out falsey values if areaMetrics.length is 0 + ].filter(Boolean); // Filter out falsey values return extent(extents.flat()) as [undefined, undefined] | [number, number]; }, [enhancedTimeseries, lineMetrics, areaMetrics]); @@ -94,10 +94,10 @@ export function DatasetChart(props: DatasetChartProps) { There are no active metrics to visualize. )} - + - +