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; }
28 print "module $name(){ ////toplevel\n";
29 my $cs = $count{$name};
30 my $total = 0; $total += $_ foreach values %$cs;
31 my $rowsz = ceil(sqrt($total));
32 my $nrows = ceil($total / $rowsz);
33 $total_count += $total;
34 $max_nrows = $nrows if $nrows > $max_nrows;
35 $max_rowsz = $rowsz if $rowsz > $max_rowsz;
37 print "// total=$total, rowsz=$rowsz, nrows=$nrows\n";
38 foreach my $nspots (sort keys %$cs) {
39 my $c = $cs->{$nspots};
42 Frame(\$phase, token_pitch * [ $rowsz + 0.5, $nrows ]);
46 my $xy = sprintf "[ %5.1f, %5.1f ]",
47 int($ix / $nrows) - 0.5 * ($rowsz-1),
48 $ix % $nrows - 0.5 * ($nrows-1);
49 print " translate(token_pitch * $xy) Token_L();\n";
59 foreach $name (sort keys %count) {
64 // total_count=$total_count
65 // max_rowsz=$max_rowsz max_nrows=$max_nrows
68 STDOUT->error and die $!;
71 White Green Blue Red Yellow Purple Black Orange
72 20 15 14 12 13 15 18 20