This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new ee467ff3f191 [SPARK-55711][UI][FOLLOWUP] Fix Job DAG visualization
display issue caused by initial viewBox
ee467ff3f191 is described below
commit ee467ff3f191b2d570b93a8a5fe581de857dffc1
Author: Kent Yao <[email protected]>
AuthorDate: Thu Feb 26 18:41:05 2026 +0800
[SPARK-55711][UI][FOLLOWUP] Fix Job DAG visualization display issue caused
by initial viewBox
### What changes were proposed in this pull request?
Follow-up to SPARK-54373 (#53087). Replace the initial `viewBox` attribute
with `width` and `height` on the Job DAG SVG element, consistent with the fix
applied to `spark-sql-viz.js` in the SPARK-54374 followup (#54482).
### Why are the changes needed?
Setting `viewBox` before dagre-d3 renders the graph changes the SVG
coordinate system, which affects how dagre-d3 positions elements. This causes
the same display issue as reported for SQL plan visualization in
https://github.com/apache/spark/pull/53864#issuecomment-3889339344.
Using `width` and `height` instead gives a large initial canvas without
altering the coordinate system that dagre-d3 depends on. The final `viewBox`,
`width`, and `height` are still correctly set after rendering completes.
### Does this PR introduce _any_ user-facing change?
Yes, fixes the Job DAG visualization display regression introduced by
SPARK-54373.
### How was this patch tested?
Tested in Chrome DevTools.
### Was this patch authored or co-authored using generative AI tooling?
Yes, GitHub Copilot CLI was used.
cc pan3793
Closes #54511 from yaooqinn/SPARK-55711.
Authored-by: Kent Yao <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
---
core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
b/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
index 9deeb419d3ec..fa30004bb5b7 100644
--- a/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
+++ b/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
@@ -160,7 +160,8 @@ function renderDagViz(forJob) {
const svg = graphContainer()
.append("svg")
.attr("class", jobOrStage)
- .attr("viewBox", `${-VizConstants.svgMarginX} ${-VizConstants.svgMarginY}
${window.innerWidth || 1920} 1000`);
+ .attr("width", window.innerWidth || 1920)
+ .attr("height", 1000);
if (forJob) {
renderDagVizForJob(svg);
} else {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]