@gravity-ui/yagr
TypeScript icon, indicating that this package has built-in type declarations

4.3.2 • Public • Published

Ẏ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

/@gravity-ui/yagr/

    Package Sidebar

    Install

    npm i @gravity-ui/yagr

    Weekly Downloads

    1,656

    Version

    4.3.2

    License

    MIT

    Unpacked Size

    6.05 MB

    Total Files

    153

    Last publish

    Collaborators

    • gravity-ui-bot
    • amje
    • resure