ui: XY plot in the results panel, drawn by the energy plot's code (#94)

XY Plot opens a section in the results panel: a quantity picker, the
series from results.xy plotted against the step's own axis with the
frame or mode shown marked (a click shows the nearest), nodal fields
read at the probed node, and Export CSV through results.xy. The energy
plot and the XY plot share one line-plot function.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
jyvikoandClaude Opus 5.5 authored and Irakli Kourtis committed 2026-10-16 05:31:33 -04:00
1 parent 9a8469cf4b
commit 4a8d34d619
4 files changed
+330 -49

No files matched your search

+5
View File
@@ -125,6 +125,11 @@ pub fn done(command: &str, label: &str, params: &Value, v: &Value) -> String {
None => format!("Showing {step}, last frame"),
}),
"results.clear" => Some("Back to the model".to_string()),
"results.xy" => {
let points = v.get("points").and_then(Value::as_u64).unwrap_or(0);
let what = v.pointer("/y/label").and_then(Value::as_str).unwrap_or("the series");
Some(format!("Plotted {what}: {}", plural(points, "point")))
}
"file.sample" => {
let label = v.get("sample").and_then(Value::as_str).and_then(fieldcraft_engine::sample::find).map(|s| s.label);
label.map(|l| format!("Opened the {l} sample"))