OK, don't I feel dumb. I posted this in weather website help, but it really belongs here. Deleted that one (no replies), reposting here.
--
Well, I was looking at my site doing a redesign... and thought putting the wind direction as an arrow in a circle would look neat. Now, I could have done this with a bunch of images (one for each direction)... but that limits you to as many directions as images you make.
Instead, I decided to use a little javascript and a little (non-standard) HTML: the <canvas> tag. If you are using Opera, Safari, or Firefox, you'll see this if you visit
skigod.us. If you're using IE, you likely won't see it (but it'll degrade nicely and show the direction as an abbreviation).
Now, this code isn't very good as a drop-in thing... you'll have to fiddle with it to fit your site design. But if you want it... cool. Have fun. At a minimum, you'll have to go in and set your foreground color.
The code for the canvas is the functions setup_wind_canvas, draw_arrow, clear_arrow, update_arrow, and unglow_arrow in
this file.
Maybe some day I'll make the arrow move smoothly instead of pop to the new position...