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

vizwit

v1.1.0

Published

An interactive data visualization tool

Downloads

14

Readme

VizWit

Join the chat at https://gitter.im/timwis/vizwit Stories in Ready Build Status js-standard-style

An interactive data visualization tool. VizWit uses a JSON config file to generate interactive charts that cross-filter one another. It currently supports data hosted in Socrata and Carto, which includes open data provided by cities such as Philadelphia, Chicago, and San Francisco). Data that’s hosted elsewhere can be supported by adding a new data provider.

screencast

Features

  • Clicking on a chart cross-filters the other charts
  • Multiple datasets on one page
  • Configurable via GUI (work in progress)
  • Fork configurations with a gist
  • Pie chart
  • Callout metric
  • Scrolling bar charts
  • Responsive / mobile-friendly
  • Embeddable (and cross-filtering still works)
  • Free-text search on table
  • 100% client-side
  • Open source / extendable

Examples

Configuration

VizWit cards are configured via JSON objects. The layout is defined using size and order properties on those objects, generated by the Config Builder (work in progress). The resulting JSON file is then hosted on gist.github.com, a free and easy service to share code snippets. The Gist ID is then used in the VizWit URL (ie. vizw.it/?gist=a304ce8fac9c14dfbf16). This allows viewers to fork the Gist and build their own VizWit page.

Configuration Documentation

Build your own

Visit the builder and add a few cards, then configure them using the wrench icon. When you're finished, click Export and copy the configuration code into a new "gist" at gist.github.com. Once you click Create, you should see your new "gist" and the "gist id" of random characters in the URL (ie. 813483da72ac781f8b13). Use that gist id to go to http://vizw.it?gist=YOUR_GIST_ID

Alternatively, use the live editor to edit the raw JSON alongside a live representation of it.

If you'd like to share what you've created, post an issue with a link to it.

Technology

VizWit is a client-side JavaScript application. The application is structured using Backbone. Charts are built using AmCharts. Maps are built using Leaflet. Tables are built using DataTables. Tests (of which there are not nearly enough!) are run using Mocha. The interactive layout is generated by Gridstack. The application is compiled using Browserify. See the full list of dependencies in package.json

How it works

vizwit.js is the primary chart-generating module. It takes a container selector and a config object and uses them to initialize a view (bar chart, map, table, etc.). The views are passed a collection and a filteredCollection, which are identical and allow the view to query the data provider. Views generate the chart/map/table/etc. and listen for user interactions on them. On an interaction, the view triggers the global event object with the filter (ie. state=PA), and all views that use the same dataset receive the event and use their filteredCollection to query the data provider with the filter passed through the event. By using a separate collection, VizWit can show the "filtered value" and the "original value" side-by-side.

The actual entry point is either vizwit-loader.js or vizwit-embed.js. vizwit-loader.js fetches a gist or local file, reads its configuration, and passes it to layout.js to create a layout on the page. Then for each chart in the configuration, layout.js calls init() from vizwit.js as described above. vizwit-embed.js simply finds the parent container of the <script> tag that was embedded, and calls init() from vizwit.js inside of it. This way of embedding allows the VizWit library to only be loaded once on the page with as many charts embedded in any element (example).

Development

  • After cloning the repo, use npm install to install dependencies
  • While developing, use npm start to automatically recompile when changes are made and run a web server at localhost:8080
  • Use npm test to verify code style and run unit tests
  • Use npm run build for a production build, and then use npm run deploy to push the dist/ directory to the gh-pages branch (first make the deploy script executable via chmod +x deploy.sh)

License

GPL-2 (create an issue if that doesn't work for someone)