- print join(' ', map { $keys->{key}{$_} =~ s/\s.*//r } grep {$_} keys %{$_})
- for $keys->{mode} || ();
- say '<dd><table class="keys big"><tr>';
- $keys->print_key('', $_, $keys->{def}{''}{$_} // 'ni') for @sample;
- print '</tr></table>';
- say '</dd>';
+ for my $mode ($keys->{mode} ? sort keys %{ $keys->{mode} } : '') {
+ my %inventory;
+ $inventory{$_}++ for grep { /^g[2-9]/ } map { s/ (?!ext).*//r }
+ values %{ $keys->{def}{$mode} };
+ print '<span class=graph>';
+ print "<label>$_</label>" for $keys->{key}{$mode} =~ s/\s.*//r || ();
+ for my $g (sort keys %inventory) {
+ printf '<span class="%s" style="width:%.0f%%" title="%3$d %4$s"> %s</span>',
+ $g, $_/$most*100, $_,
+ join(' ', map {
+ $keys->{flag}{$_}[0] || 'extra' # legend label of each class
+ } reverse split / /, $g)
+ for $inventory{$g};
+ }
+ say '</span>';
+ }
+ print "\t<td class=ni>";
+ print join ' ', map { $caticon{$_} // () } split m{/}, $keys->{category};
+ say '';
+ $keys->print_key('', $_, ($keys->{def}{''}{$_} // 'ni') =~ s/ mode\S*//r)
+ for @sample;
+ say '</tr>';