This issue has been created
 
 
Diagram Application / cid:jira-generated-image-avatar-b8bf3585-507b-43e0-818a-544e7444ec39 XADIAGRAM-61 Open

Inline stencil(...) shapes render as plain rectangles in view mode (pako not global)

 
View issue   ·   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-4fcfeee0-b12f-4bce-978f-9d87ed6b2b7b Kamil Kruk created this issue on 24/Aug/26 14:18
 
Summary: Inline stencil(...) shapes render as plain rectangles in view mode (pako not global)
Issue Type: cid:jira-generated-image-avatar-b8bf3585-507b-43e0-818a-544e7444ec39 Bug
Affects Versions: 1.3
Assignee: Unassigned
Attachments: Testing_Diagram.drawio, image-2026-08-24-14-13-58-038.png
Created: 24/Aug/26 14:18
Environment: XWiki 18.4 (Docker), Diagram Application (free), draw.io webjar 6.5.7.
Priority: cid:jira-generated-image-static-major-9a76dc3c-31c0-46bc-9aae-48aef94976d5 Major
Reporter: Kamil Kruk
Description:

Visio-imported shapes store their geometry inline as shape=stencil(...). They render fine in the editor, but in view mode each one becomes a plain filled rectangle, with no console error.

The reason is that pako isn't available as a global on the view page. draw.io's createShape only decodes inline stencils when typeof(pako) !== "undefined", and otherwise falls back to a plain rectangle silently.

 

My workaround — a JSX that loads pako with define temporarily nulled, so it exports to window:

var oldDefine = window.define;
window.define = undefined;
// load pako.min.js synchronously, then:
window.define = oldDefine;

After that the shapes render correctly.

A proper fix would be to load pako on the view sheet via RequireJS, set window.pako, and render only after it resolves.