From 7068830c86cd97c550141239d8dce63ce19a88c3 Mon Sep 17 00:00:00 2001 From: Manik Rana Date: Wed, 15 May 2024 22:50:45 +0530 Subject: [PATCH] fix(broken): update formulae Signed-off-by: Manik Rana --- web/ui/react-app/src/pages/graph/HistogramChart.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/ui/react-app/src/pages/graph/HistogramChart.tsx b/web/ui/react-app/src/pages/graph/HistogramChart.tsx index 6a918be9fef..d4c0a407942 100644 --- a/web/ui/react-app/src/pages/graph/HistogramChart.tsx +++ b/web/ui/react-app/src/pages/graph/HistogramChart.tsx @@ -49,12 +49,12 @@ const HistogramChart: FC<{ histogram: Histogram; index: number; scale: ScaleType const minPositive = buckets ? parseFloat(buckets[closestToZero.closestIdx + 1][1]) : 0; const maxNegative = buckets ? parseFloat(buckets[closestToZero.closestIdx - 1][2]) : 0; const minNegative = buckets ? parseFloat(buckets[0][1]) : 0; - const startNegative = buckets ? Math.log(Math.abs(minNegative)) : 0; //start_neg - const endNegative = buckets ? Math.log(Math.abs(maxNegative)) : 0; //end_neg + const startNegative = buckets ? -Math.log(Math.abs(minNegative)) : 0; //start_neg + const endNegative = buckets ? -Math.log(Math.abs(maxNegative)) : 0; //end_neg const startPositive = buckets ? Math.log(minPositive) : 0; //start_pos const endPositive = buckets ? Math.log(maxPositive) : 0; //end_pos - const widthNegative = startNegative - endNegative; //width_neg + const widthNegative = endNegative - startNegative; //width_neg const widthPositive = endPositive - startPositive; //width_pos const widthTotal = widthNegative + expBucketWidth + widthPositive; //width_total @@ -191,7 +191,7 @@ const RenderHistogramBars: FC = ({ scale === 'linear' ? ((left - rangeMin) / (rangeMax - rangeMin)) * 100 + '%' : left < 0 - ? (Math.log(Math.abs(left)) - startNegative / widthTotal) * 100 + '%' // negative buckets boundary + ? (-(Math.log(Math.abs(left)) - startNegative) / widthTotal) * 100 + '%' // negative buckets boundary : (Math.log(left) - startPositive + bw + widthNegative / widthTotal) * 100 + '%'; // positive buckets boundary const bucketHeight = scale === 'linear' ? (fds[bIdx] / fdMax) * 100 + '%' : (count / countMax) * 100 + '%';