Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Frontier Plot

ProNew

A score against its cost: each model is a path through its runs with shaped markers and its name at the end. Pointing near a point isolates the model, drops guides to both axes and shows the values.

Installation

pnpm dlx shadcn@latest add @viewport/frontier-plot

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
title*string—
yLabel*string

The two measures, shown as chips in the title and on the axes, e.g. "Score" and "Cost ($)".

—
xLabel*string—
series*PlotSeries[]—
groups{ id: string; label: string; shape: Shape }[]

The marker shapes and what they stand for. Listed under the plot; pointing at one isolates its series.

[]
xTicks*number[]

Tick values for each axis.

—
yTicks*number[]—
logXboolean

Use a logarithmic x axis, for measures such as cost that span orders of magnitude.

false
formatX(value: number) => stringString
formatY(value: number) => stringString
heightnumber

The height of the plot, in pixels.

380
classNamestring—

Accessibility

  • Arrow keys step through every point and read the same values as the pointer.
  • Marker shape, not only color, says how a model was run, and the shapes are named in a legend.
  • The data is also a table for screen readers.
  • Paths appear already drawn under reduced motion.