Ir al contenido

HorizontalBar

Un valor por categoría, con los nombres a la izquierda donde caben los nombres largos: los endpoints más lentos, el almacenamiento por tabla. Ordenado de mayor a menor.

import { HorizontalBar, RowsChartSkeleton } from '@sypnia/ui/react'

En esta página
  1. Endpoints más lentos, y el skeleton
  2. Cuándo usarlo
  3. Para todos
  4. Props

Endpoints más lentos, y el skeleton

Slowest endpoints
Time to answer, 95th percentile
  • GET /orders?include=items840 ms
  • POST /checkout620 ms
  • GET /products/search410 ms
  • POST /login180 ms
  • GET /me95 ms
Ver como tabla
Endpoint
GET /orders?include=items840 ms
POST /checkout620 ms
GET /products/search410 ms
POST /login180 ms
GET /me95 ms
Código
import { HorizontalBar, RowsChartSkeleton } from '@sypnia/ui/react';

// Long names fit on the left; sorted from the slowest.
export default function Endpoints() {
  return (
    <div className="sy-stack">
      <HorizontalBar title="Slowest endpoints" subtitle="Time to answer, 95th percentile" label="Endpoint" formatValue={(v) => `${v} ms`}
        items={[{ label: 'GET /orders?include=items', value: 840 }, { label: 'POST /checkout', value: 620 }, { label: 'GET /products/search', value: 410 }, { label: 'GET /me', value: 95 }, { label: 'POST /login', value: 180 }]} />
      <RowsChartSkeleton rows={3} />
    </div>
  );
}

Cuándo usarlo

Úsalo cuando

  • Rankings y categorías con nombres largos.

No lo uses cuando

  • Valores en el tiempo: usa BarChart o LineChart.

Para todos

  • Cada fila se puede enfocar y se nombra con su etiqueta y su valor.
  • En celulares la barra va debajo del nombre, a todo el ancho.

Props

HorizontalBarTipoPor defecto
itemsobligatorio { label: string; value: number; }[]
titleobligatorio ReactNode
empty ReactNode
error ReactNode
formatValue Fmt
height number
keepOrder boolean
label

The header of the first column of the table view.

string Name
loading boolean
loadingRows

On the first load (`loading` with no items): how many rows will come, drawn as rows of skeleton. Default 5.

number
subtitle ReactNode
RowsChartSkeletonTipoPor defecto
rows number 5
  1. Endpoints más lentos, y el skeleton
  2. Cuándo usarlo
  3. Para todos
  4. Props

    Busca páginas, secciones y términos