version 1.125, 2007/08/03 17:44:35
|
version 1.127, 2007/08/04 00:01:52
|
Line 208 my %gnuplot_defaults =
|
Line 208 my %gnuplot_defaults =
|
test => $sml_test, |
test => $sml_test, |
description => 'Font size to use in web output (pts)', |
description => 'Font size to use in web output (pts)', |
edit_type => 'choice', |
edit_type => 'choice', |
choices => [['5','5 (small)'],'7',['9','9 (medium)'],'10','12',['15','15 (large)']] |
choices => [['5','5 (small)'],'6','7','8',['9','9 (medium)'],'10',['11','11 (large)'],'12','15'] |
}, |
}, |
fontface => { |
fontface => { |
default => 'sans-serif', |
default => 'sans-serif', |
Line 501 my %curve_defaults =
|
Line 501 my %curve_defaults =
|
choices => [keys(%linestyles)] |
choices => [keys(%linestyles)] |
}, |
}, |
linewidth => { |
linewidth => { |
default => 4, |
default => 2, |
test => $int_test, |
test => $int_test, |
description => 'Line width (may not apply to all line styles)', |
description => 'Line width (may not apply to all line styles)', |
edit_type => 'choice', |
edit_type => 'choice', |
Line 713 sub get_font {
|
Line 713 sub get_font {
|
} elsif ( $Apache::lonplot::plot{'font'} eq 'medium') { |
} elsif ( $Apache::lonplot::plot{'font'} eq 'medium') { |
$size = '9'; |
$size = '9'; |
} elsif ( $Apache::lonplot::plot{'font'} eq 'large') { |
} elsif ( $Apache::lonplot::plot{'font'} eq 'large') { |
$size = '15'; |
$size = '11'; |
} else { |
} else { |
$size = '9'; |
$size = '9'; |
} |
} |
Line 757 sub end_key {
|
Line 757 sub end_key {
|
return $result; |
return $result; |
} |
} |
|
|
|
sub gnuplot_protect { |
|
my ($string) = @_; |
|
$string =~ s{([_^&~\{\}]|\\\\)}{\\\\$1}g; |
|
return $string; |
|
} |
|
|
##------------------------------------------------------------------- title |
##------------------------------------------------------------------- title |
sub start_title { |
sub start_title { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
Line 768 sub start_title {
|
Line 774 sub start_title {
|
if (length($title) > $max_str_len) { |
if (length($title) > $max_str_len) { |
$title = substr($title,0,$max_str_len); |
$title = substr($title,0,$max_str_len); |
} |
} |
|
$title = &gnuplot_protect($title); |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result.=&Apache::edit::tag_start($target,$token,'Plot Title'); |
$result.=&Apache::edit::tag_start($target,$token,'Plot Title'); |
my $text=&Apache::lonxml::get_all_text("/title",$parser,$style); |
my $text=&Apache::lonxml::get_all_text("/title",$parser,$style); |
Line 799 sub start_xlabel {
|
Line 806 sub start_xlabel {
|
if (length($xlabel) > $max_str_len) { |
if (length($xlabel) > $max_str_len) { |
$xlabel = substr($xlabel,0,$max_str_len); |
$xlabel = substr($xlabel,0,$max_str_len); |
} |
} |
|
$xlabel = &gnuplot_protect($xlabel); |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result.=&Apache::edit::tag_start($target,$token,'Plot Xlabel'); |
$result.=&Apache::edit::tag_start($target,$token,'Plot Xlabel'); |
my $text=&Apache::lonxml::get_all_text("/xlabel",$parser,$style); |
my $text=&Apache::lonxml::get_all_text("/xlabel",$parser,$style); |
Line 831 sub start_ylabel {
|
Line 839 sub start_ylabel {
|
if (length($ylabel) > $max_str_len) { |
if (length($ylabel) > $max_str_len) { |
$ylabel = substr($ylabel,0,$max_str_len); |
$ylabel = substr($ylabel,0,$max_str_len); |
} |
} |
|
$ylabel = &gnuplot_protect($ylabel); |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result .= &Apache::edit::tag_start($target,$token,'Plot Ylabel'); |
$result .= &Apache::edit::tag_start($target,$token,'Plot Ylabel'); |
my $text = &Apache::lonxml::get_all_text("/ylabel",$parser,$style); |
my $text = &Apache::lonxml::get_all_text("/ylabel",$parser,$style); |
Line 864 sub start_label {
|
Line 873 sub start_label {
|
$text = &Apache::run::evaluate($text,$safeeval,$$parstack[-1]); |
$text = &Apache::run::evaluate($text,$safeeval,$$parstack[-1]); |
$text =~ s/\n/ /g; |
$text =~ s/\n/ /g; |
$text = substr($text,0,$max_str_len) if (length($text) > $max_str_len); |
$text = substr($text,0,$max_str_len) if (length($text) > $max_str_len); |
$label{'text'} = $text; |
$label{'text'} = &gnuplot_protect($text); |
push(@labels,\%label); |
push(@labels,\%label); |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result .= &Apache::edit::tag_start($target,$token,'Plot Label'); |
$result .= &Apache::edit::tag_start($target,$token,'Plot Label'); |