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
Size: 555
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Add this line to your application's Gemfile:
'blacklight_heatmaps'
And then execute:
le install
Run the BlacklightMaps installer:
s generate blacklight_heatmaps:install
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”minX, maxX, maxY, minY
). example: “ENVELOPE(122.934585571, 153.987060547, 45.522888184, 20.422889709)”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
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: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
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']
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.
Run Solr and Blacklight (with BlacklightMaps) for interactive development:
le exec rake blacklight_heatmaps:server
Run the test suite
le exec rake ci