Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/vertical-meter
Generate a dotted vertical bar whose height depends on the given value
https://github.com/shinnn/vertical-meter
Last synced: 27 days ago
JSON representation
Generate a dotted vertical bar whose height depends on the given value
- Host: GitHub
- URL: https://github.com/shinnn/vertical-meter
- Owner: shinnn
- License: isc
- Created: 2017-04-28T07:08:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-30T23:49:37.000Z (over 5 years ago)
- Last Synced: 2024-04-14T13:15:34.402Z (7 months ago)
- Language: JavaScript
- Homepage: https://npm.runkit.com/vertical-meter
- Size: 105 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vertical-meter
[![npm version](https://img.shields.io/npm/v/vertical-meter.svg)](https://www.npmjs.com/package/vertical-meter)
[![Build Status](https://travis-ci.com/shinnn/vertical-meter.svg?branch=master)](https://travis-ci.com/shinnn/vertical-meter)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/vertical-meter.svg)](https://coveralls.io/github/shinnn/vertical-meter?branch=master)Generate a dotted vertical bar whose height depends on the given value
```javascript
const verticalMeter = require('vertical-meter');console.log(
verticalMeter(0),
verticalMeter(0.25),
verticalMeter(0.5),
verticalMeter(0.75),
verticalMeter(1)
);
``````
⠀ ⣀ ⣤ ⣶ ⣿
```## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
```
npm install vertical-meter
```## API
```javascript
const verticalMeter = require('vertical-meter');
```### verticalMeter(*value*)
*value*: `number` (`0`..`1`)
Return: `string`| argument | return |
|:-----------------------|:-------------|
| `0` <= x < `1/8` | `' '` |
| `1/8` <= x < `3/8` | `'⣀'` |
| `3/8` <= x < `5/8` | `'⣤'` |
| `5/8` <= x < `7/8` | `'⣶'` |
| `7/8` <= x <= `1` | `'⣿'` |## License
[ISC License](./LICENSE) © 2018 - 2019 Shinnosuke Watanabe