blacklight_heatmaps 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cefef95e8b1a4bb3a7e075c2eec6832db12e6baadd58a03c97af5165d95fca89
4
- data.tar.gz: e3032fe56ab7fa0848ba334f2faf12b97a9657e62912aaa4a8269530e954db7d
3
+ metadata.gz: 26bffb89cbdef284a0c7d9371bc7d4258a831727f612189f357b8885581c2525
4
+ data.tar.gz: 66c943c2b5d8d29040fab2f39eddc56f502d94559737a4322ba303dfcfee5015
5
5
  SHA512:
6
- metadata.gz: 442643a2ab97acd4ddf6e71f9cb015a62d1ef194adb3084105a11300988e3361df51422e133f6664956e413ff86998dccc5ce5d7d3431b9619ebd88e092bb4af
7
- data.tar.gz: ea43d51dc46c20bf0304e0d4d65d2106e50ef5fc1a8549579c8dfe2a20a20be56b88840f5eddabf78b7ce0763f2d35a7321512f2ba6df28247689473c033320b
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=json';
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 .page_links').html('');
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 .page_links').html(
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=\"#{document_path}\"}>
27
- {#{blacklight_config.index.title_field}}
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
@@ -3,6 +3,7 @@ module BlacklightHeatmaps
3
3
  isolate_namespace BlacklightHeatmaps
4
4
  initializer 'blacklight-maps.helpers' do |app|
5
5
  ActionView::Base.send :include, Blacklight::MapsHelper
6
+ Mime::Type.register 'application/vnd.heatmaps+json', :heatmaps
6
7
  end
7
8
  end
8
9
  end
@@ -1,3 +1,3 @@
1
1
  module BlacklightHeatmaps
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  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']" \
@@ -1,31 +1,31 @@
1
1
  example_id | status | run_time |
2
2
  --------------------------------------------------------------------------------------- | ------ | --------------- |
3
- ./spec/features/configurable_basemap_spec.rb[1:1] | passed | 7.83 seconds |
4
- ./spec/features/configurable_basemap_spec.rb[1:2:1] | passed | 0.29095 seconds |
5
- ./spec/features/configurable_basemap_spec.rb[1:3:1] | passed | 0.24555 seconds |
6
- ./spec/features/index_page_map_spec.rb[1:1] | passed | 0.55661 seconds |
7
- ./spec/features/show_page_map_spec.rb[1:1] | passed | 0.52044 seconds |
8
- ./spec/features/show_page_map_spec.rb[1:2] | passed | 0.2398 seconds |
9
- ./spec/helpers/blacklight/maps_helper_spec.rb[1:1:1] | passed | 0.00666 seconds |
10
- ./spec/helpers/blacklight/maps_helper_spec.rb[1:2:1] | passed | 0.00164 seconds |
11
- ./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:1:1] | passed | 0.00018 seconds |
12
- ./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:2:1] | passed | 0.00018 seconds |
13
- ./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:3:1] | passed | 0.00026 seconds |
14
- ./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:4:1] | passed | 0.00028 seconds |
15
- ./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:1:1] | passed | 0.00019 seconds |
16
- ./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:2:1] | passed | 0.001 seconds |
17
- ./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:3:1] | passed | 0.00535 seconds |
18
- ./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:1:1] | passed | 0.00058 seconds |
19
- ./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:2:1] | passed | 0.00041 seconds |
20
- ./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:3:1] | passed | 0.00052 seconds |
21
- ./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:4:1] | passed | 0.00028 seconds |
22
- ./spec/models/concerns/blacklight_heatmaps/point_spec.rb[1:1:1] | passed | 0.00033 seconds |
23
- ./spec/models/concerns/blacklight_heatmaps/point_spec.rb[1:2:1] | passed | 0.00024 seconds |
24
- ./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:1:1:1] | passed | 0.00079 seconds |
25
- ./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:1:2:1] | passed | 0.00282 seconds |
26
- ./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:2:1] | passed | 0.001 seconds |
27
- ./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:3:1] | passed | 0.0008 seconds |
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.01013 seconds |
30
- ./spec/views/catalog/_show_leaflet_map_default.html.erb_spec.rb[1:1:1] | passed | 0.08558 seconds |
31
- ./spec/views/catalog/_show_leaflet_map_default.html.erb_spec.rb[1:2:1] | passed | 0.00166 seconds |
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 '.page_links', text: '18 items found'
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: '{title_display}'
34
+ .to have_css '.media .media-body h3.media-heading a', text: '{title}'
35
35
  end
36
36
  end
37
37
  end
@@ -4,7 +4,7 @@ class TestAppGenerator < Rails::Generators::Base
4
4
  source_root './spec/test_app_templates'
5
5
 
6
6
  def add_gems
7
- gem 'blacklight', '~> 6.0'
7
+ gem 'blacklight', '~> 7.0'
8
8
 
9
9
  Bundler.with_clean_env do
10
10
  run 'bundle install'
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.6.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-09 00:00:00.000000000 Z
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: '6.0'
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: '6.0'
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.json.jbuilder
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.1.1
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