source: main/trunk/model-sites-dev/von-sparql/js/paper/examples/JSON/Symbols.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: 809 bytes
Line 
1<!DOCTYPE html>
2<html>
3<head>
4 <meta charset="UTF-8">
5 <title>Symbols</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="canvas1">
9 var ellipse = new Path.Ellipse({
10 from: [0, 0],
11 to: [200, 100],
12 fillColor: 'red'
13 });
14 var symbol = new Symbol(ellipse);
15 var p1 = symbol.place([100, 100]);
16 p1.rotate(45);
17 var p2 = symbol.place([300, 200]);
18 p2.rotate(-30);
19 window._json = project.exportJSON();
20 console.log(window._json);
21 </script>
22 <script type="text/paperscript" canvas="canvas2">
23 project.importJSON(window._json);
24 </script>
25</head>
26<body>
27 <canvas id="canvas1" width="500" height="500"></canvas>
28 <canvas id="canvas2" width="500" height="500"></canvas>
29</body>
30</html>
Note: See TracBrowser for help on using the repository browser.