version 1.92, 2003/10/24 17:35:32
|
version 1.95, 2004/03/08 17:31:37
|
Line 244 my %gnuplot_defaults =
|
Line 244 my %gnuplot_defaults =
|
test => sub {$_[0]=~/^(Polar|Cartesian)$/}, |
test => sub {$_[0]=~/^(Polar|Cartesian)$/}, |
description => 'Plot type:', |
description => 'Plot type:', |
edit_type => 'choice', |
edit_type => 'choice', |
choices => ['Polar','Cartesian'] |
choices => ['Cartesian','Polar'] |
}, |
}, |
); |
); |
|
|
Line 401 required. Unfortunately, you must make
|
Line 401 required. Unfortunately, you must make
|
in the order gnuplot expects the data. |
in the order gnuplot expects the data. |
</p><p> |
</p><p> |
Specifying the data should usually be done with a perl variable or array, |
Specifying the data should usually be done with a perl variable or array, |
such as \@Xdata and \@Ydata. You may also specify numerical data seperated |
such as \@Xdata and \@Ydata. You may also specify numerical data separated |
by commas. Again, the order of the <b>data</b> tags is important. The |
by commas. Again, the order of the <b>data</b> tags is important. The |
first tag will be the X data and the second will be the Y data. |
first tag will be the X data and the second will be the Y data. |
</p> |
</p> |
Line 512 sub end_gnuplot {
|
Line 512 sub end_gnuplot {
|
my $randnumber; |
my $randnumber; |
# need to call rand everytime start_script would evaluate, as the |
# need to call rand everytime start_script would evaluate, as the |
# safe space rand number generator and the global rand generator |
# safe space rand number generator and the global rand generator |
# are not seperate |
# are not separate |
if ($target eq 'web' || $target eq 'tex' || $target eq 'grade' || |
if ($target eq 'web' || $target eq 'tex' || $target eq 'grade' || |
$target eq 'answer') { |
$target eq 'answer') { |
$randnumber=int(rand(1000)); |
$randnumber=int(rand(1000)); |
Line 659 sub start_title {
|
Line 659 sub start_title {
|
&Apache::edit::start_spanning_row(). |
&Apache::edit::start_spanning_row(). |
&Apache::edit::editline('',$text,'',60); |
&Apache::edit::editline('',$text,'',60); |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
my $text=$$parser[-1]->get_text("/title"); |
|
$result.=&Apache::edit::rebuild_tag($token); |
$result.=&Apache::edit::rebuild_tag($token); |
$result.=&Apache::edit::modifiedfield($token); |
$result.=&Apache::edit::modifiedfield("/title",$parser); |
} |
} |
return $result; |
return $result; |
} |
} |
Line 693 sub start_xlabel {
|
Line 692 sub start_xlabel {
|
&Apache::edit::start_spanning_row(). |
&Apache::edit::start_spanning_row(). |
&Apache::edit::editline('',$text,'',60); |
&Apache::edit::editline('',$text,'',60); |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
my $text=$$parser[-1]->get_text("/xlabel"); |
|
$result.=&Apache::edit::rebuild_tag($token); |
$result.=&Apache::edit::rebuild_tag($token); |
$result.=&Apache::edit::modifiedfield($token); |
$result.=&Apache::edit::modifiedfield("/xlabel",$parser); |
} |
} |
return $result; |
return $result; |
} |
} |
Line 728 sub start_ylabel {
|
Line 726 sub start_ylabel {
|
&Apache::edit::start_spanning_row(). |
&Apache::edit::start_spanning_row(). |
&Apache::edit::editline('',$text,'',60); |
&Apache::edit::editline('',$text,'',60); |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
my $text=$$parser[-1]->get_text("/ylabel"); |
|
$result.=&Apache::edit::rebuild_tag($token); |
$result.=&Apache::edit::rebuild_tag($token); |
$result.=&Apache::edit::modifiedfield($token); |
$result.=&Apache::edit::modifiedfield("/ylabel",$parser); |
} |
} |
return $result; |
return $result; |
} |
} |
Line 770 sub start_label {
|
Line 767 sub start_label {
|
&Apache::edit::get_new_args |
&Apache::edit::get_new_args |
($token,$parstack,$safeeval,keys(%label_defaults)); |
($token,$parstack,$safeeval,keys(%label_defaults)); |
$result.=&Apache::edit::rebuild_tag($token); |
$result.=&Apache::edit::rebuild_tag($token); |
my $text=$$parser[-1]->get_text("/label"); |
$result.=&Apache::edit::modifiedfield("/label",$parser); |
$result.=&Apache::edit::modifiedfield($token); |
|
} |
} |
return $result; |
return $result; |
} |
} |
Line 849 sub start_function {
|
Line 845 sub start_function {
|
&Apache::edit::editline('',$text,'',60); |
&Apache::edit::editline('',$text,'',60); |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
$result.=&Apache::edit::rebuild_tag($token); |
$result.=&Apache::edit::rebuild_tag($token); |
my $text=$$parser[-1]->get_text("/function"); |
$result.=&Apache::edit::modifiedfield("/function",$parser); |
$result.=&Apache::edit::modifiedfield($token); |
|
} |
} |
return $result; |
return $result; |
} |
} |
Line 892 sub start_data {
|
Line 887 sub start_data {
|
my @data; |
my @data; |
if ($datatext =~ /,/) { # comma deliminated |
if ($datatext =~ /,/) { # comma deliminated |
@data = split /,/,$datatext; |
@data = split /,/,$datatext; |
} else { # Assume it's space seperated. |
} else { # Assume it's space separated. |
@data = split / /,$datatext; |
@data = split / /,$datatext; |
} |
} |
for (my $i=0;$i<=$#data;$i++) { |
for (my $i=0;$i<=$#data;$i++) { |
Line 927 sub start_data {
|
Line 922 sub start_data {
|
&Apache::edit::editline('',$text,'',60); |
&Apache::edit::editline('',$text,'',60); |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
$result.=&Apache::edit::rebuild_tag($token); |
$result.=&Apache::edit::rebuild_tag($token); |
my $text=$$parser[-1]->get_text("/data"); |
$result.=&Apache::edit::modifiedfield("/data",$parser); |
$result.=&Apache::edit::modifiedfield($token); |
|
} |
} |
return $result; |
return $result; |
} |
} |