Opus Motion ★ Star on GitHub

Data · treemap-split

Treemap split

A squarified treemap: one block fills the chart area, splits into strips and then into value-sized rectangles, each labelled with its name, a count-up value and share; colour by palette or by value, with an optional highlighted tile.

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

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

What Treemap split is for

Part-to-whole with many items: portfolio or budget breakdowns, disk usage, market caps, revenue by product, survey categories, file sizes. Pass data as [{label, value, color?}], set prefix / suffix and colours; works on a transparent background.

  • treemap
  • tiles
  • chart
  • breakdown
  • share
  • proportion
  • infographic
  • data
  • overlay
  • statistics
  • budget
  • portfolio

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 prefix
Colour props
lowColor highColor colors background ink
Mood
hud
Roles
accent, subject

Use Treemap split in Remotion, React or HTML

Remotion project

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

# render an mp4 (run in the library folder)
node cli/mgl.mjs render treemap-split --props '{"title":"Revenue by product line","subtitle":"Area shows share of total revenue","prefix":"$","lowColor":"#BFD4FF","highColor":"#1C4FD8","colors":["#2F6FED","#FF7A45","#16B39A","#F2B134","#8E5CF0","#E5487F","#5BC0EB","#7A8794","#9BCB3C","#D96C6C"],"background":"#F5F3EE","ink":"#18212B"}'

# or export for apps / editors: mp4 | webm-alpha | prores-alpha | gif | png | poster
node cli/mgl.mjs export treemap-split --as webm-alpha --props '{"title":"Revenue by product line","subtitle":"Area shows share of total revenue","prefix":"$","lowColor":"#BFD4FF","highColor":"#1C4FD8","colors":["#2F6FED","#FF7A45","#16B39A","#F2B134","#8E5CF0","#E5487F","#5BC0EB","#7A8794","#9BCB3C","#D96C6C"],"background":"#F5F3EE","ink":"#18212B"}'

React / Next.js

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

<MotionPlayer
  motion="treemap-split"
  props={{
    title: 'Revenue by product line',
    subtitle: 'Area shows share of total revenue',
    prefix: '$',
    lowColor: '#BFD4FF',
    highColor: '#1C4FD8',
    colors: [
      '#2F6FED',
      '#FF7A45',
      '#16B39A',
      '#F2B134',
      '#8E5CF0',
      '#E5487F',
      '#5BC0EB',
      '#7A8794',
      '#9BCB3C',
      '#D96C6C',
    ],
    background: '#F5F3EE',
    ink: '#18212B',
  }}
  playOnView
  loop="auto"
/>

Plain HTML / WordPress

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

<opus-motion motion="treemap-split"
  props='{"title":"Revenue by product line","subtitle":"Area shows share of total revenue","prefix":"$","lowColor":"#BFD4FF","highColor":"#1C4FD8","colors":["#2F6FED","#FF7A45","#16B39A","#F2B134","#8E5CF0","#E5487F","#5BC0EB","#7A8794","#9BCB3C","#D96C6C"],"background":"#F5F3EE","ink":"#18212B"}'>
</opus-motion>

Compose spec (multi-scene video)

json
{
  "width": 1920,
  "height": 1080,
  "fps": 30,
  "scenes": [
    {
      "motion": "treemap-split",
      "props": {
        "title": "Revenue by product line",
        "subtitle": "Area shows share of total revenue",
        "prefix": "$",
        "lowColor": "#BFD4FF",
        "highColor": "#1C4FD8",
        "colors": [
          "#2F6FED",
          "#FF7A45",
          "#16B39A",
          "#F2B134",
          "#8E5CF0",
          "#E5487F",
          "#5BC0EB",
          "#7A8794",
          "#9BCB3C",
          "#D96C6C"
        ],
        "background": "#F5F3EE",
        "ink": "#18212B"
      }
    }
  ]
}

Treemap split props

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

PropDefaultWhat it does
data[{"label":"Software","value":380},{"label":"Hardware","value":240},{"label":"Services",…tiles [{label, value, color?}]; any count, values are relative, sorted largest first
title"Revenue by product line"headline (empty = none)
subtitle"Area shows share of total revenue"small line under the headline (empty = none)
prefix"$"text before every number, e.g. "$"
suffix"M"text after every number, e.g. "M", " GB"
decimals0decimal places on the values
showValuetrueprint the (counting-up) value in each tile
showSharetrueprint the percentage share in each tile
colorMode"palette""palette" (one colour per tile) or "value" (low-to-high gradient)
lowColor"#BFD4FF"colour of the smallest tile when colorMode is "value"
highColor"#1C4FD8"colour of the largest tile when colorMode is "value"
gap8gap between tiles in u
radius14tile corner radius in u
highlight""label of a tile to outline and spotlight at the end (empty = none)
colors["#2F6FED","#FF7A45","#16B39A","#F2B134","#8E5CF0","#E5487F","#5BC0EB","#7A8794","#9BCB…palette for tiles without their own colour
background"#F5F3EE"page colour, or "transparent" to sit over other content
ink"#18212B"text colour
fontFamily""CSS font family (empty = Space Grotesk)
startAt10frame the split starts
speed1animation speed multiplier

Notes & credits

Technique sources:

  • original round-3 chart motion