mosaic
¶
get_network_ip
¶
get_network_ip() -> str
Detects the primary local network IP of the host machine.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
get_mosaic
async
¶
Serves the initial mosiac frame.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
get_valid_trials
async
¶
Scans the workdir for folders containing telemetry data.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
get_trial_viewer
async
¶
get_trial_viewer(
request: Request, trial_id: str
) -> HTMLResponse
Land here when clicking a trial.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
get_filter_schema
async
¶
Returns metadata for all available filter types, derived from Pydantic models.
Filter classes are auto-discovered from AnyFilter's union; no changes needed here when a new filter is added to filters.py.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
| Python | |
|---|---|
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 | |
get_plot_config_schema
async
¶
Returns PlotConfig's raw JSON schema, descriptions included - single
source of truth for the Plot Editor's and JSON editor's hover tooltips
(trial-viewer.ts), so a Field(description=...) change in plot_config.py
shows up in both without any manual sync. Properties are keyed by their
camelCase alias (e.g. "lineMode"), matching config.* in the frontend
and the JSON editor's own document, since PlotConfig's model_config
serializes by alias.
Uses GenerateJsonSchemaWithDefaults (settings.py - the same generator
the Dojo settings panel's own schema endpoint uses, not redefined here)
for two extras beyond plain model_json_schema(): each field's
description gets its default value appended, and each enum type in
$defs gets an x-enum-descriptions map of value -> attribute-docstring
(e.g. GridMode.ALL's own docstring), since standard JSON Schema's
enum keyword has no room for per-value metadata - that's what lets a
dropdown show a tooltip on "Major + Minor" itself, not just on the
Gridlines field as a whole.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
list_profiles
async
¶
List all saved profiles, including those in sub-folders.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
get_profile
async
¶
Return the saved profile (tabs + active index), validated against the schema.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
save_profile
async
¶
Save the current set of plot tabs as a named profile.
body is a plain dict (not _PlotProfile directly) so the legacy-format
discriminator in _parse_profile can run before Pydantic's own request
validation would otherwise reject an old-shaped payload with a 422 - in
practice the frontend only ever POSTs the current (tabs-based) format,
but accepting a legacy body here too keeps this endpoint's behavior
symmetric with get_profile. The Content-Length header is checked first
as a lightweight size guard. Sub-folder paths (e.g. 'project/baseline')
are supported; directories are created automatically.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
delete_profile
async
¶
Delete a saved profile.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
list_labs
async
¶
List all saved lab graphs with their input column requirements and output labels.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
| Python | |
|---|---|
get_lab
async
¶
Return the raw LiteGraph JSON for a saved lab.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
| Python | |
|---|---|
save_lab
async
¶
Save a LiteGraph graph JSON as a named lab.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
delete_lab
async
¶
Delete a saved lab.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
get_trial_data
async
¶
get_trial_data(
trial_id: str,
cols: str = Query(None),
filters: str = Query(None),
display_unit_system: str | None = Query(None),
max_points: int | None = Query(None, gt=0),
) -> dict[str, Any]
Loops over the columns in the trial_id provided and returns their data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trial_id
|
str
|
Trial to search (e.g. |
required |
cols
|
str
|
Comma separated list of column names to return data for (e.g. |
Query(None)
|
filters
|
str
|
String representation of filters to be applied sequentially. Defaults to Query(None). |
Query(None)
|
display_unit_system
|
str
|
Named unit system to convert data into before returning (e.g. |
Query(None)
|
max_points
|
int
|
Maximum number of data points per trace. When the raw data exceeds this limit the response is downsampled using uniform time-domain buckets. Defaults to Query(None). |
Query(None, gt=0)
|
Raises:
| Type | Description |
|---|---|
HTTPException
|
Raised if no shared.CURRENT_JOB was set. |
HTTPException
|
Raised if the database path for the trial was found. |
HTTPException
|
Raised if an error occured while extracting data from the database. |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict[str, Any]
|
Dictionary containing split columns and their associated data. |
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
| Python | |
|---|---|
899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 | |
list_trial_media
async
¶
Lists media files in the trial directory with their fps metadata.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
get_gif_as_webm
async
¶
Converts a GIF to WebM on-demand, cached in the system temp directory.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
get_trial_media_file
async
¶
Serves a single media file from the trial directory.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
get_trial_dists
async
¶
Returns per-trial distribution configs merged with sampled values and PDF/PMF data.
Source code in src/mujoco_mojo/utils/layers/dojo/routers/mosaic.py
| Python | |
|---|---|
1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 | |
get_trial_logs
async
¶
Parses and returns the per-trial log file.
Looks for mojo.log first; if absent, falls back to the first *.log
file (by name) found in the trial directory.