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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Jan 25 18:58:38 UTC 2007


Revision: 1224
          http://svn.sourceforge.net/rkward/?rev=1224&view=rev
Author:   tfry
Date:     2007-01-25 10:58:38 -0800 (Thu, 25 Jan 2007)

Log Message:
-----------
More previews

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/plots/ecdf_plot.php
    trunk/rkward/rkward/plugins/plots/ecdf_plot.xml
    trunk/rkward/rkward/plugins/plots/histogram.php
    trunk/rkward/rkward/plugins/plots/scatterplot.php
    trunk/rkward/rkward/plugins/plots/scatterplot.xml

Modified: trunk/rkward/rkward/plugins/plots/ecdf_plot.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/ecdf_plot.php	2007-01-25 18:40:10 UTC (rev 1223)
+++ trunk/rkward/rkward/plugins/plots/ecdf_plot.php	2007-01-25 18:58:38 UTC (rev 1224)
@@ -9,11 +9,31 @@
 	}
 	
 	function printout () {
-	$x = getRK_val ("x");
-	$col = getRK_val ("col");
+		doPrintout (true);
+	}
+	
+	function cleanup () {
 ?>
+rm (rk.temp.range)
+<?
+	}
+
+	function preview () {
+		preprocess ();
+		calculate ();
+		doPrintout (false);
+		cleanup ();
+	}
+
+	function doPrintout ($final) {
+		$x = getRK_val ("x");
+		$col = getRK_val ("col");
+	
+		if ($final) { ?>
 rk.header ("Empirical Cumulative Distribution Function", list ("Variable", rk.get.description (<? echo ($x); ?>), "Minimum", rk.temp.range[1], "Maximum", rk.temp.range[2]))
 rk.graph.on ()
+
+<?		} ?>
 try ({
 	plot.ecdf (<? echo ($x); ?>, <? getRK ("dopoints"); ?>, <? getRK ("verticals"); ?> <? getRK ("plotoptions.code.printout"); ?>)
 <?	if (getRK_val ("th_pnorm")) { ?>
@@ -23,13 +43,9 @@
 	rug (<? echo ($x); ?>, <? getRK ("ticksize"); ?>, <? getRK ("lwd"); ?>, <? getRK ("side"); ?>, col ="<? getRK ("col_rug"); ?>")
 <?	} ?>
 })
+<?		if ($final) { ?>
 rk.graph.off ()
-<?
+<?		}
 	}
-	
-	function cleanup () {
+
 ?>
-rm (rk.temp.range)
-<?
-	}
-?>

Modified: trunk/rkward/rkward/plugins/plots/ecdf_plot.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/ecdf_plot.xml	2007-01-25 18:40:10 UTC (rev 1223)
+++ trunk/rkward/rkward/plugins/plots/ecdf_plot.xml	2007-01-25 18:58:38 UTC (rev 1224)
@@ -11,11 +11,10 @@
 		<tabbook>
 			<tab label="Variable(s)" >
 				<row>
+					<varselector id="vars" />
 					<column>
-						<varselector id="vars" />
-					</column>
-					<column>
 						<varslot multi="false" type="numeric" id="x" source="vars" label="variable(s):" required="true" />
+						<preview id="preview"/>
 					</column>
 					<stretch/>
 				</row>

Modified: trunk/rkward/rkward/plugins/plots/histogram.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/histogram.php	2007-01-25 18:40:10 UTC (rev 1223)
+++ trunk/rkward/rkward/plugins/plots/histogram.php	2007-01-25 18:58:38 UTC (rev 1224)
@@ -13,7 +13,10 @@
 }
 
 function preview () {
-	doPrintout (false);
+	preprocess ();
+	calculate ();
+	doPrintout (false);	// only this one actually needed...
+	cleanup ();
 }
 
 // internal helper functions

Modified: trunk/rkward/rkward/plugins/plots/scatterplot.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/scatterplot.php	2007-01-25 18:40:10 UTC (rev 1223)
+++ trunk/rkward/rkward/plugins/plots/scatterplot.php	2007-01-25 18:58:38 UTC (rev 1224)
@@ -1,7 +1,7 @@
 <?
 function preprocess () {
 ?>
-	rk.temp <- list ()
+rk.temp <- list ()
 <?
 }
 
@@ -48,12 +48,30 @@
 }
 
 function printout () {
-	
+	doPrintout (true);
+}
+
+function cleanup () {
 ?>
+rm(rk.temp)
+rm(rk.temp.iterator)
+<?
+}
+
+function preview () {
+	preprocess ();
+	calculate ();
+	doPrintout (false);
+	cleanup ();
+}
+
+function doPrintout ($final) { ?>
 if (!rk.temp$ok) stop ()
 
+<? if ($final) { ?>
 rk.graph.on()
 
+<?	} ?>
 try ({
 	# make frame and axes
 	plot(rk.temp$Xdef, rk.temp$Ydef, type="n", xlab = "<? echo ($Xname); ?>", ylab = "<? echo ($Yname); ?>", main = "<? echo ($main); ?>", sub = "<? echo ($sub); ?>", axes = <? getRK("axes") ;?>, log = "<? getRK("logX") ; getRK("logY") ; ?>")
@@ -71,15 +89,8 @@
 	}
 })
 
+<? if ($final) { ?>
 rk.graph.off()
-
-<?
+<?	}
 }
-
-function cleanup () {
 ?>
-rm(rk.temp)
-rm(rk.temp.iterator)
-<?
-}
-?>

Modified: trunk/rkward/rkward/plugins/plots/scatterplot.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/scatterplot.xml	2007-01-25 18:40:10 UTC (rev 1223)
+++ trunk/rkward/rkward/plugins/plots/scatterplot.xml	2007-01-25 18:58:38 UTC (rev 1224)
@@ -30,8 +30,13 @@
 			<tab label="Variables" >
 				<row>
 					<varselector id="vars" />
-					<varslot multi="true" duplicate="true" types="number unknown" id="x" source="vars" label="'X' variables" required="true" />
-					<varslot multi="true" duplicate="true" types="number unknown" id="y" source="vars" label="'Y' variables" required="true" />
+					<column>
+						<row>
+							<varslot multi="true" duplicate="true" types="number unknown" id="x" source="vars" label="'X' variables" required="true" />
+							<varslot multi="true" duplicate="true" types="number unknown" id="y" source="vars" label="'Y' variables" required="true" />
+						</row>
+						<preview id="preview"/>
+					</column>
 				</row>
 			</tab>
 			<tab label="Axes" >
@@ -136,8 +141,13 @@
 		<page>
 			<row>
 				<varselector id="vars" />
-				<varslot multi="true" duplicate="true" types="number unknown" id="x" source="vars" label="'X' variables" required="true" />
-				<varslot multi="true" duplicate="true" duplicate="true" types="number unknown" id="y" source="vars" label="'Y' variables" required="true" />
+				<column>
+					<row>
+						<varslot multi="true" duplicate="true" types="number unknown" id="x" source="vars" label="'X' variables" required="true" />
+						<varslot multi="true" duplicate="true" types="number unknown" id="y" source="vars" label="'Y' variables" required="true" />
+					</row>
+					<preview id="preview"/>
+				</column>
 			</row>
 		</page>
 	<!-- axes-->


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