From e9a8166ac53f9bc93dc50472cefe91410a9547af Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Fri, 27 Feb 2026 14:52:38 +0100 Subject: [PATCH 1/4] [d3-chart] fixed bubble plot size calculation --- semcore/d3-chart/src/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/semcore/d3-chart/src/utils.ts b/semcore/d3-chart/src/utils.ts index f485eb11e0..12716e65f3 100644 --- a/semcore/d3-chart/src/utils.ts +++ b/semcore/d3-chart/src/utils.ts @@ -278,7 +278,7 @@ export const getChartDefaultColorName = (index: number) => { export const getBubbleChartValueScale = (data: any[], key: string) => { const z = scaleSqrt() .domain([0, Math.max(...data.map((el) => el[key]))]) - .range([5.5, 50.5]); + .range([5.5, 50.5]); // min/max radius return z; }; @@ -328,7 +328,7 @@ export const calculateBubbleDomain = ( min -= minValueShift * 2; max += maxValueShift * 2; - return [min, max]; + return [Math.floor(min), Math.floor(max)]; }; interface PlotEventEmitterEmit { From a95328cc3f49da0a893d88a9e915bb4db274db49 Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Fri, 27 Feb 2026 15:11:47 +0100 Subject: [PATCH 2/4] [website, d3-chart] fixed layout for bubble chart in playground --- playground/entries/Chart/Bubble.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/playground/entries/Chart/Bubble.tsx b/playground/entries/Chart/Bubble.tsx index 1c8acdaaf9..8a855a32d4 100644 --- a/playground/entries/Chart/Bubble.tsx +++ b/playground/entries/Chart/Bubble.tsx @@ -22,9 +22,15 @@ const data = [ ]; function getJSX(props: BubbleChartJSXProps) { + const isRow = props.commonChartProps.direction === 'row' || props.commonChartProps.direction === 'row-reverse'; + + // @ts-expect-error `w` is part of real legendProps from component, but we can't set it in playground manually + props.legendProps.w = isRow ? '72px' : '100%'; + const plotWidth = isRow ? 280 : 320; + return ( Date: Thu, 5 Mar 2026 11:00:37 +0100 Subject: [PATCH 3/4] [d3-chart] fixed bubble plot size calculation --- playground/entries/Chart/Bubble.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/playground/entries/Chart/Bubble.tsx b/playground/entries/Chart/Bubble.tsx index 8a855a32d4..6eddbc4006 100644 --- a/playground/entries/Chart/Bubble.tsx +++ b/playground/entries/Chart/Bubble.tsx @@ -23,9 +23,6 @@ const data = [ function getJSX(props: BubbleChartJSXProps) { const isRow = props.commonChartProps.direction === 'row' || props.commonChartProps.direction === 'row-reverse'; - - // @ts-expect-error `w` is part of real legendProps from component, but we can't set it in playground manually - props.legendProps.w = isRow ? '72px' : '100%'; const plotWidth = isRow ? 280 : 320; return ( @@ -36,6 +33,7 @@ function getJSX(props: BubbleChartJSXProps) { aria-label='Bubble chart' {...props.commonChartProps} {...(props.legendProps && { + w: isRow ? '72px' : '100%', legendProps: props.legendProps, showLegend: props.commonChartProps.showLegend as true, })} From 55879bd1366697e054e7bb202d60da2eec2fd1ab Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Thu, 5 Mar 2026 11:04:31 +0100 Subject: [PATCH 4/4] [d3-chart] fixed bubble plot size calculation --- playground/entries/Chart/Bubble.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/playground/entries/Chart/Bubble.tsx b/playground/entries/Chart/Bubble.tsx index 6eddbc4006..5f8387605b 100644 --- a/playground/entries/Chart/Bubble.tsx +++ b/playground/entries/Chart/Bubble.tsx @@ -33,8 +33,10 @@ function getJSX(props: BubbleChartJSXProps) { aria-label='Bubble chart' {...props.commonChartProps} {...(props.legendProps && { - w: isRow ? '72px' : '100%', - legendProps: props.legendProps, + legendProps: { + ...props.legendProps, + w: isRow ? '72px' : '100%', + }, showLegend: props.commonChartProps.showLegend as true, })} {...(props.legendProps?.patterns && { patterns: props.legendProps.patterns })}