Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
dyc3 committed Mar 31, 2024
1 parent 19fc0e7 commit 0dba082
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions packages/ott-vis-panel/src/components/TreeDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,18 @@ const TreeDisplay: React.FC<TreeDisplayProps> = ({

const [chartTransform, setChartTransform] = useState("translate(0, 0)");

const getRadius = useCallback((group: string): number => {
if (group === "client") {
return clientNodeRadius;
} else if (group === "balancer") {
return balancerNodeRadius;
} else {
return baseNodeRadius;
}
}, [baseNodeRadius, balancerNodeRadius, clientNodeRadius]);
const getRadius = useCallback(
(group: string): number => {
if (group === "client") {
return clientNodeRadius;
} else if (group === "balancer") {
return balancerNodeRadius;
} else {
return baseNodeRadius;
}
},
[baseNodeRadius, balancerNodeRadius, clientNodeRadius]
);

useEffect(() => {
if (svgRef.current) {
Expand Down Expand Up @@ -668,7 +671,10 @@ const TreeDisplay: React.FC<TreeDisplayProps> = ({
.ease(d3.easeCubicOut)
.attrTween("stroke", () => d3.interpolateRgb("#0f0", "#fff"))
.attrTween("stroke-width", () => t => d3.interpolateNumber(4, 1.5)(t).toString())
.attrTween("r", () => t => d3.interpolateNumber(newRadius, endRadius)(t).toString());
.attrTween(
"r",
() => t => d3.interpolateNumber(newRadius, endRadius)(t).toString()
);
});

return () => {
Expand Down

0 comments on commit 0dba082

Please sign in to comment.