From 7466762ecedaed3369a65b76951a1d0871a07cc2 Mon Sep 17 00:00:00 2001 From: vgihan Date: Mon, 12 Sep 2022 15:35:33 +0900 Subject: [PATCH] fix(view): update svg height when detail open in ClusterGraph --- .../VerticalClusterList/ClusterGraph/ClusterGraph.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/view/src/components/VerticalClusterList/ClusterGraph/ClusterGraph.tsx b/packages/view/src/components/VerticalClusterList/ClusterGraph/ClusterGraph.tsx index e3d9c4d8..d6467653 100644 --- a/packages/view/src/components/VerticalClusterList/ClusterGraph/ClusterGraph.tsx +++ b/packages/view/src/components/VerticalClusterList/ClusterGraph/ClusterGraph.tsx @@ -14,7 +14,12 @@ import { getSelectedIndex, getClusterPosition, } from "./ClusterGraph.util"; -import { CLUSTER_HEIGHT, GRAPH_WIDTH, SVG_WIDTH } from "./ClusterGraph.const"; +import { + CLUSTER_HEIGHT, + DETAIL_HEIGHT, + GRAPH_WIDTH, + SVG_WIDTH, +} from "./ClusterGraph.const"; import type { ClusterGraphElement, SVGElementSelection, @@ -80,8 +85,9 @@ const ClusterGraph = ({ }: ClusterGraphProps) => { const svgRef = useRef(null); const clusterSizes = getClusterSizes(data); - const graphHeight = getGraphHeight(clusterSizes); const selectedIndex = getSelectedIndex(data, selectedData); + const graphHeight = + getGraphHeight(clusterSizes) + (selectedIndex < 0 ? 0 : DETAIL_HEIGHT); const clusterGraphElements = data.map((cluster, i) => ({ cluster,