Skip to main content

Function: focusIds()

focusIds<Row>(s): ReadonlySet<string> | null

Defined in: packages/sdvplot/src/selection.ts:154

What a figure should emphasise. null: nothing is active, draw everything normally. A set, possibly EMPTY (a brush that encloses no point): emphasise those ids and dim the rest. Hover and selected are unioned. The cursor is ignored: a shared hover value never dims anything.

Type Parameters​

Row​

Row

Parameters​

s​

SelectionState<Row>

Returns​

ReadonlySet<string> | null

Example​

import { createSelection, focusIds } from "@sportsdataverse/sdvplot";

const store = createSelection();
const idle = focusIds(store.getState()); // null: draw everything normally
store.set({ selected: ["KC"], hover: ["BUF"] });
({ idle, focus: [...(focusIds(store.getState()) ?? [])] });