volt-easypiechart 0.2.0 → 0.3.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cba5456dfdd26aa15c1a63f069bc57e300408e6
|
4
|
+
data.tar.gz: b3aa0ee0e2382318d7f53a998b7e99db7b704412
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38ce6243c02ba0ef26809a00940c678fa0fc2751fe412e56bdc4e5d6637c28f197435671c4e25acc516b779b0dc7c38d345f24335d2253dfc81f8247bd712af7
|
7
|
+
data.tar.gz: ee83067bb442d74a93ae1acf91dbb5c96b8b77224c36e3b6cfcfc831d252298c85c8ffce905d4d2ef7c8813f126689084a3bcf9fc46f1dfb97a9088783080853
|
@@ -0,0 +1,29 @@
|
|
1
|
+
.easy-pie {
|
2
|
+
position: relative;
|
3
|
+
display: inline-block;
|
4
|
+
text-align: center;
|
5
|
+
canvas {
|
6
|
+
position: absolute;
|
7
|
+
top: 0;
|
8
|
+
left: 0;
|
9
|
+
}
|
10
|
+
.percent {
|
11
|
+
display: inline-block;
|
12
|
+
vertical-align: middle;
|
13
|
+
z-index: 2;
|
14
|
+
font-size: 1.2em;
|
15
|
+
}
|
16
|
+
.percent:after {
|
17
|
+
content: '%';
|
18
|
+
margin-left: 0.1em;
|
19
|
+
font-size: .9em;
|
20
|
+
}
|
21
|
+
.label {
|
22
|
+
text-align: center;
|
23
|
+
color: #333;
|
24
|
+
font-weight: 300;
|
25
|
+
font-size: 1.2em;
|
26
|
+
margin: 0;
|
27
|
+
padding: 0;
|
28
|
+
}
|
29
|
+
}
|
@@ -3,11 +3,17 @@ module Easypiechart
|
|
3
3
|
|
4
4
|
def index_ready
|
5
5
|
@watches = []
|
6
|
-
@elem = `$(
|
6
|
+
@elem = `$(#{first_element}).children().first()`
|
7
7
|
if @elem
|
8
8
|
if attrs.options
|
9
9
|
begin
|
10
10
|
JSON.parse(attrs.options).each do |option, value|
|
11
|
+
if option == 'size'
|
12
|
+
value_in_px = "#{value}px"
|
13
|
+
`#{@elem}.css("height",#{value_in_px});`
|
14
|
+
`#{@elem}.css("width",#{value_in_px});`
|
15
|
+
`#{@elem}.css("line-height",#{value_in_px});`
|
16
|
+
end
|
11
17
|
`#{@elem}.data(#{option}, #{value})`
|
12
18
|
end
|
13
19
|
rescue Object => e
|
@@ -21,7 +27,9 @@ module Easypiechart
|
|
21
27
|
|
22
28
|
def update_value
|
23
29
|
if @elem
|
24
|
-
|
30
|
+
attrs.percent.then do |percent|
|
31
|
+
`#{@elem}.data('easyPieChart').update(#{percent})`
|
32
|
+
end
|
25
33
|
end
|
26
34
|
end
|
27
35
|
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<:Body>
|
2
2
|
<div class="easy-pie {{ attrs.classes }}" data-percent="{{ attrs.percent }}">
|
3
|
-
<div class="
|
3
|
+
<div class="chart">
|
4
|
+
<div class="percent">{{ attrs.percent }}</div>
|
5
|
+
</div>
|
4
6
|
{{ if attrs.pie_title }}
|
5
|
-
<div class="
|
7
|
+
<div class="label">{{ attrs.pie_title }}</div>
|
6
8
|
{{ end }}
|
7
9
|
</div>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: volt-easypiechart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Hale
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: volt
|
@@ -206,6 +206,7 @@ files:
|
|
206
206
|
- LICENSE.txt
|
207
207
|
- README.md
|
208
208
|
- Rakefile
|
209
|
+
- app/easypiechart/assets/css/main.css.scss
|
209
210
|
- app/easypiechart/assets/js/jquery.easypiechart.js
|
210
211
|
- app/easypiechart/config/dependencies.rb
|
211
212
|
- app/easypiechart/config/initializers/boot.rb
|