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

untd-map

v1.0.0

Published

UNTD Map React component

Downloads

3

Readme

UNTD Map

Getting Started

Run npm install to install required dependencies, then run one of the following:

  • npm run start: this starts the explorer and serves the explorer component from /src/modules/untd/explorer
  • npm run styleguide: this starts the style guide which shows all components available in this repository, along with documentation and examples.

Using components from this library

To use components from this library, first add the repo using npm:

npm install git+ssh://[email protected]:Hyperobjekt/untd-map.git

You can then import any components into your project.

import { Header } from 'untd-components'

function AppHeader() {
  return (
    <div className="page">
      <Header />
      <div className="body">Sample page</div>
    </div>
  )
}

Publishing changes

This library can be published via NPM.

  1. Increment the package version in package.json.
  2. Commit that change: git add * ; git commit -a -m 'Update package version to [version]'.
  3. Run npm publish. This builds two versions of the javascript library and the demo files. The libraries are pushed up to NPM's repository.
  4. Commit the publish (so you don't dirty up your next working branch). git add * && git commit -a -m 'Staging build'.
  5. Update the plugin in the site where you're using it: git checkout -b update-explorer ; npm update untd-map.
  6. Commit that update, merge to master, and push. git add * ; git commit -a -m 'Update untd-map' ; git checkout master ; git merge update-explorer ; git push origin master

Contributing

  1. To contribute, check out a new branch off of the master branch.
  2. When you have finished, submit your changes as a pull request relative to the master branch.

Implementation Details

  • Base components: reactstrap
  • State management: zustand
    • manage state using a store for each module that need to share state between components

Updating data

This app draws data files from the Child Poverty Action Lab Social Mobility github repository. Use the branches in that repository to roll out data updates across a series of staging and production sites:

  1. The testing branch of the Social Mobility dataset is loaded here: https://hyperobjekt.github.io/untd-map/
  2. The staging branch of the Social Mobility dataset is loaded here: https://staging--socialmobility.netlify.app/
  3. The production branch of the Social Mobility dataset is loaded here: https://socialmobility.netlify.app/

To test updates to the dataset (:microscope: and make sure they don't break the app :fire:), follow these steps:

  1. Make your changes to master.
git add *
git commit -a -m 'Blah updates'
git push origin master
  1. Check out testing and merge master into testing. Push testing back to origin.
git checkout testing
git merge master
git push origin testing
  1. Check https://hyperobjekt.github.io/untd-map/ to make sure nothing has broken in the app. Test the features (tooltips, filtering, layer selection) and verify that all of the choropleths and point features are still displayed and filtered correctly.
  2. Repeat for the subsequent branches, moving changes to staging, testing the staging instance of the app, then moving changes to production and testing once again.

Configuration

The following values must be provided in a .env file when the application builds:

GATSBY_MAPBOX_USER= # Mapbox account username
GATSBY_MAPBOX_API_TOKEN= # Mapbox api token with appropriate (read-only) permissions
GATSBY_NODE_ENV= # Not used by the app
GATSBY_DATA_ENDPOINT= # AWS endpoint for data, no slash at end
GATSBY_DATA_BRANCH= # Which branch of the client's repo is used loaded into the app, testing, staging, or production
GATSBY_SHOW_DATA_ISSUES= # 1 or 0, display data issues in the UI (1), or log to the console (0 or unset)