Install
@graphysdk/react and React. Register the plugin once with createGraphyKit, which adds kit.geom.dumbbell() and binds kit.GraphProvider to the same plugin:
Long data: one row per dot
Map the category tox, the value to y and the group to color. The geom groups the dots of each category itself, so the legend, palette, tooltip order and highlights all come from the color scale:
color unmapped and every dot takes the default geom color, with no legend.
The layer’s position is always 'identity': the geom groups a category’s dots itself, and 'dodge' or 'stack' is rejected with UNSUPPORTED_POSITION.
Wide data
When each group is its own column, reshape it to long in the spec:Horizontal
Addkit.coord.flip(), as for a horizontal bar. The categories move to the vertical axis and the connectors lie across.
Styling
The dots are the layer’s observations and are styled through the geom’s own builder. The connector is a part with a builder of its own:style.geom({ fill: 'navy' }), styles the dots like any other geom’s observations and never the connector. The connector takes no color from the scale: it joins dots of different groups, so a scale color would be arbitrary. A connector entry’s where is tested against the category’s first dot, so write it against what every dot of the category shares, such as its x.
Hover and highlight
Hovering a category emphasizes its whole dumbbell. The tooltip lists every dot in legend order, with the dot nearest the cursor marked in place. A highlight matches dots. A connector is raised only when every dot it joins is raised: highlighting one group raises that group’s dots and no connector; highlighting one category raises its whole dumbbell.Data labels
dataLabels.showDataLabels prints every dot’s value beside it. Under the default position: 'auto' each label sits on the far side of its dot from the connector, so the gap the chart is read from stays clear. An explicit position puts every label on the side justify names, for a chart that wants them in a row.
y, formatted as the value axis formats it; map label to print another column instead. showStackTotals and showCategoryLabels are bar settings and a dumbbell places neither.
Not yet supported
- The editor’s chart-type picker and the chart agent. In annotate mode the dumbbell renders, hovers, selects and takes annotations on its dots, but it is authored in code.
- Aggregation. Duplicate rows for one category and group all draw; aggregate them first with
transform.aggregate().

