npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

liquid_gauge

v1.0.8

Published

Liquid Fill Gauge Chart

Downloads

14

Readme

LiquidGauge

Liquid fill gauge with number indicator

Example Gauge

Gauge

Configuration Options

minValue

Type: number
Default: 0
Description: The gauge minimum value.

maxValue

Type: number
Default: 200
Description: The gauge maximum value.

circleThickness

Type: number
Default: 0.05
Description: The outer circle thickness as a percentage of it's radius.

circleFillGap

Type: number
Default: 0.05
Description: The size of the gap between the outer circle and wave circle as a percentage of the outer circles radius.

circleColor

Type: string
Default: #178BCA
Description: The color of the outer circle.

waveHeight

Type: number
Default: 0.05
Description: The wave height as a percentage of the radius of the wave circle.

waveCount

Type: number
Default: 1
Description: The number of full waves per width of the wave circle.

circleThickness

Type: number
Default: 0.05
Description: The outer circle thickness as a percentage of it's radius.

waveRiseTime

Type: number
Default: 1000
Description: The amount of time in milliseconds for the wave to rise from 0 to it's final height.

waveAnimateTime

Type: number
Default: 18000
Description: The amount of time in milliseconds for a full wave to enter the wave circle.

waveRise

Type: boolean
Default: true
Description: Control if the wave should rise from 0 to it's full height, or start at it's full height.

waveHeightScaling

Type: boolean
Default: true
Description: Controls wave size scaling at low and high fill percentages. When true, wave height reaches it's maximum at 50% fill, and minimum at 0% and 100% fill. This helps to prevent the wave from making the wave circle from appear totally full or empty when near it's minimum or maximum fill.

waveAnimate

Type: boolean
Default: true
Description: Controls if the wave scrolls or is static.

waveColor

Type: string
Default: #178BCA
Description: The color of the fill wave.

waveOffset

Type: number
Default: 0
Description: The amount to initially offset the wave. 0 = no offset. 1 = offset of one full wave.

textVertPosition

Type: number
Default: 0.5
Description: The height at which to display the percentage text withing the wave circle. 0 = bottom, 1 = top.

textSize

Type: number
Default: 1
Description: The relative height of the text to display in the wave circle. 1 = 50%

valueCountUp

Type: boolean
Default: true
Description: If true, the displayed value counts up from 0 to it's final value upon loading. If false, the final value is displayed.

textColor

Type: string
Default: #045681
Description: The color of the value text when the wave does not overlap it.

waveTextColor

Type: string
Default: #A4DBf8
Description: The color of the value text when the wave overlaps it.

Example code

// Setup some data
var data = 500;

// Setup some settings
var height = 200;
var width = 200;

// Initialze the widget
var chart = d3.select('#vis')
  .append('svg')
  .attr({
    id: 'gauge',
    height: height + 'px',
    width: width + 'px',
  })
  .chart('LiquidFillGauge')
  .c({
    width: width,
    height: height,
    elementId: '#gauge',
  })
  .draw(data);