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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Sun Feb 14 19:10:59 UTC 2010


Revision: 2743
          http://rkward.svn.sourceforge.net/rkward/?rev=2743&view=rev
Author:   tfry
Date:     2010-02-14 19:10:59 +0000 (Sun, 14 Feb 2010)

Log Message:
-----------
Convert some more plot-plugins to JS

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/plots/dotchart.js
    trunk/rkward/rkward/plugins/plots/dotchart.xml
    trunk/rkward/rkward/plugins/plots/ecdf_plot.js
    trunk/rkward/rkward/plugins/plots/ecdf_plot.xml
    trunk/rkward/rkward/plugins/plots/histogram.js
    trunk/rkward/rkward/plugins/plots/histogram.xml
    trunk/rkward/rkward/plugins/plots/histogram_options.js
    trunk/rkward/rkward/plugins/plots/histogram_options.xml

Removed Paths:
-------------
    trunk/rkward/rkward/plugins/plots/cor_graph.php
    trunk/rkward/rkward/plugins/plots/dotchart.php
    trunk/rkward/rkward/plugins/plots/ecdf_plot.php
    trunk/rkward/rkward/plugins/plots/histogram.php
    trunk/rkward/rkward/plugins/plots/histogram_options.php

Deleted: trunk/rkward/rkward/plugins/plots/cor_graph.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/cor_graph.php	2010-02-11 21:38:00 UTC (rev 2742)
+++ trunk/rkward/rkward/plugins/plots/cor_graph.php	2010-02-14 19:10:59 UTC (rev 2743)
@@ -1,61 +0,0 @@
-<?
-function preprocess () { ?>
-cor.graph <- function(x) {
-	panel.cor <- function(x, y, digits=<? getRK ("digits"); ?>, cex.cor, use="<? getRK ("use"); ?>", method="<? getRK ("method"); ?>", scale=<? getRK ("scale"); ?>) {
-		usr <- par("usr"); on.exit(par(usr))
-		par(usr = c(0, 1, 0, 1))
-		r <- abs(cor(x, y, use=use, method=method))
-		txt <- format(c(r, 0.123456789), digits=digits)[1]
-		if(missing(cex.cor)) cex <- 0.8/strwidth(txt)
-	
-		test <- cor.test(x,y, use=use, method=method)
-		Signif <- symnum(test$p.value, corr = FALSE, na = FALSE,
-				cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1),
-				symbols = c("***", "**", "*", ".", " "))
-
-		if(scale) text(0.5, 0.5, txt, cex = cex * r)
-		else text(0.5, 0.5, txt, cex = cex)
-		text(.8, .8, Signif, cex=cex, col=2)
-	}
-
-	pairs(x, lower.panel=panel.smooth, upper.panel=panel.cor)
-}
-<?
-}
-	
-function calculate () {
-}
-
-function printout () {
-	doPrintout (true);
-}
-
-function preview () {
-	preprocess ();
-	calculate ();
-	doPrintout (false);
-}
-
-function doPrintout ($final) {
-	$vars = str_replace ("\n", ",", trim (getRK_val ("x"))) ;
-?>
-data <- data.frame (<? echo ($vars); ?>)
-
-<? 
-	if ($final) { ?>
-rk.header ("Correlation Matrix Plot", parameters=list ("Method", "<? getRK ("method"); ?>", "Exclusion", "<? getRK ("use"); ?>", "Precision", "<? getRK ("digits"); ?> digits", "Scale text", "<? getRK ("scale"); ?>"))
-
-rk.graph.on ()
-<?
-} ?>
-try ({
-	cor.graph (data)
-})
-<? 
-	if ($final) { ?>
-rk.graph.off ()
-
-rk.print("Legend:\t'***': p < 0.001 -- '**': p < 0.01 -- '*': p < 0.05 -- '.'': p < 0.1")
-<?  }
-}
-?>

