alphagov/magna-charta

How to do legends?

Closed this issue · 4 comments

Wondering how best to do legends? We should be able to automatically generate them.

For example, if the thead contains:

<tr><td>Cookie</td><td>Size Rating/5</td><td>Taste Rating/5</td></tr>

We should be able to generate a legend showing the two colours mean Size Rating and Taste Rating. But how to mark this up - or how to do it to keep it flexible for the user?

Or, do we just let the user do it?

@rooreynolds @timpaul

I suggest we make it a parameter of the plugin, so you can choose whether or not to show a legend, and if you do to pull the values from the table header. And let's make use of the table caption too, even if markdown can't handle them

On 9 Nov 2012, at 12:30, Jack Franklin notifications@github.com wrote:

Wondering how best to do legends? We should be able to automatically generate them.

For example, if the thead contains:

CookieSize Rating/5Taste Rating/5 We should be able to generate a legend showing the two colours mean Size Rating and Taste Rating. But how to mark this up - or how to do it to keep it flexible for the user?

Or, do we just let the user do it?

@rooreynolds @timpaul


Reply to this email directly or view it on GitHub.

Done it! 524b1f5

And it's a pure css solution too. You just restyle the column headers. Because they appear in the same order as the stacks they refer to you can cycle through the colours in the same order and everything joins up. Sass rules.

Nice!

Two things:

  1. You've added the .sass-cache file to Git. Can you add it to the gitignore and then run a git rm -r .sass-cache to remove?
  2. At some point we need to update the demo too. I can do this Monday but if you're keen, checkout the gh-pages branch and go wild.

And then, go chill and stop coding :P

PS - the gh-pages branch shouldn't ever have any other branches merged into it, it contains just the stuff needed to make alphagov.github.com/magna-charta work :)