Michael Cleverly, a clever (pun intended) Tcl expert has written a Tk application that will take a series of pictures and display them in animation form, with varying speeds.
He has also written nstcl, which is an AOLserver/OpenACS compatibility layer for plain Tcl, so that you can use the AOLserver/OpenACS (ns_*, db_*, templating, etc.) APIs in plain Tcl. nstcl currently supports Oracle, PostgreSQL and Solid, and AFAIK the next release will also support an embedded database whose name I don't remember.
You could then hack his "animation" app to do the database queries you need using nstcl. This will work for non-web and even web-based uses, although for web use you will need the Tcl plugin installed on the browser.
If you need strictly web-based, then you should probably be better off with Flash or Java.
http://michael.cleverly.com/aolserver/ for nstcl. I don't think he has made his "animation" app available, I saw it at his house in a recent visit (he lives 1.5 hours away from me), but if you ping him I'm pretty sure he wouldn't have a problem releasing it under some free software license.