2Elm.Graphics = function() {
3 var JS = Elm.JavaScript;
4 var DLeft_0 = ["DLeft"];
5 var DRight_1 = ["DRight"];
7 var DDown_3 = ["DDown"];
10 function Absolute_12(a1) {
11 return["Absolute", a1]
13 function Relative_13(a1) {
14 return["Relative", a1]
16 var Near_14 = ["Near"];
19 function Position_17(a1) {
21 return["Position", a1, a2]
24 function PositionTL_18(a1) {
26 return["PositionTL", a1, a2]
29 function PositionTR_19(a1) {
31 return["PositionTR", a1, a2]
34 function PositionBL_20(a1) {
36 return["PositionBL", a1, a2]
39 function PositionBR_21(a1) {
41 return["PositionBR", a1, a2]
44 function Element_37(id,e,w,h,o,c,l) {
45 return["Element", id, e, w, h, o, c, l ]
47 function EText_39(a1) {
49 return["EText", a1, a2]
52 function EImage_40(a1) {
53 return["EImage", JS.castStringToJSString(a1)]
55 function EVideo_41(a1) {
56 return["EVideo", JS.castStringToJSString(a1)]
58 function EFittedImage_42(a1) {
59 return["EFittedImage", JS.castStringToJSString(a1)]
61 function EFlow_43(a1) {
63 return["EFlow", a1, JS.castListToJSArray(a2)]
66 function ECollage_44(a1) {
69 return["ECollage", a1, a2, Value.groupForms(a3)]
73 var EEmpty_45 = ["EEmpty"];
74 function EContainer_46(a1) {
76 return["EContainer", a1, a2]
79 var Solid_68 = ["Solid"];
80 var Dotted_69 = ["Dotted"];
81 var Dashed_70 = ["Dashed"];
82 function Custom_71(a1) {
83 return["Custom", JS.castListToJSArray(a1)]
85 var Filled_72 = ["Filled"];
86 var Outlined_73 = ["Outlined"];
87 function CustomOutline_74(a1) {
88 return["CustomOutline", JS.castListToJSArray(a1)]
90 function Line_75(a1) {
91 return["Line", JS.castListToJSArray(a1)]
93 function Shape_78(a1) {
95 var points = JS.castListToJSArray(a1);
96 if (points.length > 0) { points.push(points[0]); }
97 return["Shape", points, a2];
100 function Form_84(a1) {
101 return function(a2) {
102 return function(a3) {
103 return function(a4) {
104 return["Form", a1, a2, a3, a4]
109 function FLine_85(a1) {
110 return function(a2) {
111 return function(a3) {
112 return["FLine", a1, a2, a3]
116 function FShape_86(a1) {
117 return function(a2) {
118 return function(a3) {
119 return["FShape", a1, a2, a3]
123 function FImage_87(a1) {
124 return function(a2) {
125 return function(a3) {
126 return["FImage", a1, a2, JS.castStringToJSString(a3)]
130 function FElement_88(a1) {
131 return["FElement", a1]
133 var left_6 = DLeft_0;
134 var right_7 = DRight_1;
135 var down_8 = DDown_3;
137 var inward_10 = DIn_4;
138 var outward_11 = DOut_5;
139 var topLeft_22 = Position_17(Near_14)(Near_14);
140 var topRight_23 = Position_17(Far_16)(Near_14);
141 var bottomLeft_24 = Position_17(Near_14)(Far_16);
142 var bottomRight_25 = Position_17(Far_16)(Far_16);
143 var midLeft_26 = Position_17(Near_14)(Mid_15);
144 var midRight_27 = Position_17(Far_16)(Mid_15);
145 var midTop_28 = Position_17(Mid_15)(Near_14);
146 var midBottom_29 = Position_17(Mid_15)(Far_16);
147 var middle_30 = Position_17(Mid_15)(Mid_15);
148 function middleAt(a1) {
149 return function(a2) {
150 return["PositionAt", a1, a2]
153 var topLeftAt_31 = PositionTL_18;
154 var topRightAt_32 = PositionTR_19;
155 var bottomLeftAt_33 = PositionBL_20;
156 var bottomRightAt_34 = PositionBR_21;
157 var absolute_35 = Absolute_12;
158 var relative_36 = Relative_13;
159 function newElement_38(e,w,h,o,c,l) { return Element_37(Guid.guid(),e,w,h,o,c,l); }
160 function basicNewElement(e,w,h) { return Element_37(Guid.guid(),e,w,h,1,Nothing,Nothing); }
161 var line_76 = Line_75;
162 var polygon_79 = Shape_78;
163 function sprite_96(src) {
166 return function(pos) {
167 return Form_84(0)(1)(pos)(FImage_87(w)(h)(src))
172 function toForm_97(pos) {
174 return Form_84(0)(1)(pos)(FElement_88(e))
177 function width_47(w__101) {
183 return newElement_38(e[2],w__101,e[4] * w__101 / e[3], e[5], e[6], e[7]);
185 var p = Value.getTextSize(w__101,e[4],be[2]);
186 return newElement_38(e[2], w__101, p[1], e[5], e[6], e[7]);
188 return newElement_38(e[2], w__101, e[4], e[5], e[6], e[7]);
191 function height_48(h__108) {
197 return newElement_38(e[2], e[3] * h__108 / e[4], h__108, e[5], e[6], e[7]);
199 return newElement_38(e[2], e[3], h__108, e[5], e[6], e[7]);
202 function size_49(w) {
205 return newElement_38(e[2], w, h, e[5], e[6], e[7]);
209 function opacity_50(o) {
211 return newElement_38(e[2], e[3], e[4], o, e[6], e[7]);
214 function color_51(c) {
216 return newElement_38(e[2], e[3], e[4], e[5], Just(c), e[7]);
221 return newElement_38(e[2], e[3], e[4], e[5], e[6], Just(JS.castStringToJSString(lnk)));
224 function widthOf_52(e) { return ~~e[3]; }
225 function heightOf_53(e) { return ~~e[4]; }
226 function sizeOf_54(e) { return["Tuple2", ~~e[3], ~~e[4]] }
227 function text_56(txt) {
228 var p = Value.getTextSize(0,0,txt);
229 return basicNewElement(EText_39("left")(txt), p[0], p[1])
231 function plainText(str) {
232 var txt = Value.toText(str);
233 var p = Value.getTextSize(0,0,txt);
234 return basicNewElement(EText_39("left")(txt),p[0],p[1])
237 var txt = monospace(Value.toText(Value.show(v)));
238 var p = Value.getTextSize(0,0,txt);
239 return basicNewElement(EText_39("left")(txt),p[0],p[1])
241 function centeredText(txt) {
242 var p = Value.getTextSize(0,0,txt);
243 return basicNewElement(EText_39("center")(txt),p[0],p[1])
245 function justifiedText(txt) {
246 var p = Value.getTextSize(0,0,txt);
247 return basicNewElement(EText_39("justify")(txt),p[0],p[1])
249 function rightedText(txt) {
250 var p = Value.getTextSize(0,0,txt);
251 return basicNewElement(EText_39("right")(txt),p[0],p[1])
253 function image_57(w) {
255 return function(src) {
256 return basicNewElement(EImage_40(src),w,h)
260 function images(srcs) {
261 var pics = Elm.Signal.constant(spacer_66(0)(0));
262 var update = Elm.Signal.lift(function(src) {
263 src = JS.castStringToJSString(src);
264 var img = new Image();
265 img.onload = function() {
266 Dispatcher.notify(pics.id,
267 image_57(this.width)(this.height)(src));
271 function f(x) { return function(y) { return x; } }
272 var combine = Elm.Signal.lift2(f)(pics)(update);
275 function video_58(w) {
277 return function(src) {
278 return basicNewElement(EVideo_41(src),w,h)
282 function fittedImage_59(w_147) {
283 return function(h_148) {
284 return function(s_149) {
285 return basicNewElement(EFittedImage_42(s_149),w_147,h_148)
289 function flow_60(dir_150) {
290 return function(es_151) {
292 var w_152 = function() {
293 var ws_154 = map(widthOf_52)(es_151);
294 return function(case1) {
302 return maximum(ws_154)
305 var h_153 = function() {
306 var hs_155 = map(heightOf_53)(es_151);
307 return function(case3) {
315 return maximum(hs_155)
318 return basicNewElement(EFlow_43(dir_150)(es_151), w_152, h_153)
322 function above_61(e1_156) {
323 return function(e2_157) {
324 return basicNewElement(EFlow_43(DDown_3)(["Cons", e1_156, ["Cons", e2_157, ["Nil"]]]), max(widthOf_52(e1_156))(widthOf_52(e2_157)), heightOf_53(e1_156) + heightOf_53(e2_157))
327 function below_62(e1_158) {
328 return function(e2_159) {
329 return basicNewElement(EFlow_43(DDown_3)(["Cons", e2_159, ["Cons", e1_158, ["Nil"]]]), max(widthOf_52(e1_158))(widthOf_52(e2_159)), heightOf_53(e1_158) + heightOf_53(e2_159))
332 function beside_63(e1_160) {
333 return function(e2_161) {
334 return basicNewElement(EFlow_43(DRight_1)(["Cons", e1_160, ["Cons", e2_161, ["Nil"]]]), widthOf_52(e1_160) + widthOf_52(e2_161), max(heightOf_53(e1_160))(heightOf_53(e2_161)))
337 function layers_64(es_162) {
338 return basicNewElement(EFlow_43(DOut_5)(es_162), maximum(map(widthOf_52)(es_162)), maximum(map(heightOf_53)(es_162)))
340 function collage_65(w_163) {
341 return function(h_164) {
342 return function(forms_165) {
343 return basicNewElement(ECollage_44(w_163)(h_164)(forms_165),w_163,h_164)
347 function spacer_66(w_166) {
348 return function(h_167) {
349 return basicNewElement(EEmpty_45,w_166,h_167)
352 function container_67(w_169) {
353 return function(h_170) {
354 return function(pos_168) {
355 return function(e_171) {
356 return basicNewElement(EContainer_46(pos_168)(e_171),w_169,h_170)
361 function segment_77(p1_172) {
362 return function(p2_173) {
363 return Line_75(["Cons", p1_172, ["Cons", p2_173, ["Nil"]]])
366 function rect_80(w_174) {
367 return function(h_175) {
368 return function(pos_176) {
369 return Shape_78(["Cons", ["Tuple2", 0 - w_174 / 2, 0 - h_175 / 2],
370 ["Cons", ["Tuple2", 0 - w_174 / 2, h_175 / 2],
371 ["Cons", ["Tuple2", w_174 / 2, h_175 / 2],
372 ["Cons", ["Tuple2", w_174 / 2, 0 - h_175 / 2], ["Nil"]]]]])(pos_176)
376 function oval_81(w_177) {
377 return function(h_178) {
378 return function(pos_179) {
382 function f_181(i_182) {
383 return["Tuple2", w_177 / 2 * cos(2 * (pi / n_180) * i_182), h_178 / 2 * sin(2 * (pi / n_180) * i_182)]
385 return Shape_78(map(f_181)(function() {
391 var lst = ["Cons", hi, lst]
401 function circle_82(r_183) {
402 return oval_81(2 * r_183)(2 * r_183)
404 function ngon_83(n_184) {
405 return function(r_185) {
406 return function(pos_186) {
408 var m_187 = toFloat(n_184);
410 function f_188(i_189) {
411 return["Tuple2", r_185 * cos(2 * (pi / m_187) * i_189), r_185 * sin(2 * (pi / m_187) * i_189)]
413 return Shape_78(map(f_188)(function() {
419 var lst = ["Cons", hi, lst]
429 function solid_89(clr_190) {
430 return function(ln_191) {
431 return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Solid_68)(clr_190)(ln_191))
434 function dotted_90(clr_192) {
435 return function(ln_193) {
436 return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Dotted_69)(clr_192)(ln_193))
439 function dashed_91(clr_194) {
440 return function(ln_195) {
441 return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Dashed_70)(clr_194)(ln_195))
444 function customLine_92(pattern_196) {
445 return function(clr_197) {
446 return function(ln_198) {
447 return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Custom_71(pattern_196))(clr_197)(ln_198))
451 function filled_93(clr) {
452 return function(shape) {
453 return Form_84(0)(1)(shape[2])(FShape_86(Filled_72)(clr)(shape));
456 function outlined_94(clr) {
457 return function(shape) {
458 return Form_84(0)(1)(shape[2])(FShape_86(Outlined_73)(clr)(shape));
461 function customOutline_95(pattern) {
462 return function(clr) {
463 return function(shape) {
464 return Form_84(0)(1)(shape[2])(FShape_86(CustomOutline_74(pattern))(clr)(shape));
468 function textured(src) {
469 return function(shape) {
470 return Form_84(0)(1)(shape[2])(FShape_86(["Textured",src])(null)(shape));
473 function rotate_98(t_212) {
474 return function(Form$thetascaleposform_213) {
475 return function(case5) {
479 var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4];
480 return Form_84(t_212 + case1)(case2)(case3)(case4)
482 throw"Non-exhaustive pattern match in case";
483 }(Form$thetascaleposform_213)
486 function scale_99(s) {
487 return function(form) {
488 return Form_84(form[1])(s * form[2])(form[3])(form[4])
491 function move_100(x_224) {
492 return function(y_225) {
493 return function(Form$thetascaleTuple2$pxpyform_226) {
494 return function(case7) {
498 var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4];
501 var case5 = case3[1], case6 = case3[2];
502 return Form_84(case1)(case2)(["Tuple2", x_224 + case5, y_225 + case6])(case4)
506 throw"Non-exhaustive pattern match in case";
507 }(Form$thetascaleTuple2$pxpyform_226)
511 return{left:left_6, right:right_7, down:down_8, up:up_9, inward:inward_10, outward:outward_11, topLeft:topLeft_22, topRight:topRight_23, bottomLeft:bottomLeft_24, bottomRight:bottomRight_25, midLeft:midLeft_26, midRight:midRight_27, midTop:midTop_28, midBottom:midBottom_29, middle:middle_30, middleAt:middleAt, topLeftAt:topLeftAt_31, topRightAt:topRightAt_32, bottomLeftAt:bottomLeftAt_33, bottomRightAt:bottomRightAt_34, absolute:absolute_35, relative:relative_36, width:width_47, height:height_48, size:size_49, opacity:opacity_50,
512 color:color_51, link:link, widthOf:widthOf_52, heightOf:heightOf_53, sizeOf:sizeOf_54, text:text_56, asText:asText, plainText:plainText, centeredText:centeredText, justifiedText:justifiedText, rightedText:rightedText, image:image_57, images:images, video:video_58, fittedImage:fittedImage_59, flow:flow_60, above:above_61, below:below_62, beside:beside_63, layers:layers_64, collage:collage_65, spacer:spacer_66, container:container_67, line:line_76, segment:segment_77, polygon:polygon_79, rect:rect_80, oval:oval_81, circle:circle_82, ngon:ngon_83, solid:solid_89, dotted:dotted_90, dashed:dashed_91, customLine:customLine_92, filled:filled_93,
513 outlined:outlined_94, customOutline:customOutline_95, textured:textured, sprite:sprite_96, toForm:toForm_97, rotate:rotate_98, scale:scale_99, move:move_100,
514 isWithin: Collage.insideForm}
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list