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

@kagronick/kgauge-vue

v1.0.7

Published

JustGage rebuilt for Vue in only 8kb

Downloads

107

Readme

KGague - A Gauge Library for Vue

KGague is the JustGage JavaScript library remade for Vue.js. It does not use any dependencies including JustGage or Raphael. All rendering is done with the Vue rendering engine using SVGs. The gagues it produces are arc or circle shapes. The gagues animate by default with the ability to customise easing functions. As the gauges moves through different ranges you can have the color fade. e.g (Green when low, red when high) These color steps can be customised. Many other features of the Gauge can be customized as well.

KGauge is 7% of the size of Just Gage with Raphael and covers most of the features. The whole library is only 8kb minified. Compare that to JustGage which is 20kb for JustGage minified and 90kb for Raphael minified. Even if you only use Vue for KGauge your page will still be smaller.

Demo

View an interactive demo

Examples

How to use

npm i @kagronick/kgauge-vue
import KGauge from "@kagronick/kgauge-vue";
export default {
  components: {
    KGauge
  },
}
<k-gauge 
  :value="30"
  :width="500"
  :height="300"
  :max="300"
  label-text="GB" />

Or just download and add

<script src="dist/kgauge-vue.min.js"></script>

API

No properties are required but you'll probably want to set value, min, and max to get started.

| Attr. Name | Description | Default Value | |-------------------|-----------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------| | width | Width of component | 200 | | height | Height of component | 150 | | value | The value to display | 10 | | min | The minimum value | 0 | | max | The maximum value | 100 | | animationDuration | How long to animate in miliseconds. Set to 0 to disable animation. | 1000 | | doughnut | Enable doughnut mode | false | | formatFunction | A function to format the value for display. Use to add dollar signs, percent, or display values that are not whole numbers. | Math.round | | colorSteps | An array of colors to fade between | ["#a9d70b", "#f9c802", "#ff0000"] | | valueFontStyle | Font style for the value text | font-size: 35px; fill: #010101; font-weight: bold; font-family: "Arial" | | labelFontStyle | The font style for the label under the value | font: 10px Arial; fill: #b3b3b3 | | minMaxFontStyle | The font style for the min and max labels | font: 11px Arial; fill: #b4b4b4 | | animateOnLoad | Animate to initial value | true | | labelText | Text to show under value | '' | | showMinMax | Show the min and max labels | true | | minTextFormatFn | Format the min text value | (v) => v | | maxTextFormatFn | Format the max text value | (v) => v | | gaugeSize | Scaling of the gauge. Can be made negative to draw the gauge outwards from the center. | 1 | | shadowOpacity | Amount of shadow. Set to 0 to disable. | .2 | | backgroundColor | Color of background | #edebeb | | easingFunction | Easing function for animations. Can be used to bounce the gauge into position. | (t)=> t*(2-t) /* Ease out quad */ | | title | Title string | | | titleStyle | Style for the title | fill: #999999; font-size: 24px; font-weight: bold |

Changelog

06-07-2019 (1.0.7) Fixed title cut off on doughnut on small sizes

06-02-2019 (1.0.6) Fixed bug with single color step. Fixed bug with shadows disabled.

06-02-2019 (1.0.5) Allows min value to be larger than max value. Fixed issue with non-zero min value in doughnut gauges. Added min and max text format functions.

05-18-2019 (1.0.4) Fixed issue with rounding color values to show up correctly on IE.

04-15-2019 (1.0.3) Fixed spelling, allow strings for width and height, added title style, changed default sizing and positioning.

Made by Kyle Agronick with code from the original JustGage project. http://justgage.com/