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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ng-us-map-svg

v1.0.2

Published

A standalone Angular component for displaying an interactive US map in SVG.

Readme

Angular US Map SVG

This package provides the ng-us-map-svg component that can be used to generate a clickable US Map SVG. An event is emitted providing the ability to set callback function and input parameters allow customizaion of fill & stroke colors.

The component is designed to be reusable and customizable. It allows you to display a clickable US map using SVG paths for each state. The map is interactive, and when a state is clicked, it emits an event with the state name. The component can be easily integrated into any Angular application.

Open in Stackblitz

usmap

This is an updated version of angular4-us-map-svg.

How to install

Accessing Component

To use it as a stand-alone component, import the component:

Then include it in your component's imports:

Then add it to the component's template:

API Reference

Inputs

||| |-|-| | gradientStops | Type: Array<string> Optional. Sets the linear gradient fill colors for the states (internally named grad1).For Example: gradientStops=['#1F886E', '#177DC1'] | | stateColor | Type: string Optional. Sets the background color of state area.For Example: stateColor="#C0C0C0" or to use the linear gradient from gradientStops stateColor="url(#grad1)" | | labelColor | Type: string Optional. Sets the color of state name text.For Example: labelColor="#C0C0C0" | | borderColor | Type: string Optional. Sets the border color of state area.For Example: borderColor="#C0C0C0" | | lineColor | Type: string Optional. Sets the line color for state names outside the map pointing to the state.For Example: lineColor="#C0C0C0" | | hoverColor | Type: string Optional. Sets the color for state when mouse hovers over them.For Example: hoverColor="#43C3FD" | | states | Type: any Optional. JSON data for states to show.The data must minimally contain an id attribute for the state identifier and a d attribute containing the SVG path of the state shape.It should also contain an x and y location for the location of the state label (the id).If the state shape is too small to contain the label, it may also define boxX, boxY, boxW, and boxH attributes (x,y, width, height) to create a separate box to place the label in. When adding an extra box, it would be expected to also add lineX1, lineY1, lineX2, andlineY2 attributes for a line to connect the state to the box. |

Output

||| |-|-| | mapClick | Will be emitted when a state area has been clicked. It returns the state abbreviation in the (mapClick) event. |

In order to perform actions based on map clicks, attach your event handler to the mapClick event.

Styling

Apply your own CSS to beautify this component.

||| |-|-| | svg-state-group | Class associated with SVG g elements that encapsulate the state border, label, and any additional parts. | | svg-state-path | Class associated with SVG path elements that draw the state borders. | | svg-state-label | Class associated with the SVG text elements that show each state abbreviation. | | svg-state-rect | Class associated with the SVG rect elements that encapsulate the state label for small states. | | svg-state-line | Class associated with SVG line elements that connect the state rectangles to the state. |