W3C home > Mailing lists > Public > public-html@w3.org > September 2009

Re: tweaking meter

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 4 Sep 2009 21:25:17 +0000 (UTC)
To: Jim Jewett <jimjjewett@gmail.com>, Toby Inkster <tai@g5n.co.uk>, "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: public-html@w3.org, jonas@sicking.cc
Message-ID: <Pine.LNX.4.62.0909042101180.6775@hixie.dreamhostps.com>
On Wed, 2 Sep 2009, Jim Jewett wrote:
> I think meter should be an appropriate element for things like "number 
> of posts" or "member for X months".
> Under the current definition, these wouldn't be appropriate, as there is 
> no *hard* maximum, but I think it would be reasonable to change the 
> element to accommodate them.

What would it look like?

If there's a known range -- such as zero to the number of posts of the 
most proliffic user on the site -- then <meter> is fine. Is the spec not 
clear about that? Should I add an example or some such for this case?

> Should meter have the ability to define multiple category breaks, such 
> as
>     val < 0.5 ==> star0
>     0.5 < val <1.5 ==> star1
>     ...
>    3.5 < val ==> star4
> and to style based on the category?

Seems like a reasonable idea for a future version. Having more than 3 
regions was explicitly not part of this version.

BTW I agree that it would be nice to use <meter> for 0-5 star ratings. 
That would be easy with XBL (insofar as anything in XBL is easy).

On Wed, 2 Sep 2009, Tab Atkins Jr. wrote:
> I'm not sure what this means in terms of authoring.  Is the author still 
> giving a max/min, and the <meter> merely displaying differently 
> above/below those levels?
> A potential solution: if max and min aren't supplied, but low and high 
> are, then the low/high regions extend to +-inf.  When the value is 
> within those regions the <meter> doesn't display as a deterministic 
> percentage, but as a special indicator of overflow/underflow.

I think it's more useful for min and max to default to 0 and 1, but in a 
future version it would definitely make sense to add keywords to min and 
max to handle this case, sure. In the meantime, I think it's fine to just 
do something like this:

   <meter min="-15" low="-10" high="25" max="30" value="-15"> 

...where the value is clamped to the min/max, but there's a tiny range at 
each end of the meter to represent the "extreme" case. That is, after all, 
more or less how a real gauge works.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Friday, 4 September 2009 21:22:27 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:51 UTC