File: parser-svg.html

package info (click to toggle)
node-zrender 5.4.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,588 kB
  • sloc: javascript: 1,259; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 698 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Parse SVG</title>
    <script src="../dist/zrender.js"></script>
</head>
<body>
    <style>
        html, body, #main {
            width: 100%;
            height: 100%;
            margin: 0;
        }
    </style>
    <div id="main"></div>
    <script type="text/javascript">
        var zr = zrender.init(document.getElementById('main'));

        fetch('./asset/Tehran_topo.svg')
            .then(response => response.text())
            .then(zrender.parseSVG)
            .then(result => {
                result.root.scale = [0.4, 0.4];
                zr.add(result.root);
            });
    </script>
</body>
</html>