The data object bound to a D3 element. Must be an
object when accessor is a string; passing null or
undefined will produce a non-actionable runtime error
from the property lookup. Validate beforehand with the
=== undefined || === null guard used by the binders.
Property key or function to extract the value.
The index of the element in its selection. Forwarded to function accessors and surfaced in the missing-property error to help locate the offending datum.
The extracted value of type T.
Resolves a DataAccessor to extract a value from a datum.
Two accessor shapes are supported:
Function accessor — invoked with
(datum, index)and the return value is used verbatim. The function may return any value, including falsy values (0,'',false,null); these are preserved and returned unchanged. Function accessors are NOT validated — if they throw, the error propagates to the binder.String accessor — treated as a property key on
datum. Presence is checked with theinoperator (NOT a truthiness/!= nullcheck), so properties whose value is0,'',false, ornullare still considered "found" and returned as-is. Only an actually-missing property triggers the helpful "Available properties: …" error.The returned value is asserted to be of type
Twithout runtime verification — callers that expect a specific shape (e.g. number) should either pass a typed function accessor or validate the result themselves.Use resolveAccessorOptional when an absent property should resolve to
undefinedinstead of throwing (e.g. optionalfill, outlier arrays).