Sparkline

1 つの伸縮する SVG に描く、軸のない単語サイズの折れ線・面・棒・ヒート図。既定は装飾扱いで、読み上げ用の要約を持つ画像にもできます。

対応フレームワーク
  • Angular: 対応
  • Vue: 対応
  • React: 対応
  • React Native: 対応

使い方

Meetings
Talk time
Focus
Streak

インポート

ts
import {
  SoneSparklineComponent,
} from "@surface-one/angular/sparkline";

API リファレンス

SoneSparklineComponentコンポーネント

`<sone-sparkline>` — a word-sized chart with no axes: a line, an area, bars or a heat strip in one stretched `<svg>`. Decorative by default (next to a number that already says it); pass `[decorative]="false"` to make it an image with a spoken summary.

セレクター
sone-sparkline
入力
名前型 デフォルト
values

The series, oldest first.

readonly number[][]
type

`line` | `area` | `bar` | `heat` (cells on the sequential ramp).

SoneSparklineType"line"
min

The bottom of the scale.

number0
max

The top of the scale; defaults to `niceCeiling(values, 4)`.

number | null | undefinedundefined
tone

The colour (`heat` uses the sequential ramp instead).

SoneChartTone"accent"
decorative

Hidden from assistive technology (default); `false` makes it `role="img"`.

booleantrue
summary

The spoken text when not decorative; defaults to “n values, peak x, total y”.

string | nullnull