sul-dlss/blacklight_heatmaps

Name: blacklight_heatmaps

Owner: Stanford University Digital Library

Description: Heatmaps for Blacklight

Created: 2016-06-22 17:48:29.0

Updated: 2018-05-03 13:51:33.0

Pushed: 2017-11-09 20:37:12.0

Homepage:

Size: 555

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

BlacklightHeatmaps

Build Status | Coverage Status

blacklight_heatmap

Features
Installation

Add this line to your application's Gemfile:

'blacklight_heatmaps'

And then execute:

le install

Run the BlacklightMaps installer:

s 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:

BlacklightHeatmaps also works with multivalued Spatial Recursive Prefix Tree types.


d": 1,
ame": "Null Island",
eo_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'
nfig.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:

acklightHeatmaps.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.

eatmap color ramp. For best results, use http://colorbrewer2.org or http://tristen.ca/hcl-picker/#/hlc/5/1
nfig.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:

le exec rake blacklight_heatmaps:server

Run the test suite

le exec rake ci

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.