plot
GraphPlot
A line or area chart built from columns of block characters. Write a list of numbers, or `- Mon: 4` rows to keep the labels.
- use it
- Good when the series needs a y-scale.
- instead
- A handful of points with no axis is Spark.
labeled rows
A list of `label: value` keeps the labels for the axis.
310
31
31
line plot, 5 points, min 0, max 31MonFri
<GraphPlot title="SIGNUPS" variant="line">
- Mon: 12
- Tue: 18
- Wed: 15
- Thu: 24
- Fri: 31
</GraphPlot>install
command
p95
Last cap is the live point.
90
9
9
area plot, 12 points, min 0, max 9jandec
import { GraphPlot } from "@/registry/default/graph-plot/graph-plot"
<GraphPlot title="P95" data="2 3 3 5 4 7 6 8 5 9 7 6" labels={["jan", "dec"]} />errors
Line only. progress reveals a prefix.
80
8
8
line plot, 10 points, min 0, max 8monfri
import { GraphPlot } from "@/registry/default/graph-plot/graph-plot"
<GraphPlot
title="ERRORS"
variant="line"
height={5}
progress={0.7}
data={[1, 1, 4, 2, 8, 3, 2, 1, 5, 2]}
labels={["mon", "fri"]}
/>| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | — | Caption drawn on the top edge of the frame. |
| data | number[] | "2 3 4" | — | One value per column, left to right. Optional when children are Markdown. |
| children | Markdown | — | - Mon: 4 Or a line of numbers. |
| labels | string[] | — | First and last labels under the axis. |
| height | number | 7 | Rows in the plot. |
| variant | "line" | "area" | "area" | Area fills down from the cap with ░. |
| progress | number | 1 | 0–1. How many columns are revealed. |
| glyphs | "shade" | "ascii" | "hash" | "bar" | string[] | "shade" | Character set. shade is ·░▒▓█. ascii is .- =#@. Pass a preset or your own characters. |
| palette | "mono" | "duo" | "multi" | "mono" | mono is one accent plus muted. duo paints the second series with --graph-accent-2. multi cycles three accents. |
| corner | string | "+" | Character at each corner of the frame. |
| frame | "box" | "corners" | "rule" | "none" | "box" | box draws the dashed border. corners keeps only the corner marks. rule draws dashed lines above and below. none drops the border and padding, and puts the title above the content. |
| className | string | — | Passed to the outer frame. |