Opus Motion ★ Star on GitHub

Data · donut-breakdown

Donut breakdown

A donut chart that sweeps round clockwise segment by segment with percentage labels, a count-up total in the centre and a legend whose values count up as each segment lands; an optional highlighted slice pops out while the rest dim.

A free, MIT-licensed animated chart from the Opus Motion Library — 616 motions for Remotion, React and plain HTML.

Donut breakdown: three frames of the animated chart, start, middle and end
Donut breakdown — start, middle and end of the 6.0-second motion.

What Donut breakdown is for

Share-of-total stories on any brand: revenue by channel, budget split, traffic sources, survey answers, market share. Replace data, colours, prefix / suffix; works on a transparent background over footage.

  • donut
  • pie
  • chart
  • breakdown
  • share
  • percentage
  • infographic
  • data
  • legend
  • overlay
  • count-up
  • statistics

Details

Category
Animated charts & data visualisation
Length
6.0 s (180 frames at 30 fps)
Formats
16:9, 1:1, 9:16
Weight
light
Transparent overlay
yes
Seamless loop
no
Text props
title subtitle centerLabel prefix
Colour props
colors background ink
Mood
hud
Roles
accent, subject

Use Donut breakdown in Remotion, React or HTML

Remotion project

terminal
# copy this motion into your Remotion project
node cli/mgl.mjs add donut-breakdown --to ../my-app/src

# render an mp4 (run in the library folder)
node cli/mgl.mjs render donut-breakdown --props '{"title":"Traffic by source","subtitle":"Share of total sessions, thousands","centerLabel":"TOTAL","prefix":"","colors":["#2F6FED","#FF7A45","#16B39A","#F2B134","#8E5CF0","#E5487F","#5BC0EB","#7A8794"],"background":"#F5F3EE","ink":"#18212B"}'

# or export for apps / editors: mp4 | webm-alpha | prores-alpha | gif | png | poster
node cli/mgl.mjs export donut-breakdown --as webm-alpha --props '{"title":"Traffic by source","subtitle":"Share of total sessions, thousands","centerLabel":"TOTAL","prefix":"","colors":["#2F6FED","#FF7A45","#16B39A","#F2B134","#8E5CF0","#E5487F","#5BC0EB","#7A8794"],"background":"#F5F3EE","ink":"#18212B"}'

React / Next.js

tsx
import {MotionPlayer} from 'opus-motion-library/web';

<MotionPlayer
  motion="donut-breakdown"
  props={{
    title: 'Traffic by source',
    subtitle: 'Share of total sessions, thousands',
    centerLabel: 'TOTAL',
    prefix: '',
    colors: [
      '#2F6FED',
      '#FF7A45',
      '#16B39A',
      '#F2B134',
      '#8E5CF0',
      '#E5487F',
      '#5BC0EB',
      '#7A8794',
    ],
    background: '#F5F3EE',
    ink: '#18212B',
  }}
  playOnView
  loop="auto"
/>

Plain HTML / WordPress

html
<script src="opus-motion.element.js" defer></script>

<opus-motion motion="donut-breakdown"
  props='{"title":"Traffic by source","subtitle":"Share of total sessions, thousands","centerLabel":"TOTAL","prefix":"","colors":["#2F6FED","#FF7A45","#16B39A","#F2B134","#8E5CF0","#E5487F","#5BC0EB","#7A8794"],"background":"#F5F3EE","ink":"#18212B"}'>
</opus-motion>

Compose spec (multi-scene video)

json
{
  "width": 1920,
  "height": 1080,
  "fps": 30,
  "scenes": [
    {
      "motion": "donut-breakdown",
      "props": {
        "title": "Traffic by source",
        "subtitle": "Share of total sessions, thousands",
        "centerLabel": "TOTAL",
        "prefix": "",
        "colors": [
          "#2F6FED",
          "#FF7A45",
          "#16B39A",
          "#F2B134",
          "#8E5CF0",
          "#E5487F",
          "#5BC0EB",
          "#7A8794"
        ],
        "background": "#F5F3EE",
        "ink": "#18212B"
      }
    }
  ]
}

Donut breakdown props

20 parameters — change any of them to make the motion yours.

PropDefaultWhat it does
data[{"label":"Direct","value":420},{"label":"Search","value":310},{"label":"Social","value…slices [{label, value, color?}]; any count, values are relative
title"Traffic by source"headline (empty = none)
subtitle"Share of total sessions, thousands"small line under the headline (empty = none)
centerLabel"TOTAL"small caption under the centre total (empty = none)
prefix""text before every number, e.g. "$"
suffix"K"text after every number, e.g. "K", "%", " users"
decimals0decimal places on the numbers
showPercenttrueprint each slice share on the ring
showLegendtruelegend beside (16:9, 1:1) or below (9:16) the donut
legendValuestrueshow the count-up value next to each legend label
sortfalsesort slices largest first
highlight-1index of a slice to pop out once the sweep ends (-1 = none)
ringWidth0.34ring thickness as a fraction of the radius (0.1-0.8)
gap2gap between slices in degrees
colors["#2F6FED","#FF7A45","#16B39A","#F2B134","#8E5CF0","#E5487F","#5BC0EB","#7A8794"]palette used for slices without their own colour
background"#F5F3EE"page colour, or "transparent" to sit over other content
ink"#18212B"text and track colour
fontFamily""CSS font family (empty = Space Grotesk)
startAt10frame the sweep starts
speed1animation speed multiplier

Notes & credits

Technique sources:

  • original round-3 chart motion