Actions Reference
Actions are the communication bus of the Nessie platform. Every feature — loading data, rendering the UI, filtering graphs — is a named action handled by one or more plugins. Plugins can dispatch actions to other plugins via context.perform_action().
How Dispatch Works
When platform.perform_action(action_name, payload) is called, the PluginManager finds the first registered plugin that handles that action name and calls plugin.handle(action, context). If multiple plugins handle the same action, the first registered wins (or a PluginPrioritization plugin decides).
Data Actions
load_graph
Load a graph from an external data source. This is the primary entry point for datasource plugins.
filter_graph
Apply attribute-based filter expressions and/or a full-text search query to a graph, returning a subgraph.
Visualization Actions
visualise_graph
Render a graph to an HTML string (SVG + JavaScript). The returned HTML fragment is injected directly into the page DOM.
render
Produce the complete application HTML page. Called once per HTTP request. Reads all workspace state from
Context and inlines CSS, JS, and plugin HTML.change_visualizer
Switch the active visualizer plugin for the current workspace.
Workspace Actions
open_workspace
Open a new workspace tab by loading a graph from a named datasource plugin.
switch_workspace
Set a workspace tab as active by index.
close_workspace
Close a workspace tab by index.
Filter Actions
apply_filters
Re-apply the current active filter stack and search query to the full graph of the active workspace. Updates the displayed graph.
add_filter
Add a
FilterExpression to the active filter stack and re-apply all filters.remove_filter
Remove a specific
FilterExpression from the active filter stack.clear_filters
Remove all filters from the active workspace and restore the full graph.
search
Set a free-text search query and re-apply all filters with the new query.
Console Actions
add_console_message
Append a message to the active workspace's console panel.
clear_console
Clear all console messages from the active workspace.
cli_execute
Execute a Nessie CLI command string (via the
nessie-cli plugin). Supports create node, create edge, edit, delete, filter, search, drop graph, clear.Special Actions
PluginPrioritization
Optional. If a plugin handles this action, the PluginManager calls it whenever multiple plugins can handle the same action. The handler receives a list of candidate plugins and returns the best one.
Dispatching Actions from a Plugin
From inside any handler, use context.perform_action() to dispatch actions to other plugins:
from nessie_api.models import Action
def my_handler(action: Action, context):
# Load a graph from another datasource
graph = context.perform_action(
Action("load_graph", {"Database Path": "/tmp/data.db"})
)
# Log a message to the UI console
context.perform_action(
Action("add_console_message", {
"message": {"message": "Graph loaded!", "type": "ok"}
})
)
# Dispatch to a specific plugin by name
html = context.perform_action(
Action("visualise_graph", graph),
"Visualiser Simple" # explicit plugin name
)