style

style.colorEdgesByProperty

colorEdgesByProperty(property: string, options?: ColorMappingOptions & object): Promise<void>

Assign colors to edges based on the values of a property.

In "ordinal" mode (default), each unique value gets a distinct palette color unless colorMap explicitly maps it. In "sequential" mode, the numeric value is linearly interpolated between colorFrom and colorTo.

All SetEdgeColor commands are wrapped in a single labeled transaction — one undo step. Emits "style:changed".

propertystringName of the edge property to use for color mapping.
optionsColorMappingOptions & objectMapping mode, explicit color map, color range, and optional relationship filter.

Returns: Promise<void>

Example

await api.style.colorEdgesByProperty("type", { mode: "ordinal" });