Krizaka UI
Krizaka UI

Charts provider

The locale, the brand palette and the words of every chart below it, set once; plus the sliding window for live data.

Web · ✓Mobile · ✓Bureau · ✓BêtaGraphiques
Niveau de support
Bêta
Taille
Non mesurée
Qui l'utilise
Aucun produit en production ne l'importe encore
import { ChartsProvider, useSlidingWindow } from "@krizaka/charts/provider";

Web et mobile — le même composant pour React et React Native. Bêta : son API peut encore changer à une version mineure.

Pourquoi il est là. Used by Sovkora.

Quand l’utiliser

  • Once near the root of an app: its locale (fr-FR), its brand (sovkora), its translated words.
  • An app that loads a brand stylesheet on :root rather than a .brand-<id> class: set brand here.

Quand ne pas l’utiliser

  • To change one chart only: every chart takes locale, brand and labels itself.À la place : Line chart

Installation

Installer

npm install @krizaka/charts

Importer

import { ChartsProvider, useSlidingWindow } from "@krizaka/charts/provider";

Exemples

French, Sovkora

Figures and dates in French, the Sovkora palette, the words translated.

Props

Sets the locale, the brand and the words of every chart below it.

PropTypeDéfautDescription
brandBrandId—The brand whose palette the charts use. Without it, a chart follows a .brand-<id> ancestor, else Krizaka. Set it when the app loads a brand stylesheet on :root (@krizaka/tokens/brands/sovkora.css).
labelsChartLabelsInput—The words, translated: the buttons, the states, the written summary.
localeLocale—The locale of every figure and date ("fr-FR"). Default "en-US".

Accessibilité

  • The words it sets are what screen readers hear: the summary, the role description, the keyboard hint.

Bonnes pratiques

  • Translate labels from the app's catalogue; the summary templates take {placeholders}.
  • In React Native, pass scheme and theme from @krizaka/ui/native's useTheme() so the charts follow the app's theme and brand.

Générée depuis le code de @krizaka/ui 5.3.4 : son meta.ts, ses exemples et ses types.Modifier cette documentation sur GitHub

Sur cette page