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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri Jun 1 14:15:41 UTC 2007


Revision: 1925
          http://svn.sourceforge.net/rkward/?rev=1925&view=rev
Author:   tfry
Date:     2007-06-01 07:15:40 -0700 (Fri, 01 Jun 2007)

Log Message:
-----------
Add basic dot chart

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/plugins/Makefile.am
    trunk/rkward/rkward/plugins/under_development.pluginmap

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

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2007-06-01 14:00:25 UTC (rev 1924)
+++ trunk/rkward/ChangeLog	2007-06-01 14:15:40 UTC (rev 1925)
@@ -1,3 +1,4 @@
+- CLT plugins allow drawing grid
 - add max.print option to R-Backend settings dialog
 - syntax highlighting is minimally faster for long outputs
 - graphics export plugin gains option for EPS compatibility

Modified: trunk/rkward/rkward/plugins/Makefile.am
===================================================================
--- trunk/rkward/rkward/plugins/Makefile.am	2007-06-01 14:00:25 UTC (rev 1924)
+++ trunk/rkward/rkward/plugins/Makefile.am	2007-06-01 14:15:40 UTC (rev 1925)
@@ -59,8 +59,12 @@
 	plots/plot_stepfun_options.rkh \
 	plots/plot_stepfun_options.xml \
 	plots/plot_stepfun_options.php \
+	plots/piechart.rkh \
 	plots/histogram.rkh \
-	plots/ecdf_plot.rkh
+	plots/dotchart.php \
+	plots/ecdf_plot.rkh \
+	plots/dotchart.xml \
+	plots/dotchart.rkh
 
 pluginsXdistributionsdir = $(kde_datadir)/rkward/distributions
 dist_pluginsXdistributions_DATA = \

Added: trunk/rkward/rkward/plugins/plots/dotchart.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/dotchart.php	                        (rev 0)
+++ trunk/rkward/rkward/plugins/plots/dotchart.php	2007-06-01 14:15:40 UTC (rev 1925)
@@ -0,0 +1,52 @@
+<?
+function preprocess () {
+}
+
+function calculate () {
+}
+
+function printout () {
+	doPrintout (true);
+}
+
+function preview () {
+	preprocess ();
+	calculate ();
+	doPrintout (false);
+}
+
+function doPrintout ($final) {
+	$vars = getRK_val ("x");
+	$tabulate= getRK_val ("tabulate")=="TRUE";
+
+	$options = getRK_val ("plotoptions.code.printout");
+
+	$plotpre = getRK_val ("plotoptions.code.preprocess");
+	$plotpost = getRK_val ("plotoptions.code.calculate");
+
+if($tabulate) {?>
+x <- table (<? echo ($vars); ?>, exclude=NULL)
+<?      } else { ?>
+x <- <? echo ($vars); ?>
+
+if (!is.numeric (x)) {
+	warning ("Data may not be numeric, but proceeding as requested.\nDid you forget to check the tabulate option?")
+}
+<?      } ?>
+
+<?	if ($final) { ?>
+rk.header ("Dot chart", list ("Variable", rk.get.description (<? echo ($vars); ?>)))
+
+rk.graph.on ()
+<?	}
+?>
+try ({
+<?	if (!empty ($plotpre)) printIndented ("\t", $plotpre); ?>
+	dotchart(x<? echo ($options); ?>)
+<?	if (!empty ($plotpost)) printIndented ("\t", $plotpost); ?>
+})
+<?	if ($final) { ?>
+rk.graph.off ()
+<? }
+}
+?>

Added: trunk/rkward/rkward/plugins/plots/dotchart.rkh
===================================================================
--- trunk/rkward/rkward/plugins/plots/dotchart.rkh	                        (rev 0)
+++ trunk/rkward/rkward/plugins/plots/dotchart.rkh	2007-06-01 14:15:40 UTC (rev 1925)
@@ -0,0 +1,26 @@
+<!DOCTYPE rkhelp>
+<document>
+	<summary>
+Draw a dot chart
+	</summary>
+
+	<usage>
+Choose a matrix, vector or a factor to be plotted. Further options are available on the second tab.
+	</usage>
+
+	<settings>
+		<caption id="tab_variables"/>
+		<setting id="x">Matrix, vector or a factor. Data needs to be numeric unless the tabulate option is checked, below.</setting>
+		<setting id="tabulate">Use tabulate option mainly for factor variables or wherever else applicable.</setting>
+		<caption id="tab_options"/>
+		<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/dotchart"/></li>
+			<li><link href="rkward://rhelp/table"/></li>
+		</ul>
+	</related>
+</document>

Added: trunk/rkward/rkward/plugins/plots/dotchart.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/dotchart.xml	                        (rev 0)
+++ trunk/rkward/rkward/plugins/plots/dotchart.xml	2007-06-01 14:15:40 UTC (rev 1925)
@@ -0,0 +1,29 @@
+<!DOCTYPE rkplugin>
+<document>
+	<code file="dotchart.php" />
+	<help file="dotchart.rkh" />
+	<logic>
+		<set id="plotoptions.allow_ylim" to="false"/>
+		<set id="plotoptions.allow_log" to="false"/>
+		<set id="plotoptions.allow_type" to="false"/>
+	</logic>
+	<dialog label="Dot chart" >
+		<tabbook>
+			<tab label="Variables" id="tab_variables">
+				<row>
+					<varselector id="vars"/>
+					<column>
+					<varslot min_vars="1" id="x" source="vars" required="true" label="Variable"/>
+					<checkbox id="tabulate" label="Tabulate" value="TRUE" value_unchecked="FALSE" checked="false" />
+					<stretch/>
+					<preview id="preview"/>
+					</column>
+				</row>
+			</tab>
+			<tab label="Options" id="tab_options">
+				<stretch/>
+				<embed id="plotoptions" component="rkward::plot_options" as_button="true" label="Plot Options"/>
+			</tab>
+		</tabbook>
+	</dialog>
+</document>

Modified: trunk/rkward/rkward/plugins/under_development.pluginmap
===================================================================
--- trunk/rkward/rkward/plugins/under_development.pluginmap	2007-06-01 14:00:25 UTC (rev 1924)
+++ trunk/rkward/rkward/plugins/under_development.pluginmap	2007-06-01 14:15:40 UTC (rev 1925)
@@ -4,6 +4,7 @@
 	<components>
 		<component type="standard" id="crosstab" file="analysis/crosstab.xml" label="Crosstabs" />
 		<component type="standard" id="piechart" file="plots/piechart.xml" label="Piechart" />
+		<component type="standard" id="dotchart" file="plots/dotchart.xml" label="Dotchart" />
 	</components>
 
 	<hierarchy>
@@ -18,6 +19,7 @@
 		</menu>
 		<menu id="plots" label="Plots" index="5">
 			<entry component="piechart" index="11"/>
+			<entry component="dotchart" index="12"/>
 		</menu>
 		<menu id="distributions" label="Distributions" index="7">
 			<menu id="univariate_continuous_distributions" label="Univariate continuous distributions" index="2">


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