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

lucify-refugees

v1.0.10

Published

React components for visualizing asylum seeker flows to Europe

Downloads

13

Readme

The flow towards Europe

A visualization of the flow of asylum seekers to European countries from 2012 onwards. Based on UNHCR data. See it in action here. For a more in-depth explanation, read this blog post.

Visualization screenshot

This project uses a combination of React, D3.js and PIXI.js.

Development

Dependencies

  • Node + NPM
  • Development: Bundler: gem install bundler
  • Development: Ruby + RubyGems
  • Development: GDAL (http://www.gdal.org/). On OS X with homebrew install with brew install gdal.
  • Testing: Mocha, for running unit tests: npm install -g mocha

Setup and running

Run the following in the project directory:

  1. npm install
  2. gulp or node ./node_modules/gulp/bin/gulp.js

This project requires gulp 4.0, which is installed by npm install under node_modules. To be able to use the plain gulp command as above, make sure you have gulp-cli version 0.4 installed:

npm install gulpjs/gulp-cli#4.0 -g

For development, run bundle install as well.

Distribution build

A distribution is built by the command gulp dist.

You will likely need to edit the embedBaseUrl and assetContext parameters in gulpfile.babel.js to match your hosting environment. If you are hosting the component at http://www.example.com/static/refugees, you should set embedBaseUrl to http://www.example.com/ and assetContext to static/refugees/.

Publish to Amazon S3

The project includes a gulp task for publishing the project to Amazon S3. It will use credentials from the AWS credentials file (http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html).

In addition to setting up the credentials file, you should change the defaultBucket option in gulfile.babel.js to match the name of your S3 bucket. Additionally, you may wish to change the maxAge option, which affects the cache-control header of assets with filenames having content hashes.

Run the publish task with gulp s3-deploy.

Unit tests

Run unit test with the command mocha in thr project directory.

Embed codes

The build automatically creates a file called embed-codes.html alongside index.html. It contains embed codes for embedding the visualisation into other pages through an iFrame.

Use embed codes from http://www.lucify.com/embed/the-flow-towards-europe/embed-codes.html to embed the visualisation via our Akamai-backed hosting.

Data source

UNHCR monthly asylum applications

If you update the data, you can change the time period during which the visualization runs by updating the values in src/js/model/refugee-constants.js. Note that changing these values has not been extensively tested, and might result in glitches.

Automatic download

Run the included download script:

$ src/scripts/download-unhcr-data.sh

Run gulp prepare-data to generate the JSON file for the visualization.

Manual download

If you prefer to download the data manually, open the UNHCR asylum applications data portal, select the options below and click on Export / Current View / CSV:

  • Years: 2012, 2013, 2014, 2015, 2016
  • Months: All months
  • Country of asylum: All countries
  • Origin: All countries
  • Data item to display: Country of asylum, origin, year

Save the resulting file as data/unhcr_popstats_export_asylum_seekers_monthly.csv, remove the first four (header) rows and run gulp prepare-data to generate the JSON file for the visualization.

Authors

Have feedback? Contact us!

License

This project is released under the MIT license.