@graphysdk/geom-lollipop
Beta. This geom is on a
0.xversion line: a minor release may change its aesthetics, style parts or look. Use a caret range (^0.1.0) to take only patches.
A lollipop geom for the Graphy charting SDK. It compares one value per category, like a bar, as a head at the value and a stem dropped from it to zero.
Learn more at graphy.dev.
Install
npm install @graphysdk/geom-lollipop @graphysdk/react
Requires React 19. Its only peer is @graphysdk/react.
Usage
Data is long, one row per lollipop. Map the category to x and the value to y, and a group to color for grouped lollipops:
import { createGraphyKit, GraphRenderer } from '@graphysdk/react';
import { lollipop } from '@graphysdk/geom-lollipop';
const kit = createGraphyKit({ plugins: [lollipop] });
const spec = kit.pipe(
kit.createSpec({ x: 'product', y: 'revenue' }),
kit.geom.lollipop(),
kit.scale.x.discrete(),
kit.scale.y.continuous()
);
export function Revenue({ data }) {
return (
<kit.GraphProvider spec={spec} data={data}>
<GraphRenderer />
</kit.GraphProvider>
);
}
Add kit.coord.flip() for a horizontal lollipop. Style the heads with kit.style.geom.lollipop() and the stems with kit.style.geom.lollipop.stem().
Docs
Feedback
This geom is released early to hear what works. Tell us on Discord.
Licence
This package is available under PolyForm Noncommercial, Small Business, or a 32-day Free Trial. Free Trial is local or internal evaluation only — it does not cover a public page. See what you can do under the trial.
For a commercial licence, talk to us.