The diagram builder allows you to create visual representations of your water treatment facility with live data overlays. Build process flow diagrams, equipment layouts, and system schematics that update in real-time.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
Diagrams combine:- Background images or colors
- Equipment icons and symbols
- Lines and connections
- Text labels
- Live variable data overlays
- Interactive tooltips
Creating a Diagram
Set Background
Configure the canvas background:
- Solid color (backgroundColor)
- Background image (backgroundImg)
Add Elements
Use the sidebar tools to add:
- Images (equipment, icons)
- Lines (pipes, connections)
- Polylines (complex paths)
- Text labels
- Variable displays
Canvas Tools
The diagram builder provides multiple drawing and editing tools:Navigation Tools
Click and drag to move around the canvas. Useful for large diagrams.Activation: Click pan icon or press and hold middle mouse button
Zoom in/out to view details or get overview.Controls:
- Zoom In button (+)
- Zoom Out button (-)
- Mouse wheel scroll
Drawing Tools
Draw straight connections between two points.Usage:
- Select line tool
- Click start point
- Click end point
- Configure line style (color, width)
Draw multi-segment paths for complex piping routes.Usage:
- Select polyline tool
- Click each vertex point
- Press Enter to finish or right-click
- Press Escape to cancel
Add text labels to the diagram.Features:
- Custom font size
- Color selection
- Bold/italic styling
- Editable after placement
Place equipment icons and symbols.Available Images:
- Pumps and motors
- Tanks and vessels
- Valves and actuators
- Sensors and instruments
- Piping components
Add floating variable displays that show live data.Display Types:
- Numeric values
- Percentage bars
- Boolean indicators
- Binary bit status
/src/modules/DrawDiagram/views/DrawDiagram.jsx:25-118
Element Configuration
Image Elements
Images represent equipment and can display associated variable data.Line Elements
Lines represent pipes, connections, or flows.Hexadecimal color code for the line
Line thickness in pixels (1-20 recommended)
Polyline Elements
Polylines create complex paths with multiple segments./src/modules/DrawDiagram/hooks/useDrawingTools.js
Text Elements
Text elements provide labels and annotations.Font size in pixels (8-72 recommended)
Text color in hexadecimal
Font style:
normal, bold, or italicVariable Data Overlay
Variables can be overlaid on diagram elements to show live values.Position Options
- Top
- Centro (Center)
- Bottom
Display variable value above the element.Best for: Tank levels, overhead indicators
Variable Display Types
Numeric Display
Numeric Display
Shows the current numeric value with optional units.Displays:
45.2 L/minPercentage Display
Percentage Display
Shows value as a percentage of maximum.Displays:
75% (if current value is 750)Boolean Display
Boolean Display
Color-coded indicator for on/off states.Displays: Green dot (ON) or Red dot (OFF)
Binary Bit Display
Binary Bit Display
Shows status of a specific bit in a binary variable.Use Case: Monitoring individual flags in a status word
/src/modules/DrawDiagram/hooks/useTooltipManager.js:116
Diagram Metadata
Each diagram stores metadata for configuration:/src/modules/DrawDiagram/views/DrawDiagram.jsx:50-55
Saving and Loading Diagrams
Save Diagram
/src/modules/DrawDiagram/views/DrawDiagram.jsx:192-250
Load Diagram
/src/modules/DrawDiagram/views/DrawDiagram.jsx:372-387
Keyboard Shortcuts
| Key | Action |
|---|---|
| Escape | Cancel current tool/operation |
| Delete | Delete selected element |
| Enter | Finish polyline drawing |
| Right-click | Cancel line/polyline or finish polyline |
/src/modules/DrawDiagram/views/DrawDiagram.jsx:287-317
Element Layering
Control the stacking order of diagram elements:- Bring to Front
- Send to Back
Move selected element to the top layer.Use Case: Make important elements visible above pipes/lines
/src/modules/DrawDiagram/views/DrawDiagram.jsx:76-77
Canvas Controls
Zoom Controls
/src/modules/DrawDiagram/views/DrawDiagram.jsx:266-274
Undo Function
Remove the most recently added element:/src/modules/DrawDiagram/views/DrawDiagram.jsx:252-264
Best Practices
Diagram Organization
Diagram Organization
- Create separate diagrams for different process areas
- Use consistent icon styles across diagrams
- Group related equipment visually
- Maintain clear flow direction (left-to-right or top-to-bottom)
Line Routing
Line Routing
- Use polylines for complex piping routes
- Avoid crossing lines when possible
- Use different colors for different media (water, chemicals, air)
- Keep line widths proportional to actual pipe sizes
Variable Display
Variable Display
- Show only critical variables on overview diagrams
- Position displays to avoid overlap
- Use consistent positioning (e.g., all flow rates at bottom)
- Consider percentage displays for capacity metrics
Performance
Performance
- Limit diagrams to 50-100 elements for optimal performance
- Use background images sparingly (large files slow rendering)
- Create detail diagrams for complex areas rather than one massive diagram
Troubleshooting
Elements Not Appearing
Elements Not Appearing
Possible Causes:
- Element positioned outside visible canvas area
- Element behind other elements (layer order)
- Element color matches background
- Use pan and zoom to search
- Check element layer order
- Select element from element list
Variable Data Not Updating
Variable Data Not Updating
Checklist:
- Variable exists and has data
- Variable ID correctly assigned to element
- Display position configured
showproperty istrue
Cannot Select Element
Cannot Select Element
Causes:
- Element not draggable (lines, polylines)
- Another tool is active
- Element behind non-draggable element
- Press Escape to cancel active tool
- Use layer controls to bring element forward
- Click element edge/corner for better selection
Diagrams are rendered using Konva.js, a high-performance HTML5 canvas library. All drawing operations are hardware-accelerated for smooth interaction even with complex diagrams.
