[rkward-cvs] SF.net SVN: rkward: [1964] trunk/rkward/rkward/plugins

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Sep 17 16:29:52 UTC 2007


Revision: 1964
          http://rkward.svn.sourceforge.net/rkward/?rev=1964&view=rev
Author:   tfry
Date:     2007-09-17 09:29:52 -0700 (Mon, 17 Sep 2007)

Log Message:
-----------
Rename barplot_options to barplot_embed (step 1)

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/embedded.pluginmap

Added Paths:
-----------
    trunk/rkward/rkward/plugins/plots/barplot_embed.php
    trunk/rkward/rkward/plugins/plots/barplot_embed.rkh
    trunk/rkward/rkward/plugins/plots/barplot_embed.xml

Removed Paths:
-------------
    trunk/rkward/rkward/plugins/plots/barplot_options.php
    trunk/rkward/rkward/plugins/plots/barplot_options.rkh
    trunk/rkward/rkward/plugins/plots/barplot_options.xml

Modified: trunk/rkward/rkward/plugins/embedded.pluginmap
===================================================================
--- trunk/rkward/rkward/plugins/embedded.pluginmap	2007-09-17 15:57:23 UTC (rev 1963)
+++ trunk/rkward/rkward/plugins/embedded.pluginmap	2007-09-17 16:29:52 UTC (rev 1964)
@@ -7,7 +7,7 @@
 		<component type="standard" id="color_chooser" file="plots/color_chooser.xml" label="Color Chooser" />
 		<component type="standard" id="plot_stepfun_options" file="plots/plot_stepfun_options.xml" label="Step Function plot options" />
 		<component type="standard" id="histogram_options" file="plots/histogram_options.xml" label="Histogram Options" />
-		<component type="standard" id="barplot_embed" file="plots/barplot_options.xml" label="Barplot Options" />
+		<component type="standard" id="barplot_embed" file="plots/barplot_embed.xml" label="Barplot Options" />
 
 		<component type="standard" id="x11grid" file="x11device/grid.xml" label="Draw Grid" />
 	</components>

Copied: trunk/rkward/rkward/plugins/plots/barplot_embed.php (from rev 1957, trunk/rkward/rkward/plugins/plots/barplot_options.php)
===================================================================
--- trunk/rkward/rkward/plugins/plots/barplot_embed.php	                        (rev 0)
+++ trunk/rkward/rkward/plugins/plots/barplot_embed.php	2007-09-17 16:29:52 UTC (rev 1964)
@@ -0,0 +1,70 @@
+<?
+function preprocess () {
+	// first fetch all relevant options
+	global $options;
+	$options = array ();
+
+	$options['xvar'] = getRK_val ("xvar");
+	$options['type'] = getRK_val ("type");
+	if ($options['type'] == "juxtaposed") {
+		$options['juxtaposed'] = true;
+		$options['labels'] = getRK_val ("labels");
+		if ($options['labels']) {
+			$options['place'] = getRK_val ("place");
+		}
+	} else {
+		$options['labels'] = false;
+		$options['juxtaposed'] = false;
+	}
+	$options['legend'] = getRK_val ("legend");
+	$options['colors'] = getRK_val ("colors");
+
+	// generate and print argument list suitable for display in rk.header
+	if ($options['legend']) $legend_label = "TRUE";
+	else $legend_label = "FALSE";
+	echo (', "colors", "' . $options['colors'] . '", "Type", "' . $options['type'] . '", "Legend", "' . $legend_label . '"');
+}
+
+function calculate () {
+}
+
+function printout () {
+	global $options;
+
+	if ($options['colors'] == 'rainbow') {
+		$col_option = ', col=rainbow (if(is.matrix(' . $options['xvar'] . ')) dim(' . $options['xvar'] . ') else length(' . $options['xvar'] . '))';
+	}
+
+	// construct the main call to barplot
+	$main_call = 'barplot(' . $options['xvar'] . $col_option;
+	if ($options['juxtaposed']) $main_call .= ', beside=TRUE';
+	if ($options['legend']) $main_call .= ', legend.text=TRUE';
+	if ($options['labels']) $main_call .= ", ylim = yrange";
+	$main_call .= getRK_val ('plotoptions.code.printout');
+	$main_call .= ")\n";
+
+	$plot_pre = getRK_val ('plotoptions.code.preprocess');
+	$plot_adds = getRK_val ('plotoptions.code.calculate');
+
+	// now print everything as needed
+	echo ($plot_pre);
+
+	if ($options['labels']) { ?>
+# adjust the range so that the labels will fit
+yrange <- range (<? echo ($options['xvar']); ?>, na.rm=TRUE) * 1.2
+if (yrange[1] > 0) yrange[1] <- 0
+if (yrange[2] < 0) yrange[2] <- 0
+<?	
+		echo ("bplot <- ");
+	}
+
+	echo ($main_call);
+
+	if ($options['labels']) {
+		echo ('text (bplot,' . $options['xvar'] . ', labels=' . $options['xvar'] . ', pos=' . $options['place'] . ', offset=.5)');
+		echo ("\n");
+	}
+
+	echo ($plot_adds);
+}
+?>

