simple_drilldown 0.8.2 → 0.8.3

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: 02a013f2b885c10991f53c854f8d127147b9ad141e1e80d80b2edef5ee7a2e8a
4
- data.tar.gz: 949351a24e5171784d0c608126e835a19d736e8bd0248b8816728c37528632be
3
+ metadata.gz: e641a96b877ef453506755526c3fb0fb30974f4c8f62f837008f028d24d2e693
4
+ data.tar.gz: 603066309062265101fc4c038673ddffdb37a8b03f1cabb26472534eaad2cf76
5
5
  SHA512:
6
- metadata.gz: 3f0f84cedda3f43e60380c4ac010f7c0f5643c9e1e384efcafb86e2583d1a44e4920368c81a26542018b448960d3b3f89dcebd5f0682fd28064a00ce73f0fb4c
7
- data.tar.gz: 749dab308a7a85d6cb5d8ae55f5ec4449d90e2c81b81ca1642fd6e048bf2a5730a7e6992f8eb0204762b067c1c371b6b743c38f071cb3de9bddfe16ec0f53a4a
6
+ metadata.gz: af0ea2c629a6269a1463891e065dc89e7d60c94fcd34554433ee8288dbb7210490e2fdcb5505d2bb42e9a7bddf83ee61baa0b9528307d6a2dc10784553530b7f
7
+ data.tar.gz: 1f21dcf709ad307cfadc52f0a660e047ed5f44fd2aa2d77ff525ead5e3b0520ac9a58d9e83132b43ccdf29ed2583298e35b3b084bc3587c418b7da0f5ae96e34
@@ -1,19 +1,19 @@
1
1
  <%
2
2
  data =
3
- case @dimensions.size
4
- when 0
5
- { @result[:value] => @result[:count] }
6
- when 1
7
- @result[:rows].map { |r| [@dimensions[0][:label_method] ? @dimensions[0][:label_method].call(r[:value]) : r[:value], r[:count]] }
8
- when 2
9
- @result[:rows].map do |r|
10
- {
11
- name: r[:value],
12
- data: r[:rows].map { |r2| [r2[:value], r2[:count]] }
13
- }
14
- end
15
- when 3
3
+ case @dimensions.size
4
+ when 0
5
+ { @result[:value] => @result[:count] }
6
+ when 1
7
+ @result[:rows].map { |r| [@dimensions[0][:label_method] ? @dimensions[0][:label_method].call(r[:value]) : r[:value], r[:count]] }
8
+ when 2
9
+ @result[:rows].map do |r|
10
+ {
11
+ name: r[:value],
12
+ data: r[:rows].map { |r2| [r2[:value], r2[:count]] }
13
+ }
16
14
  end
15
+ when 3
16
+ end
17
17
  %>
18
18
 
19
19
  <%
@@ -37,10 +37,10 @@
37
37
  <% (0..2).each do |i|
38
38
  options = [['', '']]
39
39
  options << [@dimensions[i][:pretty_name], @dimensions[i][:url_param_name]] if @dimensions[i]
40
- options += @remaining_dimensions.keys.map { |name| [controller.c_dimension_defs[name][:pretty_name], name] } %>
40
+ options += @remaining_dimensions.keys.map { |name| [controller.c_dimension_defs[name][:pretty_name], name] } %>
41
41
  <%= t(i == 0 ? :group_by : :then_by) %>:
42
42
  <%= form.select 'dimensions', options, { :selected => @search.dimensions && @search.dimensions[i] },
43
- { onChange: 'form.submit()', name: 'search[dimensions][]', id: "search_dimensions_#{i}" } %>
43
+ { onChange: 'form.submit()', name: 'search[dimensions][]', id: "search_dimensions_#{i}" } %>
44
44
  <% end %>
45
45
 
46
46
  <br/>
@@ -62,21 +62,22 @@
62
62
  </div>
63
63
 
64
64
  <% if @dimensions.size == 1 &&
65
- [SimpleDrilldown::Search::DisplayType::BAR, SimpleDrilldown::Search::DisplayType::PIE].include?(@search.display_type) %>
65
+ [SimpleDrilldown::Search::DisplayType::BAR, SimpleDrilldown::Search::DisplayType::PIE].include?(@search.display_type) %>
66
66
  <%= javascript_tag do %>
67
67
  $('#chart-1').on('click', function(e){
68
- chart = Chartkick.charts['chart-1'].getChartObject();
69
- firstPoint = chart.getElementsAtEvent(e)[0]
70
- if (firstPoint) {
71
- label = chart.data.labels[firstPoint._index];
72
- value = chart.data.datasets[firstPoint._datasetIndex].data[firstPoint._index];
73
- console.log("Label: " + label + ", Value: " + value);
74
- new_location = window.location.toString();
75
- new_location = new_location.replace("&search[dimensions][]=<%= @dimensions[0][:url_param_name] %>", '');
76
- new_location = new_location + '&search[filter][<%= @dimensions[0][:url_param_name] %>][]=' + label;
77
- console.log(new_location);
78
- window.location = new_location;
79
- }
68
+ chart = Chartkick.charts['chart-1'].getChartObject();
69
+ firstPoint = chart.getElementsAtEvent(e)[0]
70
+ if (firstPoint) {
71
+ label = chart.data.labels[firstPoint._index];
72
+ value = chart.data.datasets[firstPoint._datasetIndex].data[firstPoint._index];
73
+ console.log("Label: " + label + ", Value: " + value);
74
+ new_location = window.location.toString();
75
+ new_location = new_location.replace(/#.*$/, '');
76
+ new_location = new_location.replace("&search[dimensions][]=<%= @dimensions[0][:url_param_name] %>", '');
77
+ new_location = new_location + '&search[filter][<%= @dimensions[0][:url_param_name] %>][]=' + label;
78
+ console.log(new_location);
79
+ window.location = new_location;
80
+ }
80
81
  });
81
82
  <% end %>
82
83
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module SimpleDrilldown
2
- VERSION = '0.8.2'
2
+ VERSION = '0.8.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_drilldown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uwe Kubosch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-23 00:00:00.000000000 Z
11
+ date: 2021-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: caxlsx_rails