pyrobosim.web.figure

Builds a Plotly figure from a PyRoboSim world, mirroring the matplotlib GUI.

Rendering is split into two layers:

  • Static geometry (rooms, hallways, locations, object spawns, resting objects, optional collision polygons) is drawn as layout.shapes. These polygons often have interior holes (e.g., a room’s wall ring), so they use SVG path shapes with an even-odd fill rule.

  • Dynamic content (planner graphs, and per robot: planner path, sensor data, body, orientation line, and any held object) is drawn as traces at stable indices, so it can be updated each frame with dynamic_patch() instead of rebuilding the whole figure.

Classes

RobotTraceData(path, sensors, body, ...)

The (x, y) data for one robot's dynamic traces, in trace order.

Functions

color_to_css(color)

Converts a PyRoboSim RGB color to a CSS rgb(...) string.

dynamic_patch(world, selected_robot)

Builds a Dash Patch updating only the dynamic per-robot trace data, leaving static shapes, planner graphs, and the layout untouched.

make_figure(world, *[, selected_robot, ...])

Builds a complete Plotly figure rendering a world, mirroring the GUI.

num_graph_traces(selected_robot)

Counts the traces emitted for planner graphs (two per graph: edges, nodes).