Orthogonal Layout
Discover concepts, use cases, and practical customization of the orthogonal layout

The orthogonal layout arranges graph elements so that all edges run exclusively at right angles, horizontally and vertically, to produce highly readable, grid-like diagrams. It's ideal for software architecture, UML, circuit diagrams, database schemas, and other technical or structured data visualizations.

Orthogonal layout example

What is an orthogonal layout?

In graph visualization, orthogonal layout is a positioning algorithm that arranges nodes and edges so that all connections run exclusively at 90 degree angles (horizontally and vertically).

This creates grid-like diagrams that are particularly effective for things like visualizing code structures, control networks, and business processes.

Orthogonal layouts reduce visual noise by aligning data in a strict grid, making complex relationships easier to follow.

It works best when:

  • You want right-angle connections
  • Minimal edge crossings and bends are important
  • A clear, grid-like structure improves readability
Orthogonal Layout Sample

Create your own orthogonal diagram application

Whether you're building UML class diagrams, circuit schematics, business process models, or custom technical visualizations: yFiles' orthogonal layout arranges your data into clear, professional diagrams automatically—no manual alignment needed.

The advanced orthogonal layout algorithm instantly positions thousands of nodes and routes all edges at right angles, creating orderly, grid-based structures with minimal crossings and bends—even in large, interconnected networks.

Bring your diagrams to life with interactive features: rearrange nodes on the grid, highlight logical flows, auto-route connections, and enable seamless exploration of complex structures—on the web, in any framework, and on your preferred platform.

Build your first orthogonal graph application today—for free!

Start now
Orthogonal graph example

Use cases Real-world applications of yFiles' orthogonal layout in technical diagram visualization

From UML class diagrams and software architecture to electronic schematics and activity diagrams, orthogonal routing eliminates visual clutter and accurately represents relationships, dependencies, and logical flows.

UML class diagrams

By arranging nodes and edges exclusively along vertical and horizontal lines, the orthogonal layout keeps class relationships, inheritance chains, and interface implementations immediately clear—no matter the complexity of your code base.

In yFiles, orthogonal layout minimizes edge crossings and bends, aligning classes and their connections perfectly to a logical, grid-based framework. The result: class hierarchies and associations are presented in a clean, accessible format that accelerates code understanding and onboarding.

UML class diagram
UML class diagram

Flow and activity diagrams

Orthogonal layout excels at visualizing flowcharts, activity diagrams, and process workflows—types of diagrams where clear, direct flows and easy path-following are essential.

The layout makes process steps, control flows, and alternative branches easy to trace from start to finish. With yFiles, you can interactively build, update, and rearrange flow and activity diagrams. The orthogonal layout adapts instantly, keeping everything structured, readable, and aesthetically consistent—whether diagramming business processes, software logic, or organizational workflows.

Flow chart/Activity diagram
Flow chart/Activity diagram

CAD-like visualizations

Langner, Inc. uses yFiles' orthogonal layout to visualize complex industrial control networks in a clear, CAD-style manner. This approach helps represent digital assets and their connections with right-angle edges, making diagrams familiar and easy to understand for users. The ability to minimize edge crossings and bends improves clarity and usability, which is crucial for cybersecurity risk assessment in critical infrastructure like power plants and factories. By integrating yFiles, Langner's OTbase software offers fast, interactive network visualization with export options such as Visio, enhancing both security oversight and user adoption.

Langner, Inc. case study
CAD-style industrial control network visualization
CAD-style industrial control network visualization

Core principles of the orthogonal layout Take control of structure and clarity

Grid placement

First of all, one of the key principles is that nodes are positioned on a grid. This sets orthogonal layout apart from other types, such as hierarchical layout, where node placement is more flexible. The grid-based positioning in orthogonal layouts enforces strict horizontal and vertical alignment, which helps maintain a clean and structured visual organization throughout the diagram.

Orthogonal layout operates on the basic assumption that both nodes and edge segments are placed on a grid. This introduces certain constraints, but also helps achieve a clean and structured layout. The layout algorithm aims not only to reduce the number of bends and crossings, but also to minimize the overall grid area used, resulting in a more compact drawing.

Grid placement in orthogonal layout

Kandinsky model

Another key assumption is the use of the Kandinsky model. In early scientific applications of orthogonal layouts, it was assumed that each node could have at most one edge per side, meaning a maximum of four incident edges. This was too limiting for many real-world use cases, where nodes often have higher degrees. The Kandinsky model addressed this by allowing multiple edges per side.

