Skip to content

gravity-ui/yagr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1fb134e · Apr 9, 2024
Nov 14, 2023
Mar 27, 2024
Dec 25, 2023
Apr 9, 2024
Apr 9, 2024
Mar 29, 2021
Mar 11, 2021
Aug 17, 2021
Jun 15, 2023
Jul 30, 2021
Jun 16, 2023
May 28, 2021
Sep 16, 2021
Apr 9, 2024
Sep 16, 2021
Jun 16, 2023
Aug 3, 2023
Nov 24, 2023
Jun 22, 2023
Apr 9, 2024
Apr 9, 2024
Jun 16, 2023

Repository files navigation

Ẏagr

Yagr is a high-performance HTML5 canvas chart renderer based on uPlot. It provides high-level features for uPlot charts.

Features

Quick Start

npm i @gravity-ui/yagr

NPM Module

import Yagr from '@gravity-ui/yagr';

new Yagr(document.body, {
    timeline: [1, 2, 3, 4, 5],
    series: [
        {
            data: [1, 2, 3, 4, 5],
            color: 'red',
        },
        {
            data: [2, 3, 1, 4, 5],
            color: 'green',
        },
    ],
});

Script Tag

<script src="https://unpkg.com/@gravity-ui/yagr/dist/yagr.iife.min.js"></script>
<script>
    new Yagr(document.body, {
        timeline: [1, 2, 3, 4, 5],
        series: [
            {
                data: [1, 2, 3, 4, 5],
                color: 'red',
            },
            {
                data: [2, 3, 1, 4, 5],
                color: 'green',
            },
        ],
    });
</script>

Examples

Need something specific? Yagr presents some useful examples in the demo/examples folder. How to start them with current version:

  1. Clone the repository
  2. Install dependencies npm i
  3. Run npm run build
  4. Run npx http-server .
  5. Open examples in browser according to the http-server output