The Visio diagram is not showing properly or some elements are missing

There are two reasons the diagram may not be shown fully:

1. Before you save a Visio file as SVG make sure that nothing in the diagram is selected. If you save a diagram with a shape selected then the resulting SVG can be empty or only show the selected shape. You should find that you can easily open your SVG file using your browser in order to check the file.

2. SVG sanitization - SVG files uploaded to the Visio tile (How to use the Visio tile) are sanitized by SquaredUp DS to prevent cross-site scripting (XSS) attacks, such as redirecting to a phishing site. If an SVG is failing to display correctly, then it is likely that certain tags are being removed by the sanitizer.

There are two ways to fix the problem of SVG sanitization:

1. Modify the original SVG

2. Disable SVG sanitization

1. Modify the original SVG

The most common source of this issue is importing Visio stencils or SVGs from third party sources. If certain tags are being removed, please replace them with alternatives if possible.

SVG tags known to cause issues are: foreignObject and use tags.

foreignObject tags are often used within switch tags. If so, they can be removed along with the switch tag and the second part of the switch tag can be used in their place. For instance,

<switch>
    <foreignObject>
        ...
    </foreignObject>
    <svg>
        ...
    </svg>
</switch>

becomes

<svg>
    ...
</svg>

To replace use tags, replace them with the tag they are referencing. For instance,

<g id="123" firstAttributes="...">
    ...
</g>
...
<use xlink:href="#123" secondAttributes="..."/>

becomes

<g id="123" firstAttributes="...">
    ...
</g>
...
<g firstAttributes="..." secondAttributes="...">
    ...
</g>

2. Disable SVG sanitization

If you are unable to modify the original SVG then it is also possible to disable SVG sanitization. This method is only available for SquaredUp DS v4.2 and above. Please be aware that disabling this feature presents a security risk and that it affects all SVGs uploaded to Visio tiles across the whole of SquaredUp DS.

Please ensure that if you choose to disable SVG sanitization, users are advised to remain vigilant and must be cautious of any strange behavior on pages containing uploaded SVGs.

  1. On the SquaredUp server, run Notepad as administrator (StartRun, type notepad, and then right-click and select Run as administrator).

    In Notepad, open the security.json file from the SquaredUp DS folder:

    ...\User\Configuration\security.json

    If the file doesn't exist, create it by following these steps and saving the file as security.json at the end.

  2. Edit the JSON file to contain the following property:
    {
        "enable-visio-svg-sanitization": false
    }
  3. If the file already contains settings, then you will need to add a comma at the end of the previous line.
  4. Save the json file.
  5. Recycle the SquaredUp DS application pool.

For more help see:

How to use the Visio tile

Troubleshooting the Visio tile

Was this article helpful?


Have more questions or facing an issue?