[rkward-cvs] SF.net SVN: rkward: [1824] trunk/rkward/rkward/plugins
nono_231 at users.sourceforge.net
nono_231 at users.sourceforge.net
Wed Apr 18 16:22:31 UTC 2007
Revision: 1824
http://svn.sourceforge.net/rkward/?rev=1824&view=rev
Author: nono_231
Date: 2007-04-18 09:22:31 -0700 (Wed, 18 Apr 2007)
Log Message:
-----------
Added new pie chart in under_development plugins
Modified Paths:
--------------
trunk/rkward/rkward/plugins/under_development.pluginmap
Added Paths:
-----------
trunk/rkward/rkward/plugins/plots/piechart.php
trunk/rkward/rkward/plugins/plots/piechart.xml
Added: trunk/rkward/rkward/plugins/plots/piechart.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/piechart.php (rev 0)
+++ trunk/rkward/rkward/plugins/plots/piechart.php 2007-04-18 16:22:31 UTC (rev 1824)
@@ -0,0 +1,45 @@
+<?
+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";
+
+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 ("Pie chart", list ("Variable", rk.get.description (<? echo ($vars); ?>)))
+
+rk.graph.on ()
+<? }
+?>
+try ({
+ pie(x, col=rainbow( if(is.matrix(x)) dim(x) else length(x)))
+})
+<? if ($final) { ?>
+rk.graph.off ()
+<? }
+}
+?>
Added: trunk/rkward/rkward/plugins/plots/piechart.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/piechart.xml (rev 0)
+++ trunk/rkward/rkward/plugins/plots/piechart.xml 2007-04-18 16:22:31 UTC (rev 1824)
@@ -0,0 +1,19 @@
+<!DOCTYPE rkplugin>
+<document>
+ <code file="piechart.php" />
+ <dialog label="Pie 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>
+ </tabbook>
+ </dialog>
+</document>
Modified: trunk/rkward/rkward/plugins/under_development.pluginmap
===================================================================
--- trunk/rkward/rkward/plugins/under_development.pluginmap 2007-04-18 14:22:31 UTC (rev 1823)
+++ trunk/rkward/rkward/plugins/under_development.pluginmap 2007-04-18 16:22:31 UTC (rev 1824)
@@ -3,6 +3,7 @@
<document base_prefix="" namespace="rkward">
<components>
<component type="standard" id="crosstab" file="analysis/crosstab.xml" label="Crosstabs" />
+ <component type="standard" id="piechart" file="plots/piechart.xml" label="Piechart" />
</components>
<hierarchy>
@@ -16,6 +17,7 @@
<entry component="crosstab" index="11"/>
</menu>
<menu id="plots" label="Plots" index="5">
+ <entry component="piechart" index="11"/>
</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