#load "helpers.uce" COMPONENT(Request& context) { DValue asset_props; asset_props["css"]["0"] = "themes/common/css/gauges.css"; asset_props["js"]["0"] = "components/gauges/common.js"; print(component("../theme/assets", asset_props, 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(); DValue 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(); ?>
}