Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

3.2 KB
Raw Blame
---
title: Beeswarm
description: "Two dot swarms, before and after, settle on an axis showing 3.4 versus 10.6"
component: beeswarm
vibe: data
length: 130
useWhen:
  - "A distribution comparison where many individual dots show a before and after, such as 3.4 versus 10.6."
  - "A beat that proves an improvement across a whole population of teams or users."
  - "A data scene where the spread matters as much as the median."
avoidWhen:
  - "You want one smooth curve moving left — use `distribution-shift`."
  - "You want each item's before and after in its own row — use `dumbbell-shift`."
  - "You want dots falling into a bell curve — use `galton-stack`."
askedAs:
  - "dot swarm before and after"
  - "distribution of dots on an axis"
  - "I want many individual dots settling to show 3.4 versus 10.6"
  - "compare two groups with a dot plot, before and after"
  - "scatter of dots shifting to a higher value"
  - "swarm plot comparison"
---

<ComponentPreview name="beeswarm" />

<InstallBlock name="beeswarm" />

## Usage

```tsx
// src/Root.tsx
import { Composition } from "remotion";
import { Beeswarm } from "@/components/remocn/beeswarm";

const BeeswarmScene = () => (
  <Beeswarm
    count={200}
    domain={[0, 14]}
    axisLabel="launch videos shipped per quarter"
    totalLabel="200 teams"
  />
);

export const RemotionRoot = () => (
  <Composition
    id="Beeswarm"
    component={BeeswarmScene}
    durationInFrames={150}
    fps={30}
    width={1280}
    height={720}
  />
);
```

A pour of dots falls onto an axis as one grey swarm, then splits into a before group and an after group that slide to their medians and label themselves. Pass `before` and `after` as groups (label, median, spread), `count` of dots, and the axis `domain` and `axisLabel`. Ships dark and light via `theme`.

<PropsTable title="Props"
  rows={[
    {
      name: "before",
      type: "BeeswarmGroup",
      default: "DEFAULT_BEFORE",
      description: "Starting group with a label, median and spread.",
    },
    {
      name: "after",
      type: "BeeswarmGroup",
      default: "DEFAULT_AFTER",
      description: "Improved group with a label, median and spread.",
    },
    {
      name: "count",
      type: "number",
      default: "200",
      description: "Number of dots in the swarm.",
    },
    {
      name: "domain",
      type: "[number, number]",
      default: "[0, 14]",
      description: "Axis range as a minimum and maximum.",
    },
    {
      name: "tickStep",
      type: "number",
      default: "2",
      description: "Spacing between axis ticks.",
    },
    {
      name: "axisLabel",
      type: "string",
      default: "\"launch videos shipped per quarter\"",
      description: "Caption under the axis.",
    },
    {
      name: "totalLabel",
      type: "string",
      default: "\"200 teams\"",
      description: "Label on the full swarm before it splits.",
    },
    {
      name: "accent",
      type: "string",
      default: "\"#3B5BFD\"",
      description: "Accent color for the hero element.",
    },
    {
      name: "speed",
      type: "number",
      default: "1",
      description: "Playback multiplier.",
    },
    {
      name: "theme",
      type: "\"dark\" | \"light\"",
      default: "\"dark\"",
      description: "Dark or light palette.",
    },
  ]}
/>