-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
366 lines (324 loc) · 11 KB
/
index.html
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<html>
<head>
<meta charset="UTF-8">
<title>Apparatus: A hybrid graphics editor and programming environment for creating interactive diagrams</title>
<style>
html, body {
margin: 0;
}
body {
font-family: helvetica, sans-serif;
font-size: 16px;
font-weight: 300;
color: #555;
}
.Menubar {
padding: 0.75em 40px;
margin-bottom: 40px;
background-color: #eee;
}
.Menubar a {
margin-right: 2em;
color: #333;
}
section {
max-width: 1100px;
margin: 20px 20px 20px 40px;
}
section:after {
content:"";
display:table;
clear:both;
}
p {
line-height: 1.4;
max-width: 640px;
}
img {
max-width: 100%;
}
a {
text-decoration: none;
color: #09c;
}
.Title {
font-size: 48px;
font-weight: bold;
color: #333;
}
.Description b {
color: #333;
font-style: italic;
}
.Launch a {
display: inline-block;
background-color: #fc0;
background: linear-gradient(to bottom, #fd0 0%, #fb0 100%);
color: #333;
font-weight: bold;
padding: 10px 20px;
border-radius: 10px;
box-shadow: inset 0px -2px 4px rgba(0, 0, 0, 0.3), 0px 2px 4px rgba(0, 0, 0, 0.3);
}
h1 {
font-size: 1.75em;
font-weight: 500;
color: #333;
}
h2 {
font-size: 1.25em;
font-weight: 500;
color: #555;
margin: 1em 0;
}
.Teaser {
float: right;
width: 420px;
margin: 0px 20px 0px 40px;
box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.25);
}
.Example {
float: left;
width: 200px;
margin: 0px 20px 20px 0px;
}
.ExampleAuthor {
color: #999;
}
.Videolist {
width: 200px;
margin-right: 20px;
float: left;
}
.Videolist p {
cursor: pointer;
opacity: 0.5;
}
.Videolist p.Selected {
opacity: 1;
}
.Video {
position: relative;
padding-bottom: 62.5%;
height: 0;
}
.Video iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.25);
}
.Usage {
display: block;
margin-right: 20px;
margin-bottom: 2em;
box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.25);
}
.Javascript {
margin-left: 40px;
font-family: Menlo, monospace;
}
.Expression, code {
color: #B5561E;
}
.Result {
color: #2D9A90;
}
</style>
</head>
<body>
<div class="Menubar">
<a href="#examples">Examples</a>
<a href="#tutorials">Tutorials</a>
<a href="#documentation">Documentation</a>
<a href="#development">Development</a>
</div>
<section id="overview">
<div class="Teaser">
<iframe src="https://player.vimeo.com/video/140304675" width="420" height="263" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
<div class="Title">Apparatus</div>
<div class="Description">
<p>Apparatus is a hybrid <b>graphics editor</b> and <b>programming environment</b> for creating <b>interactive diagrams</b>.</p>
<p>The Apparatus Editor runs in the browser and interactive diagrams created with Apparatus can be shared and embedded on the web (coming soon).</p>
<p>Apparatus is free, open-source software, under development on <a href="https://github.com/cdglabs/apparatus">GitHub</a>.</p>
</div>
<div class="Launch">
<a href="editor/">Launch Apparatus Editor</a>
</div>
</section>
<section id="examples">
<h1>Examples</h1>
<div class="Example"><a href="editor/?load=doc/examples/Wheel%20Diagram.json">
<img src="assets/examples/cycloid.png">
<div class="ExampleTitle">Cycloid</div>
<div class="ExampleAuthor">Joshua Horowitz</div>
</a></div>
<div class="Example"><a href="editor/?load=doc/examples/Bike%20Diagram.json">
<img src="assets/examples/bike.png">
<div class="ExampleTitle">Bike</div>
<div class="ExampleAuthor">Paula Te</div>
</a></div>
<div class="Example"><a href="editor/?load=doc/examples/Potted%20Plant.json">
<img src="assets/examples/pottedplant.png">
<div class="ExampleTitle">Potted Plant</div>
<div class="ExampleAuthor">Bret Victor</div>
</a></div>
<div class="Example"><a href="editor/?load=doc/examples/Bezier.json">
<img src="assets/examples/bezier.gif">
<div class="ExampleTitle">Quadradic Bezier</div>
<div class="ExampleAuthor">Matthias Graf</div>
</a></div>
<div class="Example"><a href="editor/?load=doc/examples/Circumference.json">
<img src="assets/examples/circumference.png">
<div class="ExampleTitle">Circumference</div>
<div class="ExampleAuthor">Matthias Graf</div>
</a></div>
<div class="Example"><a href="editor/?load=doc/examples/Involute.json">
<img src="assets/examples/involute.png">
<div class="ExampleTitle">Involute</div>
<div class="ExampleAuthor">Matthias Graf</div>
</a></div>
<div class="Example"><a href="editor/?load=doc/examples/Tides.json">
<img src="assets/examples/tides.png">
<div class="ExampleTitle">Tides</div>
<div class="ExampleAuthor">Toby Schachman</div>
</a></div>
<div class="Example"><a href="editor/?load=doc/examples/Arm%20Linkage.json">
<img src="assets/examples/armlinkage.png">
<div class="ExampleTitle">Arm Linkage</div>
<div class="ExampleAuthor">Toby Schachman</div>
</a></div>
<div class="Example"><a href="editor/?load=doc/examples/Face.json">
<img src="assets/examples/face.png">
<div class="ExampleTitle">Face</div>
<div class="ExampleAuthor">Toby Schachman</div>
</a></div>
<div class="Example"><a href="editor/?load=doc/examples/Polygon.json">
<img src="assets/examples/polygon.png">
<div class="ExampleTitle">Polygon</div>
<div class="ExampleAuthor">Toby Schachman</div>
</a></div>
<div class="Example"><a href="editor/?load=doc/examples/Star.json">
<img src="assets/examples/star.png">
<div class="ExampleTitle">Star</div>
<div class="ExampleAuthor">Bret Victor</div>
</a></div>
<div class="Example"><a href="editor/?load=doc/examples/Slider.json">
<img src="assets/examples/slider.png">
<div class="ExampleTitle">Slider</div>
<div class="ExampleAuthor">Toby Schachman</div>
</a></div>
<div class="Example"><a href="editor/?load=doc/examples/Color%20Picker.json">
<img src="assets/examples/colorpicker.png">
<div class="ExampleTitle">Color Picker</div>
<div class="ExampleAuthor">Toby Schachman</div>
</a></div>
<div class="Example"><a href="editor/?load=doc/examples/Bar%20Chart.json">
<img src="assets/examples/barchart.png">
<div class="ExampleTitle">Bar Chart</div>
<div class="ExampleAuthor">Toby Schachman</div>
</a></div>
<div class="Example"><a href="editor/?load=doc/examples/Cartesian%20Plot.json">
<img src="assets/examples/cartesian.png">
<div class="ExampleTitle">Cartesian Plot</div>
<div class="ExampleAuthor">Toby Schachman</div>
</a></div>
</section>
<section id="tutorials">
<h1>Tutorials</h1>
<div class="Videolist">
<p data-vimeo="140149532" class="Selected">1. Make a Face</p>
<p data-vimeo="140149531">2. Make a Clock</p>
<p data-vimeo="140149777">3. Make a Color Picker</p>
<p data-vimeo="140149972">4. Make a Bar Chart</p>
<p data-vimeo="140150120">5. Make a Plot</p>
<p data-vimeo="140150639">6. Make a Polygon</p>
</div>
<div style="margin-left: 220px; margin-right: 20px;">
<div class="Video">
<iframe id="vimeoiframe" src="https://player.vimeo.com/video/140149532" width="500" height="313" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
</div>
</section>
<script>
var links = Array.prototype.slice.call(document.querySelectorAll("p[data-vimeo]"));
var vimeoiframe = document.querySelector("#vimeoiframe");
links.forEach(function (link) {
link.addEventListener("click", function () {
links.forEach(function (link) {
link.classList.remove("Selected");
});
link.classList.add("Selected");
vimeoid = link.getAttribute("data-vimeo");
vimeoiframe.setAttribute("src", "https://player.vimeo.com/video/" + vimeoid);
});
console.log(link);
});
</script>
<section id="documentation">
<h1>Documentation</h1>
<h2>Editor Interface</h2>
<div class="Usage">
<img src="assets/usage.png">
</div>
<h2>Javascript in Expressions</h2>
<p>One-liners will be evaluated.</p>
<div class="Javascript">
<div class="Expression">4 + 4</div>
<div class="Result">8</div>
</div>
<p>If you have a multi-line expression, use <code>return</code> at the end.</p>
<div class="Javascript">
<div class="Expression">
var x = 32;<br>
return x * x;
</div>
<div class="Result">1024</div>
</div>
<p>All of the javascript <code>Math</code> constants and methods are in scope.</p>
<div class="Javascript">
<div class="Expression">abs(-3) + sin(PI)</div>
<div class="Result">3</div>
</div>
<p>Additionally, the constant <code>TAU</code> (<code>2*PI</code>) is in scope.</p>
<div class="Javascript">
<div class="Expression">cos(TAU / 6)</div>
<div class="Result">0.5</div>
</div>
<p>A color utility function <code>rgba(r, g, b, a)</code> is in scope.</p>
<div class="Javascript">
<div class="Expression">rgba(1.0, 0.5, 0.5, 0.5)</div>
<div class="Result">"rgba(255, 128, 128, 0.5)"</div>
</div>
<p>Use <code>spread</code> to create spreads.</p>
<p>Create a range:</p>
<div class="Javascript">
<div class="Expression">spread(0, 5)</div>
<div class="Result">0, 1, 2, 3, 4</div>
</div>
<p>Create a range with an increment:</p>
<div class="Javascript">
<div class="Expression">spread(0, 5, 0.5)</div>
<div class="Result">0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5</div>
</div>
<p>Turn a javascript array into a spread:</p>
<div class="Javascript">
<div class="Expression">spread([0, 2, 3, 5])</div>
<div class="Result">0, 2, 3, 5</div>
</div>
<h2>Notes</h2>
<p>Apparatus is still an early stage project so there are likely bugs. Please report any issues on the <a href="https://github.com/cdglabs/apparatus/issues">GitHub Issues</a> page. Thanks!</p>
<p>Apparatus aims to support all modern browsers but has been mostly tested in Chrome.</p>
<p>Apparatus will auto-save your diagram. If it crashes (stops working), try refreshing and your diagram will be restored to its last working state.</p>
</section>
<section id="development">
<h1>Development</h1>
<p>Apparatus is under <a href="https://github.com/cdglabs/apparatus/releases">active development</a>. Discuss how Apparatus should evolve on the <a href="https://groups.google.com/forum/#!forum/aprtus">Apparatus Google Group</a>.</p>
<p>Source code is <a href="https://github.com/cdglabs/apparatus">available on GitHub</a> under the MIT license. Contributions are very welcome! Big thanks to <a href="https://github.com/cdglabs/apparatus/graphs/contributors">all who have contributed code</a> to Apparatus.</p>
<p>Apparatus was originally developed by <a href="http://tobyschachman.com/">Toby Schachman</a> as a research project within the <a href="http://www.cdglabs.org/">Communications Design Group (CDG)</a> sponsored by SAP Labs. Thanks to Bret Victor, Paula Te, Matthias Graf, Michael Nagle, Chaim Gingold, Robert Ochshorn, Glen Chiacchieri, Joshua Horowitz, Ian Johnson, Simon Last, Ivan Zhao, Emily Eiffler, Vi Hart, and Monique DeSalvo for design discussions, beta testing, and encouragement!</p>
</section>
</body>
</html>