[rkward-cvs] [rkward] rkward: Make Header().addFromUI() chainable, and also use it in corr_matrix plugin.
Thomas Friedrichsmeier
thomas.friedrichsmeier at ruhr-uni-bochum.de
Mon Nov 17 16:12:02 UTC 2014
Git commit dc15a0d0c13a3afe97bc5937b35aeb143b66daa6 by Thomas Friedrichsmeier.
Committed on 17/11/2014 at 16:11.
Pushed by tfry into branch 'master'.
Make Header().addFromUI() chainable, and also use it in corr_matrix plugin.
M +1 -1 rkward/plugins/analysis/corr_matrix.js
M +1 -0 rkward/scriptbackends/common.js
http://commits.kde.org/rkward/dc15a0d0c13a3afe97bc5937b35aeb143b66daa6
diff --git a/rkward/plugins/analysis/corr_matrix.js b/rkward/plugins/analysis/corr_matrix.js
index de98d71..d323844 100644
--- a/rkward/plugins/analysis/corr_matrix.js
+++ b/rkward/plugins/analysis/corr_matrix.js
@@ -120,7 +120,7 @@ function calculate () {
function printout () {
// TODO: Printing of method and use is a poor solution, esp. when translated. We should support getting the <radio>'s option labels, and print those, instead.
- new Header (i18n ("Correlation Matrix")).add (i18n ("Method"), getString ("method.label")).add (i18n ("Exclusion"), getString ("use.label")).print ();
+ new Header (i18n ("Correlation Matrix")).addFromUI ("method").addFromUI ("use").print ();
echo ('rk.results (data.frame (result, check.names=FALSE), titles=c (' + i18n ("Coefficient") + ', names (data)))\n');
if (do_p) {
if (polyCorr) {
diff --git a/rkward/scriptbackends/common.js b/rkward/scriptbackends/common.js
index 4f50373..0dbef44 100644
--- a/rkward/scriptbackends/common.js
+++ b/rkward/scriptbackends/common.js
@@ -118,6 +118,7 @@ Header = function (title, level) {
}
this.addFromUI = function (elementid) {
this.parameters = this.parameters.concat (_RK_backend.getUiLabelPair (elementid));
+ return this;
}
this.print = function (indentation) {
makeHeaderCode (this.title, this.parameters, this.level, indentation);
More information about the rkward-tracker
mailing list