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

@exanic/newhome-gauge

v1.6.1

Published

SVG gauge with zero dependencies

Downloads

5

Readme

newhome Gauge

SVG gauge with zero dependencies. Used in newhome sustainability check

Table of contents

Usage

<div class="newhome-gauge">
    <div class="newhome-gauge__container">
        <svg xmlns="http://www.w3.org/2000/svg" width="290" height="290" viewbox="0 0 290 290" class="newhome-gauge__svg js-newhome-gauge">
            <circle class="newhome-gauge__circle newhome-gauge__circle--above" />
            <circle class="newhome-gauge__circle newhome-gauge__circle--mid" />
            <circle class="newhome-gauge__circle newhome-gauge__circle--below" />
        </svg>

        <div class="newhome-gauge__control">
            <div class="newhome-gauge__needle">
                <svg xmlns="http://www.w3.org/2000/svg" width="8" height="154" viewBox="0 0 8 154" class="js-newhome-gauge-needle">
                    <polygon id="needle" points="4 0 5 1 8 150 4 154 0 150 3 1 4 0" />
                </svg>
            </div>
        </div>
    </div>
</div>

Importing in a Typescript project

npm install @exanic/newhome-gauge
import NewhomeGauge from '@exanic/newhome-gauge';

var myGauge = new NewhomeGauge();

// Init gauge
if (myGauge.init()) {
    // Set sections according to your circle elements in percent
    myGauge.setSections([35, 5, 60]);
    
    // Set status of the needle in percent
    myGauge.setStatus(29);
}

Importing via script tag

<script src="newhome-gauge.js"></script>
var NewhomeGauge = NewhomeGauge.default;
var myGauge = new NewhomeGauge();

// Init gauge
if (myGauge.init()) {
    // Set sections according to your circle elements in percent
    myGauge.setSections([35, 5, 60]);
    
    // Set status of the needle in percent
    myGauge.setStatus(29);
}

Run locally

npm run start

This will start a web server on localhost:8080

Browser Support

All modern browser are supported.

IE 11 is only supported if the gsap core library is loaded on your page. That way shortcomings with transforms and transform-origin on SVG elements are fixed.

Contributing

Here's how to contribute to this package and publish new versions.

Run

Run the project by running the following command

npm run start

Build

Build your changes by running the following command

npm run build

Authenticate

Login with your npmjs.com account. Your account must be a member of the exanic organisation.

npm login

Publish

Increase the version number in package.json and publish the package to npmjs.com

npm publish

The updated version should now be available under https://www.npmjs.com/package/@exanic/newhome-gauge