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

vue-arc-counter

v3.1.0

Published

Vue compoment to create an SVG counter in a circular arc

Downloads

43

Readme

VUE ARC COUNTER

This Vue component generates counter in a circular arc. The angles, colors, strokewidth, spacing between dashes and direction can all be controlled through properties.

Examples

diagram of arc counter

Sample code on codesandbox

Browser example on Codepen

Project setup

With a package manager

# npm
$ npm install vue-arc-counter

#yarn
$ yarn add vue-arc-counter

For the browser

<script src="unpkg.com/vue-arc-counter@latest/dist/arcCounter.umd.min.js"></script>

How it works

The component generates an SVG element with default width and height of 100% (outer diameter of the counter). Two dashed strokes are overlayed: the bottom one controlled by stroke and dashCount and the top one by activeStroke and activeCount. A start angle smaller than the end angle will make for clockwise counting, vice versa.

You can display a string of text to add a value or label, with limited positioning options. This can be styled with CSS.

The absolute difference between end and start angles should always be less than 360 degrees.

Properties

|prop|description|default|options| |:---|---|---|---| |size|width and height of element|10rem|String| |dashCount|Total number of dashes|21|Natural number| |activeCount|Number of dashes on top|5|Natural number| |strokeWidth|Bottom stroke width as a percentage of the radius|20|0 to 100| |activeWidth|Top stroke width as a percentage of the radius|20|0 to 100| |stroke|Stroke color of the bottom dashes|lightgrey|color| |activeStroke|Stroke color of the top dashes|dodgerblue|color| |dashSpacing|Fraction of width taken up by space between dashes|1/4|0 to 1| |start|Start angle from top|-120|-360 to 360| |end|End angle from top|120|-360 to 360| |text|Text string to display inside SVG|""|String| |textX|Horizontal position of svg text string|center|center, left, right| |textY|Vertical position of svg text string|center|center, top, bottom|

License

MIT Open Source License