0.0.11 • Published 3 years ago

liquid-tank v0.0.11

Weekly downloads
11
License
ISC
Repository
github
Last release
3 years ago

Liquid Tank

Simple widget for displaying data from liquids.

Options

PropertyDescriptionTypeDefault
minMinimum valueNumber0
maxMaximum valueNumber1
segmentsList of segments.Array
fillStyleStyle of the tank fill. Either "solid" or "segmented".String"solid"
darkWhen set to true it adjusts colors for a darker background.Booleanfalse
fontFamilyFont family for the displayed valueStringArial
fontSizeFont size for the displayed valueNumber20
valueFormatterFunction used to format the displayed value. Must return a string.Function

Example

var element = document.getElementById("widget");
var liquidTank = new LiquidTank(element, {
    min: 0,
    max: 100,
    fillStyle: 'solid',
    segments: [
        {
            color: "#00FF00",
            startValue: 0,
            endValue: 90
        },
        {
            color: "#FF0000",
            startValue: 90,
            endValue: 100
        }
    ],
    dark: false,
    fontFamily: 'Arial',
    fontSize: 20,
    valueFormatter: function (value) {
        return value + ' L';
    }
});

liquidTank.setValue(80);
0.0.11

3 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago

0.0.0

5 years ago