conn_graph_ui.py

conn_graph_ui.py#

Simple Conection Graph Web UI with Graphviz integration.

This creates a web interface that: 1. Uses Graphviz for proper graph layouts 2. Serves focused views of connection graphs

class openmdao.visualization.conn_graph_ui.ConnGraphHandler(conn_graph, *args, **kwargs)[source]

Bases: SimpleHTTPRequestHandler

Custom handler for serving the connection graph web interface.

Parameters:
conn_graphAllConnGraph

Connection graph instance used to serve UI requests.

*argslist

Positional arguments passed to the base handler.

**kwargsdict

Keyword arguments passed to the base handler.

Attributes:
conn_graphAllConnGraph

Connection graph instance used to serve UI requests.

Methods

address_string()

Return the client address.

copyfile(source, outputfile)

Copy all data between two file objects.

create_text_graph(subgraph, title)

Create a simple text-based graph representation when Graphviz is not available.

date_time_string([timestamp])

Return the current date and time formatted for a message header.

do_GET()

Handle GET requests.

do_HEAD()

Serve a HEAD request.

end_headers()

Send the blank line ending the MIME headers.

get_html_template()

Get the HTML template.

get_query_param(param[, default])

Get query parameter value.

get_subsystems()

Get list of unique subsystems.

guess_type(path)

Guess the type of a file.

handle()

Handle multiple requests if necessary.

handle_expect_100()

Decide what to do with an "Expect: 100-continue" header.

handle_one_request()

Handle a single HTTP request.

list_directory(path)

Helper to produce a directory listing (absent index.html).

log_date_time_string()

Return the current time formatted for logging.

log_error(format, *args)

Log an error.

log_message(format, *args)

Log an arbitrary message.

log_request([code, size])

Log an accepted request.

parse_request()

Parse a request (internal).

send_error(code[, message, explain])

Send and log an error reply.

send_head()

Common code for GET and HEAD commands.

send_header(keyword, value)

Send a MIME header to the headers buffer.

send_json_response(data)

Send JSON response.

send_response(code[, message])

Add the response header to the headers buffer and log the response code.

send_response_only(code[, message])

Send the response header only.

serve_graph_info()

Serve basic graph information.

serve_main_page()

Serve the main HTML page.

serve_search()

Serve search results.

serve_subsystem_graph(subsystem)

Serve graph for a specific subsystem.

serve_variable_graph(variable)

Serve graph focused on a specific variable.

translate_path(path)

Translate a /-separated PATH to the local filename syntax.

version_string()

Return the server software version string.

MessageClass

finish

flush_headers

setup

__init__(conn_graph, *args, **kwargs)[source]

Initialize the handler.

create_text_graph(subgraph, title)[source]

Create a simple text-based graph representation when Graphviz is not available.

Parameters:
subgraphnetworkx.DiGraph

Graph to represent.

titlestr

Title for the generated view.

Returns:
str

HTML string containing a simple graph representation.

do_GET()[source]

Handle GET requests.

get_html_template()[source]

Get the HTML template.

Returns:
str

HTML template content.

get_query_param(param, default='')[source]

Get query parameter value.

Parameters:
paramstr

Query parameter name.

defaultstr

Default value if parameter is not present.

Returns:
str

Parameter value or the default.

get_subsystems()[source]

Get list of unique subsystems.

Returns:
list of str

Sorted list of subsystem pathnames.

send_json_response(data)[source]

Send JSON response.

Parameters:
datadict

Object to serialize as JSON.

serve_graph_info()[source]

Serve basic graph information.

serve_main_page()[source]

Serve the main HTML page.

serve_search()[source]

Serve search results.

serve_subsystem_graph(subsystem)[source]

Serve graph for a specific subsystem.

Parameters:
subsystemstr

Subsystem pathname to focus on.

serve_variable_graph(variable)[source]

Serve graph focused on a specific variable.

Parameters:
variablestr

Variable name to focus on.