Copied: trunk/rkward/rkward/plugins/plots/barplot_embed.rkh (from rev 1957, trunk/rkward/rkward/plugins/plots/barplot_options.rkh)
===================================================================
--- trunk/rkward/rkward/plugins/plots/barplot_embed.rkh	                        (rev 0)
+++ trunk/rkward/rkward/plugins/plots/barplot_embed.rkh	2007-09-17 16:29:52 UTC (rev 1964)
@@ -0,0 +1,39 @@
+<!DOCTYPE rkhelp>
+<document>
+	<summary>
+Options applicable to bar plots
+	</summary>
+
+	<usage>
+Choose if you want stacked bars, legend, and rainbow colors. Also you can choose if you want to display or not bar values (labels) and in what place.
+	</usage>
+
+	<settings>
+		<setting id="legend">Should a legend be added to the barplot? The row names of the data will be used to construct the legend, so this option has no effect, if the rows are not named.</setting>
+		<setting id="colors">Select between grey and rainbow colors.</setting>
+		<setting id="type">Select a type between juxtaposed bars and stacked bars. This setting is only meaningful for two-dimensional data. If you chose stacked bars you can not display bar values, below.</setting>
+		<setting id="labels">Select if you want to display bar values (labels).</setting>
+		<setting id="place">If you have selected to display bar values (labels) you can select where should they be displayed:
+		<li> Above the bars </li>
+		<li> Beside the bars </li>
+		<li> Inside the bars </li>
+		</setting>
+		<setting id="plotoptions">Generic plot options. See <link href="rkward://component/plot_options"/>.</setting>	
+	</settings>
+	<related>
+		<ul>
+			<li><link href="rkward://component/barplot"/></li>
+			<li><link href="rkward://component/plot_options"/></li>
+			<li><link href="rkward://rhelp/barplot"/></li>
+			<li><link href="rkward://rhelp/table"/></li>
+		</ul>
+	</related>
+	<technical>
+		This plugin is meant to be embedded in other plugins. It does not by itself provide a means to select input data. When embedding this plugin, you will be interested in the following properties:
+		<ul>
+			<li><i>xvar</i>: The name of the data variable. You can connect this to a varslot, or set it to a fixed string such as "x". This is required.</li>
+			<li><i>code.preprocess</i>: Provides a summary of parameters to be used in a call to rk.header(), if you have a use for it.</li>
+			<li><i>code.printout</i>: The actual commands needed to construct the barplot.</li>
+		</ul>
+	</technical>
+</document>

