# @nebula.js/sn-kpi

A KPI supernova, based on the Qlik Sense nativa KPI object.

[![CircleCI](https://circleci.com/gh/qlik-trial/sn-kpi.svg?style=svg&circle-token=7dcc416f3e6c829bcc01f29554c96097ba6f1508)](https://circleci.com/gh/qlik-trial/sn-kpi)
[![Maintainability](https://api.codeclimate.com/v1/badges/d87a8d2814c8a4ba6ea3/maintainability)](https://codeclimate.com/repos/60c0a216875d9901b6012459/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/d87a8d2814c8a4ba6ea3/test_coverage)](https://codeclimate.com/repos/60c0a216875d9901b6012459/test_coverage)

![KPI preview](./assets/preview.png)

## Contribution

Instructions for developing and releasing can be found in the [contribution document](https://github.com/qlik-trial/sn-kpi/blob/main/.github/CONTRIBUTION.md)

## Installing

If you use npm: `npm install @nebula.js/sn-kpi`.

You can also load through the script tag directly from [https://unpkg.com](https://unpkg.com/@nebula.js/sn-kpi).

## Usage

```js

import { embed } from '@nebula.js/stardust';
import kpi from '@nebula.js/sn-kpi';

// 'app' is an enigma app model
const nuked = embed(app, {
  types: [{ // register the kpi
    name: 'kpi',
    load: () => Promise.resolve(kpi);
  }]
});

nuked.render({
  element,
  type: 'kpi',
});
```

[See full example](./example)
