Skip to content

Function: applySelectionEmphasis()

applySelectionEmphasis<T>(option, selected, opts?): T

Pure, declarative selection-emphasis transform for a built ECharts option.

Given one or more selected category names, returns a new option in which the matching data element(s) render at full prominence while the rest are dimmed via itemStyle.opacity. It is a no-op (returns the input unchanged) when selected is undefined or empty.

T

The option object type (typically Record<string, unknown>).

T

The ECharts option produced by one of the build*Option helpers.

string | string[] | undefined

The selected category name(s); undefined/empty means no emphasis.

SelectionEmphasisOptions

Optional opacity overrides. See SelectionEmphasisOptions.

T

A new option with emphasis applied, or the original option when there is no selection.