Heatmap ranked rows — Charts block

Pro

charts-heatmap-ranked-rows · for app, analytics pages

Heatmap ranked rows

The rows sorted by their total, each one a thin strip of its cells, when which row leads matters more than the columns

Documentation

Installation

One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).

pnpm dlx shadcn-vue@latest add @trame/charts-heatmap-ranked-rows

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import ChartsHeatmapRankedRows from '@/components/trame/blocks/charts/charts-heatmap-ranked-rows.vue'

const props = {
title: "Orders by time slot",
subtitle: "Orders placed on the online store, September 1 to October 12",
columns: [
"9 a.m.",
"10 a.m."
],
rows: [
{
label: "Monday",
cells: [
25,
29
]
},
{
label: "Tuesday",
cells: [
29,
23
]
}
],
scale: {
unit: "orders"
}
}
</script>

<template>
<ChartsHeatmapRankedRows v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
title*stringWordsthe grid’s heading ("Room occupancy")
subtitlestringWordsone line under it: the period, what a cell counts
columns*string[]Wordsthe second dimension, in its order
rows*Row[]Datathe measured values, row by row, as the app holds them
scaleScaleDatathe range the shades span
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Row rows[] · 2 props
PropTypeDescription
label*stringWordsthe row’s name ("March cohort", "Tuesday")
cells*(number | null)[]one value per column, in the columns’ order; null: nothing measured
Scale scale · 3 props
PropTypeDescription
minnumberthe value of the lightest step; the smallest value by default
maxnumberthe value of the darkest step; the largest value by default
unitstringWordswhat a value counts, after a number ("nights", "orders")
Options options · 4 props
PropTypeDescription
format'number' | 'percent' | 'money'how a value is written: percent takes 0–100, money cents
legendbooleanshows the low-to-high key; true by default
currencystringDesignISO 4217 for money values, EUR by default
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa band of the page that redefines the theme surfaces inside it
What it asks your app for

The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
moneyformats a price, given in cents
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour word for an interface key, or undefined to keep the block’s own

The words it says itself, in English and French; label(key) replaces any of them:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo many attempts, try again in a moment.Trop de tentatives, réessayez dans un moment.

Features

  • Every word in the server HTML
  • Same markup in Vue and React
  • Theme tokens only: every theme, light and dark
  • Shows what you give it, invents nothing
  • No motion; still under reduced motion
  • Real buttons and links, a visible focus
  • Reads rows from your app

A charts section, for app, analytics pages.

More charts blocks

  • Chart line table: a trend over time for two or three series, with its figures beside it in a table.
  • Chart ranked bars: categories ranked from the largest as horizontal bars with the value at their end (channels, pages, categories): when the labels are too long to sit under columns.
  • Chart stacked area: several series stacked as bands over time so the top edge reads the sum (traffic by source, sales by channel): when the total matters as much as the parts.
  • Key metrics featured: The merchant’s own primary metric takes the lead beside a quiet list of supporting measures.
  • Key metrics tiles: Centered figures on generous tiles for the merchant’s own headline measures, with context beneath.
  • Metric grid ruled grid: an analytics page of the host’s own measures over a chosen period: one ruled grid of chart tiles sharing their borders, the first metric leading at two thirds, each with its value, this period against the previous and an area chart.
  • Spend trend stacked bars: a plan with variable spend: three figures and a stacked bar chart of what each period cost.
  • Stat cards linked: figures about goals or finance, each with a status line that leads to the detail.

All 20 charts blocks