#load "helpers.uce" COMPONENT(Request& context) { starter_register_js("components/gauges/common.js", context); starter_register_css("themes/common/css/gauges.css", context); String gauge_id = first(context.props["id"].to_string(), "arcgauge-" + std::to_string((u64)time())); String title = context.props["title"].to_string(); String subtitle = context.props["subtitle"].to_string(); String style = context.props["style"].to_string(); DTree scale = context.props["scale"]; <>

0.0 ? gauge_clamp_value((value / max_value) * 100.0, 0.0, 100.0) : 0.0; f64 arc_length = round((pct / 100.0) * 157.08 * 10.0) / 10.0; String resolved_color = ""; if(merged["color"].get_type_name() == "array") resolved_color = gauge_range_color(merged["color"], value); else resolved_color = merged["color"].to_string(); if(resolved_color == "") { if(pct >= 85.0) resolved_color = "var(--error, #ef4444)"; else if(pct >= 60.0) resolved_color = "var(--warning, #f59e0b)"; else resolved_color = "var(--success, #10b981)"; } String display_value = gauge_format_number(value, precision) + merged["unit"].to_string(); String watermark_prefix = merged["watermark_prefix"].to_string(); ?>
}