Skip to content

@graphty/graphty-element / session / RuleTree

Type Alias: RuleTree ​

RuleTree = { kind: "expression"; where: Query; } | { attribute: Path; kind: "range"; max?: number; min?: number; } | { attribute: Path; kind: "categories"; values: readonly string[]; } | { direction?: SelectionDirection; kind: "degree"; max?: number; min?: number; } | { id: number; kind: "component"; } | { depth: number; kind: "neighborhood"; seeds: readonly NodeId[]; } | { kind: "isolated"; } | { kind: "self-loop"; } | { kind: "repeated-edge"; } | { kind: "edges"; where: Query; } | { kind: "member"; of: Scope; } | { item: ResultItem; kind: "item"; } | { above?: number; kind: "threshold"; path: Path; top?: number; } | { kind: "all"; of: readonly RuleTree[]; } | { kind: "any"; of: readonly RuleTree[]; } | { kind: "not"; of: RuleTree; }

Defined in: graphty-element/src/catalog/types.ts:1026

A rule tree: what the visibility filter keeps, and what a rule set holds.

Every leaf speaks about nodes, edges or both, and is SILENT about the rest: all and any fold the halves that are not silent, and not negates only those. edges, self-loop and repeated-edge speak edges; member speaks the referenced set's nodes, and its edges only when that set is read listed or clipped ("visible" is); item and threshold speak the half or halves their field lives on; every other leaf speaks nodes. A group with no members constrains nothing.

OPEN UNION: leaf kinds may be added in a minor release; handle unknown kinds.

Union Members ​

Type Literal ​

{ kind: "expression"; where: Query; }


Type Literal ​

{ attribute: Path; kind: "range"; max?: number; min?: number; }


Type Literal ​

{ attribute: Path; kind: "categories"; values: readonly string[]; }


Type Literal ​

{ direction?: SelectionDirection; kind: "degree"; max?: number; min?: number; }


Type Literal ​

{ id: number; kind: "component"; }


Type Literal ​

{ depth: number; kind: "neighborhood"; seeds: readonly NodeId[]; }


Type Literal ​

{ kind: "isolated"; }

The nodes with no edge to another node: each is a component of its own, so these are exactly the nodes data.statistics().components.isolatedCount counts. A node whose only edges are self-loops is one. Speaks nodes.


Type Literal ​

{ kind: "self-loop"; }

The edges whose two ends are the same node: statistics().selfLoopCount of them. Speaks edges.


Type Literal ​

{ kind: "repeated-edge"; }

The edges beyond the first between one pair of nodes, in the graph's edge order: exactly the edges statistics().repeatedEdgeCount counts. On an undirected graph a-b and b-a are one pair; on a directed graph they are two. Speaks edges.


Type Literal ​

{ kind: "edges"; where: Query; }


Type Literal ​

{ kind: "member"; of: Scope; }

The members of a scope, usually a kept set: { kind: "member", of: { set: id } }. A removed set is read from its kept record, so removing a set never changes what a rule holds.


Type Literal ​

{ item: ResultItem; kind: "item"; }

The elements one item of a result holds: community 3, the path's nodes and edges. Speaks the half or halves the result publishes the key's field on (onPath speaks both).


Type Literal ​

{ above?: number; kind: "threshold"; path: Path; top?: number; }

The elements whose value for a path passes one cut. The population is the elements that carry a finite number for the path; each half that has one speaks, ranked on its own. Reserved, refused until built: percentile, z and population.

above? ​

readonly optional above?: number

Strictly above this value. Exactly one cut.

kind ​

readonly kind: "threshold"

path ​

readonly path: Path

A value path: results.<run>.<field> or data.<field>.

top? ​

readonly optional top?: number

The top n, whole tie groups only (the TopRanking tie policy). Exactly one cut.


Type Literal ​

{ kind: "all"; of: readonly RuleTree[]; }


Type Literal ​

{ kind: "any"; of: readonly RuleTree[]; }


Type Literal ​

{ kind: "not"; of: RuleTree; }