Socket
Socket
Sign inDemoInstall

liquid-tank

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    liquid-tank

Simple widget for displaying data from liquids.


Version published
Weekly downloads
26
increased by116.67%
Maintainers
1
Install size
16.5 kB
Created
Weekly downloads
 

Readme

Source

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);

FAQs

Last updated on 22 Mar 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc