Scoping

Each time an opening brace is put into the file, a new scope begins. Scopes behave similar as in programming languages, meaning that any color name or style definitions take their effect only within the scope, up to the closing brace. Thus if you redefine a style just after an opening brace, the style returns to its original definition after the closing brace. (See Defining Styles.)

Scoping also applies to the numbering (including pre, post, format and append), compress, vspacing, indicator, angle and text.* chart options. Any changes to these take effect only until the next closing brace. Scoping explicitly does not apply to background.* and comment.* options. Those take effect until the next such option or all the way to the bottom of the chart.

You can nest scopes arbitrarily deep and can also use the parallel block syntax with a single block to manually open a new scope, such as below.

...numbering is off here...
{
    #number only in this scope
    numbering=yes;
    ...various elements with numbers...
};
...other elements with no numbers...

Enclosing a set of elements in braces results in exactly the same layout as in case when they are not enclosed in braces (including the handling of compress, vspacing, keep_with_next and keep_together attributes and the use of parallel and overlap keywords)[40]. Thus if you mark an element between the braces with parallel elements after the closing brace can be laid out besides it[41].



[40] This is true only if you do not change the layout of the block, but use the default, see Parallel Blocks.

[41] However, you get extra tools, since marking the entire block with overlap or parallel will make elements after the block to be laid over or besides the whole block, respectively. See Parallel Keyword