Visio defaults to tabbing from shape to shape in the order that the shapes are added to the page. However, this can end up with an illogical order if you are trying to navigate a diagram with the keyboard, which is often an accessibility requirement. Fortunately, Visio provides a Diagram Navigation pane so that the tab order can be changed, but how does it do it? The following short video shows how the navigation order, displayed as numbers in each shape, is assigned a value as soon as the order is edited.
Accessibility is important in my current project, so understanding how this happens was important to understand, and to surface this order to JavaScript, as we want to list the shapes in a logical order too.
I managed this by adding a User.visNavOrder to the master shape of all the significant masters, and a hidden Shape Data row, labelled “Navigation Order“. This has the following formula for its value: