blacklight_heatmaps 1.1.0 → 1.2.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/javascripts/blacklight_heatmaps/viewers/index.js +18 -21
- data/app/assets/javascripts/blacklight_heatmaps/viewers/show.js +6 -7
- data/app/views/catalog/_document_heatmaps.html.erb +1 -1
- data/app/views/catalog/index.heatmaps.jbuilder +3 -2
- data/lib/blacklight_heatmaps/engine.rb +6 -0
- data/lib/blacklight_heatmaps/version.rb +1 -1
- data/lib/generators/blacklight_heatmaps/install_generator.rb +1 -9
- data/lib/tasks/blacklight_heatmaps_tasks.rake +0 -10
- data/spec/examples.txt +28 -28
- data/spec/features/index_page_map_spec.rb +6 -2
- data/spec/features/show_page_map_spec.rb +8 -2
- data/spec/spec_helper.rb +1 -1
- data/spec/test_app_templates/Gemfile.extra +0 -1
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +10 -1
- data/vendor/assets/javascripts/leaflet_solr_heatmap.js +27 -23
- metadata +22 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d17c7141af8d62f449bd775e630d6025aaf0bac17246624d69a2f7670362c32f
|
4
|
+
data.tar.gz: 005c68a070804d833652823aacfa4c0e132a5dcf58c6b59acba858ce7a21691d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a5699ecdf0aa29be155b2d2f958782788956941504b2bbf1b3fe4040984c37256298c544064f2e730bc2b600e3b553824f62b311000271e4d5bed36e788ac16
|
7
|
+
data.tar.gz: db83dfacd91ab4030ad762d9cefdd863b01c78103082d175b09f4c0cfe6cfaf2d4369003222b4aa15837a25d8f074fb62ab0aae11e2117a5cd60189b95929e7b
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Blacklight.onLoad(function () {
|
2
2
|
'use strict';
|
3
3
|
|
4
|
-
|
5
|
-
BlacklightHeatmaps.indexView(
|
4
|
+
document.querySelectorAll('[data-index-map]').forEach(function (el) {
|
5
|
+
BlacklightHeatmaps.indexView(el, {});
|
6
6
|
});
|
7
7
|
});
|
8
8
|
|
@@ -13,20 +13,22 @@ Blacklight.onLoad(function () {
|
|
13
13
|
options: {},
|
14
14
|
|
15
15
|
initialize: function (el, options) {
|
16
|
-
var
|
17
|
-
var
|
18
|
-
var
|
19
|
-
var
|
20
|
-
var template = $el.data().sidebarTemplate;
|
21
|
-
var colorRamp = $el.data().colorRamp;
|
16
|
+
var requestUrl = el.dataset.searchUrl + '&format=heatmaps';
|
17
|
+
var geometryField = el.dataset.geometryField;
|
18
|
+
var template = el.dataset.sidebarTemplate;
|
19
|
+
var colorRamp = JSON.parse(el.dataset.colorRamp);
|
22
20
|
|
23
21
|
// Blank out page link content first and disable pagination
|
24
|
-
|
25
|
-
|
22
|
+
document.querySelectorAll('#sortAndPerPage .page-links').forEach(function (links) {
|
23
|
+
links.innerHTML = '';
|
24
|
+
});
|
25
|
+
document.querySelectorAll('ul.pagination').forEach(function (links) {
|
26
|
+
links.classList.add('d-none');
|
27
|
+
});
|
26
28
|
|
27
|
-
var map = L.map(
|
29
|
+
var map = L.map(el.id).setView([0, 0], 1);
|
28
30
|
var basemap = BlacklightHeatmaps.selectBasemap(
|
29
|
-
|
31
|
+
el.dataset.basemapProvider
|
30
32
|
).addTo(map);
|
31
33
|
|
32
34
|
var solrLayer = L.solrHeatmap(requestUrl, {
|
@@ -57,7 +59,7 @@ Blacklight.onLoad(function () {
|
|
57
59
|
solrLayer.on('dataAdded', function (e) {
|
58
60
|
if (e.response && e.response.docs) {
|
59
61
|
var html = '';
|
60
|
-
|
62
|
+
e.response.docs.forEach(function (value) {
|
61
63
|
html += L.Util.template(template, value);
|
62
64
|
});
|
63
65
|
|
@@ -65,16 +67,11 @@ Blacklight.onLoad(function () {
|
|
65
67
|
|
66
68
|
var docCount = e.response.pages.total_count;
|
67
69
|
|
68
|
-
|
69
|
-
parseInt(docCount).toLocaleString() + ' ' +
|
70
|
-
|
71
|
-
);
|
70
|
+
document.querySelectorAll('#sortAndPerPage .page-links').forEach(function (links) {
|
71
|
+
links.innerHTML = parseInt(docCount).toLocaleString() + ' ' + (docCount == 1 ? 'item' : 'items') + ' found';
|
72
|
+
});
|
72
73
|
}
|
73
74
|
});
|
74
|
-
|
75
|
-
$(document).on('turbolinks:click', function (e) {
|
76
|
-
e.preventDefault();
|
77
|
-
});
|
78
75
|
},
|
79
76
|
|
80
77
|
pluralize: function (count, word) {
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Blacklight.onLoad(function () {
|
2
2
|
'use strict';
|
3
3
|
|
4
|
-
|
5
|
-
BlacklightHeatmaps.showView(
|
4
|
+
document.querySelectorAll('[data-show-map]').forEach(function (el) {
|
5
|
+
BlacklightHeatmaps.showView(el);
|
6
6
|
});
|
7
7
|
});
|
8
8
|
|
@@ -13,15 +13,14 @@ Blacklight.onLoad(function () {
|
|
13
13
|
options: {},
|
14
14
|
|
15
15
|
initialize: function (el, options) {
|
16
|
-
var
|
17
|
-
var features = $el.data().features;
|
16
|
+
var json = JSON.parse(el.dataset.features);
|
18
17
|
|
19
|
-
var map = L.map(
|
18
|
+
var map = L.map(el.id).setView([0, 0], 1);
|
20
19
|
var basemap = BlacklightHeatmaps.selectBasemap(
|
21
|
-
|
20
|
+
el.dataset.basemapProvider
|
22
21
|
).addTo(map);
|
23
22
|
|
24
|
-
var features = L.geoJson(
|
23
|
+
var features = L.geoJson(json, {
|
25
24
|
pointToLayer: function(feature, latlng) {
|
26
25
|
return L.marker(latlng, {
|
27
26
|
icon: BlacklightHeatmaps.Icons.default
|
@@ -2,8 +2,9 @@ presenter = Blacklight::JsonPresenter.new(@response, blacklight_config)
|
|
2
2
|
|
3
3
|
json.response do
|
4
4
|
json.docs(presenter.documents) do |document|
|
5
|
-
|
6
|
-
json.
|
5
|
+
document_presenter = document_presenter(document)
|
6
|
+
json.url search_state.url_for_document(document)
|
7
|
+
json.title document_presenter.heading
|
7
8
|
end
|
8
9
|
|
9
10
|
json.facet_heatmaps @response['facet_counts']['facet_heatmaps']
|
@@ -7,6 +7,12 @@ module BlacklightHeatmaps
|
|
7
7
|
end
|
8
8
|
|
9
9
|
Mime::Type.register 'application/vnd.heatmaps+json', :heatmaps
|
10
|
+
if Blacklight::VERSION > '8'
|
11
|
+
Blacklight::Configuration.default_configuration do
|
12
|
+
Blacklight::Configuration.default_values[:search_state_fields] ||= []
|
13
|
+
Blacklight::Configuration.default_values[:search_state_fields] += %i[bbox]
|
14
|
+
end
|
15
|
+
end
|
10
16
|
end
|
11
17
|
end
|
12
18
|
end
|
@@ -15,12 +15,6 @@ module BlacklightHeatmaps
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
def install_webpacker
|
19
|
-
return unless Rails.version.to_i == 6
|
20
|
-
|
21
|
-
rake 'webpacker:install'
|
22
|
-
end
|
23
|
-
|
24
18
|
def configuration
|
25
19
|
inject_into_file 'app/controllers/catalog_controller.rb', after: 'configure_blacklight do |config|' do
|
26
20
|
"\n # BlacklightHeatmaps configuration values" \
|
@@ -30,9 +24,7 @@ module BlacklightHeatmaps
|
|
30
24
|
"\n config.basemap_provider = 'positron'" \
|
31
25
|
"\n config.show.partials.insert(1, :show_leaflet_map)" \
|
32
26
|
"\n config.index.respond_to.heatmaps = true" \
|
33
|
-
"\n config.view.heatmaps
|
34
|
-
"\n #Heatmap color ramp. For best results, use http://colorbrewer2.org or http://tristen.ca/hcl-picker/#/hlc/5/1" \
|
35
|
-
"\n config.view.heatmaps.color_ramp = ['#ffffcc', '#a1dab4', '#41b6c4', '#2c7fb8', '#253494']" \
|
27
|
+
"\n config.view.heatmaps(partials: [], color_ramp: ['#ffffcc', '#a1dab4', '#41b6c4', '#2c7fb8', '#253494'])" \
|
36
28
|
"\n"
|
37
29
|
end
|
38
30
|
end
|
@@ -11,15 +11,5 @@ namespace :blacklight_heatmaps do
|
|
11
11
|
conn.add docs
|
12
12
|
conn.commit
|
13
13
|
end
|
14
|
-
|
15
|
-
desc 'Fetch random data from WhosOnFirst gazetteer and index into Solr'
|
16
|
-
task :seed_random, [:n] => [:environment] do |_t, args|
|
17
|
-
args.with_defaults(n: 10)
|
18
|
-
puts "Indexing #{args[:n]} random data records"
|
19
|
-
docs = YAML.load(`bundle exec ruby #{File.join(BlacklightHeatmaps::Engine.root, 'scripts', 'sample_whosonfirst.rb')} #{args[:n]}`)
|
20
|
-
conn = Blacklight.default_index.connection
|
21
|
-
conn.add docs
|
22
|
-
conn.commit
|
23
|
-
end
|
24
14
|
end
|
25
15
|
end
|
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] |
|
4
|
-
./spec/features/configurable_basemap_spec.rb[1:2:1] |
|
5
|
-
./spec/features/configurable_basemap_spec.rb[1:3:1] |
|
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] |
|
9
|
-
./spec/helpers/blacklight/maps_helper_spec.rb[1:1:1] | passed | 0.
|
10
|
-
./spec/helpers/blacklight/maps_helper_spec.rb[1:2:1] | passed | 0.
|
11
|
-
./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:1:1] | passed | 0.
|
3
|
+
./spec/features/configurable_basemap_spec.rb[1:1] | failed | 2.14 seconds |
|
4
|
+
./spec/features/configurable_basemap_spec.rb[1:2:1] | failed | 2.14 seconds |
|
5
|
+
./spec/features/configurable_basemap_spec.rb[1:3:1] | failed | 2.17 seconds |
|
6
|
+
./spec/features/index_page_map_spec.rb[1:1] | failed | 2.33 seconds |
|
7
|
+
./spec/features/show_page_map_spec.rb[1:1] | failed | 2.15 seconds |
|
8
|
+
./spec/features/show_page_map_spec.rb[1:2] | failed | 13.26 seconds |
|
9
|
+
./spec/helpers/blacklight/maps_helper_spec.rb[1:1:1] | passed | 0.0061 seconds |
|
10
|
+
./spec/helpers/blacklight/maps_helper_spec.rb[1:2:1] | passed | 0.00302 seconds |
|
11
|
+
./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:1:1] | passed | 0.00009 seconds |
|
12
12
|
./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:2:1] | passed | 0.00028 seconds |
|
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.
|
28
|
-
./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:4:1] | passed | 0.
|
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.
|
13
|
+
./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:3:1] | passed | 0.0001 seconds |
|
14
|
+
./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:4:1] | passed | 0.00018 seconds |
|
15
|
+
./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:1:1] | passed | 0.00016 seconds |
|
16
|
+
./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:2:1] | passed | 0.00236 seconds |
|
17
|
+
./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:3:1] | passed | 0.00194 seconds |
|
18
|
+
./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:1:1] | passed | 0.00093 seconds |
|
19
|
+
./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:2:1] | passed | 0.00011 seconds |
|
20
|
+
./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:3:1] | passed | 0.00107 seconds |
|
21
|
+
./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:4:1] | passed | 0.00033 seconds |
|
22
|
+
./spec/models/concerns/blacklight_heatmaps/point_spec.rb[1:1:1] | passed | 0.00006 seconds |
|
23
|
+
./spec/models/concerns/blacklight_heatmaps/point_spec.rb[1:2:1] | passed | 0.0004 seconds |
|
24
|
+
./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:1:1:1] | passed | 0.00184 seconds |
|
25
|
+
./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:1:2:1] | passed | 0.01369 seconds |
|
26
|
+
./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:2:1] | passed | 0.00369 seconds |
|
27
|
+
./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:3:1] | passed | 0.00426 seconds |
|
28
|
+
./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:4:1] | passed | 0.00213 seconds |
|
29
|
+
./spec/views/catalog/_document_heatmaps.html.erb_spec.rb[1:1] | passed | 0.01306 seconds |
|
30
|
+
./spec/views/catalog/_show_leaflet_map_default.html.erb_spec.rb[1:1:1] | passed | 0.00263 seconds |
|
31
|
+
./spec/views/catalog/_show_leaflet_map_default.html.erb_spec.rb[1:2:1] | passed | 0.00492 seconds |
|
@@ -5,8 +5,12 @@ feature 'Index page map', js: true do
|
|
5
5
|
visit search_catalog_path(q: ' ', view: 'heatmaps', search_field: 'all_fields')
|
6
6
|
expect(page).to have_css '.leaflet-map-pane'
|
7
7
|
|
8
|
-
#
|
9
|
-
|
8
|
+
# Conditionally check for the PNG only on GitHub CI
|
9
|
+
# Leaflet chooses tile zoom based on retina; this causes tests to fail locally
|
10
|
+
if ENV['GITHUB_ACTIONS']
|
11
|
+
# Zoomed to world
|
12
|
+
expect(page).to have_css 'img[src*="/light_all/1/0/0.png"]'
|
13
|
+
end
|
10
14
|
|
11
15
|
# Hides pagination
|
12
16
|
expect(page).to have_css 'ul.pagination', visible: false
|
@@ -4,8 +4,14 @@ feature 'Show map map', js: true do
|
|
4
4
|
it 'renders a leaflet map' do
|
5
5
|
visit solr_document_path '43037890'
|
6
6
|
expect(page).to have_css '.leaflet-map-pane'
|
7
|
-
|
8
|
-
|
7
|
+
|
8
|
+
# Conditionally check for the tile only on GitHub CI
|
9
|
+
# Leaflet chooses tile zoom based on retina; this causes tests to fail locally
|
10
|
+
if ENV['GITHUB_ACTIONS']
|
11
|
+
# Zoomed to Kazakhstan
|
12
|
+
expect(page).to have_css 'img[src*="light_all/4/11/5.png"]'
|
13
|
+
end
|
14
|
+
|
9
15
|
expect(page).to have_css 'svg g path'
|
10
16
|
end
|
11
17
|
it 'renders a point type and a polygon' do
|
data/spec/spec_helper.rb
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
gem 'sprockets', '< 4'
|
@@ -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', '~> 7.0'
|
7
|
+
gem 'blacklight', ENV.fetch('BLACKLIGHT_VERSION', '~> 7.0')
|
8
8
|
|
9
9
|
Bundler.with_clean_env do
|
10
10
|
run 'bundle install'
|
@@ -24,4 +24,13 @@ class TestAppGenerator < Rails::Generators::Base
|
|
24
24
|
def install_engine
|
25
25
|
generate 'blacklight_heatmaps:install'
|
26
26
|
end
|
27
|
+
|
28
|
+
# Temporarily force js assets to fall back to sprockets
|
29
|
+
def clean_up_js_builds
|
30
|
+
return unless File.exist?('app/assets/builds')
|
31
|
+
|
32
|
+
append_to_file 'app/assets/config/manifest.js', "\n//= link application.js\n" if File.exist?('app/assets/config/manifest.js')
|
33
|
+
gsub_file 'app/assets/config/manifest.js', '//= link_tree ../builds', ''
|
34
|
+
remove_dir 'app/assets/builds'
|
35
|
+
end
|
27
36
|
end
|
@@ -55,12 +55,12 @@ L.SolrHeatmap = L.GeoJSON.extend({
|
|
55
55
|
geojson.type = 'FeatureCollection';
|
56
56
|
geojson.features = [];
|
57
57
|
|
58
|
-
|
58
|
+
_this.facetHeatmap.counts_ints2D.forEach(function(value, row) {
|
59
59
|
if (value === null) {
|
60
60
|
return;
|
61
61
|
}
|
62
62
|
|
63
|
-
|
63
|
+
value.forEach(function (val, column) {
|
64
64
|
if (val === 0) {
|
65
65
|
return;
|
66
66
|
}
|
@@ -105,12 +105,12 @@ L.SolrHeatmap = L.GeoJSON.extend({
|
|
105
105
|
var maxValue = classifications[classifications.length - 1];
|
106
106
|
var gradient = _this._getGradient(classifications);
|
107
107
|
|
108
|
-
|
108
|
+
_this.facetHeatmap.counts_ints2D.forEach(function(value, row) {
|
109
109
|
if (value === null) {
|
110
110
|
return;
|
111
111
|
}
|
112
112
|
|
113
|
-
|
113
|
+
value.forEach(function (val, column) {
|
114
114
|
if (val === 0) {
|
115
115
|
return;
|
116
116
|
}
|
@@ -172,12 +172,12 @@ L.SolrHeatmap = L.GeoJSON.extend({
|
|
172
172
|
maxClusterRadius: 140,
|
173
173
|
});
|
174
174
|
|
175
|
-
|
175
|
+
_this.facetHeatmap.counts_ints2D.forEach(function(value, row) {
|
176
176
|
if (value === null) {
|
177
177
|
return;
|
178
178
|
}
|
179
179
|
|
180
|
-
|
180
|
+
value.forEach(function (val, column) {
|
181
181
|
if (val === 0) {
|
182
182
|
return;
|
183
183
|
}
|
@@ -218,7 +218,7 @@ L.SolrHeatmap = L.GeoJSON.extend({
|
|
218
218
|
_getClassifications: function (howMany) {
|
219
219
|
var _this = this;
|
220
220
|
var oneDArray = [];
|
221
|
-
|
221
|
+
_this.facetHeatmap.counts_ints2D.forEach(function(value, row) {
|
222
222
|
if (value != null) {
|
223
223
|
oneDArray = oneDArray.concat(value);
|
224
224
|
}
|
@@ -244,7 +244,7 @@ L.SolrHeatmap = L.GeoJSON.extend({
|
|
244
244
|
|
245
245
|
_this.eachLayer(function (layer) {
|
246
246
|
var color;
|
247
|
-
|
247
|
+
classifications.forEach(function (val, i) {
|
248
248
|
if (layer.feature.properties.count >= val) {
|
249
249
|
color = scale[i];
|
250
250
|
}
|
@@ -296,22 +296,26 @@ L.SolrHeatmap = L.GeoJSON.extend({
|
|
296
296
|
_getData: function () {
|
297
297
|
var _this = this;
|
298
298
|
var startTime = Date.now();
|
299
|
-
$.getJSON({
|
300
|
-
url: _this._solrUrl,
|
301
|
-
data: {
|
302
|
-
bbox: _this._mapViewToBbox(),
|
303
|
-
},
|
304
|
-
success: function (data) {
|
305
|
-
var totalTime = 'Solr response time: ' + (Date.now() - startTime) + ' ms';
|
306
|
-
if (_this.options.logging) {
|
307
|
-
console.log(totalTime);
|
308
|
-
}
|
309
299
|
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
300
|
+
var url = new URL(_this._solrUrl);
|
301
|
+
url.searchParams.append('bbox', _this._mapViewToBbox());
|
302
|
+
|
303
|
+
fetch(url, {
|
304
|
+
headers: {
|
305
|
+
'Accept': 'application/json',
|
306
|
+
}
|
307
|
+
}).then(function (response) {
|
308
|
+
return response.json();
|
309
|
+
}).then(function (data) {
|
310
|
+
var totalTime = 'Solr response time: ' + (Date.now() - startTime) + ' ms';
|
311
|
+
if (_this.options.logging) {
|
312
|
+
console.log(totalTime);
|
313
|
+
}
|
314
|
+
|
315
|
+
_this.docsCount = data.response.numFound;
|
316
|
+
_this.renderStart = Date.now();
|
317
|
+
_this._computeHeatmapObject(data);
|
318
|
+
_this.fireEvent('dataAdded', data);
|
315
319
|
});
|
316
320
|
},
|
317
321
|
|
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: 1.
|
4
|
+
version: 1.2.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:
|
11
|
+
date: 2024-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 7.1.4
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '8'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 7.1.4
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '8'
|
@@ -34,30 +34,36 @@ dependencies:
|
|
34
34
|
name: blacklight
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - "
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '7.16'
|
40
|
+
- - "<"
|
38
41
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
42
|
+
version: '9'
|
40
43
|
type: :runtime
|
41
44
|
prerelease: false
|
42
45
|
version_requirements: !ruby/object:Gem::Requirement
|
43
46
|
requirements:
|
44
|
-
- - "
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '7.16'
|
50
|
+
- - "<"
|
45
51
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
52
|
+
version: '9'
|
47
53
|
- !ruby/object:Gem::Dependency
|
48
54
|
name: leaflet-rails
|
49
55
|
requirement: !ruby/object:Gem::Requirement
|
50
56
|
requirements:
|
51
57
|
- - "~>"
|
52
58
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
59
|
+
version: 1.3.0
|
54
60
|
type: :runtime
|
55
61
|
prerelease: false
|
56
62
|
version_requirements: !ruby/object:Gem::Requirement
|
57
63
|
requirements:
|
58
64
|
- - "~>"
|
59
65
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
66
|
+
version: 1.3.0
|
61
67
|
- !ruby/object:Gem::Dependency
|
62
68
|
name: leaflet-sidebar-rails
|
63
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,19 +149,19 @@ dependencies:
|
|
143
149
|
- !ruby/object:Gem::Version
|
144
150
|
version: '0'
|
145
151
|
- !ruby/object:Gem::Dependency
|
146
|
-
name:
|
152
|
+
name: selenium-webdriver
|
147
153
|
requirement: !ruby/object:Gem::Requirement
|
148
154
|
requirements:
|
149
|
-
- - "
|
155
|
+
- - "~>"
|
150
156
|
- !ruby/object:Gem::Version
|
151
|
-
version: '
|
157
|
+
version: '4.11'
|
152
158
|
type: :development
|
153
159
|
prerelease: false
|
154
160
|
version_requirements: !ruby/object:Gem::Requirement
|
155
161
|
requirements:
|
156
|
-
- - "
|
162
|
+
- - "~>"
|
157
163
|
- !ruby/object:Gem::Version
|
158
|
-
version: '
|
164
|
+
version: '4.11'
|
159
165
|
description: Search and view Blacklight resources on a map.
|
160
166
|
email:
|
161
167
|
- phillipjreed@gmail.com
|
@@ -235,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
241
|
- !ruby/object:Gem::Version
|
236
242
|
version: '0'
|
237
243
|
requirements: []
|
238
|
-
rubygems_version: 3.
|
244
|
+
rubygems_version: 3.5.9
|
239
245
|
signing_key:
|
240
246
|
specification_version: 4
|
241
247
|
summary: Search and view Blacklight resources on a map.
|