Page 1 of 15

Yet more gauges

Posted: Mon 06 Jun 2011 10:47 am
by mcrossley
I am just playing with some more new gauges (I must be obsessed with the them!).

You can see the experimental page here (with controls for changing some of the formats):
http://weather.wilmslowastro.com/gaugesB/gauges.htm

This is pure Javascript/HTML5/Canvas, no graphics other than the page background.

Note, that I have made no attempt to make this latest version work with IE8 or older yet, and I am still playing with it, so the page may break from time to time - refresh in 15 mins to see if I fix it!

Also this is running on my old laptop over my ADSL, which I also use for work, so things may be a bit slow if lots of you hit the page!

Re: Yet more gauges

Posted: Mon 06 Jun 2011 7:29 pm
by wd40
Those are really neat gauges.

Re: Yet more gauges

Posted: Mon 06 Jun 2011 8:06 pm
by mcrossley
Unfortunately I cannot make them work with IE8 or older as they use Canvas features that are not implemented in excanvas. I just found that they also use Canvas features that are not available on Palm WebOS either. :(

Re: Yet more gauges

Posted: Tue 07 Jun 2011 4:23 am
by GraemeT
They look pretty good, Mark.

Re: Yet more gauges

Posted: Tue 07 Jun 2011 7:01 am
by Ned
Works nicely on my Android phone (but slowly)
FF4 is struggling (missing 3 lower gauges, no live readings)

Re: Yet more gauges

Posted: Tue 07 Jun 2011 9:23 am
by mcrossley
I have minified the code more aggressively and made some other changes that speed it up a bit. I'll look into the FF4 issue, thanks...

Re: Yet more gauges

Posted: Tue 07 Jun 2011 9:35 am
by steve
I get the following error in FF4:

Error: uncaught exception: [Exception... "An invalid or illegal string was specified" code: "12" nsresult: "0x8053000c (NS_ERROR_DOM_SYNTAX_ERR)" location: "http://weather.wilmslowastro.com/gauges ... ies.min.js Line: 1"]

I had a quick look at line 1 in steelseries.min.js... and gave up :lol:

Re: Yet more gauges

Posted: Tue 07 Jun 2011 9:39 am
by mcrossley
Ha! Steve the 'debug' version of the page with "un-minified" scripts is on "gaugesB.htm". I don't have FF installed at the mo, so if you could give me a clue I'll have a look!

Re: Yet more gauges

Posted: Tue 07 Jun 2011 9:55 am
by steve
The error is at line 851:

backgroundContext.rotate(rotationOffset + (threshold - minValue) * angleStep + HALF_PI);

The second time that line is executed, "threshold" is undefined. Hope that helps.

Re: Yet more gauges

Posted: Tue 07 Jun 2011 9:57 am
by mcrossley
TA, I'll have a trace through the code, some else wrote it though so it may take a while...

Re: Yet more gauges

Posted: Tue 07 Jun 2011 10:13 am
by mcrossley
Fixed - I hope, an uninitialised variable in my code :oops:

Re: Yet more gauges

Posted: Tue 07 Jun 2011 10:16 am
by nitrx
They seem to work fine now in FF 4 great job !

Re: Yet more gauges

Posted: Tue 07 Jun 2011 10:17 am
by steve
Yes, looks OK now in FF4 :clap:

Re: Yet more gauges

Posted: Tue 07 Jun 2011 10:17 am
by gemini06720
Mark, gauges display well in Firefox 3, Google Chrome, Opera and Internet Explorer 9... ;)

Re: Yet more gauges

Posted: Tue 07 Jun 2011 10:35 am
by mcrossley
Thanks Ray - what no Safari? :lol:
Shame about excanvas and WebOS, wonder if they display OK on iPhone/iPad?