VSDX import clips overflowing shape text at the text-block height
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- html, javascript
Direzione di ricerca
Start with src/main/webapp/js/diagramly/vsdx/importer.js at getTextLabel() and trace how overflow=width is rendered in src/main/webapp/mxgraph/src/util/mxSvgCanvas2D.js at createCss(). Reproduce the reported clipping by importing the attached VSDX with HeadlessEditorUi.importVisio, then decoding it into a Graph with HTML labels enabled. Done means the shape’s text remains visible below its boundary while preserving the text, wrapping width, and geometry without changing other importer cases.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Preflight Checklist
- I agree to follow the Code of Conduct.
- I have searched the issue tracker for a matching report without finding one.
Describe the bug
In a local integration using the unmodified draw.io Visio importer and Graph, imported HTML labels use overflow=width. The resulting HTML has a height limit and overflow:hidden, so lower lines are clipped when a Visio text block extends below its shape.
The attached synthetic VSDX reproduces the clipping without our document library or private source files. It contains two shapes with generic text:
- Shape 1: a top-aligned 3 × 0.49 inch invisible box, with a leading U+2028 blank line and four nonempty lines (Author, Review, Approval, Date). Lower lines are clipped.
- Shape 2: a 25 × 15 mm blue box with slash-separated text. This is an additional wrapping/clipping probe; see the scope limitation below.
To Reproduce
- Download and extract upstream-repro.vsdx.zip.
- With draw.io's
app.min.jsandextensions.min.jsloaded, importupstream-repro.vsdxusingHeadlessEditorUi.importVisio. - Decode the first imported page into an ordinary
Graphwith HTML labels enabled. Do not apply any downstream text-layout adaptations. - Inspect shape 1: all four nonempty lines are in the label DOM, but the lower lines are clipped by the height/overflow rules.
This is the control used in our reproduction (the globals are supplied by the draw.io bundles; file is the attached VSDX as a browser File, and container is a visible diagram element):
const xml = await new Promise((resolve, reject) =>
new HeadlessEditorUi().importVisio(
file, resolve, reject, 'upstream-repro.vsdx'));
const graph = new Graph(container);
graph.setHtmlLabels(true);
const diagram = mxUtils.parseXml(xml).getElementsByTagName('diagram')[0];
const modelXml = mxUtils.parseXml(Graph.decompress(diagram.textContent));
new mxCodec(modelXml).decode(modelXml.documentElement, graph.getModel());
graph.refresh();
graph.fit(24);
graph.center(true, true);
Expected behavior
Preserve the original text, leading blank line, wrapping width and shape/text-block geometry, while allowing text that Visio renders beyond an invisible shape's lower boundary to remain visible. A native Visio-generated PDF of the original document confirms this overflow behavior. The attached reproduction was newly generated; it has not separately been opened/saved in native Visio.
Screenshots
The self-contained synthetic VSDX is attached above. Private document screenshots are intentionally omitted. In our automated control, shape 1 has 31 non-whitespace glyphs intersecting clipping boundaries before the adaptation and none afterward. The complete text is present in both models; the failure is visual clipping.
draw.io version (In the Help->About menu of the draw.io editor):
- Bundled source/build pinned to jgraph/drawio commit 17b367b91dbab91804f852645788d7ffb46dcb79.
- This reproduction uses
HeadlessEditorUiandGraph, rather than the full editor UI, so there is no Help → About value for this integration.
Desktop (please complete the following information):
- OS: Windows.
- Browser: Google Chrome, automated through Playwright.
- Browser version: 154.0.8037.100.
Smartphone (please complete the following information):
- Device / OS / browser / version: Not tested; desktop integration reproduction.
I tested the problem in incognito/private mode with all browser extensions switched off, write "yes" below:
- Yes: reproduced in a fresh isolated Playwright browser context, without a user profile or extensions. The interactive browser's incognito UI was not separately tested.
Additional context
The relevant source paths appear to be:
- VSDX importer,
getTextLabel(), which setsoverflow=width. mxSvgCanvas2D.createCss(), where that overflow mode also constrains height.
Downstream correction approach tested
After decoding the imported model, our browser adapter:
- Changes
overflow=widthtooverflow=blockon nonempty imported HTML vertex labels identified byvsdxID. This retains the wrapping width while allowing vertical overflow. - Adds HTML
<wbr>opportunities after slash characters in visible text nodes for the slash-separated wrapping case. It handles string values and XML object values with alabelattribute, without altering unrelated attributes. - Refreshes the graph. Shape/text-block geometry and stored VSDX characters are unchanged. The HTML-only
wbrmarkers are never written into VSDX text. Direct edge labels and non-HTML values are left unchanged.
The synthetic control has no clipped glyphs after adaptation, and applying the adaptation again produces identical model XML. We also checked the original case against its native PDF: all 16 overflowing text blocks and the four-line slash-separated label are visible, with unchanged geometry. Edit/export/reset checks preserve the underlying text and other package contents.
Scope limitation: The full draw.io UI was also observed clipping the original overflowing metadata text, but it wrapped a similar slash-separated label correctly. We have not isolated the full-UI version/configuration difference. Therefore, the slash-wrapping probe should not be treated as a confirmed bug in every full-editor version. The primary report is the vertical clipping, with a proven headless import/render reproduction.
This is a downstream workaround and a suggested direction for investigation, rather than a claim that changing the default globally is safe. An upstream fix would need to preserve the intended overflow semantics for other importer cases.
The attachment contains only the newly generated generic VSDX, with no private document content.
- Lingua principale
- JavaScript
- Stelle
- 9.4k
- Fork
- 1.4k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di jgraph/drawio
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Requesting a VPAT for app.diagrams.netForse già presa @alderg l’ha presa 24 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
Import TablesApertaenhancement possible-duplicate
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Tutte le issue di jgraph/drawio
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 82/100
Leonxlnx/taste-skill#216 ·
I maintainer di solito rispondono entro 1 giorno
-
Docs: 11 broken linksAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
all-contributors/cli#690 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
area: ui Bug Payload OSS
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
payloadcms/payload#19839 ·
I maintainer di solito rispondono entro 1 giorno