Frontier Plot
ProNewA 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
| Prop | Type | Default |
|---|---|---|
| title* | string | — |
| yLabel* | stringThe 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[] | — |
| logX | booleanUse a logarithmic x axis, for measures such as cost that span orders of magnitude. | false |
| formatX | (value: number) => string | String |
| formatY | (value: number) => string | String |
| height | numberThe height of the plot, in pixels. | 380 |
| className | string | — |
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.