Add in HorizontalLegend.

Lists entries side-by-side in the available width, after which the
entries wrap onto the next row. If an entry is too wide it is
truncated. If there are too many entries some rows will not be shown.

Close #755.
I thought the parens made it more readable, as it's clearer which pair of values is being compared.

The `this.textHeight` is the height of the icon. I can factor that out into a `getIconWidth()` call, but I think that's over-engineering too early.