Copied: trunk/rkward/rkward/plugins/plots/barplot_embed.xml (from rev 1957, trunk/rkward/rkward/plugins/plots/barplot_options.xml)
===================================================================
--- trunk/rkward/rkward/plugins/plots/barplot_embed.xml	                        (rev 0)
+++ trunk/rkward/rkward/plugins/plots/barplot_embed.xml	2007-09-17 16:29:52 UTC (rev 1964)
@@ -0,0 +1,36 @@
+<!DOCTYPE rkplugin>
+<document>
+	<code file="barplot_options.php" />
+	<help file="barplot_options.rkh" />
+	<logic>
+		<external id="xvar" default=""/>
+		<set id="plotoptions.allow_ylim" to="false"/>
+		<set id="plotoptions.allow_xlim" to="false"/>
+		<set id="plotoptions.allow_type" to="false"/>
+
+		<convert id="juxtaposed" mode="equals" sources="type.string" standard="juxtaposed" />
+		<connect client="labels.enabled" governor="juxtaposed" />
+		<convert id="labelsvalue" mode="and" sources="labels.state;labels.enabled" />
+		<connect client="place.enabled" governor="labelsvalue" />
+	</logic>
+	<dialog label="Barplot Options">
+		<checkbox id="legend" label="Draw Legend" value="1" value_unchecked="0" checked="false"/>
+		<radio id="colors" label="Colors" >
+			<option value="default" label="Default (grayscale)"/>
+			<option value="rainbow" label="Rainbow colors" checked="true"/>
+		</radio>
+		<radio id="type" label="Type" >
+			<option value="juxtaposed" label="Juxtaposed" checked="true"/>
+			<option value="stacked" label="Stacked"/>
+		</radio>
+		<frame id="Value labels">
+			<checkbox id="labels" label="Display values" value="1" value_unchecked="0"/>
+			<radio id="place" label="Placement">
+				<option value="3" label="Above Bars" checked="true"/>
+				<option value="2" label="Beside Bars"/>
+				<option value="1" label="Inside Bars"/>
+			</radio>
+		</frame>
+		<embed id="plotoptions" component="rkward::plot_options" as_button="true" label="Plot Options"/>
+	</dialog>	
+</document>

Deleted: trunk/rkward/rkward/plugins/plots/barplot_options.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/barplot_options.php	2007-09-17 15:57:23 UTC (rev 1963)
+++ trunk/rkward/rkward/plugins/plots/barplot_options.php	2007-09-17 16:29:52 UTC (rev 1964)
@@ -1,70 +0,0 @@
-<?
-function preprocess () {
-	// first fetch all relevant options
-	global $options;
-	$options = array ();
-
-	$options['xvar'] = getRK_val ("xvar");
-	$options['type'] = getRK_val ("type");
-	if ($options['type'] == "juxtaposed") {
-		$options['juxtaposed'] = true;
-		$options['labels'] = getRK_val ("labels");
-		if ($options['labels']) {
-			$options['place'] = getRK_val ("place");
-		}
-	} else {
-		$options['labels'] = false;
-		$options['juxtaposed'] = false;
-	}
-	$options['legend'] = getRK_val ("legend");
-	$options['colors'] = getRK_val ("colors");
-
-	// generate and print argument list suitable for display in rk.header
-	if ($options['legend']) $legend_label = "TRUE";
-	else $legend_label = "FALSE";
-	echo (', "colors", "' . $options['colors'] . '", "Type", "' . $options['type'] . '", "Legend", "' . $legend_label . '"');
-}
-
-function calculate () {
-}
-
-function printout () {
-	global $options;
-
-	if ($options['colors'] == 'rainbow') {
-		$col_option = ', col=rainbow (if(is.matrix(' . $options['xvar'] . ')) dim(' . $options['xvar'] . ') else length(' . $options['xvar'] . '))';
-	}
-
-	// construct the main call to barplot
-	$main_call = 'barplot(' . $options['xvar'] . $col_option;
-	if ($options['juxtaposed']) $main_call .= ', beside=TRUE';
-	if ($options['legend']) $main_call .= ', legend.text=TRUE';
-	if ($options['labels']) $main_call .= ", ylim = yrange";
-	$main_call .= getRK_val ('plotoptions.code.printout');
-	$main_call .= ")\n";
-
-	$plot_pre = getRK_val ('plotoptions.code.preprocess');
-	$plot_adds = getRK_val ('plotoptions.code.calculate');
-
-	// now print everything as needed
-	echo ($plot_pre);
-
-	if ($options['labels']) { ?>
-# adjust the range so that the labels will fit
-yrange <- range (<? echo ($options['xvar']); ?>, na.rm=TRUE) * 1.2
-if (yrange[1] > 0) yrange[1] <- 0
-if (yrange[2] < 0) yrange[2] <- 0
-<?	
-		echo ("bplot <- ");
-	}
-
-	echo ($main_call);
-
-	if ($options['labels']) {
-		echo ('text (bplot,' . $options['xvar'] . ', labels=' . $options['xvar'] . ', pos=' . $options['place'] . ', offset=.5)');
-		echo ("\n");
-	}
-
-	echo ($plot_adds);
-}
-?>

