1<!DOCTYPE html>
2<html>
3    <head>
4        <meta charset="utf-8">
5        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6        <base href="http://snapsvg.io/docs/">
7        <title>Snap.svg API Reference</title>
8        <link rel="shortcut icon" href="/assets/favicon.ico?v=1">
9        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
10        <link rel="stylesheet" href="/assets/docs/fonts/stylesheet.css?v=201311041519">
11        <link rel="stylesheet" href="/assets/docs/css/topcoat-desktop-light.css?v=201311041519">
12        <link rel="stylesheet" href="/assets/docs/css/main.css?v=201311041519">
13        <link rel="stylesheet" href="/assets/docs/css/dr.css?v=201311041519">
14        <link rel="stylesheet" href="/assets/docs/css/prism.css?v=201311041519">
15        <link rel="stylesheet" href="/assets/style/docs-header.css?v=201311041519">
16        <script>
17            var _gaq = _gaq || [];
18            _gaq.push(['_setAccount', 'UA-44948757-1']);
19            _gaq.push(['_trackPageview']);
20
21            (function() {
22                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
23                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
24                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
25            })();
26
27            function trackOutboundLink(link, category, action) {
28                try {
29                    _gaq.push(['_trackEvent', category , action]);
30                } catch(err){}
31
32                setTimeout(function() {
33                    document.location.href = link.href;
34                }, 100);
35            }
36        </script>
37    </head>
38    <body class="light">
39
40        <header id="header">
41            <div class="wrap">
42                <a href="/" class="logo">
43                    <img src="/assets/images/logo.svg" alt=""/>
44                    <span class="header">Snap.svg</span>
45                </a>
46                <nav>
47                    <a href="/">Home</a>
48                    <a href="/about/">Why Snap</a>
49                    <a href="/start/" class="mobile-hide">Getting Started</a>
50                    <a href="/docs/" class="mobile-hide selected">Docs</a>
51                    <a href="/support/">Support</a>
52                    <a href="/demos/" class="mobile-hide">Demos</a>
53                    <a class="bt" href="/assets/downloads/Snap.svg-0.1.0.zip" onclick="trackOutboundLink(this, 'Download', '0.1');return false;">Download</a>
54                </nav>
55            </div>
56        </header>
57
58<!--[if lt IE 9]>
59<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
60
61        <div id="wrapper">
62            <div class="max-width">
63                  <div id="sideNav">
64                      <div class="combo">
65                          <input type="search" id="dr-filter" value="" placeholder="search" class="topcoat-search-input">
66                      </div>
67                      <div id="pageNav">
68                          <ol id="dr-toc">
69                              {{ for (var i = 0; i < it.toc.length; i++) { }}
70                              <li class="dr-lvl{{=it.toc[i].indent}}">
71                                  <a href="#{{=it.toc[i].name}}" class="{{=it.toc[i].clas}}"><span>{{=it.toc[i].name}}{{=it.toc[i].brackets}}</span></a>
72                              </li>
73                              {{ } }}
74                          </ol>
75                      </div>
76                  </div>
77              </div>
78              <div id="site">
79                  <div id="content" class="max-width">
80                      {{~it.out :item:index}}
81                      <article id="{{=item[0].title}}">
82                          <header>
83                              <h3 class="{{=item[0].clas}}">{{=item[0].name}}<a href="#{{=item[0].title}}" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line {{=item[0].line}} in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L{{=item[0].line}}">&#x27ad;</a></h3>
84                          </header>
85                          <section>
86                              <div class="extra" id="{{=item[0].title}}-extra"></div>
87                              <div class="{{=item[0].clas}}">
88                                  {{~item :line:i}}
89                                  {{ if (i > 0) { }}
90                                  {{ if (line.text) { }}<p>{{=line.text.join("</p><p>")}}</p>{{ } }}
91                                  {{ if (line.attr) { }}<div class="topcoat-list__container">
92                                      <h3 class="topcoat-list__header">Parameters</h3>
93                                      <ol class="topcoat-list">
94                                          {{~line.attr :attr:j}}<li class="topcoat-list__item"><span class="dr-param">{{=attr.name}}</span>
95                                              <span class="dr-type">{{~attr.type :type:k}}<em class="dr-type-{{=type}}">{{=type}}</em> {{~}}</span>
96                                              <span class="dr-description">{{=attr.desc}}</span></li>
97                                          {{~}}
98                                      </ol>
99                                  </div>{{ } }}
100                                  {{ if (line.html) { }}{{=line.html}}
101                                  {{ } }}
102                                  {{ if (line.head) { }}<h3>{{=line.head}}</h3>
103                                  {{ } }}
104                                  {{ if (line.code) { }}<section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">{{=line.code.join("\n")}}</code></pre></section>
105                                  {{ } }}
106                                  {{ if (line.rtrn) { }}<p class="dr-returns">
107                                      <strong class="dr-title">Returns:</strong>
108                                      {{~line.rtrn.type :type:k}}
109                                      <em class="dr-type-{{=type}}">{{=type}}</em>
110                                      {{~}}
111                                      <span class="dr-description">{{=line.rtrn.desc}}</span>
112                                  </p>
113                                  {{ } }}
114                                  {{ if (line.json) { }}<ol class="dr-json">
115                                      {{~line.json :a:j}}
116                                      {{ if (a.key) { }}
117                                      <li>
118                                          <span class="dr-json-key">{{=a.key}}</span>
119                                          <span class="dr-type">{{~a.type :type:k}}<em class="dr-type-{{=type}}">{{=type}}</em> {{~}}</span>
120                                          <span class="dr-json-description">{{=a.desc}}</span>
121                                      </li>
122                                      {{ } else if (a.start) { }}
123                                      <li>{{=a.start}}<ol class="dr-json">
124                                      {{ } else if (a.end) { }}
125                                      </ol></li><li>{{=a.end}}</li>
126                                      {{ } else { }}
127                                      <li>{{=a}}</li>
128                                      {{ } }}
129                                      {{~}}
130                                  </ol>{{ } }}
131                                  {{ } }}
132                                  {{~}}
133                              </div>
134                          </section>
135                      </article>
136                      {{~}}
137                  </div>
138        <footer></footer>
139      </div>
140    </div>
141    <!-- <script src="//use.edgefonts.net/source-sans-pro:n3,n4,n6;source-code-pro:n3.js"></script> -->
142    <script src="/assets/docs/js/prism.js"></script>
143<script>!function(e){if(e){for(var t=function(e,t){var n=t.toUpperCase().split(""),r=n.shift(),a=RegExp("^["+r.toLowerCase()+r+"][a-z]*"+n.join("[a-z]*")+"[a-z]*$")
144return!!(e+"").match(a)},n=function(e,n){e+="",n+=""
145var r,a=0
146if(e==n)return 1
147if(!e||!n)return 0
148if(t(e,n))return.9
149a=0,r=e.toLowerCase()
150for(var i,o=0,l=n.length;l>o;o++)i=r.indexOf(n.charAt(o)),~i&&(r=r.substring(i+1),a+=1/(i+1))
151return a=Math.max(a/l-Math.abs(e.length-l)/e.length/2,0)},r=e.getElementsByTagName("span"),a=[],i=/[^\.\(]*(?=(\(\))?$)/,o=0,l=r.length;l>o;o++)a[o]={li:r[o].parentNode.parentNode,text:r[o].innerHTML.match(i)[0]}
152var h=document.getElementById("dr-filter"),f=function(e,t){return t.weight-e.weight}
153h.onclick=h.onchange=h.onkeydown=h.onkeyup=function(){var t=h.value,r=[]
154if(t.length>1){for(var i=0,o=a.length;o>i;i++)r[i]={li:a[i].li,weight:n(a[i].text,t)}
155r.sort(f)}else r=a
156for(i=0,o=r.length;o>i;i++)e.appendChild(r[i].li)}}}(document.getElementById("dr-toc"))</script>
157</body></html>