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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Sep 14 12:19:39 UTC 2011


Revision: 3774
          http://rkward.svn.sourceforge.net/rkward/?rev=3774&view=rev
Author:   tfry
Date:     2011-09-14 12:19:38 +0000 (Wed, 14 Sep 2011)
Log Message:
-----------
Add parameter description to limitation plugin, too. Also some minor cleanups.

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/data/limit_vector_length.js
    trunk/rkward/rkward/plugins/data/limit_vector_length.rkh
    trunk/rkward/rkward/plugins/data/limit_vector_length.xml
    trunk/rkward/rkward/plugins/data/one_var_tabulation.rkh
    trunk/rkward/rkward/plugins/data/one_var_tabulation.xml
    trunk/rkward/rkward/plugins/plots/pareto.js

Modified: trunk/rkward/rkward/plugins/data/limit_vector_length.js
===================================================================
--- trunk/rkward/rkward/plugins/data/limit_vector_length.js	2011-09-14 10:53:50 UTC (rev 3773)
+++ trunk/rkward/rkward/plugins/data/limit_vector_length.js	2011-09-14 12:19:38 UTC (rev 3774)
@@ -5,7 +5,7 @@
 	echo ('max.categories <- ' + getValue ("cutoff") + '\n');
 	echo ('if (length (' + invar + ') > max.categories) {\n');
 	echo ('\t' + invar + ' <- sort (' + invar);
-	if (getValue ("sorting") != "lowest") echo (', decreasing=TRUE');
+	if (getValue ("sorting") != "smallest") echo (', decreasing=TRUE');
 	echo (')\n');
 	if (getValue ("include_others.checked")) {
 		var others_labelling = getValue ("others_label");

Modified: trunk/rkward/rkward/plugins/data/limit_vector_length.rkh
===================================================================
--- trunk/rkward/rkward/plugins/data/limit_vector_length.rkh	2011-09-14 10:53:50 UTC (rev 3773)
+++ trunk/rkward/rkward/plugins/data/limit_vector_length.rkh	2011-09-14 12:19:38 UTC (rev 3774)
@@ -16,4 +16,16 @@
 		<setting id="custom_stat">If you chose to use a custom statistic for summarizing the cut off values, specify it, here, as a function of <em>x</em>.</setting>
 		<setting id="others_label">Label to use for the "others" category. Note: If your data is not labeled, emptying this field will sometimes be preferable.</setting>
 	</settings>
+
+	<technical>
+		General users may skip this section of help, this is primarily for developers.
+
+		The following external properties are provided for use in the embedding plugin.
+		<ul>
+			<li><i>invar</i>: Symbol name of the input variable to be limited. Defaults to 'x'.</li>
+			<li><i>outvar</i>: Symbol name to use for the output variable (the limited vector). May be identical to <i>invar</i>. Defaults to 'x'.</li>
+			<li><i>parameters</i>: This property will be set to a string describing the limitation options, suitable for pasting into the "parameters" argument of rk.header().</li>
+		</ul>
+		The generated code is available from <i>code.calculate</i>.
+	</technical>
 </document>

Modified: trunk/rkward/rkward/plugins/data/limit_vector_length.xml
===================================================================
--- trunk/rkward/rkward/plugins/data/limit_vector_length.xml	2011-09-14 10:53:50 UTC (rev 3773)
+++ trunk/rkward/rkward/plugins/data/limit_vector_length.xml	2011-09-14 12:19:38 UTC (rev 3774)
@@ -5,13 +5,23 @@
 	<logic>
 		<external id="invar" default="x"/>
 		<external id="outvar" default="x"/>
+		<external id="parameters"/>
+
+		<script><![CDATA[
+				gui.addChangeCommand ("sorting.string", "updateDescription ()");
+				gui.addChangeCommand ("cutoff.int", "updateDescription ()");
+				updateDescription = function () {
+					gui.setValue ("parameters", '"Limit"="' + gui.getValue ("cutoff.int") + ' ' + gui.getValue ("sorting.string") + ' values"');
+				}
+				updateDescription ();
+		]]></script>
 	</logic>
 	<dialog label="Limit Vector Length">
 		<row>
 			<spinbox type="integer" id="cutoff" initial="10" min="1" label="Limit"/>
 			<radio id="sorting" label="Sorting">
-				<option value="lowest" label="Keep smallest values"/>
-				<option value="highest" checked="true" label="Keep largest values"/>
+				<option value="smallest" label="Keep smallest values"/>
+				<option value="largest" checked="true" label="Keep largest values"/>
 			</radio>
 		</row>
 		<frame id="include_others" label="Add remainder category" checkable="true" checked="true">

Modified: trunk/rkward/rkward/plugins/data/one_var_tabulation.rkh
===================================================================
--- trunk/rkward/rkward/plugins/data/one_var_tabulation.rkh	2011-09-14 10:53:50 UTC (rev 3773)
+++ trunk/rkward/rkward/plugins/data/one_var_tabulation.rkh	2011-09-14 12:19:38 UTC (rev 3774)
@@ -27,7 +27,7 @@
 	<technical>
 		General users may skip this section of help, this is primarily for developers.
 
-		The following external tags are provided for use in the embedding plugin.
+		The following external properties are provided for use in the embedding plugin.
 		<ul>
 			<li><i>varsource</i>: The tabulation plugin does not show its own varselector by default. Connect your own to this one (client="embedded_id.varsource.selected", governor="myvarselector_id.selected").</li>
 			<li><i>outvar</i>: By default, the plugin produces a table in a variable called "x". You can set it to use a different name, here.</li>

Modified: trunk/rkward/rkward/plugins/data/one_var_tabulation.xml
===================================================================
--- trunk/rkward/rkward/plugins/data/one_var_tabulation.xml	2011-09-14 10:53:50 UTC (rev 3773)
+++ trunk/rkward/rkward/plugins/data/one_var_tabulation.xml	2011-09-14 12:19:38 UTC (rev 3774)
@@ -41,7 +41,7 @@
 				gui.setValue ("parameters", '"Tabulation groups"=paste (names (groups), collapse=" by "), "Tabulation statistic"=' + gui.getValue ("fun_label"));
 			}
 			updateFunLabel ();
