source: main/trunk/model-sites-dev/von-sparql/js/paper/examples/SVG Export/Line Testing.html@ 28914

Last change on this file since 28914 was 28914, checked in by ak19, 10 years ago

Supporting javascript libraries and bespoke code written by Steffan to support the von-sparql user interface

File size: 945 bytes
Line 
1<!DOCTYPE html>
2<html>
3<head>
4 <meta charset="UTF-8">
5 <title>Line Testing</title>
6 <link rel="stylesheet" href="../css/style.css">
7 <script type="text/javascript" src="../../dist/paper.js"></script>
8 <script type="text/paperscript" canvas="canvas">
9 var x1 = 5,
10 x2 = 45,
11 y1 = 5,
12 y2 = 45;
13 var line1 = new Path.Line([x1, y1], [x2, y2]);
14 line1.strokeColor = "blue";
15 line1.strokeWidth = "10";
16
17 var x3 = 20,
18 x4 = 99,
19 y3 = 20,
20 y4 = 77;
21 var line2 = new Path.Line([x3, y3], [x4, y4]);
22 line2.strokeColor = "red";
23 line2.strokeWidth = "2";
24
25 var x5 = 50,
26 x6 = 200,
27 y5 = 55,
28 y6 = 300;
29 var line3 = new Path.Line([x5, y5], [x6, y6]);
30 line3.strokeColor = "yellow";
31 line3.strokeWidth = "5";
32
33 document.getElementById('svg').appendChild(project.exportSVG());
34 </script>
35</head>
36<body>
37 <canvas id="canvas" width="500" height="500"></canvas>
38 <svg id="svg" width="500" height="500"></svg>
39</body>
40</html>
Note: See TracBrowser for help on using the repository browser.