gnutemplate 0.1.4 → 0.1.5

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: 7b32995859d468d838a3c7f476b474c01e63a78b6a83322520e32a8679ba61a4
4
- data.tar.gz: 4c9c563343a43a41381139321133c4d54ce0149b025a5902552e2f7a85b86bb9
3
+ metadata.gz: 938bfcdda59a01c5b28de1b23a331dc0c460a7463fb1d29e5015529d30c44b38
4
+ data.tar.gz: 074f1acb7782fe8144a2ccdf080c1585926cbe80ac0168f2a342dc74ce10f22c
5
5
  SHA512:
6
- metadata.gz: 7fe81edb3d97e393a8a6ff75aa40359c40bfb6308caafba292d524f76a6c9c5a4ee81e6ab6712ba233b8cc88337079b51debdbcdb7fab6106219cad573676cf3
7
- data.tar.gz: d6a66f2a88b1a0cd9dc738c3bc26f9d2d2c78dba0f3be755f0ed30052af0ba0a7cd95da01800659f3f03ef2e5c19dc68951bb19288ec45a2d28a02852d93dc12
6
+ metadata.gz: 2e1fe6e09cce907cf658a4565ce6e66bbdc49737d777ce2be168ecf8cf24abc1917b66155f6a391076ed1071ef9c1f008d280648e0130b0cc6fe538e154fafeb
7
+ data.tar.gz: c634c9fb872802587644288d539601380522eb28093af6f045b9d1b43fffc4fd7a62c7eca587ee9635a705b30bbb84677e3ba34f5c5c0c79a5248d79e82d587d
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gnutemplate
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
data/lib/gnutemplate.rb CHANGED
@@ -53,7 +53,7 @@ module Gnutemplate
53
53
  set :xtics, "rotate by 90"
54
54
  end
55
55
 
56
- xrange ||= (rows_min.flatten.compact.min)..(rows_max.flatten.compact.max)
56
+ xrange ||= (rows_min.to_a.flatten.compact.min)..(rows_max.to_a.flatten.compact.max)
57
57
  set xrange: xrange
58
58
  set :grid
59
59
  set style: :fill_solid
@@ -93,7 +93,7 @@ module Gnutemplate
93
93
  set :xtics, "rotate by 90"
94
94
  end
95
95
 
96
- xrange ||= (rows_min.flatten.compact.min)..(rows_max.flatten.compact.max)
96
+ xrange ||= (rows_min.to_a.flatten.compact.min)..(rows_max.to_a.flatten.compact.max)
97
97
  set xrange: xrange
98
98
  set :grid
99
99
  set style: :fill_solid
@@ -123,8 +123,8 @@ module Gnutemplate
123
123
  alpha_hex = (alpha * 256 / 100).to_s(16).upcase
124
124
  colors = ["##{alpha_hex}CC0000", "##{alpha_hex}00CC00", "##{alpha_hex}0000CC", "##{alpha_hex}888800"]
125
125
 
126
- xmax ||= data.flatten.max
127
- xmin ||= data.flatten.min
126
+ xmax ||= data.to_a.flatten.max
127
+ xmin ||= data.to_a.flatten.min
128
128
  freqs = data.map {|d| d.to_a.histogram(bins, min: xmin, max: xmax) }
129
129
  ymax ||= freqs.map{ _1[1] }.flatten.max * 1.1
130
130
 
@@ -180,7 +180,6 @@ module Gnutemplate
180
180
  xticinterval = (xmax-xmin).to_f / bins
181
181
  set xrange: 0..((xmax-xmin) / xticinterval).to_i
182
182
 
183
-
184
183
  xtics = freqs[0][0]
185
184
  .each.with_index
186
185
  .inject("(") { |result, (x, i)| result += "'#{x-xticinterval/2}-#{x+xticinterval/2}' #{i}," }
@@ -206,8 +205,8 @@ module Gnutemplate
206
205
  alpha_hex = (alpha * 256 / 100).to_s(16).upcase
207
206
  colors = ["##{alpha_hex}CC0000", "##{alpha_hex}00CC00", "##{alpha_hex}0000CC", "##{alpha_hex}888800"]
208
207
 
209
- xmax ||= data.flatten.max
210
- xmin ||= data.flatten.min
208
+ xmax ||= data.to_a.flatten.max
209
+ xmin ||= data.to_a.flatten.min
211
210
  freqs = data.map {|d| d.to_a.histogram(bins, min: xmin, max: xmax) }
212
211
  ymax ||= freqs.map{ _1[1] }.flatten.max * 1.1
213
212
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnutemplate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - showata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-08 00:00:00.000000000 Z
11
+ date: 2023-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: numo-gnuplot