Modified: trunk/rkward/rkward/plugins/plots/dotchart.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/dotchart.js	2010-02-11 21:38:00 UTC (rev 2742)
+++ trunk/rkward/rkward/plugins/plots/dotchart.js	2010-02-14 19:10:59 UTC (rev 2743)
@@ -1,48 +1,27 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
-
-
 function printout () {
 	doPrintout (true);
 }
 
 function preview () {
-	preprocess ();
-	calculate ();
 	doPrintout (false);
 }
 
 function doPrintout (full) {
-	var vars = "";
-	var names_mode = "";
-	var tabulate = "";
+	var vars = getValue ("x");
+	var names_mode = getValue ("names_mode");
+	var tabulate = getValue ("tabulate");
+
 	var tabulate_header = "";
-	var options = "";
-	var plotpre = "";
-	var plotpost = "";
-	vars = getValue ("x");
-	names_mode = getValue ("names_mode");
-	tabulate= getValue ("tabulate")=="TRUE";
-	tabulate= getValue ("tabulate");
 	if (tabulate) {
 		tabulate_header = '"Tabulate", "Yes"';
 	} else {
 		tabulate_header = '"Tabulate", "No"';
 	}
 
-	options = getValue ("plotoptions.code.printout");
+	var options = getValue ("plotoptions.code.printout");
 
-	plotpre = getValue ("plotoptions.code.preprocess");
-	plotpost = getValue ("plotoptions.code.calculate");
+	var plotpre = getValue ("plotoptions.code.preprocess");
+	var plotpost = getValue ("plotoptions.code.calculate");
 
 	if (tabulate) {
 		echo ('x <- table (' + vars + ', exclude=NULL)\n');
@@ -66,9 +45,9 @@
 	} else if (names_mode == "custom") {
 		echo ("names(x) <- c (\"" + str_replace (";", "\", \"", trim (getValue ("names_custom"))) + "\")\n");
 	}
-	if (!empty (plotpre)) printIndented ("\t", plotpre);
+	if (plotpre != "") printIndented ("\t", plotpre);
 	echo ('	dotchart(x' + options + ')\n');
-	if (!empty (plotpost)) printIndented ("\t", plotpost);
+	if (plotpost != "") printIndented ("\t", plotpost);
 	echo ('})\n');
 	if (full) {
 		echo ('rk.graph.off ()\n');

Deleted: trunk/rkward/rkward/plugins/plots/dotchart.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/dotchart.php	2010-02-11 21:38:00 UTC (rev 2742)
+++ trunk/rkward/rkward/plugins/plots/dotchart.php	2010-02-14 19:10:59 UTC (rev 2743)
@@ -1,64 +0,0 @@
-<?
-function preprocess () {
-}
-
-function calculate () {
-}
-
-function printout () {
-	doPrintout (true);
-}
-
-function preview () {
-	preprocess ();
-	calculate ();
-	doPrintout (false);
-}
-
-function doPrintout ($final) {
-	$vars = getRK_val ("x");
-	$names_mode = getRK_val ("names_mode");
-	$tabulate= getRK_val ("tabulate")=="TRUE";
-	$tabulate= getRK_val ("tabulate");
-	if ($tabulate) {
-		$tabulate_header = '"Tabulate", "Yes"';
-	} else {
-		$tabulate_header = '"Tabulate", "No"';
-	}
-
-	$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", parameters=list ("Variable", rk.get.description (<? echo ($vars); ?>), <? echo ($tabulate_header); ?>))
-
-rk.graph.on ()
-<?	}
-?>
-try ({
-<?	if ($names_mode == "rexp") {
-		echo ("names(x) <- " . getRK_val ("names_exp") . "\n");
-	} else if ($names_mode == "custom") {
-		echo ("names(x) <- c (\"" . str_replace (";", "\", \"", trim (getRK_val ("names_custom"))) . "\")\n");
-	}
-	if (!empty ($plotpre)) printIndented ("\t", $plotpre); ?>
-	dotchart(x<? echo ($options); ?>)
-<?	if (!empty ($plotpost)) printIndented ("\t", $plotpost); ?>
-})
-<?	if ($final) { ?>
-rk.graph.off ()
-<? }
-}
-?>

Modified: trunk/rkward/rkward/plugins/plots/dotchart.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/dotchart.xml	2010-02-11 21:38:00 UTC (rev 2742)
+++ trunk/rkward/rkward/plugins/plots/dotchart.xml	2010-02-14 19:10:59 UTC (rev 2743)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-	<code file="dotchart.php" />
+	<code file="dotchart.js" />
 	<help file="dotchart.rkh" />
 	<logic>
 		<convert id="custom_names" mode="equals" sources="names_mode.string" standard="custom"/>

Modified: trunk/rkward/rkward/plugins/plots/ecdf_plot.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/ecdf_plot.js	2010-02-11 21:38:00 UTC (rev 2742)
+++ trunk/rkward/rkward/plugins/plots/ecdf_plot.js	2010-02-14 19:10:59 UTC (rev 2743)
@@ -1,16 +1,5 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
 function preprocess () {
-	var x = "";
-	x = getValue ("x");
+	var x = getValue ("x");
 
 	echo ('yrange <- range (' + x + ', na.rm=TRUE)\n');
 	if (getValue ("th_pnorm") && getValue ("adjust_th_pnorm")) {
@@ -19,20 +8,17 @@
 	}
 }
 
-
 function printout () {
 	doPrintout (true);
 }
 
 function preview () {
 	preprocess ();
-	calculate ();
 	doPrintout (false);
 }
 
 function doPrintout (full) {
-	var x = "";
-	x = getValue ("x");
+	var x = getValue ("x");
 
 	if (full) {
 		echo ('rk.header ("Empirical Cumulative Distribution Function", list ("Variable", rk.get.description (' + x + '), "Minimum", yrange[1], "Maximum", yrange[2]))\n');
@@ -43,7 +29,7 @@
 	echo ('	plot.ecdf (' + x + ', ' + getValue ("stepfun_options.code.printout") + getValue ("plotoptions.code.printout") + ')\n');
 	if (getValue ("th_pnorm")) {
 		echo ('	curve (pnorm');
-		if (getValue ("adjust_th_pnorm")) echo " (x, mean=data.mean, sd=data.sd)";
+		if (getValue ("adjust_th_pnorm")) echo (" (x, mean=data.mean, sd=data.sd)");
 		echo (', from=yrange[1], to=yrange[2], add=TRUE, ' + getValue ("col_thnorm.code.printout") + ')\n');
 	}
 	if (getValue ("rug")) {

Deleted: trunk/rkward/rkward/plugins/plots/ecdf_plot.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/ecdf_plot.php	2010-02-11 21:38:00 UTC (rev 2742)
+++ trunk/rkward/rkward/plugins/plots/ecdf_plot.php	2010-02-14 19:10:59 UTC (rev 2743)
@@ -1,49 +0,0 @@
-<?
-function preprocess () {
-	$x = getRK_val ("x");
-?>
-yrange <- range (<? echo ($x); ?>, na.rm=TRUE)
-<?
-	if (getRK_val ("th_pnorm") && getRK_val ("adjust_th_pnorm")) { ?>
-data.mean <- mean (<? echo ($x); ?>, na.rm=TRUE)
-data.sd <- sd (<? echo ($x); ?>, na.rm=TRUE)
-<?
-	}
-}
-
-function calculate () {
-}
-
-function printout () {
-	doPrintout (true);
-}
-
-function preview () {
-	preprocess ();
-	calculate ();
-	doPrintout (false);
-}
-
-function doPrintout ($final) {
-	$x = getRK_val ("x");
-	
-	if ($final) { ?>
-rk.header ("Empirical Cumulative Distribution Function", list ("Variable", rk.get.description (<? echo ($x); ?>), "Minimum", yrange[1], "Maximum", yrange[2]))
-
-rk.graph.on ()
-<?	} ?>
-try ({
-	plot.ecdf (<? echo ($x); ?>, <? getRK ("stepfun_options.code.printout"); ?><? getRK ("plotoptions.code.printout"); ?>)
-<?	if (getRK_val ("th_pnorm")) { ?>
-	curve (pnorm<? if (getRK_val ("adjust_th_pnorm")) echo " (x, mean=data.mean, sd=data.sd)"; ?>, from=yrange[1], to=yrange[2], add=TRUE, <? getRK ("col_thnorm.code.printout"); ?>)
-<?	}
-	if (getRK_val ("rug")) { ?>
-	rug (<? echo ($x); ?>, <? getRK ("ticksize"); ?>, <? getRK ("lwd"); ?>, <? getRK ("side"); ?><? getRK ("col_rug.code.printout"); ?>)
-<?	} ?>
-})
-<?	if ($final) { ?>
-rk.graph.off ()
-<?	}
-}
-
-?>

Modified: trunk/rkward/rkward/plugins/plots/ecdf_plot.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/ecdf_plot.xml	2010-02-11 21:38:00 UTC (rev 2742)
+++ trunk/rkward/rkward/plugins/plots/ecdf_plot.xml	2010-02-14 19:10:59 UTC (rev 2743)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-	<code file="ecdf_plot.php" />
+	<code file="ecdf_plot.js" />
 	<help file="ecdf_plot.rkh" />
 	<logic>
 		<connect client="plotoptions.xvar" governor="x.available"/>

Modified: trunk/rkward/rkward/plugins/plots/histogram.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/histogram.js	2010-02-11 21:38:00 UTC (rev 2742)
+++ trunk/rkward/rkward/plugins/plots/histogram.js	2010-02-14 19:10:59 UTC (rev 2743)
@@ -1,42 +1,21 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-
----------------------------- */
-
-// globals
-var undefined;
-
-
-
 function printout () {
 	doPrintout (true);
 }
 
 function preview () {
-	preprocess ();
-	calculate ();
-	doPrintout (false);	// only this one actually needed...
+	doPrintout (false);
 }
 
 // internal helper functions
 function doPrintout (full) {
-	var densityscaled = "";
-	var bw = "";
-	var adjust = "";
-	var narm = "";
-	var n = "";
-	var x = "";
-	var plot_adds = "";
-	densityscaled = getValue ("densityscaled");
-	bw =  getValue ("bw");
-	adjust = getValue ("adjust");
-	narm = getValue ("narm");
-	n = getValue ("n"); //calls "resolution"
-	x = getValue ("x");
-	plot_adds = getValue ("plotoptions.code.calculate");
+	var densityscaled = getValue ("densityscaled");
+	var bw =  getValue ("bw");
+	var adjust = getValue ("adjust");
+	var narm = getValue ("narm");
+	var n = getValue ("n"); //called "resolution"
+	var x = getValue ("x");
+	var plot_adds = getValue ("plotoptions.code.calculate");
 
-
 	if (full) {
 		echo ('rk.header ("Histogram", list ("Variable", rk.get.description (' + x + ') ');
 		if ((densityscaled) && getValue ("density")) {
@@ -60,7 +39,7 @@
 	if ((densityscaled) && getValue ("density")) {
 		echo ('	lines(density(' + x + ', bw="' + bw + '", adjust = ' + adjust + ', ' + narm + ', n = ' + getValue ("n") + ')' + getValue ("col_density.code.printout") + ')\n');
 	}
-	if (!empty (plot_adds)) {
+	if (plot_adds.length > 0) {
 		echo ('\n');
 		// print the grid() related code
 		printIndented ("\t", plot_adds);

Deleted: trunk/rkward/rkward/plugins/plots/histogram.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/histogram.php	2010-02-11 21:38:00 UTC (rev 2742)
+++ trunk/rkward/rkward/plugins/plots/histogram.php	2010-02-14 19:10:59 UTC (rev 2743)
@@ -1,52 +0,0 @@
-<?
-function preprocess () {
-}
-
-function calculate () {
-}
-
-function printout () {
-	doPrintout (true);
-}
-
-function preview () {
-	preprocess ();
-	calculate ();
-	doPrintout (false);	// only this one actually needed...
-}
-
-// internal helper functions
-function doPrintout ($final) {
-	$densityscaled = getRK_val ("densityscaled");
-	$bw =  getRK_val ("bw");
-	$adjust = getRK_val ("adjust");
-	$narm = getRK_val ("narm");
-	$n = getRK_val ("n"); //calls "resolution"
-	$x = getRK_val ("x");
-	$plot_adds = getRK_val ("plotoptions.code.calculate");
-
-
-	if ($final) { ?>
-rk.header ("Histogram", list ("Variable", rk.get.description (<? echo ($x); ?>) <? if (($densityscaled) && getRK_val ("density")) { ?>, "Density bandwidth", "<? echo ($bw); ?>", "Density adjust", <? echo ($adjust); ?>, "Density resolution", <? echo ($n); ?>, "Density Remove missing values", <? echo ($narm); ?> <? } ?> <? getRK ("histogram_opt.code.preprocess"); ?>))
-
-rk.graph.on ()
-<?	}
-?>
-try ({
-	hist (<? echo ($x); getRK ("histogram_opt.code.calculate"); getRK ("histogram_opt.code.printout"); getRK ("plotoptions.code.printout"); ?>)
-<?	if (($densityscaled) && getRK_val ("density")) { ?>
-	lines(density(<? echo ($x); ?>, bw="<? echo ($bw); ?>", adjust = <? echo ($adjust); ?>, <? echo ($narm); ?>, n = <? getRK ("n"); ?>)<? getRK ("col_density.code.printout"); ?>)
-<?	} ?>
-<?	if (!empty ($plot_adds)) { ?>
-
-<?		// print the grid() related code
-		printIndented ("\t", $plot_adds);
-	}
-?>
-})
-<?	if ($final) { ?>
-rk.graph.off ()
-<?	}
-}
-
-?>

Modified: trunk/rkward/rkward/plugins/plots/histogram.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/histogram.xml	2010-02-11 21:38:00 UTC (rev 2742)
+++ trunk/rkward/rkward/plugins/plots/histogram.xml	2010-02-14 19:10:59 UTC (rev 2743)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-	<code file="histogram.php" />
+	<code file="histogram.js" />
 	<help file="histogram.rkh" />
 	<logic>
 		<connect client="plotoptions.xvar" governor="x.available"/>

Modified: trunk/rkward/rkward/plugins/plots/histogram_options.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/histogram_options.js	2010-02-11 21:38:00 UTC (rev 2742)
+++ trunk/rkward/rkward/plugins/plots/histogram_options.js	2010-02-14 19:10:59 UTC (rev 2743)
@@ -1,38 +1,15 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
 // globals
 var histcalcoptions;
 var histplotoptions;
 var headeroptions;
-var undefined;
 
 function makeCodes () {
-	var varname = "";
-	var histbreaks = "";
-	var right = "";
-	var inclowest = "";
-	var freq = "";
-	var addbars = "";
-	var labels = "";
-	var histlty = "";
-	var density = "";
-	var histbordercol = "";
-	var histfillcol = "";
 	histcalcoptions = ", breaks=";
 	histplotoptions = "";
 	headeroptions = "";
-	varname = getValue ("varname");
+	var varname = getValue ("varname");
 
-	histbreaks = getValue ("histbreaksFunction");
+	var histbreaks = getValue ("histbreaksFunction");
 	headeroptions += ', "Break points", "';
 	if (histbreaks == "cells") {
 		histcalcoptions += getValue ("histbreaks_ncells");
@@ -40,8 +17,7 @@
 	} else if (histbreaks == "int") {
 		histcalcoptions += "seq (floor (min (" + varname + ", na.rm=TRUE))-0.5, ceiling (max (" + varname + ", na.rm=TRUE))+0.5)";
 		headeroptions += 'Integers"';
-	}
-	else if (histbreaks == "vec") {
+	} else if (histbreaks == "vec") {
 		histcalcoptions += "(function(x) {y = extendrange(x,f=0.1); seq(from=y[1], to=y[2], length=" + getValue ("histbreaks_veclength") + ")})(" + varname + ")";
 		headeroptions += 'Equally spaced vector of length ' + getValue ("histbreaks_veclength") + '"';
 	} else {
@@ -49,7 +25,7 @@
 		headeroptions += histbreaks + '"';
 	}
 
-	right = getValue ("rightclosed");
+	var right = getValue ("rightclosed");
 	if (!right) {
 		headeroptions += ', "Right closed", "FALSE"';
 		histcalcoptions += ", right=FALSE";
@@ -57,7 +33,7 @@
 		headeroptions += ', "Right closed", "TRUE"';
 	}
 
-	inclowest = getValue ("include_lowest");
+	var inclowest = getValue ("include_lowest");
 	if (!inclowest) {
 		headeroptions += ', "Include in lowest cell", "FALSE"';
 		histcalcoptions += ", include.lowest=FALSE";
@@ -65,7 +41,7 @@
 		headeroptions += ', "Include in lowest cell", "TRUE"';
 	}
 
-	freq = getValue ("freq");
+	var freq = getValue ("freq");
 	if (!freq) {
 		histplotoptions += ", freq=FALSE";
 		headeroptions += ', "Scale", "Density"';
@@ -73,24 +49,28 @@
 		headeroptions += ', "Scale", "Frequency"';
 	}
 
-	addbars = getValue ("addtoplot");
+	var addbars = getValue ("addtoplot");
 	if (addbars) histplotoptions += ", add=TRUE";
 
-	labels = getValue ("barlabels");
+	var labels = getValue ("barlabels");
 	if (labels) histplotoptions += ", labels=TRUE";
 
-	histlty = getValue ("histlinetype");
+	var histlty = getValue ("histlinetype");
 	histplotoptions += ", lty=" + "\"" + histlty + "\"";
 
+	var histbordercol = "";
 	if (histlty != "blank") {
-		density = getValue ("density");
+		var density = getValue ("density");
 		histplotoptions += ", density=" + density;
 		if (density > 0) histplotoptions += ", angle=" + getValue ("angle");
-		if (getValue ("doborder")) histbordercol = getValue ("histbordercol.code.printout");
-		else histbordercol = ", border=FALSE";
+		if (getValue ("doborder")) {
+			histbordercol = getValue ("histbordercol.code.printout");
+		} else {
+			histbordercol = ", border=FALSE";
+		}
 	}
 
-	histfillcol = "";
+	var histfillcol = "";
 	if (getValue ("usefillcol")) histfillcol = getValue ("histfillcol.code.printout");
 
 	histplotoptions += histbordercol + histfillcol;

Deleted: trunk/rkward/rkward/plugins/plots/histogram_options.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/histogram_options.php	2010-02-11 21:38:00 UTC (rev 2742)
+++ trunk/rkward/rkward/plugins/plots/histogram_options.php	2010-02-14 19:10:59 UTC (rev 2743)
@@ -1,99 +0,0 @@
-<?
-function makeCodes () {
-	global $histcalcoptions;
-	global $histplotoptions;
-	global $headeroptions;
-
-	$histcalcoptions = ", breaks=";
-	$histplotoptions = "";
-	$headeroptions = "";
-	$varname = getRK_val ("varname");
-
-	$histbreaks = getRK_val ("histbreaksFunction");
-	$headeroptions .= ', "Break points", "';
-	if ($histbreaks == "cells") {
-		$histcalcoptions .= getRK_val ("histbreaks_ncells");
-		$headeroptions .= 'Approximately ' . getRK_val ("histbreaks_ncells") . ' cells"';
-	} else if ($histbreaks == "int") {
-		$histcalcoptions .= "seq (floor (min (" . $varname . ", na.rm=TRUE))-0.5, ceiling (max (" . $varname . ", na.rm=TRUE))+0.5)";
-		$headeroptions .= 'Integers"';
-	}
-	else if ($histbreaks == "vec") {
-		$histcalcoptions .= "(function(x) {y = extendrange(x,f=0.1); seq(from=y[1], to=y[2], length=" . getRK_val ("histbreaks_veclength") . ")})(" . $varname . ")";
-		$headeroptions .= 'Equally spaced vector of length ' . getRK_val ("histbreaks_veclength") . '"';
-	} else {
-		$histcalcoptions .= "\"" . $histbreaks . "\"";
-		$headeroptions .= $histbreaks . '"';
-	}
-
-	$right = getRK_val ("rightclosed");
-	if (!$right) {
-		$headeroptions .= ', "Right closed", "FALSE"';
-		$histcalcoptions .= ", right=FALSE";
-	} else {
-		$headeroptions .= ', "Right closed", "TRUE"';
-	}
-
-	$inclowest = getRK_val ("include_lowest");
-	if (!$inclowest) {
-		$headeroptions .= ', "Include in lowest cell", "FALSE"';
-		$histcalcoptions .= ", include.lowest=FALSE";
-	} else {
-		$headeroptions .= ', "Include in lowest cell", "TRUE"';
-	}
-
-	$freq = getRK_val ("freq");
-	if (!$freq) {
-		$histplotoptions .= ", freq=FALSE";
-		$headeroptions .= ', "Scale", "Density"';
-	} else {
-		$headeroptions .= ', "Scale", "Frequency"';
-	}
-
-	$addbars = getRK_val ("addtoplot");
-	if ($addbars) $histplotoptions .= ", add=TRUE";
-
-	$labels = getRK_val ("barlabels");
-	if ($labels) $histplotoptions .= ", labels=TRUE";
-
-	$histlty = getRK_val ("histlinetype");
-	$histplotoptions .= ", lty=" . "\"" . $histlty . "\"";
-
-	if ($histlty != "blank") {
-		$density = getRK_val ("density");
-		$histplotoptions .= ", density=" . $density;
-		if ($density > 0) $histplotoptions .= ", angle=" . getRK_val ("angle");
-		if (getRK_val ("doborder")) $histbordercol = getRK_val ("histbordercol.code.printout");
-		else $histbordercol = ", border=FALSE";
-	}
-
-	$histfillcol = "";
-	if (getRK_val ("usefillcol")) $histfillcol = getRK_val ("histfillcol.code.printout");
-
-	$histplotoptions .= $histbordercol . $histfillcol;
-}
-
-function preprocess () {
-	global $headeroptions;
-
-	makeCodes();
-
-	echo ($headeroptions);
-}
-
-function calculate () {
-	global $histcalcoptions;
-
-	// makeCodes() has already run
-
-	echo ($histcalcoptions);
-}
-
-function printout () {
-	global $histplotoptions;
-
-	// makeCodes() has already run
-
-	echo ($histplotoptions);
-}
-?>

Modified: trunk/rkward/rkward/plugins/plots/histogram_options.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/histogram_options.xml	2010-02-11 21:38:00 UTC (rev 2742)
+++ trunk/rkward/rkward/plugins/plots/histogram_options.xml	2010-02-14 19:10:59 UTC (rev 2743)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-	<code file="histogram_options.php"/>
+	<code file="histogram_options.js"/>
 	<help file="histogram_options.rkh"/>
 	<logic>
 		<external id="varname" default=""/>


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