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

blacklight-heatmaps

v2.0.0

Published

Heatmaps for Blacklight

Downloads

100

Readme

BlacklightHeatmaps

blacklight_heatmap

Features

  • Configurable heatmaps of result sets
    • Works with center points and bounding box data
  • Show page map view
  • Changeout the basemap to any tile layer
  • Really fast with large data sets
    • Utilizes Solr's facet heatmap feature to provide snappy results. Tested with an index > 10,000,000 records.
  • Customizable result view template

Installation

Add this line to your application's Gemfile:

gem 'blacklight_heatmaps'

And then execute:

bundle install

Run the BlacklightMaps installer:

rails generate blacklight_heatmaps:install

Getting started

Indexing data

BlacklightHeatmaps expects your data to be indexed as a Spatial Recursive Prefix Tree type. The plugin currently supports data indexed in formats:

  • x y Syntax. example: "-121.631609 36.688128"
  • CQL ENVELOPE Syntax (minX, maxX, maxY, minY). example: "ENVELOPE(122.934585571, 153.987060547, 45.522888184, 20.422889709)"

BlacklightHeatmaps also works with multivalued Spatial Recursive Prefix Tree types.

{
  "id": 1,
  "name": "Null Island",
  "geo_srpt": [
    "ENVELOPE(-0.0005, 0.000379, 0.000309, -0.000282)", "0 0"
  ]
}

Solr does not seem to be able to handle multivalued points without an accompanying geometry.

Additional formats could be added by extending BlacklightHeatmaps::GeometryParser

Customizing the basemap

By default three different basemaps are included with BlacklightHeatmaps. You can modify these by changing the configuration value in the CatalogController.

  # Basemaps configured include: 'positron', 'darkMatter', 'OpenStreetMap.HOT'
  config.basemap_provider = 'OpenStreetMap.HOT'

BlacklightHeatmaps allows you to customize your basemap further to any Leaflet TileLayer subclass. This includes WMS layers, TileLayers, etc. Checkout Leaflet Providers for more ideas on basemaps you can use.

To customize the basemap, make sure that you extend the BlacklightHeatmaps.Basemaps object to include your basemap selection:

  BlacklightHeatmaps.Basemaps[' OpenStreetMap.BlackAndWhite'] = L.tileLayer('http://{s}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png', {
	maxZoom: 18,
	attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});

Customizing the color display

The heatmap color ramp is also customizable. This setting can be modified in CatalogController by passing in an array of hexadecimal color values as strings.

  #Heatmap color ramp. For best results, use http://colorbrewer2.org or http://tristen.ca/hcl-picker/#/hlc/5/1
  config.view.heatmaps.color_ramp = ['#fef0d9','#fdcc8a','#fc8d59','#e34a33','#b30000']

changed_ramp

ColorBrewer is a great resource in choosing a color ramp. It also has options for colorblind safe ramps to use and can export the hex values in an array that you can paste into your configuration.

Development

Run Solr and Blacklight (with BlacklightMaps) for interactive development:

bundle exec rake blacklight_heatmaps:server

Run the test suite

bundle exec rake ci

Build the Javascript bundle

After changing the source javascript in app/javascript, you may want to rebuild the bundled javascript by running:

npm run prepare