Deleted: trunk/rkward/rkward/plugins/plots/barplot_options.rkh
===================================================================
--- trunk/rkward/rkward/plugins/plots/barplot_options.rkh	2007-09-17 15:57:23 UTC (rev 1963)
+++ trunk/rkward/rkward/plugins/plots/barplot_options.rkh	2007-09-17 16:29:52 UTC (rev 1964)
@@ -1,39 +0,0 @@
-<!DOCTYPE rkhelp>
-<document>
-	<summary>
-Options applicable to bar plots
-	</summary>
-
-	<usage>
-Choose if you want stacked bars, legend, and rainbow colors. Also you can choose if you want to display or not bar values (labels) and in what place.
-	</usage>
-
-	<settings>
-		<setting id="legend">Should a legend be added to the barplot? The row names of the data will be used to construct the legend, so this option has no effect, if the rows are not named.</setting>
-		<setting id="colors">Select between grey and rainbow colors.</setting>
-		<setting id="type">Select a type between juxtaposed bars and stacked bars. This setting is only meaningful for two-dimensional data. If you chose stacked bars you can not display bar values, below.</setting>
-		<setting id="labels">Select if you want to display bar values (labels).</setting>
-		<setting id="place">If you have selected to display bar values (labels) you can select where should they be displayed:
-		<li> Above the bars </li>
-		<li> Beside the bars </li>
-		<li> Inside the bars </li>
-		</setting>
-		<setting id="plotoptions">Generic plot options. See <link href="rkward://component/plot_options"/>.</setting>	
-	</settings>
-	<related>
-		<ul>
-			<li><link href="rkward://component/barplot"/></li>
-			<li><link href="rkward://component/plot_options"/></li>
-			<li><link href="rkward://rhelp/barplot"/></li>
-			<li><link href="rkward://rhelp/table"/></li>
-		</ul>
-	</related>
-	<technical>
-		This plugin is meant to be embedded in other plugins. It does not by itself provide a means to select input data. When embedding this plugin, you will be interested in the following properties:
-		<ul>
-			<li><i>xvar</i>: The name of the data variable. You can connect this to a varslot, or set it to a fixed string such as "x". This is required.</li>
-			<li><i>code.preprocess</i>: Provides a summary of parameters to be used in a call to rk.header(), if you have a use for it.</li>
-			<li><i>code.printout</i>: The actual commands needed to construct the barplot.</li>
-		</ul>
-	</technical>
-</document>

Deleted: trunk/rkward/rkward/plugins/plots/barplot_options.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/barplot_options.xml	2007-09-17 15:57:23 UTC (rev 1963)
+++ trunk/rkward/rkward/plugins/plots/barplot_options.xml	2007-09-17 16:29:52 UTC (rev 1964)
@@ -1,36 +0,0 @@
-<!DOCTYPE rkplugin>
-<document>
-	<code file="barplot_options.php" />
-	<help file="barplot_options.rkh" />
-	<logic>
-		<external id="xvar" default=""/>
-		<set id="plotoptions.allow_ylim" to="false"/>
-		<set id="plotoptions.allow_xlim" to="false"/>
-		<set id="plotoptions.allow_type" to="false"/>
-
-		<convert id="juxtaposed" mode="equals" sources="type.string" standard="juxtaposed" />
-		<connect client="labels.enabled" governor="juxtaposed" />
-		<convert id="labelsvalue" mode="and" sources="labels.state;labels.enabled" />
-		<connect client="place.enabled" governor="labelsvalue" />
-	</logic>
-	<dialog label="Barplot Options">
-		<checkbox id="legend" label="Draw Legend" value="1" value_unchecked="0" checked="false"/>
-		<radio id="colors" label="Colors" >
-			<option value="default" label="Default (grayscale)"/>
-			<option value="rainbow" label="Rainbow colors" checked="true"/>
-		</radio>
-		<radio id="type" label="Type" >
-			<option value="juxtaposed" label="Juxtaposed" checked="true"/>
-			<option value="stacked" label="Stacked"/>
-		</radio>
-		<frame id="Value labels">
-			<checkbox id="labels" label="Display values" value="1" value_unchecked="0"/>
-			<radio id="place" label="Placement">
-				<option value="3" label="Above Bars" checked="true"/>
-				<option value="2" label="Beside Bars"/>
-				<option value="1" label="Inside Bars"/>
-			</radio>
-		</frame>
-		<embed id="plotoptions" component="rkward::plot_options" as_button="true" label="Plot Options"/>
-	</dialog>	
-</document>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list