analytics_charts 1.7.0 → 1.7.3
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/lib/analytics_charts/pie_and_labels.rb +8 -6
- data/lib/analytics_charts/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8151634bb34d878263b395455a342ddc9dbe191f
|
4
|
+
data.tar.gz: adfa800ddcd5adae6a0749477a41f2a442f12a57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e184fa9fb3ab71d682479b67ed77d8a9af64bac387cd8c5920fcba60ee4fa0b1bb249c1560f990f62a59426f1b136cd8559125492b8b973d5ff66fa945831352
|
7
|
+
data.tar.gz: c55506d34c1799b0e3c2c268f8498f5f88e7e447e8c59b34cf6923d1016e62e4f0bc94c852fc072e5068e286fd820f17b8aaf4e1a1631b867a6fcaa5d74d8031
|
@@ -16,8 +16,9 @@ class AnalyticsCharts::PieAndLabels < AnalyticsCharts::CustomPie
|
|
16
16
|
organization = organization.gsub(/['%]/, '%' => '%%', "'" => "\'")
|
17
17
|
@org_text_size = 14
|
18
18
|
@org_height = @org_text_size + 1
|
19
|
-
|
20
|
-
|
19
|
+
# features in hash should match those in annotate_organization
|
20
|
+
@org_features = {'fill' => '#FFFFFF', 'pointsize'=> @org_text_size, 'font_weight'=> 500 }
|
21
|
+
@org_texts = tokenize_text_by_lines(organization, @org_features)
|
21
22
|
org_text_offset = @org_texts.size * @org_height
|
22
23
|
|
23
24
|
@label_size = 16
|
@@ -28,7 +29,8 @@ class AnalyticsCharts::PieAndLabels < AnalyticsCharts::CustomPie
|
|
28
29
|
# (num_labels + 1) to account for white key on bottom of labels
|
29
30
|
@height_with_no_disclaimer = [200 + 20, 20 + self.label_height * (num_labels + 1) + 20].max + @composite_rows + org_text_offset
|
30
31
|
disclaimer = disclaimer.gsub(/['%]/, '%' => '%%', "'" => "\'")
|
31
|
-
@
|
32
|
+
@disclaimer_features = {'fill' => '#FFFFFF', 'pointsize'=> 12, 'font_weight' => 500 }
|
33
|
+
@disclaimer_texts = tokenize_text_by_lines(disclaimer, @disclaimer_features)
|
32
34
|
@height = @height_with_no_disclaimer + @disclaimer_texts.size * 12
|
33
35
|
@data = Hash.new # Value is array with two items
|
34
36
|
@aggregate = Array([0,0,0,0]) # Cluster brands into categories
|
@@ -48,7 +50,7 @@ class AnalyticsCharts::PieAndLabels < AnalyticsCharts::CustomPie
|
|
48
50
|
y_offset = @height_with_no_disclaimer - offset
|
49
51
|
@org_texts.each do |text|
|
50
52
|
insert_text(22, y_offset ,text,
|
51
|
-
@label_hash.merge(
|
53
|
+
@label_hash.merge(@org_features))
|
52
54
|
@d.annotate(@base_image, 0 ,0, 22, y_offset, text)
|
53
55
|
y_offset += @org_height
|
54
56
|
end
|
@@ -59,12 +61,12 @@ class AnalyticsCharts::PieAndLabels < AnalyticsCharts::CustomPie
|
|
59
61
|
if text.include? "@$$" # No paragraph break if we insert this uncommonly used word
|
60
62
|
text.sub!("@$$", "")
|
61
63
|
insert_text(22, y_offset ,text,
|
62
|
-
@label_hash.merge(
|
64
|
+
@label_hash.merge(@disclaimer_features))
|
63
65
|
@d.annotate(@base_image, 0 ,0, 22, y_offset, text)
|
64
66
|
next
|
65
67
|
else
|
66
68
|
insert_text(22, y_offset ,text,
|
67
|
-
@label_hash.merge(
|
69
|
+
@label_hash.merge(@disclaimer_features))
|
68
70
|
y_offset += 12
|
69
71
|
end
|
70
72
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: analytics_charts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- STEPHEN YU
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|