librrd playground

This dialog provides terse explanations of some details that you may not be able to figure out just by carefully studying and playing with the examples.

diagrams

Terminal stations can be written as "label" or 'label'.

Any diagram expression can be surrounded by braces {} in order to then specify a class, ID, or both.

Unwanted collapsing can be prevented with empty sequences.

layout stylesheets

The language is modeled after CSS. The selector language has 4 tags (terminal, nonterminal, sequence, stack); wildcard, class, and ID selectors; a :root pseudo-selector; and descendant and child combinators. Specificity and cascading is as in CSS. The possible properties are explained below.

align-items controls vertical alignment of a container's items. It is an inherited property. align-self on an item controls its own alignment, overriding the container. The possible values for both properties are top, center, bottom, and baseline. The default value is top. If two values are given for align-self, they apply to the left and right sides of the item, respectively.

justify-content controls horizontal justification of a container's items. It is an inherited property. The possible values are left, right, start, end, center, space-around, space-between, and space-evenly. The default value is space-between.

Other properties (all non-inherited) are

  • flex-absorb, a proportion between 0 and 1, default 0;
  • gap a nonnegative number, default 0;
  • continuation-marker, a string, default ; and
  • font, up to 4 space-separated strings, being the font family, style, weight, and size, respectively, taking their default values if omitted, which are sans-serif, normal, normal, and 1rem.

rendering stylesheets

This is literally CSS applied to the rendered SVG. Elements in the SVG have classes corresponding to the layout constructors, in addition to classes and IDs carried down from the diagram, and are nested in the same way as the diagram constructors (modulo intervening g tags). Don’t change the font (even though you can) because text extents (and hence the widths of stations) are computed at layout time, not rendering time, and depend on the font.