File size: 2,029 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
flavors:
  - flavor: svg
    path: /swarmplot/
  - flavor: canvas
    path: /swarmplot/canvas/

SwarmPlot:
  package: '@nivo/swarmplot'
  tags: []
  stories:
    - label: Custom circle component
      link: swarmplot--custom-circle-component
    - label: Adding extra layers
      link: swarmplot--extra-layers
    - label: Using annotations
      link: swarmplot--using-annotations
  description: |
    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](https://github.com/d3/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.

SwarmPlotCanvas:
  package: '@nivo/swarmplot'
  tags:
    - canvas
  stories:
    - label: Using annotations
      link: swarmplotcanvas--using-annotations
  description: |
    A variation around the [SwarmPlot](self:/swarmplot) component.
    Well suited for large data sets as it does not impact DOM tree depth,
    however you'll lose the isomorphic ability and transitions.

    You can optionally enable a voronoi mesh to capture user's
    interactions, using the `useMesh` property.

    Even if the canvas implementation is faster, please note that
    if you have a lot of nodes **calculating the underlying simulation
    will involve a lot of computing and will affect performance**.