--- loncom/xml/lonplot.pm 2001/12/18 20:34:58 1.4 +++ loncom/xml/lonplot.pm 2001/12/18 22:29:42 1.5 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Dynamic plot # -# $Id: lonplot.pm,v 1.4 2001/12/18 20:34:58 matthew Exp $ +# $Id: lonplot.pm,v 1.5 2001/12/18 22:29:42 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -48,7 +48,7 @@ my $onoff_test = sub {$_[0]=~/^(on|o my $key_pos_test = sub {$_[0]=~/^(top|bottom|right|left|outside|below)+$/}; my $sml_test = sub {$_[0]=~/^(small|medium|large)$/}; my $linestyle_test = sub {$_[0]=~/^(lines|linespoints|dots|points|steps)$/}; - +my $words_test = sub {$_[0]=~/^((\w+\b*)+$/}; ## ## Default values for attributes of elements ## @@ -56,33 +56,33 @@ my %plot_defaults = ( height => {default => 200, test => $int_test }, width => {default => 200, test => $int_test }, - bgcolor => {default => "xffffff", test => $color_test}, - fgcolor => {default => "x000000", test => $color_test}, - transparent => {default => "off", test => $onoff_test}, - grid => {default => "off", test => $onoff_test}, - border => {default => "on" , test => $onoff_test}, - font => {default => "medium", test => $sml_test } + bgcolor => {default => 'xffffff', test => $color_test}, + fgcolor => {default => 'x000000', test => $color_test}, + transparent => {default => 'off', test => $onoff_test}, + grid => {default => 'off', test => $onoff_test}, + border => {default => 'on', test => $onoff_test}, + font => {default => 'medium', test => $sml_test } ); my %key_defaults = ( - title => { default => "on" , test => $onoff_test }, - box => { default => "off" , test => $onoff_test }, - pos => { default => "top right" , test => $key_pos_test} + title => { default => '', test => $words_test }, + box => { default => 'off', test => $onoff_test }, + pos => { default => 'top right', test => $key_pos_test} ); my %label_defaults = ( xpos => {default => 0, test => $real_test }, ypos => {default => 0, test => $real_test }, - color => {default => "x000000", test => $color_test }, - justify => {default => "left", + color => {default => 'x000000', test => $color_test }, + justify => {default => 'left', test => sub {$_[0]=~/^(left|right|center)$/}} ); my %axis_defaults = ( - color => {default => "x000000", test => $color_test}, + color => {default => 'x000000', test => $color_test}, thickness => {default => 1, test => $int_test }, xmin => {default => -10.0, test => $real_test }, xmax => {default => 10.0, test => $real_test }, @@ -92,9 +92,9 @@ my %axis_defaults = my %curve_defaults = ( - color => {default => "x000000", test => $color_test }, - name => {default => "x000000", test => sub {$_[0]=~/^[\w ]*$/} }, - linestyle => {default => "lines", test => $linestyle_test } + color => {default => 'x000000', test => $color_test }, + name => {default => 'x000000', test => sub {$_[0]=~/^[\w ]*$/} }, + linestyle => {default => 'lines', test => $linestyle_test } ); ##