trexwrapper
enables the user to listen and respond to events on objects in a Tableau dashboard using event handlers.
Objects are the pieces of the Tableau dashboard that a user interacts with. The following objects are supported:
- Dashboard (:py
~client_code.model.proxies.Dashboard
) - Worksheet (:py
~client_code.model.proxies.Worksheet
) - Filter (:py
~client_code.model.proxies.Filter
) - Parameter (:py
~client_code.model.proxies.Parameter
) - Datasource (:py
~client_code.model.proxies.Datasource
)
- Dashboard (:py
Events are triggered when a user interacts with objects on the dashboard. The following events are supported:
- Changing a filter (:py
~client_code.model.proxies.FilterChangedEvent
) - Changing a parameter (:py
~client_code.model.proxies.ParameterChangedEvent
) - Selecting marks (:py
~client_code.model.proxies.MarksSelectedEvent
)
- Changing a filter (:py
- Event handlers are the functions and methods that respond to the events above. These functions can do anything you want them to! For example:
from trexjacket.api import get_dashboard
dashboard = get_dashboard().register_event_handler('selection_changed', notify_selection)
def notify_selection(event):
print(f'Someone selected these marks: {event.get_selected_marks()}')