shreyaskj-0710 commented on code in PR #55012:
URL: https://github.com/apache/airflow/pull/55012#discussion_r2318761964
##########
airflow-core/src/airflow/ui/src/components/Graph/DownloadButton.tsx:
##########
@@ -26,24 +26,28 @@ import { toaster } from "src/components/ui";
export const DownloadButton = ({ name }: { readonly name: string }) => {
const { t: translate } = useTranslation("components");
- const { getNodes, getZoom } = useReactFlow();
- const onClick = () => {
- const nodesBounds = getNodesBounds(getNodes());
+ const { fitView } = useReactFlow();
+
+ const onClick = async () => {
+
+ // Ensure the graph fits before taking screenshot
+ fitView({ duration: 0, padding: 0.1 });
+
+ // Small delay to let layout stabilize
+ await new Promise((resolve) => setTimeout(resolve, 50));
Review Comment:
Hi @pierrejeambrun ,
Have Implemented suggested changes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]