charty 0.2.11 → 0.2.12

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: eac796ba17aeb9a82a312d7099c898a2350abaf34c3fad80ea1afd1483de1797
4
- data.tar.gz: 8001339bd86377ab3693cc2eeb0a826c04c4ea4e08d58e3a10e99849a273cd58
3
+ metadata.gz: ab62fdc14b2c1b6410bea925353cdb6fbd7b25d4bf81e007dad99aa5f0dd1976
4
+ data.tar.gz: d61cced997d48a2b5c26e2867a96dfc53be97e5c6c0eb85f323a11d1257a2ef6
5
5
  SHA512:
6
- metadata.gz: 3679334bb56834f7fb1067878c60e7601375e05d6adf63e566eb2cd3847a7ce1423bb27d0104f666854c8343840706a8e14dcc12bc8420ae062b8144d3f6ebc2
7
- data.tar.gz: f4bbec96ae815cd758b67a993355fe5e42a10b91d7ef351e63570ec84fa618e65e4c2df4006f2d3431738c8b82b6a5dcf74d79a9b4ce005f89f18fd2ae88d31d
6
+ metadata.gz: 198e8dc2bf17033af0b124a1fbca82d2c29efde9bdaf55fb9bc57bc1184e66e0f7bd8268edfb4c13d90b46f20d955f65760db168010c5ec886c30f53f59db45d
7
+ data.tar.gz: 605dea2aab3c7633a1a3ef3351cc48f0e1f507da4993f529286c0ef0cf2b69cae7b666d22b4e4a7a993f69a9177ed441766983e6e4e9cd2e909f17f1ebbeff49
@@ -62,6 +62,8 @@ jobs:
62
62
 
63
63
  - run: sudo apt install build-essential libsqlite3-dev
64
64
 
65
+ - run: npm install playwright@latest
66
+
65
67
  - run: bundle install --jobs 4 --retry 3 --without "nmatrix python"
66
68
 
67
69
  - run: bundle exec rake
@@ -58,6 +58,8 @@ jobs:
58
58
 
59
59
  - run: sudo apt install build-essential libsqlite3-dev
60
60
 
61
+ - run: npm install playwright@latest
62
+
61
63
  - run: bundle install --jobs 4 --retry 3 --without "numo python"
62
64
 
63
65
  - run: bundle exec rake
@@ -74,6 +74,8 @@ jobs:
74
74
 
75
75
  - run: sudo apt install build-essential libsqlite3-dev
76
76
 
77
+ - run: npm install playwright@latest
78
+
77
79
  - run: pip install --user matplotlib pandas
78
80
 
79
81
  - run: bundle install --jobs 4 --retry 3 --without "nmatrix numo"
@@ -309,8 +309,8 @@ module Charty
309
309
 
310
310
  groups = (0 ... x.length).group_by do |i|
311
311
  key = {}
312
- key[:color] = color[i] unless color.nil?
313
- key[:style] = style[i] unless style.nil?
312
+ key[:color] = color.iloc(i) unless color.nil?
313
+ key[:style] = style.iloc(i) unless style.nil?
314
314
  key
315
315
  end
316
316
 
@@ -8,13 +8,17 @@ module Charty
8
8
  end
9
9
 
10
10
  def each(&block)
11
- step = (@range.end - @range.begin).to_r / (@num_step - 1)
12
- (@num_step - 1).times do |i|
13
- block.call(@range.begin + i * step)
14
- end
11
+ if @num_step == 1
12
+ block.call(@range.begin)
13
+ else
14
+ step = (@range.end - @range.begin).to_r / (@num_step - 1)
15
+ (@num_step - 1).times do |i|
16
+ block.call(@range.begin + i * step)
17
+ end
15
18
 
16
- unless @range.exclude_end?
17
- block.call(@range.end)
19
+ unless @range.exclude_end?
20
+ block.call(@range.end)
21
+ end
18
22
  end
19
23
  end
20
24
  end
@@ -185,7 +185,7 @@ module Charty
185
185
  elsif vector.categorical?
186
186
  :categorical
187
187
  else
188
- case vector[0]
188
+ case vector.iloc(0)
189
189
  when true, false
190
190
  boolean_type
191
191
  else
data/lib/charty/vector.rb CHANGED
@@ -34,6 +34,7 @@ module Charty
34
34
 
35
35
  alias size length
36
36
 
37
+ def_delegators :adapter, :iloc
37
38
  def_delegators :adapter, :to_a
38
39
  def_delegators :adapter, :each
39
40
  def_delegators :adapter, :empty?
@@ -61,6 +61,10 @@ module Charty
61
61
  data.equals(Pandas::Series.new(other, index: data.index))
62
62
  end
63
63
 
64
+ def iloc(i)
65
+ data.iloc[i]
66
+ end
67
+
64
68
  def [](key)
65
69
  case key
66
70
  when Charty::Vector
@@ -34,7 +34,8 @@ module Charty
34
34
  :uniq,
35
35
  :unique_values,
36
36
  :values_at,
37
- :where
37
+ :where,
38
+ :iloc
38
39
 
39
40
  def compare_data_equality(other)
40
41
  if other.is_a?(self.class)
@@ -57,6 +57,8 @@ module Charty
57
57
  end
58
58
  end
59
59
 
60
+ def_delegator :data, :[], :iloc
61
+
60
62
  def_delegators :data, :[], :[]=
61
63
  def_delegators :data, :each, :to_a, :empty?
62
64
 
@@ -148,7 +150,7 @@ module Charty
148
150
  when Charty::Vector
149
151
  where(key)
150
152
  else
151
- super(key_to_loc(key))
153
+ iloc(key_to_loc(key))
152
154
  end
153
155
  end
154
156
 
@@ -1,5 +1,5 @@
1
1
  module Charty
2
- VERSION = "0.2.11"
2
+ VERSION = "0.2.12"
3
3
 
4
4
  module Version
5
5
  numbers, TAG = VERSION.split("-")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: charty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - youchan
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-09-10 00:00:00.000000000 Z
13
+ date: 2022-10-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: red-colors
@@ -375,7 +375,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
375
375
  - !ruby/object:Gem::Version
376
376
  version: '0'
377
377
  requirements: []
378
- rubygems_version: 3.2.23
378
+ rubygems_version: 3.3.13
379
379
  signing_key:
380
380
  specification_version: 4
381
381
  summary: Visualizing your data in a simple way.