bar_chart.ts

One row of a results table drawn as bars, a bar per library. The bars repeat the numbers for the eye, and the ratios are the table's own (to_matrix_ratios): against the best in the row, or against the library a reader chose, so a chart never compares differently from the table it summarizes.

view source

Declarations
#

2 declarations

BarChartItem
#

bar_chart.ts view source

BarChartItem import type {BarChartItem} from '@ryanatkn/syntax-highlighter-bench/bar_chart.js';

One library's bar: a number with its length and ratio, or the reason there is none.

library

type string

text

The number as text, or the reason there is none.

type string

has_value

Whether the library has a number in the row.

type boolean

fraction

The bar's length, as a fraction of the row's largest number: 0, and no bar, with no number or one at or under zero.

type number

ratio

The ratio against the baseline, when the number has one.

type number | undefined

within_floor

Whether the ratio is inside the row's noise floor, and so not a difference.

type boolean

bound

Whether the ratio is a lower bound, as matrix_row_is_bounded says.

type boolean

anchor

Whether this library's number is the one the ratios are taken against.

type boolean

details

What the number is made of, as the tables show it in a cell's details.

type string[]

to_bar_chart
#

bar_chart.ts view source

(row: MatrixRow, libraries: readonly string[], reference: string | null): BarChartItem[] import {to_bar_chart} from '@ryanatkn/syntax-highlighter-bench/bar_chart.js';

The bars of a row, in the order of libraries. A bar's length is its number over the largest in the row, whichever direction is better, so a longer bar is always more of the row's unit.

row

libraries

type readonly string[]

reference

the library the ratios are taken against, or null for the best in the row

type string | null

returns

BarChartItem[]

Depends on
#

Imported by
#