# ZigZag (software)

ZigZag is a data model, invented by Ted Nelson, that deconstructs the spreadsheet to allow irregular relations, at the same time generalizing the idea to multiple dimensions.
The design is centered on an information structure called a zzstructure and its interactive visualizations. Instead of conventional linear text or tree structures, zzstructure is a multidimensional extension of a spreadsheet whose cells can contain various kinds of data.
Whereas conventional spreadsheet software requires a rectangle of equal-length rows, the ZigZag model holds arbitrary structures of cells—as long as they are orthogonally connected (left edge to right edge, top edge to bottom, and so on in as many dimensions as desired).
At any moment, the display shows any two dimensions in table form, but only existing cells are shown—what would be empty space on a spreadsheet simply does not exist. Users can pivot the display about any cell to efficiently "rotate" any unseen dimension in place of either visible one, allowing them to browse high dimensional grids in a zigzag manner.

## Structure

Each cell may have at most one positive connection and one negative connection in any dimension. The user may step freely from a cell to any adjacent cell in a selected dimension. Each node exists on all dimensions, though it may or may not be connected to anything in that dimension.
Nelson calls this structure "hyperthogonal". He personally retains the ZigZag® trademark, the idea being that a user can zig and zag through structures in multiple dimensions.

## History

Nelson tells the origin of the idea in his autobiography, POSSIPLEX. The idea came to Nelson in 1981 in the following form: "Going rightward and downward might not necessarily get you to the same place as going downward and rightward." At that time Nelson was working at Datapoint in San Antonio, Texas. Since employees are generally required to report new software concepts to their employer, Nelson told his supervisor, Klavs Landberg. Landberg's reaction was "Get out of here with your crazy ideas." Nelson took this as permission to develop the idea independently.
The first prototype consisting of two character-graphical views was implemented as a Perl module by Andrew Pam in 1997. From 2000 to 2003, a free software project GZigZag (later Gzz) developed another prototype with more views and other conventions, but Ted Nelson stopped supporting it. The underlying zzStructure was a patented technology (U.S. patent 6,262,736). The patent expired on May 5, 2019. The Gzz prototype is available at xanadu.com/zigzag.

## Key demonstrations

Nelson's basic demo video shows how a person may be given a name, title, date of birth, spouse and children. This generalizes to a family-tree view.
Adam Moore, while at the University of Nottingham, used the GzigZag prototype to demonstrate an animated demonstration of biochemistry in a video.

## Possible directions of generalization

Since hyperthogonal structure is abstract, it can in principle be used for anything—data, visualization, programing, animation.
- Data and visualization: The data structures in the standard demo (marriage and children) become a visualization (a family tree, explorable, from Queen Elizabeth II, up to Queen Victoria).
- programming: Various abstractions have been posited to use ZigZag as a programming system, some of which were in Andrew Pam's 1996 prototype.
- text editing: Text editing was in the Azz prototype and is also possible in the Gzz package, though it is not emphasized.