Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: RFC: HTML::Dashboard (Spreadsheet-like formatting for HTML tables)

by hossman (Prior)
on Apr 18, 2007 at 20:46 UTC ( [id://610841]=note: print w/replies, xml ) Need Help??


in reply to RFC: HTML::Dashboard (Spreadsheet-like formatting for HTML tables)

I haven't looked too closely at your API, just at your output -- but i definitely think a majority of this should be done with CSS ... the value adds you can provide are:

  • generating the xhtml tables from the raw data
  • providing a rule based interface to add a CSS class to rows/columns/cells based on coderefs or regexes
  • automaticaly sorting the data as specified

...i would leave the concrete specifics of how the rows/columns/cells look to a user supplied CSS. That way if i decide i want all the negative numbers to be in red instead of bold, i can just change my (possibly site global) CSS file, instead of editing the script that calls your module.

Your mechanism for prioritizing rules is interesting ... but i would avoid naming them red/ylw/grn ... it's too easy for people to assume those are color specific and not realize they relate to precedence. I would just have a precedence argument that is numeric, higher number wins (or lower, your choice) .. the interesting cases are:

  • multiple rules have the same precedence? ... in that case i would just use all the CSS classes for that rule (it's legal to have multiple class names separated by space, the browser applies them all)
  • should cell rules override row rules override column rules? .. i would say not necessarily, you can allow undef as a precedence and use that to indicate that it's applied no matter what other rules are picked based on their precedence (ie: it's equal to whatever the highest value found is). ... perhaps an optional method could be called by the client specifying an uber-precedence of row/col/cell (if this method is never used, their rules are all equal)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://610841]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-03-29 10:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found