Diagram-oriented graphical engine