Skip to content

Commit

Permalink
fix(view): update svg height when detail open in ClusterGraph
Browse files Browse the repository at this point in the history
  • Loading branch information
vgihan committed Sep 12, 2022
1 parent 34aee96 commit 7466762
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -80,8 +85,9 @@ const ClusterGraph = ({
}: ClusterGraphProps) => {
const svgRef = useRef<SVGSVGElement>(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,
Expand Down

0 comments on commit 7466762

Please sign in to comment.