Low Tech. Web .9 beta.
2008-09-06 15:44:21.048674+00 by
meuon
6 comments
There is a lot of push towards incredibly powerful web toolkits. Very complex javascript, lots of embedded flash. But that requires powerful client computers, and all that JavaScript/ActionScript has fits crossing domains, for good reasons.
So you have to go back to old school. Enter PHP and GDlib creating graphics on the fly at the web server. This Geek Gauge example in PHP will create (given some assumptions) nice looking graphs as an image and will try to resize itself and the data nicely based on parameters given.
It's useful for embedding data displays low tech browsers as well as things like Chumby's, Google Gadgets and other widgets where everything but images seem to be cached, relayed, or protected from embedding data from other sources.
The best part is the looks you get when showing to "Web 2.0 kids" who can't conceive of doing it without an IDE, JavaScript/ActionScript and possibly a fat embed/object download..
[ related topics:
Children and growing up Photography Robotics Graphics Embedded Devices
]
comments in ascending chronological order (reverse):
#Comment Re: made: 2008-09-06 16:14:38.491513+00 by:
markd
I've been having a lot of fun with the Google Chart API <http://code.google.com/apis/chart/> - don't
even need executable code on the server side. I've done some small projects with perl to massage some
data and blort out the chart API junk for an img tag.
#Comment Re: made: 2008-09-06 17:18:46.059132+00 by:
meuon
[edit history]
We've been using the Google Charts API it as well. But I'm working on a "write once: display many" function. The magic of the day is using is displaying the function inline:
ob_start(); imagepng($image); $imgdata = ob_get_contents(); ob_end_clean(); $img = base64_encode($imgdata); imagedestroy($image)
print "Image: <img src=\"data:image/png;base64," . htmlentities($img) . "\" alt=\"embedded graph\"%gt;" ;
So that we can create and output that graph in the same connection as the HTML. No 'get' for the browser.
#Comment Re: made: 2008-09-06 19:30:14.083205+00 by:
meuon
Scratch above. MSIE < 8 does not support the above. Google Chrome has som interesting auth permanence issues, and.. well.. punting. writing out temporary image and linking to. darn.
#Comment Re: made: 2008-09-06 20:20:29.718971+00 by:
markd
Bummer :-( Since that's a ridiculously cool technique.
#Comment Re: made: 2008-09-06 20:50:17.310984+00 by:
ebradway
meuon: There are reasons to push computation to the client - but not the reasons
you usually encounter.
And JavaScript (or ECMAScript) is just now starting to come of age. Chrome and
FireFox 3.1's TraceMonkey are examples of how it's being taken seriously.
Oddly, Safari has had one of the best JavaScript interpreters since day-one.
#Comment Re: made: 2008-09-08 00:39:11.553891+00 by:
meuon
And now for munging/kludging some low tech for
Autovation demo's.
LibMing (Flash/.SWF tools), which took a little work to get to compile/install on Ubuntu, but was worth it allowed me to create a .SWF
that plays on a Chumby that talks to a PHP script that outputs dynamically created jpg's (apparently Flash does not like PNG's) for some near real time electric meter reading and in-home informational display. The things geeks glue together for trade shows...
The kewl part was I made a "Flash" .swf without Flash.. on Linux.
using Joe as an editor.