8 $_=<DATA>; chomp or die;
9 our @names = split /\t/, $_;
13 foreach my $nspots (qw(1 2 3 4)) {
14 $_=<DATA>; chomp or die;
15 my @l = split /\t/, $_;
16 foreach my $i (0..$#names) { $count{$names[$i]}{$nspots} = $l[$i] || 0; }
25 print "module $name(){ ////toplevel\n";
26 my $cs = $count{$name};
27 my $total = 0; $total += $_ foreach values %$cs;
28 my $rowsz = ceil(sqrt($total));
29 my $nrows = ceil($total / $rowsz);
31 print "// total=$total, rowsz=$rowsz, nrows=$nrows\n";
32 foreach my $ndots (sort keys %$cs) {
33 my $c = $cs->{$ndots};
39 my $xy = sprintf "[ %5.1f, %5.1f ]",
40 $ix / $nrows - 0.5 * $rowsz,
41 $ix % $nrows - 0.5 * $nrows;
42 print " translate(token_pitch * $xy) Token_L();\n";
52 foreach $name (sort keys %count) {
56 STDOUT->error and die $!;
59 White Green Blue Red Yellow Purple Black Orange
60 20 15 14 12 13 15 18 20