News archive
SVGGraph 2.3
This new version of SVGGraph adds three more types of graph - horizontal versions of the bar, stacked bar and grouped bar graphs.
Also in this update, I've added options for controlling the region of the graph displayed within the grid (by specifying the minimum and maximum values), and an option to control the grid divisions.
The 3D bar graph has been slightly updated too, and now supports displaying negative values. You can get a copy of this new version by visiting the downloads page.
mozRequestAnimationFrame and webkitRequestAnimationFrame
Following on from my look at setInterval, I've been looking into these new global timing functions for use in animations. Firefox has mozRequestAnimationFrame and Chrome has webkitRequestAnimationFrame and if either of them are available in your browser it will be used to update the clock in the canvas below.
These functions act similarly to setTimer
, though they trigger
the callback function when the browser thinks it is time to update the page
instead of at a fixed interval.
TagCanvas 1.7
TagCanvas 1.7 doesn't have much in the way of new features, but I have spent a lot of time improving how things work. I've added a new option for setting the update interval and another option for reading tag weights from a data attribute, all the rest of the modifications are internal changes to make TagCanvas work better.
To do this I've done a lot of profiling using Chrome and IE's built-in developer tools, and using Firebug for profiling on Firefox. This led me to change and refactor a lot of internal functions, but I've also improved IE compatibility and fixed some other small glitches along the way.
The updated files are available from the TagCanvas page.
JPEG Saver 4.2.1
This is the minor update I mentioned last week - apart from a small bugfix in the clock item dialog and two new transitions called "Dotty" and "Spot Wipe" (Yes, I know it sounds like a cleaning product. Thinking of good names for things is not my strong point - JPEG Saver doesn't save JPEGs either.) the main difference in this version is where the screen saver is installed on 64-bit systems.
Up to now, JPEG Saver has suggested installing into the
Windows/System32
folder - you could always change the install
folder to somewhere else, but this is where the Control Panel Display
Properties looks for screen savers to display in the drop-down box. On a
64-bit Windows installation, the System32
folder is for 64-bit
executables, and 32-bit versions go into SysWOW64
. The operating
system will actually redirect any 32-bit files copied into System32
into the SysWOW64
folder.
This is where things went a bit wrong. 64-bit Windows 7's Control Panel looks
in SysWOW64
for screen savers, but 64-bit Vista's doesn't.
Luckily, all versions of Windows also look in the main Windows
folder, so the new installer will use that folder when it detects a 64-bit
operating system. The updated installer is available from the
downloads page.
How accurate is window.setInterval()?
For some reason this question came into my head the other day. I decided to build a Javascript clock to answer the question, mainly because it's more fun than looking at tables or graphs of statistics. It's not very scientific, but it does answer my question quite well - I really wanted to know if the interval would average out over time or not.
In the canvas above there are two clocks, the one on the left always
drawn using the current time returned by a new Date()
, and
the one on the right calculated by adding the number of milliseconds in
the interval to the initial time. To give a smooth frame rate of 25 frames
per second, the interval is set to 40 milliseconds - so with each interval, 40
milliseconds is added onto the right-hand clock. (The clock in the background
is just a scaled-up version of the real time clock on the left.)