A swarm plot component which can also be used to make a beeswarm plot when using a single group.
This chart can display 2 data dimensions, a categorical one: groups, and a quantitative one: values.
You can optionally add a third quantitative dimension if you enable
dynamic node size, please have a look at the size
property
for further information.
You can also enable a voronoi mesh to capture user's
interactions, using the useMesh
property.
This example uses 3 dimensions, the grouping is done by the group
property while the value is determined by the price
property,
node size is dynamic and depends on the volume
property.
Under the hood, this chart uses d3-force with a simulation involving collisions and x/y forces, the quality of the simulation can be adjusted, the strength of the value force too.
The responsive alternative of this component is ResponsiveSwarmPlot
.
Chart data.
'id'
Property used to retrieve the node's unique identifier.
'value'
Property used to retrieve the node's value.
Optional formatter for values.
Available groups.
'group'
Propety used to group nodes, must return a group which is available in the groups property.
6
How to compute node size, static or dynamic.
2
Spacing between nodes.
Chart width.
Chart height.
'Depends on device'
Adjust pixel ratio, useful for HiDPI screens.
Chart margin.
1
Force strength.
120
Adjust the simulation quality.
'vertical'
Chart layout.
0
Gap between each serie.
Define style for common elements such as labels, axes…
Define chart's colors.
'group'
Property or accessor function to be used with colors.
0
Control node border width.
'rgba(0, 0, 0, 0)'
Control node border color.
'grid'
, 'axes'
, 'circles'
, 'annotations'
, 'mesh'
]Defines the order of layers and add custom layers.
Override default circle component for the SVG implementation.
Override default circle rendering for the canvas implementation.
true
Enable/disable x grid.
Specify values to use for vertical grid lines.
true
Enable/disable y grid.
Specify values to use for horizontal grid lines.
Top axis configuration.
Right axis configuration.
Bottom axis configuration.
Left axis configuration.
true
Enable/disable interactivity.
false
Use a mesh to detect mouse interactions, always true for canvas.
false
Display the mesh used to detect mouse interactions (voronoi cells), depends on useMesh.
onMouseEnter handler.
onMouseMove handler.
onMouseLeave handler.
onClick handler.
Custom tooltip component.
true
Enable/disable transitions.
'gentle'
Motion config for react-spring, either a preset or a custom configuration.