# cli-dot-matrix-display

> A library to create a command line dot matrix display.

Latest version **0.1.2** (published 2017-02-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install cli-dot-matrix-display
pnpm add cli-dot-matrix-display
yarn add cli-dot-matrix-display
bun add cli-dot-matrix-display
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2017-02-19 |
| First published | 2017-02-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Björn Hempel |
| Maintainers | julbo |

## Links

- npm: https://www.npmjs.com/package/cli-dot-matrix-display
- npm.io page: https://npm.io/package/cli-dot-matrix-display

## Recent versions

- 0.1.2 (latest) — 2017-02-19
- 0.1.1 — 2017-02-19
- 0.1.0 — 2017-02-19

## README

# cli-dot-matrix-display

> A library to create a command line dot matrix display.


## Install

```
$ npm install cli-dot-matrix-display
```


## Usage

```js
var cliDotMatrixDisplay = require('cli-dot-matrix-display');

var width   = 128;
var height  = 32;
var display = new cliDotMatrixDisplay.builder(width, height);

/* print some custom dots */
var dots = {
    0: {
        0: true
    },
    1: {
        1: true
    },
    2: {
        2: true
    },
    3: {
        3: true
    }
};
console.log('――――――――――');
display.setDots(dots, true);
console.log(display.getPanel());
console.log('――――――――――');

/* print all dots */
console.log('――――――――――');
display.enableAllDots();
console.log(display.getPanel());
console.log('――――――――――');

/* print empty display */
console.log('――――――――――');
display.resetPanel();
console.log(display.getPanel());
console.log('――――――――――');

/* print sinus curve */
console.log('――――――――――');
var heightHalf = Math.floor((height - 1) / 2);
display.setDotsByCallback(function (x) {
    return Math.sin(16 * x * Math.PI / 180) * heightHalf + heightHalf;
}, true, {'fill-below': true});
console.log(display.getPanel());
console.log('――――――――――');

/* print increasing line */
console.log('――――――――――');
display.setDotsByCallback(function (x) {
    return x / 4;
}, true, {'fill-above': true});
console.log(display.getPanel());
console.log('――――――――――');

console.log('');
```

![cli-dot-matrix-display!](https://www.ixno.de/images/cli-dot-matrix-display.png)

## License

ISC © [Björn Hempel](https://www.ixno.de)

---
_Source: https://npm.io/package/cli-dot-matrix-display · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
