Uploaded image for project: 'Diagram Application'
  1. Diagram Application
  2. XADIAGRAM-61

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 1.3
    • None
    • XWiki 18.4 (Docker), Diagram Application (free), draw.io webjar 6.5.7.
    • Unknown

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kamilkruk Kamil Kruk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: