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

kapatp at users.sourceforge.net kapatp at users.sourceforge.net
Sun Apr 1 17:36:43 UTC 2007


Revision: 1775
          http://svn.sourceforge.net/rkward/?rev=1775&view=rev
Author:   kapatp
Date:     2007-04-01 10:36:43 -0700 (Sun, 01 Apr 2007)

Log Message:
-----------
Simple Plot plugin under PLots

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

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

Added: trunk/rkward/rkward/plugins/plots/plot.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/plot.php	                        (rev 0)
+++ trunk/rkward/rkward/plugins/plots/plot.php	2007-04-01 17:36:43 UTC (rev 1775)
@@ -0,0 +1,49 @@
+<?
+function preprocess () {
+}
+
+function calculate () {
+}
+
+function printout () {
+	doPrintout (true);
+}
+
+function preview () {
+	preprocess ();
+	calculate ();
+	doPrintout (false);
+}
+
+function doPrintout ($final) {
+	$x = getRK_val ("xvarslot");
+	$y = getRK_val ("yvarslot");
+	if (!($y == "")) {
+		$y = ", " . $y;
+	}
+	// get additional code (as of now grid) from the calculate section
+	$plot_adds = getRK_val ("plotoptions.code.calculate");
+
+	if ($final) {
+?>
+rk.graph.on ()
+<?
+	}
+?>
+try({
+	plot(<? echo ($x . $y . getRK_val ("plotoptions.code.printout")); ?>);
+<?	if (!empty ($plot_adds)) { ?>
+
+<?		// print the grid() related code
+		printIndented ("\t", $plot_adds);
+	}
+?>
+})
+<?
+	if ($final) {
+?>
+rk.graph.off ()
+<?
+	}
+}
+?>

Added: trunk/rkward/rkward/plugins/plots/plot.rkh
===================================================================
--- trunk/rkward/rkward/plugins/plots/plot.rkh	                        (rev 0)
+++ trunk/rkward/rkward/plugins/plots/plot.rkh	2007-04-01 17:36:43 UTC (rev 1775)
@@ -0,0 +1,23 @@
+<!DOCTYPE rkhelp>
+<document>
+	<summary>
+		This is an implementation of the standard (traditional S) graphics function <b>plot</b>.
+	</summary>
+	<usage>
+		Choose the X and Y variables and customize the options to draw the plot.
+	</usage>
+	<settings>
+		<caption id="tab_variables"/>
+		<setting id="xvarslot">This is the <i>x</i> argument. And it is required to draw any plot. In the simplest case of plotting variables of class type integer/numeric, when "Y Variable" is not provided, this is actually the y-coordinate and the indices of the plotting variable is taken as the x-coordinate. See R reference on 'plot' for more details.</setting>
+		<setting id="yvarslot">This is the <i>y</i> argument.</setting>
+		<caption id="tab_options"/>
+		<setting id="plotoptions">Further generic plot options. Refer to <link href="rkward://component/plot_options"/> for details.</setting>
+	</settings>
+	<related>
+		<ul>
+			<li><link href="rkward://rhelp/plot"/></li>
+			<li><link href="rkward://component/plot_options"/></li>
+		</ul>
+	</related>
+</document>
+

Added: trunk/rkward/rkward/plugins/plots/plot.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/plot.xml	                        (rev 0)
+++ trunk/rkward/rkward/plugins/plots/plot.xml	2007-04-01 17:36:43 UTC (rev 1775)
@@ -0,0 +1,29 @@
+<!DOCTYPE rkplugin>
+<document>
+	<code file="plot.php" />
+	<help file="plot.rkh" />
+	<logic>
+		<set id="plotoptions.allow_log" to="true"/>
+		<set id="plotoptions.allow_aspect" to="true"/>
+		<set id="plotoptions.allow_grid" to="true"/>
+	</logic>
+	<dialog label="Plot" >
+		<tabbook>
+			<tab label="Variables" id="tab_variables">
+				<row>
+					<varselector id="vars"/>
+					<column>
+					<varslot id="xvarslot" source="vars" required="true" label="X variable"/>
+					<varslot id="yvarslot" source="vars" required="false" label="Y variable"/>
+					<stretch/>
+					<preview id="preview"/>
+					</column>
+				</row>
+			</tab>
+			<tab label="Plot Options" id="tab_options">
+			<embed id="plotoptions" component="rkward::plot_options" label="Various plot options"/>
+			</tab>
+		</tabbook>
+	</dialog>
+
+</document>

Modified: trunk/rkward/rkward/plugins/under_development.pluginmap
===================================================================
--- trunk/rkward/rkward/plugins/under_development.pluginmap	2007-04-01 15:00:32 UTC (rev 1774)
+++ trunk/rkward/rkward/plugins/under_development.pluginmap	2007-04-01 17:36:43 UTC (rev 1775)
@@ -2,6 +2,7 @@
 
 <document base_prefix="" namespace="rkward">
 	<components>
+		<component type="standard" id="plot" file="plots/plot.xml" label="Simple Plot" />
 	</components>
 
 	<hierarchy>
@@ -14,6 +15,7 @@
 		<menu id="analysis" label="Analysis" index="4">
 		</menu>
 		<menu id="plots" label="Plots" index="5">
+			<entry component="plot"/>
 		</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