Javascript integration - KiCad Web Viewer

Marus, thanks for your help! After some experiments I got it work. There are some troubles with sizing elements (viewbox) but it is another story…

Below is code that worked for me:

{{velocity}}
  {{html clean="false"}}
    $doc.getAttachment('interior.svg').getContentAsString()
    #set ($discard = $xwiki.jsx.use('KiCad WebWeb Viewer.WebHome'))
  {{/html}}
{{/velocity}}
{{html clean="false"}}
<script>
  require.config({
    paths: {
      'SVGPanZoom': 'https://wiki.mwmotors.cz/bin/download/KiCad%20Web%20Viewer/WebHome/KiCadWebView'
    }
  });
  require(['SVGPanZoom'], function(SVGPanZoom) {
    window.SVGPanZoom = SVGPanZoom;
    var el = document.getElementsByTagName('svg')[0]; // first svg on page
    KiCadWebView.schematic(el);
  });
</script>
{{/html}}