openPage {rlc} | R Documentation |
Open a new empty page
Description
openPage
starts a server, establishes a web socket connection between it and the current
R session and loads linked-charts JS library with all the dependencies. This function initializes
an instance of class LCApp
and stores it in the namespace of the package. If another
instance has already been stored (i.e. another app has been started with this function), the existing
app will be closed.
Usage
openPage(
useViewer = TRUE,
rootDirectory = NULL,
startPage = NULL,
layout = NULL,
port = NULL,
browser = NULL,
onlyServer = FALSE,
...
)
Arguments
useViewer |
If |
rootDirectory |
A path to the root directory for the server. Any file, requested by the server
will be searched for in this directory. If |
startPage |
A path to an HTML file that should be used as a starting page of the app.
It can be an absolute path to a local file, or it can be relative to the |
layout |
Adds one of the defaults layouts to each new page. Currently, only tables of arbitrary
size are supported. To add a table, this parameter must be equal to |
port |
Defines which TCP port the server will listen to. If not defined, random available port
will be used (see |
browser |
A browser in which to open a new web page.
If not defined, default browser will be used. For more information check |
onlyServer |
If |
... |
Further arguments passed to |
Details
Argument onStart
of jrc
openPage
function is replaced in rlc
with beforeLoad
and afterLoad
. The reason for that is when the page opens, rlc
has to put there all the existing charts. Different situations may require some code be loaded before or after
that happens. beforeLoad
and afterLoad
provide a way to define two callback functions, each
receiving a Session
object as an argument and is called once for each new page.
beforeLoad
runs before anything else has happened, while afterLoad
is called after all the
existing charts have been added to the page.
This function initializes a new instance of class LCApp
and wraps around methods
startServer
and openPage
of its parent class App
.
Value
A new instance of class LCApp
.
Examples
## Not run: openPage()
openPage(useViewer = FALSE, layout = "table2x3")
## End(Not run)