In this model, one edge can exit a side without bending (the center edge), while the others bend slightly away from it, those on the left side bend left, and those on the right bend right. This approach allows for higher-degree nodes while maintaining the orthogonal structure and explains some of the bending behavior you might observe in such diagrams.

Kandinsky model in orthogonal layout

Crossing minimization

The process begins with an arbitrary input graph. In the first step, the algorithm fixes the topology. This means it places nodes on the plane and determines the order in which edges leave each node, creating a rough layout. From this, it can identify edge crossings. The goal here is to minimize crossings, which is done through an optimized algorithm. Any remaining crossings are replaced with dummy nodes so that the resulting graph can be processed without any actual edge overlaps. If the input graph can be drawn without crossings, the algorithm will produce such a layout.

Crossing minimization in orthogonal layout

Bend minimization

Next is the shape step, where the structure of each edge is defined. The algorithm determines which segments are horizontal or vertical and where the bends occur, but not yet how long each segment should be. At this point, it also aims to minimize the number of bends, keeping the visual structure as simple as possible.

Bend minimization in orthogonal layout

Compactness optimization

Finally, in the coordinate assignment step, the layout engine assigns exact positions to all nodes and edges on a grid. It determines the lengths of edge segments and ensures the drawing is as compact as possible by minimizing the width and height of the diagram.

Concepts recap

Concept Meaning
Grid placement Nodes and edge segments are aligned to invisible grid lines, ensuring horizontal and vertical arrangement.
Kandinsky model Allows multiple edges per node side while maintaining orthogonal constraints by assigning bend directions.
Crossing minimization Reduces the number of edge crossings to improve readability in dense diagrams.
Bending minimization Minimizes the number of bends in edge paths for a cleaner, more structured appearance.
Compactness optimization Produces the smallest possible diagram area by tightly packing nodes and minimizing unused space.

Watch the full webinar episode

Watch the full episode below to gain a comprehensive understanding of orthogonal layouts in yFiles. Dr. Benjamin Niedermann walks you through the core concepts and provides practical demonstrations.

Explore more resources:

Video Thumbnail
load from YouTube

Watch the full episode below to gain a comprehensive understanding of orthogonal layouts in yFiles. Dr. Benjamin Niedermann walks you through the core concepts and provides practical demonstrations.

Video Thumbnail
load from YouTube

Explore more resources:

Interactive orthogonal layout demos

Discover a selection of interactive demos showcasing different orthogonal layout features in yFiles. Explore how various layout options help visualize complex structured data clearly and intuitively.

Step-by-step guide How to create an orthogonal layout with yFiles

Creating an orthogonal graph layout with yFiles takes just a few steps:

1. Create the network from business data

Start by initializing the graph structure and define a basic orthogonal layout.

2. Make information visible

Next, add more information to the graph by adding labels, applying colors, defining item sizes, etc. All dynamically based on the given data.

3. Improve arrangement

Further improve item placement, e.g., align raw materials at the start of the diagram.

4. Apply different layout options

The orthogonal layout offers various options, such as controlling the grid spacing and bend styles, which help you reduce visual clutter by minimizing edge bends and aligning nodes precisely on the grid for clearer, more structured diagrams.
Playground sample - Orthogonal Layout

Interactive orthogonal layout playground

The Playground lets you experiment with yFiles' orthogonal layout interactively. Create, edit, and style graphs, adjust layout parameters, and see results instantly—all in one online IDE. Discover how easy it is to prototype and design graph-based applications with yFiles.

graph.nodeDefaults.size = [70, 70]; graph.nodeDefaults.style = new ShapeNodeStyle({ shape: ShapeNodeShape.ELLIPSE, cssClass: "node", }); graph.nodeDefaults.labels.style = new LabelStyle({ shape: LabelShape.PILL, backgroundFill: "white", backgroundStroke: "1px solid #6A8293", font: "15px poppins", textFill: "#6A8293", }); graph.edgeDefaults.labels.style = new LabelStyle({ shape: LabelShape.PILL, backgroundFill: "#6A8293", backgroundStroke: "1px solid white", font: "15px poppins", textFill: "white", }); graphComponent.fitGraphBounds()

Why use yFiles' orthogonal layout? Unique capabilities for orthogonal layouts you won't find in other SDKs.

