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

@datacommonsorg/web-components

v0.0.1

Published

Embed [Data Commons](https://datacommons.org) [statistical variable](https://datacommons.org/tools/statvar) observation visualizations in your web application.

Readme

Data Commons Web Components

Embed Data Commons statistical variable observation visualizations in your web application.

Usage

Include datacommons.js in your html's <head>...</head> tag. Then use datacommons-* web component tags to add embedded data visualizations.

Example:

<html>
  <head>
    <script src="https://datacommons.org/datacommons.js"></script>
  </head>
  <body>
    <datacommons-line
      title="US Population Over Time"
      place="country/USA"
      variables="Count_Person"
    ></datacommons-line>
  </body>
</html>

Playground (source)

Components

Examples

Variables and places

Data Commons web components visualize statistical variables about one or more places. Variables and places are identified by Data Commons Identifiers, or DCIDs.

To find the DCID of a place or variable:

  1. Browse all 175K+ variables with the Data Commons Statistical Variable Explorer.

  2. Search for places and variables with the Data Commons Search page.

  3. Use the Data Commons Graph Browser to understand the relationship between entities.

Example #1: Inspecting Health / Health Insurance (Household) / No Health Insurance / Households Without Health Insurance shows us that the statistical variable Count_Household_NoHealthInsurance is available in the United States (DCID: country/USA) at State, County, and City levels.

Example #2 , the graph browser country/USA page shows the DCIDs for all US states and territories.

Styling

Custom styles are supported through CSS shadow parts.

| CSS ::part | Description | Components | | ------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -------------------------- | | container | Chart container element | All | | legend | Chart legend | bar, line, map,pie | | place-path | Geo boundary | map | | place-path-<dcid> | Geo boundary for a particular place. Example: place-path-geoId\/12 * | map | | series | Series data (line, bar, lollipop, etc) | bar, line. pie | | series-place-<dcid> | Series data for a particular place. Example: series-place-geoId\/12 * | bar, line. pie | | series-place-<dcid>-variable-<dcid> | Series data for a particular place and variable. Example: series-place-geoId\/12-variable-Count_Person * | bar, line | | series-variable-<dcid> | Series data for a variable. Example: series-place-variable-Count_Person | bar, line. pie | | header | Chart title | All | | subheader | Chart subtitle (if provided in slot="subheader") | All | | footer | Chart footer (if provided in slot="footer") | All | | x-axis | X-axis line | bar, line | | x-axis-text | X-axis label text | bar, line | | x-axis-tick | X-axis tick mark | bar, line | | y-axis-text | Y-Axis label text | bar, line | | y-axis-tick | Y-Axis tick mark | bar, line |

* Escape forward slashes in ::part() names

Additionally, the following css variables are supported:

| CSS variable | Description | Default | | --------------------------- | ---------------------------------------------------------- | ------------------ | | --dc-headings-font-family | Font family for web component headings (h1 through h6) | Google Sans | | --dc-font-family | Font family for web component body text | Google Sans Text |

Example:

<html>
  <head>
    <style>
      #styled-map {
        --dc-headings-font-family: monospace;
      }
      #styled-map::part(container) {
        border-radius: 10px;
        border: 1px solid #f5f5f5;
        box-shadow: 1px 2px 6px rgba(3, 7, 18, 0.04),
          5px 8px 25px rgba(3, 7, 18, 0.08);
      }
      #styled-map::part(legend) {
        border: 1px solid #e1e1e1;
        padding: 5px 8px;
        border-radius: 10px;
      }
      #styled-map::part(title) {
        font-weight: 200;
        font-size: 16px;
        margin-bottom: 16px;
        color: #111a1b;
      }
      #styled-map::part(place-path) {
        fill: #e9e9e9;
      }
      #styled-map::part(place-path-geoId\/12),
      #styled-map::part(place-path-geoId\/13),
      #styled-map::part(place-path-geoId\/06) {
        fill-opacity: 1;
        fill: #e76f51;
        stroke: #b72a53;
        stroke-width: 2px;
      }
    </style>
  </head>
  <body>
    <datacommons-map
      id="styled-map"
      title="Three most populous US states"
      parentPlace="country/USA"
      childPlaceType="State"
      variable="Count_Person"
    ></datacommons-map>
  </body>
</head>

Playground (source)

License

Apache 2.0

Support

For general questions or issues, please open an issue on our issues page. For all other questions, please send an email to [email protected].