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
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.
On the SquaredUp server, run Notepad as administrator (Start, Run, 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.The default location for the SquaredUp folder is
C:\inetpub\wwwroot\SquaredUp
For v5 it is
C:\inetpub\wwwroot\SquaredUpv5
and for v4C:\inetpub\wwwroot\SquaredUpv4
.Name of the SquaredUp folderA custom location may have been chosen during the installation.
The default name of the SquaredUp folder is
SquaredUp
for v6 and above.For v5 it is
SquaredUpv5
, and for v4SquaredUpv4
.- Edit the JSON file to contain the following property:
{ "enable-visio-svg-sanitization": false }
- If the file already contains settings, then you will need to add a comma at the end of the previous line.
- Save the json file.
- Recycle the SquaredUp DS application pool.
For more help see: