Documentation Index
Fetch the complete documentation index at: https://mintlify.com/CspmIT/centinela-front/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Gauge component renders a speedometer-style indicator ideal for displaying real-time measurements like pressure, flow rate, temperature, or any numeric value within a defined range. Features include animated needle, progress bar, and “no data” state handling.Props
Current sensor value to display. Set to
null, undefined, '', or NaN to show “Sin datos” (no data) state.Maximum value on the gauge scale. Defines the upper limit of the arc.
If
maxValue is invalid or not provided, defaults to 1 to prevent division errors.Primary color for the progress arc, needle, and anchor. Accepts hex color codes.
Unit of measurement displayed after the value (e.g., “m³/h”, “°C”, “PSI”).
Primary description text displayed below the value (e.g., sensor name or location).
Secondary description displayed above the gauge as a title.
Visual Design
Gauge Arc Configuration
Start Angle
210° - Arc begins at bottom-left
End Angle
-30° - Arc ends at bottom-right (creates 240° total sweep)
Radius
95% of container - Maximizes use of available space
Progress Bar
Width
22px rounded bar overlaying the background arc
Style
Linear gradient from light to dark based on
color prop:- Offset 0:
#c7d2fe(light tint) - Offset 0.5: Custom
color - Offset 1:
#312e81(dark tint)
#cbd5e1)Round Cap
Enabled - Creates smooth rounded ends on the progress bar
Background Arc
Width: 22px Color: Semi-transparent blue-gray (#657EB333)
Function: Shows the full scale range behind the progress bar
Scale Markings
Split Lines
Length: 10pxWidth: 2pxColor: Medium gray (
#9ca3af)Major tick marks distributed evenly across the arcAxis Labels
Distance: 25px from arcSize: 10pxColor: Medium gray (
#9ca3af)Weight: 450 (medium)Shows numeric values at major divisionsAxis Ticks
Hidden - Only split lines (major ticks) are shown
Needle Configuration
Length
65% of gauge radius
Width
6px
Color
Matches
color prop when data available, gray (#9ca3af) when no dataCenter Anchor (Hub)
Size
26px circle at needle pivot point
Style
Dark background (
#111827) with 8px border in color (or gray if no data)Z-Index
Above needle for realistic layering effect
Text Display
The gauge shows two text areas:Value Display (Detail)
Position: 85% from top (below center) Format:{value} {unit} on first line, {description} on second line
Styling:
- Value: 24px bold, dark gray (
#111827) - Description: 22px regular, medium gray (
#4b5563)
toFixed(2)
Title Display
Position: 75% from top Content:description2 prop
Styling: 16px, dark gray (#374151)
Validation Logic
The component uses a validation helper to determine data availability:- Null/undefined values
- Empty strings
- Non-numeric data (NaN)
- Valid numbers (including 0)
Usage Examples
Pressure Gauge
Flow Rate Meter
Temperature Monitor
pH Level Indicator
Chlorine Residual
Multi-Gauge Dashboard
Animation
Value Animation: Disabled by default (
valueAnimation: false) for instant updates. Enable in source code for smooth needle transitions.Color Recommendations
| Measurement Type | Suggested Color | Hex Code |
|---|---|---|
| Pressure | Blue | #3b82f6 |
| Flow Rate | Green | #10b981 |
| Temperature | Orange | #f59e0b |
| pH Level | Purple | #8b5cf6 |
| Turbidity | Amber | #f59e0b |
| Chlorine | Green (bright) | #22c55e |
| Alarms/Critical | Red | #ef4444 |
Responsive Considerations
The gauge scales to fit its container. Recommended minimum size:Accessibility
- Include units in the
unidadprop for clarity - Use descriptive text in
descriptionanddescription2 - Ensure sufficient color contrast between gauge elements and background
- Consider providing a text-based alternative for screen readers
Performance
- Rendering: Canvas-based (efficient for real-time updates)
- Updates: Re-renders on prop changes only (memoize parent data when possible)
- Animation: Disabled by default for performance
Related Components
- Liquid Fill - For percentage-based measurements
- Line Chart - For historical trends of gauge values
- Boolean Chart - For binary state indicators
Source Reference
File:~/workspace/source/src/modules/Charts/components/GaugeSpeed.jsx:9
Built with Apache ECharts for the Centinela water treatment monitoring system.