View source: R/rk.plotOptions.R
rk.plotOptions | R Documentation |
Generates XML and JavaScript code snippets by calling rk.XML.embed
and rk.JS.vars
with useful presets. The
resulting object can be used inside the dialog XML object (to place the plot options button and disable certain tabs),
as
well as in the JS object (to then insert the actual plot options).
rk.plotOptions( label = "Generic plot options", embed = "plot_options", namespace = "rkward", button = TRUE, id.name = "auto" )
label |
A character string,
text label for the button (only used if |
embed |
A character string,
registered name ( |
namespace |
An optional character string,
XiMpLe node |
button |
Logical, whether the plot options should be embedded as a button and appear if it's pressed. |
id.name |
Character string, a unique ID for this plugin element.
If |
An object of class rk.plot.opts
.
rk.XML.embed
,
Introduction to Writing Plugins for RKWard
test.plotOptions <- rk.plotOptions() # see how differently this object class is treated # e.g., in the XML context rk.XML.dialog(test.plotOptions) # use this in the logic section to disable the "type" slot rk.XML.set(test.plotOptions, set="allow_type", to=FALSE) # now in JS context # manually define the variable cat(rk.paste.JS(test.plotOptions)) # this is usually not necessary, as rk.paste.JS.graph() can # define variables automatically cat( rk.paste.JS.graph( echo("plot(", test.plotOptions, ")"), plotOpts=test.plotOptions ) ) # as you can also see in the above example, echo() just # fills in the JS varaible echo(test.plotOptions)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.