category

The category block defines a category for a graph node or edge. Categories are used to define display properties for the item, such as the color, icon, and folding options.

Example Usage

A category may be defined as a top-level, named resource block, or as a block inside a graph, flow, or hierarchy. If defined as a top-level resource, the category will be available to all graph nodes and edges, and you can set it on a node or edge using the category HCL property:

If defined as a block inside a graph, flow, or hierarchy, the category will only be available to that graph, flow, or hierarchy. In this case, you cannot set the category with category HCL property, but can set it dynamically for each row in the SQL result set using the category column:

The inline category block is useful when you want to define a category dynamically based on the SQL result set. You can even use the base property in the inline category to inherit properties from a named category:

Argument Reference

ArgumentTypeOptional?Description
colorStringThe matching color from the default theme for the data series index.A valid color value. This may be a named color, RGB or RGBA string, or a control status color.
hrefStringOptionalA url that the item should link to. The href may use a jq template to dynamically generate the link.
iconStringOptionalAn icon) to use for the elements with this category.
titleStringOptionalA plain text title to display for this category.
foldBlockOptionalA fold block for this category.

Folding

The graph resource supports folding, allowing you to collapse multiple nodes that have the same category into a single node. You can click to expand or collapse the folded nodes. To be considered for folding, the nodes must have the same category and the same edges.

By default, folding is enabled with a threshold of 3. This means that if there are 3 or more nodes with the same category and edges, they will be folded into a single node. You can change the fold options in the fold block in the category definition. The fold block has the following properties:

ArgumentTypeOptional?Description
iconStringOptionalAn icon) to use when this category is folded. If not specified, the category icon will be used.
titleStringOptionalA plain text title to display for this category. If not specified, the category title will be used.
thresholdNumberOptionalThe number of items that should be displayed before folding. The default is 3.

More Examples

Category with Material Symbol Icon

Category with Heroicons Icon

Category with Text Icon

Category with fold properties