pinakes-ui: format all rsx blocks
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I21e7b73da193609c5d15b7f19d9668f96a6a6964
This commit is contained in:
parent
b4ffd56460
commit
26db7279d6
4 changed files with 128 additions and 85 deletions
|
|
@ -437,12 +437,7 @@ fn ForceDirectedGraph(
|
|||
|
||||
div { class: "control-group",
|
||||
label { "Simulation Status" }
|
||||
span {
|
||||
style: if *simulation_active.read() {
|
||||
"color: #4ade80;"
|
||||
} else {
|
||||
"color: #94a3b8;"
|
||||
},
|
||||
span { style: if *simulation_active.read() { "color: #4ade80;" } else { "color: #94a3b8;" },
|
||||
if *simulation_active.read() {
|
||||
"Running"
|
||||
} else {
|
||||
|
|
@ -500,11 +495,13 @@ fn ForceDirectedGraph(
|
|||
if let Some(ref node_id) = *dragged_node.read() {
|
||||
let mut nodes = physics_nodes.write();
|
||||
if let Some(node) = nodes.iter_mut().find(|n| &n.id == node_id) {
|
||||
let dx = (evt.page_coordinates().x - *drag_start_x.read()) / current_zoom * 2.0;
|
||||
let dy = (evt.page_coordinates().y - *drag_start_y.read()) / current_zoom * 2.0;
|
||||
let dx = (evt.page_coordinates().x - *drag_start_x.read()) / current_zoom
|
||||
* 2.0;
|
||||
// Reset velocity when dragging
|
||||
let dy = (evt.page_coordinates().y - *drag_start_y.read()) / current_zoom
|
||||
* 2.0;
|
||||
node.x += dx;
|
||||
node.y += dy;
|
||||
// Reset velocity when dragging
|
||||
node.vx = 0.0;
|
||||
node.vy = 0.0;
|
||||
drag_start_x.set(evt.page_coordinates().x);
|
||||
|
|
@ -561,7 +558,11 @@ fn ForceDirectedGraph(
|
|||
ref_x: "9",
|
||||
ref_y: "3.5",
|
||||
orient: "auto",
|
||||
polygon { points: "0 0, 10 3.5, 0 7", fill: "#666", fill_opacity: "0.6" }
|
||||
polygon {
|
||||
points: "0 0, 10 3.5, 0 7",
|
||||
fill: "#666",
|
||||
fill_opacity: "0.6",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -599,6 +600,7 @@ fn ForceDirectedGraph(
|
|||
drag_start_y.set(evt.page_coordinates().y);
|
||||
},
|
||||
|
||||
|
||||
circle {
|
||||
cx: "{node.x}",
|
||||
cy: "{node.y}",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue