Skip to content

Commit 32e0aa2

Browse files
authored
[ui] Try to fix weird resize loop on asset plot (#32978)
## Summary & Motivation One of our users is reporting strange behavior with asset plot charts, where the chart automatically resizes itself smaller and smaller. I'm going to try to fix this by putting a wrapper div with a set height, and remove the `width` and `height` props from the `Line` component. I'm not able to repro the issue myself, but this approach seems worth a try. ## How I Tested These Changes View asset plots, verify that they render properly.
1 parent 4c63833 commit 32e0aa2

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

js_modules/dagster-ui/packages/ui-core/src/assets/AssetValueGraph.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
ChartEvent,
66
Chart as ChartJS,
77
ChartOptions,
8+
Tooltip as ChartTooltip,
89
LineElement,
910
LinearScale,
1011
PointElement,
@@ -19,7 +20,7 @@ import {TimeContext} from '../app/time/TimeContext';
1920
import {timestampToString} from '../app/time/timestampToString';
2021
import {useRGBColorsForTheme} from '../app/useRGBColorsForTheme';
2122

22-
ChartJS.register(CategoryScale, LinearScale, LineElement, PointElement, TimeScale);
23+
ChartJS.register(CategoryScale, LinearScale, LineElement, PointElement, TimeScale, ChartTooltip);
2324

2425
export interface AssetValueGraphData {
2526
minY: number;
@@ -181,5 +182,9 @@ export const AssetValueGraph = (props: {
181182
},
182183
};
183184

184-
return <Line data={graphData} height={props.height || 100} options={options} key={props.width} />;
185+
return (
186+
<div style={{height: '100%', position: 'relative'}}>
187+
<Line data={graphData} options={options} />
188+
</div>
189+
);
185190
};

0 commit comments

Comments
 (0)