Dash¶
-
class
olympus.dashboard.dash.Dashboard(name='olympus.dashboard.dash', secret='__secret__')[source]¶ Bases:
objectDashboard entry point
Methods
add_page(self, page[, route, header])Add a new page to the dashboard on_event(self, event, handler[, namespace])Register an handler for a givent event run(self)Run the flask App
-
olympus.dashboard.dash.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
-
olympus.dashboard.dash.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}
-
olympus.dashboard.dash.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