Skip to content

Commit

Permalink
fix(D3 plugin): fix chart reflow (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
korvin89 authored Mar 15, 2024
1 parent 1070273 commit 601d603
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugins/d3/renderer/D3Widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ const D3Widget = React.forwardRef<ChartKitWidgetRef | undefined, ChartKitProps<'
forwardedRef,
() => ({
reflow() {
handleResize();
debuncedHandleResize();
},
}),
[handleResize],
[debuncedHandleResize],
);

React.useEffect(() => {
Expand All @@ -66,8 +66,8 @@ const D3Widget = React.forwardRef<ChartKitWidgetRef | undefined, ChartKitProps<'

React.useEffect(() => {
// dimensions initialize
handleResize();
}, [handleResize]);
debuncedHandleResize();
}, [debuncedHandleResize]);

if (validatedData.current !== data) {
validateData(data);
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/d3/renderer/components/styles.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.chartkit-d3 {
position: absolute;
}

.chartkit-d3-axis {
& .domain {
stroke: var(--g-color-line-generic-active);
Expand Down

0 comments on commit 601d603

Please sign in to comment.