Skip to content

LegendProps

Defined in: packages/react/src/controls.tsx:45

Props of Legend. useViews’s legendProps(group) supplies most of them.

optional className?: string

Defined in: packages/react/src/controls.tsx:53

Extra class on the outer element.


optional counts?: boolean

Defined in: packages/react/src/controls.tsx:60

Show each category’s count. Defaults to true.


group: LegendGroup

Defined in: packages/react/src/controls.tsx:47

One dimension’s legend, from layout.legends.


optional heading?: boolean

Defined in: packages/react/src/controls.tsx:58

Show the dimension’s label above its entries. Defaults to true.


optional hideEmpty?: boolean

Defined in: packages/react/src/controls.tsx:62

Leave out categories with no items. Defaults to false.


optional onSelect?: (selection) => void

Defined in: packages/react/src/controls.tsx:51

Called with a category of this group, or null to clear; makes each entry a toggle.

Selection | null

void


optional renderer?: Renderer<PlacedMark>

Defined in: packages/react/src/controls.tsx:56

Draws each entry’s swatch; use the canvas’s renderer so they match. Defaults to shapesRenderer.


optional selected?: Selection | null

Defined in: packages/react/src/controls.tsx:49

The current selection, from useViews.