Skip to content

@graphty/graph-io / styles / StyleRule

Interface: StyleRule ​

Defined in: styles/types.ts:1142

One rule of a file's styles. Rules are ordered bottom to top; per property the topmost matching rule that gives a value wins. A property is written by set or by map, never both, within one rule.

Properties ​

ext? ​

readonly optional ext?: Readonly<Record<string, unknown>>

Defined in: styles/types.ts:1163

JSON a consumer attaches for its own round trip, keyed by the consumer's package name; carried untouched and never interpreted.


facts? ​

readonly optional facts?: StyleRuleFacts

Defined in: styles/types.ts:1158

Facts an application may show.


id ​

readonly id: string

Defined in: styles/types.ts:1144

Stable within one extraction (node.defaults, node.by.Modularity Class).


map? ​

readonly optional map?: Partial<Record<StyleProperty, Mapping>>

Defined in: styles/types.ts:1156

Values computed per element.


origin ​

readonly origin: StyleRuleOrigin

Defined in: styles/types.ts:1150

Written by the file, recovered from its values, or the writing tool's default.


role ​

readonly role: StyleRuleRole

Defined in: styles/types.ts:1148

What the rule is.


set? ​

readonly optional set?: Partial<Record<StyleProperty, StyleValue>>

Defined in: styles/types.ts:1154

Constant values.


target ​

readonly target: StyleTarget

Defined in: styles/types.ts:1146

Nodes or edges.


where ​

readonly where: Predicate

Defined in: styles/types.ts:1152

Which elements the rule applies to.