From 67aa99af78e5f2c98e840931c9dd1cfbf02261fd Mon Sep 17 00:00:00 2001 From: Andrej Ocenas Date: Mon, 24 Oct 2022 11:28:49 +0200 Subject: [PATCH] NodeGraph: Fix rendering issues when values of arc are over 1 (#57460) --- public/app/plugins/panel/nodeGraph/Node.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/panel/nodeGraph/Node.tsx b/public/app/plugins/panel/nodeGraph/Node.tsx index 1dcdf97828c..f22b031fb1f 100644 --- a/public/app/plugins/panel/nodeGraph/Node.tsx +++ b/public/app/plugins/panel/nodeGraph/Node.tsx @@ -123,7 +123,7 @@ export const Node = memo(function Node(props: { */ function ColorCircle(props: { node: NodeDatum }) { const { node } = props; - const fullStat = node.arcSections.find((s) => s.values.get(node.dataFrameRowIndex) === 1); + const fullStat = node.arcSections.find((s) => s.values.get(node.dataFrameRowIndex) >= 1); const theme = useTheme2(); if (fullStat) { @@ -159,6 +159,7 @@ function ColorCircle(props: { node: NodeDatum }) { (acc, section) => { const color = section.config.color?.fixedColor || ''; const value = section.values.get(node.dataFrameRowIndex); + const el = ( 1 + ? // If the values aren't correct and add up to more than 100% lets still render correctly the amounts we + // already have and cap it at 100% + 1 - acc.percent + : value + } color={theme.visualization.getColorByName(color)} strokeWidth={2} />