new.analysis.page(handler, param.set = NULL, annotate.plot = TRUE, class.name = "plot-point", standard.ids = TRUE, skip.checks = FALSE, plot.pars.transformer = NULL, annotate.data.frame = TRUE, numeric.sig.digs = 3, no.plot = FALSE, name = NULL, label = name, description = label, advanced = 0, thumbnail = NULL, service = FALSE, in.menu = !service, paramset.transformer = NULL)
default.param.set
.
Note that it is not a requirement that all of the function arguments be included in the param set---they just won't be provided.annotate.plot
is FALSE.)AnalysisPageServer:::make.standard.ids
that will generate
IDs for you (this is also implemented but not tested).
When annotate.plot is FALSE (for example, when a PNG is requested) the rownames are always left alone and make.standard.ids
is not called.function(plot=list(), other=list())
and
return a list
. The first argument is the plot parameters extracted from the user request (these are the parameters like "width" and "height"
that are not related to the business of the request but are simply passed through to the device function), and the second is all the other parameters
from the user request.
The functinon returns a (named) list of further arguments to pass to the device function. The main use for this is to set the image dimensions
based on the user request. In that case your function would
return a list
with "width" and "height" elements. The units would be inches for svg plot. png plot uses pixel units, but if you add the
parameter units="in" then you can use inches units. You can do this if "units" %in% names(formals(device))
.
The default plot.pars.transformer=NULL
is to not transform the parameters at all.annotate.data.frame
. Default: TRUE.
several checks appropriate for the standard case of data associated with plotted regions.is(column)[1]
is "numeric". This means, in particular
that integer columns will not be rounded.!service
. TRUE means that the front-end should display this page in the menu. FALSE means that the front-end
should not display the page in the menu, but should still be ready to render it, for example by app state link (contrast with service
which the front end can't do anything with except provide a download link or use (as a service) to populate an input widget). The special
condition service = FALSE
, in.menu = TRUE
builds a Page that the front end can use but doesn't show up in the menu.
The combination of service = TRUE
, in.menu = TRUE
, doesn't make any sense and leads to an error.plot.pars.transformer
are supplied then this transformation is applied first.skip.checks
).
do.plot
)
x
and y
fields. Alternatively it may return an AnnotatedDataFrame
. (although this can be relaxed with annotate.data.frame
)
x
and y
fields are numeric.
This function throws an error if the argument does not satistfy one of these. Otherwise it returns void.
The function will be called once at the time of running this function (typically during registration) with all of its defaults to verify the second and third requirements.
The return value is a list of class "AnalysisPage" with the following components:
$handler
$params
AnalysisPageParamSet
(see param.set
)
$annotate.plot
$class.name
A list will be built with the information necessary to render the page. It will
contain the handler function in the $function
slot, as well as a $params
slot listing all of the parameters and their relevant information. The class name of
"AnalysisPage" will be slapped on this object for good measure.
register.page
, execute.handler
, AnnotatedDataFrame
page <- new.analysis.page(AnalysisPageServer:::sine.handler)
registry <- register.page(new.registry(), "sine", page)
## Note: above is equivalent to the following:
## registry <- register.page(registry, "sine", AnalysisPageServer:::sine.handler)
Run the code above in your browser using DataLab