blacklight_heatmaps 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/images/blacklight/heatmaps.svg +1 -0
- data/app/assets/javascripts/blacklight_heatmaps/viewers/index.js +3 -3
- data/app/helpers/blacklight/maps_helper.rb +2 -10
- data/app/views/catalog/index.heatmaps.jbuilder +11 -0
- data/lib/blacklight_heatmaps/engine.rb +1 -0
- data/lib/blacklight_heatmaps/version.rb +1 -1
- data/lib/generators/blacklight_heatmaps/install_generator.rb +1 -0
- data/spec/examples.txt +28 -28
- data/spec/features/index_page_map_spec.rb +1 -1
- data/spec/helpers/blacklight/maps_helper_spec.rb +1 -1
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
- metadata +7 -6
- data/app/views/catalog/index.json.jbuilder +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26bffb89cbdef284a0c7d9371bc7d4258a831727f612189f357b8885581c2525
|
4
|
+
data.tar.gz: 66c943c2b5d8d29040fab2f39eddc56f502d94559737a4322ba303dfcfee5015
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 682416c146e30849dd5762bb0f27183eb0c768e32744bd3f88ff70bc35d3b9a390e6a49cc71a594f7f42aad79a2f00f78677b8576212c65506e8ba4a290ad580
|
7
|
+
data.tar.gz: '06256879e30ffb87211d670982d7b105f06a3033bd25f54837950e2b6d8939cd1c59ba20a43fb12e26e0e3340f468247bf95964da6d355581dbf86ca89fe5ca9'
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M16 10h-2v2h2v-2zm0 4h-2v2h2v-2zm-8-4H6v2h2v-2zm4 0h-2v2h2v-2zm8-6H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V6h16v12z"/></svg>
|
@@ -15,13 +15,13 @@ Blacklight.onLoad(function () {
|
|
15
15
|
initialize: function (el, options) {
|
16
16
|
var _this = this;
|
17
17
|
var $el = $(el);
|
18
|
-
var requestUrl = $el.data().searchUrl + '&format=
|
18
|
+
var requestUrl = $el.data().searchUrl + '&format=heatmaps';
|
19
19
|
var geometryField = $el.data().geometryField;
|
20
20
|
var template = $el.data().sidebarTemplate;
|
21
21
|
var colorRamp = $el.data().colorRamp;
|
22
22
|
|
23
23
|
// Blank out page link content first and disable pagination
|
24
|
-
$('#sortAndPerPage .
|
24
|
+
$('#sortAndPerPage .page-links').html('');
|
25
25
|
$('ul.pagination li').addClass('disabled');
|
26
26
|
|
27
27
|
var map = L.map($el[0].id).setView([0, 0], 1);
|
@@ -64,7 +64,7 @@ Blacklight.onLoad(function () {
|
|
64
64
|
sidebar.setContent(html);
|
65
65
|
|
66
66
|
var docCount = e.response.pages.total_count;
|
67
|
-
$('#sortAndPerPage .
|
67
|
+
$('#sortAndPerPage .page-links').html(
|
68
68
|
parseInt(docCount).toLocaleString() + ' ' +
|
69
69
|
_this.pluralize(docCount, 'item') + ' found'
|
70
70
|
);
|
@@ -23,8 +23,8 @@ module Blacklight
|
|
23
23
|
<div class='media'>
|
24
24
|
<div class='media-body'>
|
25
25
|
<h3 class='media-heading'>
|
26
|
-
<a href=\"
|
27
|
-
{
|
26
|
+
<a href=\"{url}\"}>
|
27
|
+
{title}
|
28
28
|
</a>
|
29
29
|
</h3>
|
30
30
|
</div>
|
@@ -34,14 +34,6 @@ module Blacklight
|
|
34
34
|
|
35
35
|
private
|
36
36
|
|
37
|
-
##
|
38
|
-
# Document path used for creating client side links to documents from a
|
39
|
-
# template
|
40
|
-
# @return String
|
41
|
-
def document_path
|
42
|
-
"#{search_catalog_path}/{#{blacklight_config.document_unique_id_param}}"
|
43
|
-
end
|
44
|
-
|
45
37
|
##
|
46
38
|
# Data attributes used in displaying the index map
|
47
39
|
# @return Hash
|
@@ -0,0 +1,11 @@
|
|
1
|
+
presenter = Blacklight::JsonPresenter.new(@response, blacklight_config)
|
2
|
+
|
3
|
+
json.response do
|
4
|
+
json.docs(presenter.documents) do |document|
|
5
|
+
json.url polymorphic_url(url_for_document(document))
|
6
|
+
json.title index_presenter(document).heading
|
7
|
+
end
|
8
|
+
|
9
|
+
json.facet_heatmaps @response['facet_counts']['facet_heatmaps']
|
10
|
+
json.pages presenter.pagination_info
|
11
|
+
end
|
@@ -17,6 +17,7 @@ module BlacklightHeatmaps
|
|
17
17
|
"\n # Basemaps configured include: 'positron', 'darkMatter', 'OpenStreetMap.HOT'" \
|
18
18
|
"\n config.basemap_provider = 'positron'" \
|
19
19
|
"\n config.show.partials.insert(1, :show_leaflet_map)" \
|
20
|
+
"\n config.index.respond_to.heatmaps = true" \
|
20
21
|
"\n config.view.heatmaps.partials = []" \
|
21
22
|
"\n #Heatmap color ramp. For best results, use http://colorbrewer2.org or http://tristen.ca/hcl-picker/#/hlc/5/1" \
|
22
23
|
"\n config.view.heatmaps.color_ramp = ['#ffffcc', '#a1dab4', '#41b6c4', '#2c7fb8', '#253494']" \
|
data/spec/examples.txt
CHANGED
@@ -1,31 +1,31 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
--------------------------------------------------------------------------------------- | ------ | --------------- |
|
3
|
-
./spec/features/configurable_basemap_spec.rb[1:1] | passed |
|
4
|
-
./spec/features/configurable_basemap_spec.rb[1:2:1] | passed | 0.
|
5
|
-
./spec/features/configurable_basemap_spec.rb[1:3:1] | passed | 0.
|
6
|
-
./spec/features/index_page_map_spec.rb[1:1] |
|
7
|
-
./spec/features/show_page_map_spec.rb[1:1] |
|
8
|
-
./spec/features/show_page_map_spec.rb[1:2] | passed | 0.
|
9
|
-
./spec/helpers/blacklight/maps_helper_spec.rb[1:1:1] | passed | 0.
|
10
|
-
./spec/helpers/blacklight/maps_helper_spec.rb[1:2:1] |
|
11
|
-
./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:1:1] | passed | 0.
|
12
|
-
./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:2:1] | passed | 0.
|
13
|
-
./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:3:1] | passed | 0.
|
14
|
-
./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:4:1] | passed | 0.
|
15
|
-
./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:1:1] | passed | 0.
|
16
|
-
./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:2:1] | passed | 0.
|
17
|
-
./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:3:1] | passed | 0.
|
18
|
-
./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:1:1] | passed | 0.
|
19
|
-
./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:2:1] | passed | 0.
|
20
|
-
./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:3:1] | passed | 0.
|
21
|
-
./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:4:1] | passed | 0.
|
22
|
-
./spec/models/concerns/blacklight_heatmaps/point_spec.rb[1:1:1] | passed | 0.
|
23
|
-
./spec/models/concerns/blacklight_heatmaps/point_spec.rb[1:2:1] | passed | 0.
|
24
|
-
./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:1:1:1] | passed | 0.
|
25
|
-
./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:1:2:1] | passed | 0.
|
26
|
-
./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:2:1] | passed | 0.
|
27
|
-
./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:3:1] | passed | 0.
|
3
|
+
./spec/features/configurable_basemap_spec.rb[1:1] | passed | 3.24 seconds |
|
4
|
+
./spec/features/configurable_basemap_spec.rb[1:2:1] | passed | 0.2779 seconds |
|
5
|
+
./spec/features/configurable_basemap_spec.rb[1:3:1] | passed | 0.23355 seconds |
|
6
|
+
./spec/features/index_page_map_spec.rb[1:1] | failed | 2.27 seconds |
|
7
|
+
./spec/features/show_page_map_spec.rb[1:1] | failed | 2.26 seconds |
|
8
|
+
./spec/features/show_page_map_spec.rb[1:2] | passed | 0.26337 seconds |
|
9
|
+
./spec/helpers/blacklight/maps_helper_spec.rb[1:1:1] | passed | 0.00611 seconds |
|
10
|
+
./spec/helpers/blacklight/maps_helper_spec.rb[1:2:1] | failed | 0.00498 seconds |
|
11
|
+
./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:1:1] | passed | 0.00025 seconds |
|
12
|
+
./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:2:1] | passed | 0.00026 seconds |
|
13
|
+
./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:3:1] | passed | 0.00025 seconds |
|
14
|
+
./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:4:1] | passed | 0.00029 seconds |
|
15
|
+
./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:1:1] | passed | 0.00028 seconds |
|
16
|
+
./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:2:1] | passed | 0.00019 seconds |
|
17
|
+
./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:3:1] | passed | 0.00372 seconds |
|
18
|
+
./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:1:1] | passed | 0.00101 seconds |
|
19
|
+
./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:2:1] | passed | 0.00039 seconds |
|
20
|
+
./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:3:1] | passed | 0.0033 seconds |
|
21
|
+
./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:4:1] | passed | 0.03817 seconds |
|
22
|
+
./spec/models/concerns/blacklight_heatmaps/point_spec.rb[1:1:1] | passed | 0.00021 seconds |
|
23
|
+
./spec/models/concerns/blacklight_heatmaps/point_spec.rb[1:2:1] | passed | 0.00206 seconds |
|
24
|
+
./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:1:1:1] | passed | 0.00106 seconds |
|
25
|
+
./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:1:2:1] | passed | 0.00424 seconds |
|
26
|
+
./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:2:1] | passed | 0.00097 seconds |
|
27
|
+
./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:3:1] | passed | 0.00613 seconds |
|
28
28
|
./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:4:1] | passed | 0.00082 seconds |
|
29
|
-
./spec/views/catalog/_document_heatmaps.html.erb_spec.rb[1:1] | passed | 0.
|
30
|
-
./spec/views/catalog/_show_leaflet_map_default.html.erb_spec.rb[1:1:1] | passed | 0.
|
31
|
-
./spec/views/catalog/_show_leaflet_map_default.html.erb_spec.rb[1:2:1] | passed | 0.
|
29
|
+
./spec/views/catalog/_document_heatmaps.html.erb_spec.rb[1:1] | passed | 0.01318 seconds |
|
30
|
+
./spec/views/catalog/_show_leaflet_map_default.html.erb_spec.rb[1:1:1] | passed | 0.00453 seconds |
|
31
|
+
./spec/views/catalog/_show_leaflet_map_default.html.erb_spec.rb[1:2:1] | passed | 0.08105 seconds |
|
@@ -12,7 +12,7 @@ feature 'Index page map', js: true do
|
|
12
12
|
expect(page).to have_css 'ul.pagination li.disabled', count: 6
|
13
13
|
|
14
14
|
# Document counts
|
15
|
-
expect(page).to have_css '.
|
15
|
+
expect(page).to have_css '.page-links', text: '18 items found'
|
16
16
|
|
17
17
|
expect(page).to have_css '#index-map-sidebar', visible: false
|
18
18
|
page.first('svg g path').click
|
@@ -31,7 +31,7 @@ describe Blacklight::MapsHelper do
|
|
31
31
|
describe '#sidebar_template' do
|
32
32
|
it 'renders html template used in sidebar' do
|
33
33
|
expect(helper.sidebar_template)
|
34
|
-
.to have_css '.media .media-body h3.media-heading a', text: '{
|
34
|
+
.to have_css '.media .media-body h3.media-heading a', text: '{title}'
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight_heatmaps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Reed
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
39
|
+
version: '7.0'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '7.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: leaflet-rails
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -166,6 +166,7 @@ files:
|
|
166
166
|
- LICENSE.txt
|
167
167
|
- README.md
|
168
168
|
- Rakefile
|
169
|
+
- app/assets/images/blacklight/heatmaps.svg
|
169
170
|
- app/assets/javascripts/blacklight_heatmaps/basemaps.js
|
170
171
|
- app/assets/javascripts/blacklight_heatmaps/blacklight_heatmaps.js
|
171
172
|
- app/assets/javascripts/blacklight_heatmaps/default.js
|
@@ -183,7 +184,7 @@ files:
|
|
183
184
|
- app/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior.rb
|
184
185
|
- app/views/catalog/_document_heatmaps.html.erb
|
185
186
|
- app/views/catalog/_show_leaflet_map_default.html.erb
|
186
|
-
- app/views/catalog/index.
|
187
|
+
- app/views/catalog/index.heatmaps.jbuilder
|
187
188
|
- app/views/layouts/blacklight_heatmaps/application.html.erb
|
188
189
|
- config/routes.rb
|
189
190
|
- lib/blacklight_heatmaps.rb
|
@@ -231,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
231
232
|
- !ruby/object:Gem::Version
|
232
233
|
version: '0'
|
233
234
|
requirements: []
|
234
|
-
rubygems_version: 3.
|
235
|
+
rubygems_version: 3.0.3
|
235
236
|
signing_key:
|
236
237
|
specification_version: 4
|
237
238
|
summary: Search and view Blacklight resources on a map.
|
@@ -1,10 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# Overrides default index.json.jbuilder from Blacklight by adding the
|
3
|
-
# `facet_heatmaps` key/value
|
4
|
-
|
5
|
-
json.response do
|
6
|
-
json.docs @presenter.documents
|
7
|
-
json.facets @presenter.search_facets_as_json
|
8
|
-
json.facet_heatmaps @response['facet_counts']['facet_heatmaps']
|
9
|
-
json.pages @presenter.pagination_info
|
10
|
-
end
|