Usage
BrowserViz(portRange, host="localhost", title="BrowserViz", quiet=TRUE,
browserFile=NA, httpQueryProcessingFunction=NULL)
toJSON(..., auto_unbox=TRUE)
addRMessageHandler(key, functionName)
"ready"(obj)
"send"(obj, msg)
"browserResponseReady"(obj)
"getBrowserResponse"(obj)
"getBrowserInfo"(obj)
"closeWebSocket"(obj)
"port"(obj)
"getBrowserWindowTitle"(obj)
"setBrowserWindowTitle"(obj, newTitle, proclaim=FALSE)
"getBrowserWindowSize"(obj)
Arguments
obj
The BrowserVizClass
object returned by the
class constructor.
portRange
One or more consecutive integers in the range
1025-65535. A typical choice is 9000:9024
. The BrowserViz
class constructor will try these one at a time in succession until
a free port is found and the connection to your web browser is
established. If no open ports are found in the supplied range,
an error is reported.
host
Nearly always left to its default value, "localhost" but
included as a parameter supporting remote computers for future flexibility.
title
The constructor creates a new window (or a new tab,
depending on how you web browser is configured). This title is
displayed at the top of the window or tab.
quiet
Trace and tracking messages are written to the R console
if this variable is set to FALSE.
browserFile
defaults to NA
, which is interpreted as
an instruction to use viz.html
in the inst directory of this
package. Every subclass will have its own (possibly quite complex)
browserFile, containing HTML, Javascript, CSS, and calls to powerful
Javascript libraries (i.e., jQuery, d3, cytoscape.js).
viz.html
provides Javascript endpoints of, for instance, the
getBrowserWindowTitle
and setBrowserWindowTitle
class methods
described above.
httpQueryProcessingFunction
defaults to NULL
. When not
NULL
this function, supplied by the subclass, is called
whenever an HTTP (as opposed to a websocket) request arrives. Thus
the BrowserViz subclass can transfer data to the web browser using a
traditional HTTP GET when that is advantageous.
msg
A name list, with four required slots: "cmd", "status",
"callback", "payload". See below.
newTitle
A character string.
proclaim
Logical, default FALSE; if TRUE will add newTitle to the web page's
body, providing vivid evidence of R controlling the browser.
key
A character string, the "cmd" field of the incoming
four-field JSON command, used to dispatch on, so that the
proper function is called.
functionName
A character string: the name of a function to
which incoming web socket json commands can be dispatched.
auto_unbox
Logical, default TRUE; unboxing: do not coerce a
scalar into a 1-element list, as the new (2015) jsonlite package
prefers to do.
...
Arguments for our local, very slightly reddfined version of
toJSON.