magic_cloud 0.0.2 → 0.0.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
  SHA1:
3
- metadata.gz: b7ed426c54152c66311804b851d214ff6973a37d
4
- data.tar.gz: 45354e6f6d66aa759bb14ddf19c273b3f03a9687
3
+ metadata.gz: 7197d0ee63b2aee8e0a2a49f07477a5a6d21058a
4
+ data.tar.gz: 926729b0eeaf7c68409f1c8381fa76cc6687b235
5
5
  SHA512:
6
- metadata.gz: 85a631a786268da87479796fa4b61e40e0ed043da562662717f92c120484321a362d37baf231eece4790b629cf5a0c76ed1aebc7dd4825d7ecf675353dea0d21
7
- data.tar.gz: 3e497cb23c8068ab2ac1761e6298c6e6ffa649b0776df1fe113224c682e841e7c1653800f49cf3a9dfaf130fe07e6921212d2fa1285acfe0111d88e73a50e786
6
+ metadata.gz: 4e516459c658fcba58f33ecffa361dd4bf0184de94511174e2d453cc7dbd9e65f0e344887aaa745288796aea5affcc9399b70f3ae4f9640b86f11f2e7b4722fd
7
+ data.tar.gz: f6d3f66ef8f70b20f6b2ad80de458f111c5dd519725c406a32cc89dd2d42169c550849f4c9ebfbc501d5d6610204cc2d822cd9e68b602eee5d684fef9ac1d606
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  MagicCloud - simple pretty word cloud for Ruby
2
2
  ==============================================
3
3
 
4
+ [![Gem Version](https://badge.fury.io/rb/magic_cloud.svg)](http://badge.fury.io/rb/magic_cloud)
5
+
4
6
  **MagicCloud** is simple, pure-ruby library for making pretty
5
7
  [Wordle](http://www.wordle.net/)-like clouds. It uses RMagick as graphic
6
8
  backend.
@@ -61,11 +63,14 @@ Performance
61
63
 
62
64
  It's reasonable for me. On my small Thinkpad E330, some 50-words cloud
63
65
  image, size 700×500, are typically generated in <3sec. It's not that cool,
64
- yet not too long for you to fell asleep. The time of cloud making depends
65
- on words count, size of image (it's faster to find place for all words
66
- on larger image) and used rotation algorithm (vertical+horizontal words
67
- only is significantly faster - and, on my opinion, better looking - than
68
- "cool" free-rotated-words cloud).
66
+ yet not too long for you to fell asleep.
67
+
68
+ The time of cloud making depends on words count, size of image
69
+ (it's faster to find place for all words on larger image) and used rotation
70
+ algorithm (vertical+horizontal words only is significantly faster - and,
71
+ on my opinion, better looking - than "cool" free-rotated-words cloud). It
72
+ even depends on font - dense font like Impact takes mor time to being
73
+ layed out than sparse Tahoma.
69
74
 
70
75
  Major performance eater is perfect collision detection, which Wordle-like
71
76
  cloud needs. MagicCloud for now uses really dumb algortihm with some
@@ -13,16 +13,8 @@ module MagicCloud
13
13
  @layouter, @shape = layouter, shape
14
14
 
15
15
  # initial position
16
- @start_x = (
17
- @layouter.width/2 + # from center
18
- (rand-0.5) * # random shift
19
- (@layouter.width - @shape.width) # not more than (cloud width - word width)
20
- ).to_i
21
- @start_y = (
22
- @layouter.height/2 + # from center
23
- (rand-0.5) * # random shift
24
- (@layouter.height - @shape.height) # not more than (cloud height - word height)
25
- ).to_i
16
+ @start_x = (@layouter.width/2-@shape.width/2).to_i
17
+ @start_y = (@layouter.height/2-@shape.height/2).to_i
26
18
 
27
19
  # when shift of position is more than max delta (diagonal of cloud)
28
20
  # there is no hope it will eventually found its place
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Wordle-like word cloud main module
4
4
  module MagicCloud
5
- VERSION = '0.0.2' # aka Now Let's Publish!
5
+ VERSION = '0.0.3' # aka Better initial layout
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magic_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Shepelev