version 1.59, 2002/03/22 14:48:00
|
version 1.61, 2002/03/22 16:04:09
|
Line 91 my %linestyles =
|
Line 91 my %linestyles =
|
yerrorbars => [3,4], |
yerrorbars => [3,4], |
xyerrorbars => [4,6], |
xyerrorbars => [4,6], |
boxes => 3, |
boxes => 3, |
# boxerrorbars => [3,4,5], |
|
# boxxyerrorbars => [4,6,7], |
|
# financebars => 5, |
|
# candlesticks => 5, |
|
vector => 4 |
vector => 4 |
); |
); |
|
|
Line 371 is an error in your <b>function</b> tag.
|
Line 367 is an error in your <b>function</b> tag.
|
</dl> |
</dl> |
ENDCURVEHELP |
ENDCURVEHELP |
|
|
|
my @curve_edit_order = ('color','name','linestyle','pointsize'); |
|
|
my %curve_defaults = |
my %curve_defaults = |
( |
( |
color => { |
color => { |
Line 393 my %curve_defaults =
|
Line 391 my %curve_defaults =
|
description => 'Line style', |
description => 'Line style', |
edit_type => 'choice', |
edit_type => 'choice', |
choices => [keys(%linestyles)] |
choices => [keys(%linestyles)] |
} |
}, |
|
# gnuplots term=gif driver does not handle linewidth :( |
|
# linewidth => { |
|
# default => 1, |
|
# test => $int_test, |
|
# description => 'Line width (may not apply to all line styles)', |
|
# edit_type => 'choice', |
|
# choices => [1,2,3,4,5,6,7,8,9,10] |
|
# }, |
|
pointsize => { |
|
default => 1, |
|
test => $int_test, |
|
description => 'point size (may not apply to all line styles)', |
|
edit_type => 'choice', |
|
choices => [0,1,2,3,4,5,6,7,8,9,10] |
|
} |
); |
); |
|
|
################################################################### |
################################################################### |
Line 731 sub start_curve {
|
Line 744 sub start_curve {
|
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result .= &Apache::edit::tag_start($target,$token,'Curve'); |
$result .= &Apache::edit::tag_start($target,$token,'Curve'); |
$result .= &help_win($curve_help_text); |
$result .= &help_win($curve_help_text); |
$result .= &edit_attributes($target,$token,\%curve_defaults); |
$result .= &edit_attributes($target,$token,\%curve_defaults, |
|
\@curve_edit_order); |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
my $constructtag=&Apache::edit::get_new_args |
my $constructtag=&Apache::edit::get_new_args |
($token,$parstack,$safeeval,keys(%curve_defaults)); |
($token,$parstack,$safeeval,keys(%curve_defaults)); |
Line 1018 sub write_gnuplot_file {
|
Line 1032 sub write_gnuplot_file {
|
$curve->{'function'}.' title "'. |
$curve->{'function'}.' title "'. |
$curve->{'name'}.'" with '. |
$curve->{'name'}.'" with '. |
$curve->{'linestyle'}; |
$curve->{'linestyle'}; |
|
# |
|
# gnuplot's term=gif driver does not handle linewidths :( |
|
# . ' linewidth '. $curve->{'linewidth'}; |
|
# |
|
if (($curve->{'linestyle'} eq 'points') || |
|
($curve->{'linestyle'} eq 'linespoints') || |
|
($curve->{'linestyle'} eq 'errorbars') || |
|
($curve->{'linestyle'} eq 'xerrorbars') || |
|
($curve->{'linestyle'} eq 'yerrorbars') || |
|
($curve->{'linestyle'} eq 'xyerrorbars')) { |
|
$gnuplot_input.=' pointsize '.$curve->{'pointsize'}; |
|
} |
} elsif (exists($curve->{'data'})) { |
} elsif (exists($curve->{'data'})) { |
# Store data values in $datatext |
# Store data values in $datatext |
my $datatext = ''; |
my $datatext = ''; |
Line 1114 sub edit_attributes {
|
Line 1140 sub edit_attributes {
|
sub insert_gnuplot { |
sub insert_gnuplot { |
my $result = ''; |
my $result = ''; |
# plot attributes |
# plot attributes |
$result .= "<gnuplot \n"; |
$result .= "\n<gnuplot "; |
foreach my $attr (keys(%gnuplot_defaults)) { |
foreach my $attr (keys(%gnuplot_defaults)) { |
$result .= " $attr=\"$gnuplot_defaults{$attr}->{'default'}\"\n"; |
$result .= "\n $attr=\"$gnuplot_defaults{$attr}->{'default'}\""; |
} |
} |
$result .= ">\n"; |
$result .= ">"; |
# Add the components (most are commented out for simplicity) |
# Add the components (most are commented out for simplicity) |
# $result .= &insert_key(); |
# $result .= &insert_key(); |
# $result .= &insert_axis(); |
# $result .= &insert_axis(); |
Line 1127 sub insert_gnuplot {
|
Line 1153 sub insert_gnuplot {
|
# $result .= &insert_ylabel(); |
# $result .= &insert_ylabel(); |
$result .= &insert_curve(); |
$result .= &insert_curve(); |
# close up the <gnuplot> |
# close up the <gnuplot> |
$result .= "</gnuplot>\n"; |
$result .= "\n</gnuplot>"; |
return $result; |
return $result; |
} |
} |
|
|
Line 1141 sub insert_xtics {
|
Line 1167 sub insert_xtics {
|
my $result; |
my $result; |
$result .= "\n <xtics "; |
$result .= "\n <xtics "; |
foreach my $attr (keys(%tic_defaults)) { |
foreach my $attr (keys(%tic_defaults)) { |
$result .= "$attr=\"$tic_defaults{$attr}->{'default'}\" "; |
$result .= "\n $attr=\"$tic_defaults{$attr}->{'default'}\" "; |
} |
} |
$result .= "/>\n"; |
$result .= "/>"; |
return $result; |
return $result; |
} |
} |
|
|
Line 1151 sub insert_ytics {
|
Line 1177 sub insert_ytics {
|
my $result; |
my $result; |
$result .= "\n <ytics "; |
$result .= "\n <ytics "; |
foreach my $attr (keys(%tic_defaults)) { |
foreach my $attr (keys(%tic_defaults)) { |
$result .= "$attr=\"$tic_defaults{$attr}->{'default'}\" "; |
$result .= "\n $attr=\"$tic_defaults{$attr}->{'default'}\" "; |
} |
} |
$result .= "/>\n"; |
$result .= "/>"; |
return $result; |
return $result; |
} |
} |
|
|
sub insert_key { |
sub insert_key { |
my $result; |
my $result; |
$result .= "\n <key \n"; |
$result .= "\n <key "; |
foreach my $attr (keys(%key_defaults)) { |
foreach my $attr (keys(%key_defaults)) { |
$result .= " $attr=\"$key_defaults{$attr}->{'default'}\"\n"; |
$result .= "\n $attr=\"$key_defaults{$attr}->{'default'}\""; |
} |
} |
$result .= " />\n"; |
$result .= " />"; |
return $result; |
return $result; |
} |
} |
|
|
Line 1171 sub insert_axis{
|
Line 1197 sub insert_axis{
|
my $result; |
my $result; |
$result .= "\n <axis "; |
$result .= "\n <axis "; |
foreach my $attr (keys(%axis_defaults)) { |
foreach my $attr (keys(%axis_defaults)) { |
$result .= " $attr=\"$axis_defaults{$attr}->{'default'}\"\n"; |
$result .= "\n $attr=\"$axis_defaults{$attr}->{'default'}\""; |
} |
} |
$result .= " />\n"; |
$result .= " />"; |
return $result; |
return $result; |
} |
} |
|
|
sub insert_title { return "\n <title></title>\n"; } |
sub insert_title { return "\n <title></title>"; } |
sub insert_xlabel { return "\n <xlabel></xlabel>\n"; } |
sub insert_xlabel { return "\n <xlabel></xlabel>"; } |
sub insert_ylabel { return "\n <ylabel></ylabel>\n"; } |
sub insert_ylabel { return "\n <ylabel></ylabel>"; } |
|
|
sub insert_label { |
sub insert_label { |
my $result; |
my $result; |
$result .= "\n <label "; |
$result .= "\n <label "; |
foreach my $attr (keys(%label_defaults)) { |
foreach my $attr (keys(%label_defaults)) { |
$result .= ' '.$attr.'="'. |
$result .= "\n $attr=\"". |
$label_defaults{$attr}->{'default'}."\"\n"; |
$label_defaults{$attr}->{'default'}."\""; |
} |
} |
$result .= " ></label>\n"; |
$result .= "></label>"; |
return $result; |
return $result; |
} |
} |
|
|
Line 1196 sub insert_curve {
|
Line 1222 sub insert_curve {
|
my $result; |
my $result; |
$result .= "\n <curve "; |
$result .= "\n <curve "; |
foreach my $attr (keys(%curve_defaults)) { |
foreach my $attr (keys(%curve_defaults)) { |
$result .= ' '.$attr.'="'. |
$result .= "\n $attr=\"". |
$curve_defaults{$attr}->{'default'}."\"\n"; |
$curve_defaults{$attr}->{'default'}."\""; |
} |
} |
$result .= " >\n"; |
$result .= " >"; |
$result .= &insert_data().&insert_data()."</curve>\n"; |
$result .= &insert_data().&insert_data()."\n </curve>"; |
} |
} |
|
|
sub insert_function { |
sub insert_function { |
my $result; |
my $result; |
$result .= "<function></function>\n"; |
$result .= "\n <function></function>"; |
return $result; |
return $result; |
} |
} |
|
|
sub insert_data { |
sub insert_data { |
my $result; |
my $result; |
$result .= " <data></data>\n"; |
$result .= "\n <data></data>"; |
return $result; |
return $result; |
} |
} |
|
|