-	]]></script>
+		]]></script>
 	</logic>
 	<dialog label="Tabulate" >
 		<varselector id="varsource"/>	<!-- dummy varselector is currently needed to allow the embedding component to connect its own varselector -->

Modified: trunk/rkward/rkward/plugins/plots/pareto.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/pareto.js	2011-09-14 10:53:50 UTC (rev 3773)
+++ trunk/rkward/rkward/plugins/plots/pareto.js	2011-09-14 12:19:38 UTC (rev 3774)
@@ -7,7 +7,7 @@
 		echo ('x <- ' + getValue ("x") + '\n');
 		echo ('title <- rk.get.description (' + getValue ("x") + ')\n');
 		echo ('if (!is.numeric (x)) {\n');
-		echo ('	warning ("Data may not be numeric, but proceeding as requested.\\nDid you forget to check the tabulate option?")\n');
+		echo ('	warning ("Data is not numeric, but proceeding as requested.\\nDid you forget to check the tabulate option?")\n');
 		echo ('}\n');
 	} else {
 		echo (getValue ('tabulate_options.code.calculate'));
@@ -35,6 +35,7 @@
 		echo ('rk.header ("Pareto chart", parameters=list (');
 		if (getValue ("tabulate.checked")) echo (getValue ('tabulate_options.parameters'));
 		else echo ('"Variable"=title');
+		if (getValue ("limit.checked")) echo (', ' + getValue ('limit_options.parameters'));
 		echo ('))\n');
 		echo ('\n');
 

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