While many software development kits (SDKs) can generate orthogonal layouts, only yFiles provides these game-changing advantages, like grid-perfect positioning, and crossing minimization:

Grid-perfect positioning
Nodes snap to invisible grid lines for consistent, professional visuals.
Intelligent edge routing
Automatically finds optimal, obstacle-free paths without manual adjustment.
Crossing minimization
Advanced algorithms reduce edge crossings to maintain clarity in dense networks.
Automatic spacing
Dynamic spacing adapts to content density, avoiding clutter or excessive white space.
Labeling
No matter how beautiful a graph is arranged, most graphs rely on labels to provide context for their nodes and edges. The Orthogonal Layout calculates unambiguous placements for those labels that make them easy to read and leave no doubt which labels belong to which graph elements.
Grouped graphs
Not all information in a graph has to be expressed with node-to-node relations. Oftentimes the nodes can be subdivided into groups that represent other relationships than the edges. The Orthogonal Layout can handle any hierarchically grouped graph to provide insight into the different node relations at a glance. Orthogonal Layout: Grouped graph
Substructures
Network data often contains multiple substructures such as cycles, chains or trees. These patterns can be just as meaningful as the individual relations between nodes. The Orthogonal Layout automatically detects these structures and offers the option to highlight them by applying individual substructure layouts and integrating them seamlessly into the drawing. Orthogonal Layout: Substructures
Oriented edge drawings
The Orthogonal Layout is designed to enhance the visualization of your data by supporting custom layout orientations. Whether you want edges to flow with the main layout orientation (like from top-to-bottom), or be independent of it, this flexibility allows you to effortlessly highlight trends, illustrate inheritance, and emphasize order within your dataset. Orthogonal Layout: UML directed sample

Ideal for diagrams requiring strict alignment, clear spatial relationships, and compliance with engineering or regulatory standards, this layout eliminates diagonal connections and visual noise. It also supports hierarchical clustering to group related elements naturally.

All of this runs efficiently on yFiles' robust engine, capable of handling thousands of nodes with smooth, real-time layout updates and animations.

Frequently Asked Questions

What makes orthogonal layout different from hierarchical?

Orthogonal layout uses 90 degree edges and a grid-based alignment. Hierarchical layout emphasizes direction and flow (e.g., top-to-bottom), and may allow diagonal or curved edges.

How do I reduce the number of bends in an orthogonal layout?

You can adjust the bend cost in the layout configuration. Increasing bend cost encourages straighter edge paths, while reducing it allows more flexibility in routing.

What happens if my graph contains cycles or loops?

Orthogonal layout handles cycles well, especially in technical diagrams. However, you might need to use layout data to hint at grouping or edge direction if clarity drops with dense loops.

When should I choose orthogonal layout over other layout types?

Choose orthogonal layout when you need precise, technical diagrams such as UML class diagrams, circuit schematics, database schemas, or any visualization where grid alignment and right-angle connections improve clarity.

Can orthogonal layout handle large graphs?

Yes, yFiles' orthogonal layout is well suited for small and medium-sized sparse graphs and can handle thousands of nodes while maintaining real-time interactivity.

Recap

Orthogonal layout

Orthogonal layout is a specialized graph visualization technique that arranges nodes and edges along horizontal and vertical lines, ensuring all connections follow clean right angles. This approach excels in technical diagrams where clarity and structure are paramount, such as UML, and flow/activity diagrams, circuit schematics, and CAD-like visualizations.

The yFiles SDK offers a robust orthogonal layout engine that creates professional, grid-based diagrams automatically. With advanced features—such as customizable grid placement, Kandinsky model multi-edge routing, crossing and bend minimization, and real-time, animated updates—yFiles’ orthogonal layout adapts to any diagramming need. As detailed in core principles, use cases, and key benefits, yFiles integrates easily into various technical applications, allowing developers to leverage high performance and fine-grained customization across platforms.

To learn more or implement your own grid-perfect diagrams, explore the sections on about the layout, step-by-step guide, or try out live examples.

Related content

Got questions about
the orthogonal layout?

Email: hello@yworks.com
Phone: +49 7071 9709050

Get in touch

Start building your first
orthogonal diagramming application!

Download yFiles for free!

Choose your next steps

Get connected

Connect with our Customer Success Team regarding your ideas or projects.

Connect with the real graph drawing experts.

Dive deep

Get more detailed information about specific yFiles topics.

Download yFiles

Try yFiles free of charge.

Download the yFiles trial version.