@graphique/graphique
Version:
A data visualization system for React based on the Grammar of Graphics.
12 lines (11 loc) • 346 B
text/typescript
import type { Aes } from "../gg";
export const defineGroupAccessor = <Datum>(aes: Aes<Datum>, allowUndefined = false) => {
if (!aes && allowUndefined) return undefined
return (
aes?.fill ||
aes?.stroke ||
aes?.strokeDasharray ||
aes?.group ||
(allowUndefined ? undefined : () => '__group')
)
}