REBOL [ title: "du-jour comments graph experiment" type: 'swf5 file: %comments.swf background: 113.130.147 rate: 1 size: 400x80 author: "chl" ] background 113.130.147 rebol [ do load %/home/chris/subspace/exec/vanilla.r.conf do load to-file rejoin [lib-dir space-accessor ".r"] do load to-file rejoin [lib-dir "simplemeta.r"] pad-0: func [x] [if = length? to-string x 1 [return join "0" x] x] to-vanilla-date: func [d /local] [ rejoin [d/year "-" pad-0 d/month "-" pad-0 d/day] ] d: load space-expand "{!community.comments-by-day:100;2002-01-01}" sort/skip d 2 graph: copy [] p: 10 i: 380 / ((length? d) / 2) raster: copy [] foreach [day n] d [ append graph make pair! reduce [ to-integer (p + 0.5) 70 - (n * 3) ] append raster 'line append raster make pair! reduce [to-integer (p + 0.5) 10] append raster make pair! reduce [to-integer (p + 0.5) 70] p: p + i ] probe graph ] verdana: definefont2 [name "Verdana"] line-10-txt: edittext 'txt 100x100 [ color 255.255.255 readonly noselect font [verdana 11] color 255.255.255 ] doaction [txt: "10 comments"] border-shape: shape [ line-style [width 1 color 130.147.164] line 10x10 390x10 390x70 10x70 10x10 line 10x40 390x40 ] rebol [ compile compose/deep [ graph: shape [ line-style [width 3 color 255.255.255] line (graph) ] raster: shape [ line-style [width 1 color 130.147.164] (raster) ] ] ] placeobject2 border-shape placeobject2 raster placeobject2 graph placeobject2 line-10-txt at 15x20 showframe end