@graphty/graphty-element / session / AttributeDescriptor
Interface: AttributeDescriptor ​
Defined in: graphty-element/src/catalog/types.ts:900
One attribute available on this session, whether it was imported, joined or computed.
Properties ​
completeness ​
completeness:
number
Defined in: graphty-element/src/catalog/types.ts:920
The fraction of elements that carry a value, from 0 to 1.
kind ​
kind:
"node"|"edge"
Defined in: graphty-element/src/catalog/types.ts:908
max? ​
optionalmax?:number
Defined in: graphty-element/src/catalog/types.ts:923
measurement? ​
optionalmeasurement?:Measurement
Defined in: graphty-element/src/catalog/types.ts:915
What the values measure. Inferred as "categorical" for strings and booleans and "quantitative" for numbers; "ordinal" and "time" are never inferred. A column of number codes needs a data.declare to be read as groups. Absent for a column with no values.
measurementSource? ​
optionalmeasurementSource?:MeasurementSource
Defined in: graphty-element/src/catalog/types.ts:917
Who said so. Present exactly when measurement is.
min? ​
optionalmin?:number
Defined in: graphty-element/src/catalog/types.ts:922
name ​
name:
string
Defined in: graphty-element/src/catalog/types.ts:905
origin ​
origin:
"imported"|"joined"|"computed"|"result"
Defined in: graphty-element/src/catalog/types.ts:918
path ​
path:
string
Defined in: graphty-element/src/catalog/types.ts:902
The column's key, data.<name>, with the name unquoted; see Path. Quote it with quotePath before using it inside an expression.
plainName ​
plainName:
string
Defined in: graphty-element/src/catalog/types.ts:906
roles? ​
optionalroles?: readonlyAttributeRole[]
Defined in: graphty-element/src/catalog/types.ts:936
What the column does for the graph: the roles it plays, read from the data configuration (data.knownFields) and the last load. Absent when it plays none. A column named with spaces (shared chapters) is matched by its literal name.
const key = session.data.attributes().find((a) => a.roles?.includes("key")); // the node idsrunId? ​
optionalrunId?:string
Defined in: graphty-element/src/catalog/types.ts:926
Set when the attribute came from a run.
sampleValues ​
sampleValues: readonly
unknown[]
Defined in: graphty-element/src/catalog/types.ts:924
technicalName ​
technicalName:
string
Defined in: graphty-element/src/catalog/types.ts:907
token ​
token:
string
Defined in: graphty-element/src/catalog/types.ts:904
The bracketed form a formula uses, such as "[betweenness_centrality]".
type ​
type:
"string"|"number"|"boolean"|"integer"|"time"|"category"|"mixed"
Defined in: graphty-element/src/catalog/types.ts:909
uniqueCount? ​
optionaluniqueCount?:number
Defined in: graphty-element/src/catalog/types.ts:921
usedBy? ​
optionalusedBy?: readonlyAttributeUse[]
Defined in: graphty-element/src/catalog/types.ts:946
What reads the column now: each style layer that selects or paints by it, in stack order, then each run that weighed its edges by it. Absent when nothing does. Together with roles this is "the attributes in use":
const inUse = session.data.attributes().filter((a) => a.roles !== undefined || a.usedBy !== undefined);