circular-sliders-rails 0.1.0 → 0.1.1
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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1f2e6e0f89cc1eab4359e3134dffb3edb3a7456872aea2c1edeedc2cd31a0cae
|
4
|
+
data.tar.gz: 8ae66273d4e1d42ac7892a00e0a08412c6265b1d548a20777bb283beb3c82574
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86eb821cc7fe29cfd0a4c7edb5aaee15b48f50fb15d22580b5f27caa6ff821a7f1ee07ce59d6fe51a5208c513bb56c4b712f32b3e13de31ef3b3be6b9c68def2
|
7
|
+
data.tar.gz: cdcbcb7cb4890d727c8112565abddfc25fba3f4430940434d0f49713114e5b80de3af470bf250ce47be228f717a7866035d92d98b1405dfad28fa5f1f6b77ec5
|
data/README.md
CHANGED
@@ -83,34 +83,45 @@ Use jQuery to add circular sliders to the canvas area. Pass slider settings as o
|
|
83
83
|
|
84
84
|
Slider settings:
|
85
85
|
|
86
|
-
| Name | Type | Default
|
87
|
-
| --------------- | ------ |
|
88
|
-
| name | String | Slider n
|
89
|
-
| centerX | Float | Center of
|
90
|
-
| centerY | Float | Center of
|
91
|
-
| color | String | "#0000FF"
|
92
|
-
| minValue | Float | 0
|
93
|
-
| maxValue | Float | 0
|
94
|
-
| step | Float | 10
|
95
|
-
| units | String | ""
|
96
|
-
| radius | Float | 40 or
|
97
|
-
| lineDashLength | Float | 5
|
98
|
-
| lineDashSpacing | Float | 5
|
99
|
-
| lineWidth | Float | 5
|
100
|
-
| strokeColor | String | "#D3D3D3"
|
101
|
-
| ballColor | String | "#000000"
|
102
|
-
| textColor | String | "#000000"
|
86
|
+
| Name | Type | Default | Description |
|
87
|
+
| --------------- | ------ | ----------------------------------- | ------------------------------------------------------ |
|
88
|
+
| name | String | Slider n | Name your slider |
|
89
|
+
| centerX | Float | Center of canvas or previous slider | Specify the x value for the center of the slider |
|
90
|
+
| centerY | Float | Center of canvas or previous slider | Specify the y value for the center of the slider |
|
91
|
+
| color | String | "#0000FF" | Specify the color of the arc fill |
|
92
|
+
| minValue | Float | 0 | The minimum value of your slider |
|
93
|
+
| maxValue | Float | 0 | The maximum value of your slider |
|
94
|
+
| step | Float | 10 | The amount the value is incremented |
|
95
|
+
| units | String | "" | The units your value is displayed in |
|
96
|
+
| radius | Float | 40 or previous slider radius +≈ 15 | The radius of your slider |
|
97
|
+
| lineDashLength | Float | 5 | The arc length of each dash of your slider |
|
98
|
+
| lineDashSpacing | Float | 5 | The arc spacing length of each dash of your slider |
|
99
|
+
| lineWidth | Float | 5 | The slider and arc width |
|
100
|
+
| strokeColor | String | "#D3D3D3" | The color of the dashes on the slider |
|
101
|
+
| ballColor | String | "#000000" | The color of the slider ball |
|
102
|
+
| textColor | String | "#000000" | The color of the slider label (name, value and units) |
|
103
103
|
|
104
104
|
Retrieve values of individual sliders by calling:
|
105
105
|
|
106
106
|
$('#sliders').data('slider_name');
|
107
107
|
|
108
|
+
You should see something like this:
|
109
|
+
|
110
|
+
![Circular sliders](/vendor/assets/images/circular-sliders-rails.png)
|
111
|
+
|
108
112
|
<!-- ## Development -->
|
109
113
|
|
110
114
|
<!-- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). -->
|
111
115
|
|
116
|
+
|
112
117
|
## Contributing
|
113
118
|
|
119
|
+
1. Fork it
|
120
|
+
1. Create your feature branch (`git checkout -b my-new-feature`)
|
121
|
+
1. Commit your changes (`git commit -am 'Add some feature'`)
|
122
|
+
1. Push to the branch (`git push origin my-new-feature`)
|
123
|
+
1. Create new Pull Request
|
124
|
+
|
114
125
|
Bug reports and pull requests are welcome on GitHub at https://github.com/speterlin/circular-sliders-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
115
126
|
|
116
127
|
|
Binary file
|
@@ -77,7 +77,6 @@
|
|
77
77
|
this.value = settings.minValue;
|
78
78
|
// ball starts at top of circle which is - pi / 2
|
79
79
|
this.angle = -(Math.PI / 2);
|
80
|
-
// maybe refactor
|
81
80
|
this.ball = new Ball (settings);
|
82
81
|
}
|
83
82
|
|
@@ -86,7 +85,6 @@
|
|
86
85
|
// ball starts at top of circle
|
87
86
|
this.y = sliderSettings.centerY - sliderSettings.radius;
|
88
87
|
this.radius = sliderSettings.lineWidth;
|
89
|
-
// this is not editable option but could be
|
90
88
|
this.color = sliderSettings.ballColor;
|
91
89
|
}
|
92
90
|
|
@@ -130,7 +128,8 @@
|
|
130
128
|
ctx.arc(slider.centerX, slider.centerY, slider.radius, -(Math.PI / 2), endAngle, false);
|
131
129
|
ctx.lineWidth = slider.lineWidth;
|
132
130
|
ctx.strokeStyle = slider.color;
|
133
|
-
|
131
|
+
// have to set lineDashLength to a number > 0 for arc to be completely full in browsers like Safari, set it arbitrarily to 10 here
|
132
|
+
ctx.setLineDash([10, 0]);
|
134
133
|
ctx.stroke();
|
135
134
|
ctx.closePath();
|
136
135
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: circular-sliders-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Peterlin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- circular-sliders-rails.gemspec
|
88
88
|
- lib/circular/sliders/rails.rb
|
89
89
|
- lib/circular/sliders/rails/version.rb
|
90
|
+
- vendor/assets/images/circular-sliders-rails.png
|
90
91
|
- vendor/assets/javascripts/circular-sliders.js
|
91
92
|
homepage: https://github.com/speterlin/circular-sliders-rails
|
92
93
|
licenses:
|
@@ -109,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
110
|
version: '0'
|
110
111
|
requirements: []
|
111
112
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.7.6
|
113
114
|
signing_key:
|
114
115
|
specification_version: 4
|
115
116
|
summary: Draw concentric circles and responsively set each value.
|