This is an automated email from the ASF dual-hosted git repository. ephraimanierobi pushed a commit to branch v2-6-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 61ebaad300e6492cd7d2ec48be15adad30fd4b32 Author: Brent Bovenzi <[email protected]> AuthorDate: Thu Apr 27 19:26:16 2023 -0400 Include node height/width in center-on-task logic (#30924) (cherry picked from commit d88ef477f7daf86d2ec9ad6650e75d00e5e78e36) --- airflow/www/static/js/dag/details/graph/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/airflow/www/static/js/dag/details/graph/index.tsx b/airflow/www/static/js/dag/details/graph/index.tsx index 00ece2c5e5..31578869cf 100644 --- a/airflow/www/static/js/dag/details/graph/index.tsx +++ b/airflow/www/static/js/dag/details/graph/index.tsx @@ -107,7 +107,13 @@ const Graph = ({ openGroupIds, onToggleGroups, hoveredTaskState }: Props) => { const x = node?.positionAbsolute?.x || node?.position.x; const y = node?.positionAbsolute?.y || node?.position.y; if (!x || !y) return; - setCenter(x, y, { duration: 1000 }); + setCenter( + x + (node.data.width || 0) / 2, + y + (node.data.height || 0) / 2, + { + duration: 1000, + } + ); } };
