- print '</a>';
- my $keys = Shiar_Sheet::Keyboard->new($table);
- 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>';
+ print '</a>', "\n\t";
+ for my $mode ($table->{mode} ? sort keys %{ $table->{mode} } : '') {
+ print '<span class=graph>';
+ printf '<label>%s</label>', s/\s.*//r for $table->{def}{''}{$mode}[1] || ();
+ for my $g (sort keys %{ $table->{inventory}{$mode} }) {
+ printf '<span class="%s" style="width:%.0f%%" title="%3$d %4$s"> %s</span>',
+ $g, $_/$most*100, $_,
+ join(' ', map {
+ $table->{flag}{$_}[0] || 'extra' # legend label of each class
+ } reverse split / /, $g)
+ for $table->{inventory}{$mode}{$g};
+ }
+ say '</span>';
+ }
+ print "\t<td class=ni>";
+ print join ' ', map { $caticon{$_} // () } split m{/}, $table->{category} // '';
+ say '';
+ if (my $keys = eval {
+ my $keydata = Data("$dirbase/$inc.eng");
+ Shiar_Sheet::Keyboard->new($keydata)
+ }) {
+ $keys->print_key('', $_, ($keys->{def}{''}{$_} // ['ni']) =~ s/ mode\S*//r)
+ for @sample;
+ }
+ say '</tr>';