Skip to content

@graphty/graphty-element / session / ReadableValue

Interface: ReadableValue ​

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

One value a rule or a binding can read: the element's own node id, a data column, or a field a finished run published per element. session.data.readableValues() lists them all.

ts
for (const value of session.data.readableValues()) {
    console.log(value.path, value.plainName, value.kind, value.range ?? value.valueCount);
}
// "data.age" "age" "number" { min: 18, max: 64 }
// "results.louvain.group" "Community" "category" 6

Since ​

3.26.0

Properties ​

completeness ​

readonly completeness: number

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

The fraction of the nodes (or edges) that carry a value, from 0 to 1.


end? ​

readonly optional end?: "source" | "target"

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

Present on an edge entry that reads a value of the node at one end of each edge: path is graphty.source.<node path> or graphty.target.<node path>, and plainName, technicalName, kind, range and valueCount are the node value's (read over the nodes). A rule such as "edges whose source is Valjean" reads { kind: "text", reads: "graphty.source.data.name", mode: "exact", text: "Valjean" }, and a binding such as "width by the source's Connections" reads graphty.source.results.<run>.value.

Since ​

3.26.0


fits ​

readonly fits: readonly ReadableChannelKind[]

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

The kinds of channel on its half it can drive with no scale named: exactly the channels styles.proposeEncoding({ column }) proposes a binding for. Empty for the node id, which only a rule reads.


from ​

readonly from: "data" | "run" | "element"

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

Where it comes from.


holdsNodeIds? ​

readonly optional holdsNodeIds?: true

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

Present (true) on a node data column whose value on every node spells that node's own id, so a picker that lists the node id (path "id") can leave this column out, or the other way round. See AttributeDescriptor.holdsNodeIds.

Since ​

3.27.0


kind ​

readonly kind: ReadableValueKind

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

What kind of value it is. A partition's group is a category however its ids are spelled.


on ​

readonly on: "node" | "edge"

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

Whether nodes or edges carry it.


path ​

readonly path: string

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

What a rule or a binding reads: "id" for the node id (a rule's text leaf reads it), data.<name> for a data column, results.<run>.<field> for a run's field. Distinct for every entry, so the node id and a data column named id are two entries.


plainName ​

readonly plainName: string

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

The catalog name: the column's own name, the field's plain name, or "Node id".


range? ​

readonly optional range?: object

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

The lowest and highest value, for a number.

max ​

readonly max: number

min ​

readonly min: number


runId? ​

readonly optional runId?: string

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

The run that published it, when from is "run".


technicalName ​

readonly technicalName: string

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

The name a technical reader knows it by.


tests ​

readonly tests: readonly RuleTestKind[]

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

The rule leaves that can test it, so a condition editor offers the tests the value supports after the reader picks it: see RuleTestKind. A number with few enough distinct values to count is offered both number and category tests.

Since ​

3.26.0


usedBy? ​

readonly optional usedBy?: readonly AttributeUse[]

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

What reads it now: each style layer that selects or paints by it, in stack order, then (for a data column) each run that weighed its edges by it. Absent when nothing does, so a picker can list the values already in use first.

Since ​

3.26.0


valueCount? ​

readonly optional valueCount?: number

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

How many distinct values, for a category or a yes-or-no, and for a number when the column holds few enough distinct values to count (256 or fewer): College football's conference column of the codes 0 to 11 has 12, so "one color per value" through the ordinal scale can be offered for it.


valuesAreColors? ​

readonly optional valuesAreColors?: true

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

Present (true) when every value is text the element reads as a color, so the passthrough scale paints it as it is. See AttributeDescriptor.valuesAreColors.

Since ​

3.26.0