Remote JS

Handles javascript remote function calls

rpcjs.binding.append_child(id, node)[source]

Set the attribute of an element on the webpage

Parameters:
id: str

id of the DOM element

node: str

child node

rpcjs.binding.bind(id, event, handler, attribute=None, property=None)[source]

Bind an element event to a handler and return a property of an attribute of the element

Parameters:
id: str

id of the DOM element

event: str

Name of the event we are listening too. The full list of supported events can be found here.

handler: call

function to callback when the event is fired

attribute: str

Attribute of the element to return

property: str

Property of the element to return

rpcjs.binding.disconnect_event()[source]

Called when socketIO disconnects from the server

rpcjs.binding.display_vega(id, spec)[source]
rpcjs.binding.get_element_size(id, callback)[source]

Get the size of an element inside the webpage

Parameters:
id: str

id of the DOM element

callback: Call

Function to call with the size information {width: w, height: h}

rpcjs.binding.handshake_event()[source]

Called when socketIO connects to the server

rpcjs.binding.redirect(url)[source]

Set the attribute of an element on the webpage

Parameters:
url: str

url to redirect the client to

rpcjs.binding.register_event(event, handler, namespace='/')[source]

Register a socketio event to a python handler

Parameters:
event: str

Name of the event

handler: call

Function to call when the event is fired

rpcjs.binding.send_new_data_vega(id, name, new_values)[source]
rpcjs.binding.set_attribute(id, attribute, value)[source]

Set the attribute of an element on the webpage

Parameters:
id: str

id of the DOM element

attribute: str

name of the attribute to set

value: json

new value of the attribute

rpcjs.binding.set_property(id, property, value)[source]

Set the attribute of an element on the webpage

Parameters:
id: str

id of the DOM element

property: str

name of the property to set

value: json

new value of the property

rpcjs.binding.set_socketio(socket)[source]
rpcjs.binding.socketio()[source]