The Diagram Editor is a powerful Konva-based canvas tool that lets you create interactive process flow diagrams with real-time data visualization overlays.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
Create custom diagrams by combining images, lines, text, and live sensor data to build comprehensive visual representations of your water treatment processes.Visual Design
Drag-and-drop interface with extensive drawing tools and pre-built components.
Live Data
Bind InfluxDB variables to diagram elements for real-time monitoring.
Interactive
Zoom, pan, select, and transform elements with intuitive controls.
Export & Share
Save diagrams and share with your team for operational monitoring.
Drawing Tools
Access comprehensive drawing capabilities through the sidebar toolbar:Line Tools
- Straight Line
- Polyline
Click to set start point, click again to complete. Right-click or ESC to cancel.
- Color selection (HEX color picker)
- Stroke width (1-20px)
- Dash patterns (solid, dashed, dotted)
- Arrow indicators
Line Style Configuration
Line Style Configuration
Image Elements
Place on Canvas
Images appear at default position (150x, 150y) and can be dragged to desired location.
- Pumps and motors
- Tanks and vessels
- Valves and actuators
- Sensors and instruments
- Pipes and connectors
- Generic process symbols
Text Elements
Double-click on the canvas or use the text tool to add labels, annotations, and descriptions to your diagram.
- Font size (8-72px)
- Color selection
- Font style (normal, bold, italic)
- Real-time preview
Text Configuration
Text Configuration
Variable Overlays
Bind live sensor data to any diagram element:
Tooltip Position Panel:
Canvas Controls
Navigation
Pan
Enable pan mode to drag the canvas view. Click and drag to reposition.
Zoom In
Increase canvas scale by 5% per click for detailed editing.
Zoom Out
Decrease canvas scale by 5% per click for overview.
Element Management
Selection:- Click elements to select (blue transform border appears)
- Drag to reposition
- Use corner handles to resize
- Rotation handles for orientation adjustments
- Send to Back: Move selected element behind others
- Bring to Front: Move selected element above others
- Select element and press DELETE key
- Deleted items are tracked for database synchronization
Top Navigation Bar
The top toolbar provides quick access to common operations:- File Operations
- Edit Controls
- View Controls
- Save: Store diagram to database with metadata
- Clear: Remove all elements (with confirmation)
Diagram Management
Saving Diagrams
Saved Data Structure:
Editing Existing Diagrams
When opening a saved diagram (via URL parameter?id=123):
- System loads all elements from database
- Canvas reconstructs the complete diagram
- Variable bindings are restored
- Edit and save updates the existing record
New elements added during editing are tracked separately to optimize database updates. Only changed elements are synchronized.
Keyboard Shortcuts
| Key | Action |
|---|---|
| ESC | Cancel current drawing operation or deselect |
| ENTER | Finish polyline drawing |
| DELETE | Remove selected element |
| Right Click | Cancel line drawing or finish polyline |
Advanced Features
State Management
The diagram editor uses custom React hooks for organized state management:- useDiagramState: Elements, selection, deletion tracking
- useDrawingTools: Line, polyline, and image drawing logic
- useTooltipManager: Variable overlay configuration
- useTextTools: Text creation and editing
Performance Optimization
Efficient Rendering
Konva canvas uses WebGL for smooth rendering of complex diagrams.
Selective Updates
Only modified elements are synchronized with the database.
Background Customization
Set custom background colors or images for your diagrams:Use Cases
Process Flow Diagrams
Process Flow Diagrams
Create P&IDs (Piping and Instrumentation Diagrams) showing the complete water treatment process with pumps, tanks, valves, and flow directions.
Equipment Layouts
Equipment Layouts
Design facility layouts with equipment positions and overlay real-time operational status on each component.
Monitoring Dashboards
Monitoring Dashboards
Build custom visual dashboards that combine schematic representations with live sensor data for at-a-glance monitoring.
Training Materials
Training Materials
Develop annotated diagrams for training purposes, showing process flows and key measurement points.
Best Practices
Recommended workflow:- Plan your diagram layout before starting
- Use the zoom controls to work at comfortable detail levels
- Assign variables after completing the visual layout
- Test variable displays in view mode
- Use consistent naming for easy identification
- Document complex diagrams with text annotations
Viewing Diagrams
View Mode
Learn about viewing saved diagrams with live data updates in the Real-Time Monitoring section.
