boletia_ui 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +42 -0
- data/lib/boletia_ui/version.rb +3 -0
- data/lib/boletia_ui.rb +8 -0
- data/vendor/assets/boletia_ui/fonts/ss-standard.css +53 -0
- data/vendor/assets/boletia_ui/fonts/ss-standard.eot +0 -0
- data/vendor/assets/boletia_ui/fonts/ss-standard.js +84 -0
- data/vendor/assets/boletia_ui/fonts/ss-standard.svg +404 -0
- data/vendor/assets/boletia_ui/fonts/ss-standard.ttf +0 -0
- data/vendor/assets/boletia_ui/fonts/ss-standard.woff +0 -0
- data/vendor/assets/boletia_ui/images/cancel.png +0 -0
- data/vendor/assets/boletia_ui/images/check.png +0 -0
- data/vendor/assets/boletia_ui/images/default-search.png +0 -0
- data/vendor/assets/boletia_ui/images/download.png +0 -0
- data/vendor/assets/boletia_ui/images/edit.png +0 -0
- data/vendor/assets/boletia_ui/images/icon-logo140.png +0 -0
- data/vendor/assets/boletia_ui/images/logo/header-logo-black.png +0 -0
- data/vendor/assets/boletia_ui/images/logo/header-logo-white.png +0 -0
- data/vendor/assets/boletia_ui/images/logo/icon-logo140.png +0 -0
- data/vendor/assets/boletia_ui/images/resend.png +0 -0
- data/vendor/assets/boletia_ui/images/trash.png +0 -0
- data/vendor/assets/boletia_ui/images/trophy.png +0 -0
- data/vendor/assets/boletia_ui/images/white-resend.png +0 -0
- data/vendor/assets/boletia_ui/images/white-search.png +0 -0
- data/vendor/assets/boletia_ui/javascripts/boletia-ui/boletia-ui-components.js +117 -0
- data/vendor/assets/boletia_ui/javascripts/boletia-ui/classie.js +80 -0
- data/vendor/assets/boletia_ui/javascripts/boletia-ui/select_fx.js +335 -0
- data/vendor/assets/boletia_ui/javascripts/charts/Chart.Legend.js +56 -0
- data/vendor/assets/boletia_ui/javascripts/charts/chart.min.js +11 -0
- data/vendor/assets/boletia_ui/javascripts/charts/refundCharts.js +167 -0
- data/vendor/assets/boletia_ui/javascripts/charts/src/Chart.Bar.js +302 -0
- data/vendor/assets/boletia_ui/javascripts/charts/src/Chart.Core.js +2002 -0
- data/vendor/assets/boletia_ui/javascripts/charts/src/Chart.Doughnut.js +184 -0
- data/vendor/assets/boletia_ui/javascripts/charts/src/Chart.Line.js +374 -0
- data/vendor/assets/boletia_ui/javascripts/charts/src/Chart.PolarArea.js +250 -0
- data/vendor/assets/boletia_ui/javascripts/charts/src/Chart.Radar.js +343 -0
- data/vendor/assets/boletia_ui/javascripts/counter/counter.js +12 -0
- data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-bg_flat_0_eeeeee_40x100.png +0 -0
- data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-bg_flat_55_ffffff_40x100.png +0 -0
- data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-bg_highlight-soft_100_f6f6f6_1x100.png +0 -0
- data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-bg_highlight-soft_25_0073ea_1x100.png +0 -0
- data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-bg_highlight-soft_50_dddddd_1x100.png +0 -0
- data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-icons_0073ea_256x240.png +0 -0
- data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-icons_454545_256x240.png +0 -0
- data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-icons_666666_256x240.png +0 -0
- data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-icons_ff0084_256x240.png +0 -0
- data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-icons_ffffff_256x240.png +0 -0
- data/vendor/assets/boletia_ui/javascripts/jquery-ui/jquery-ui.min.js +8 -0
- data/vendor/assets/boletia_ui/javascripts/scrolling-header/scrolling-header.js +41 -0
- data/vendor/assets/boletia_ui/javascripts/styleguide/styleguide.js +87 -0
- data/vendor/assets/boletia_ui/javascripts/tooltips/jquery.tooltipster.min.js +1 -0
- data/vendor/assets/boletia_ui/javascripts/vendor/magnific-popup/core.js +966 -0
- data/vendor/assets/boletia_ui/javascripts/vendor/magnific-popup/fastclick.js +93 -0
- data/vendor/assets/boletia_ui/javascripts/vendor/magnific-popup/image.js +245 -0
- data/vendor/assets/boletia_ui/javascripts/vendor/magnific-popup/inline.js +66 -0
- data/vendor/assets/boletia_ui/stylesheets/boletia-admin.css.scss +41 -0
- data/vendor/assets/boletia_ui/stylesheets/fonts/ss-standard.css +53 -0
- data/vendor/assets/boletia_ui/stylesheets/fonts/ss-standard.eot +0 -0
- data/vendor/assets/boletia_ui/stylesheets/fonts/ss-standard.js +84 -0
- data/vendor/assets/boletia_ui/stylesheets/fonts/ss-standard.svg +404 -0
- data/vendor/assets/boletia_ui/stylesheets/fonts/ss-standard.ttf +0 -0
- data/vendor/assets/boletia_ui/stylesheets/fonts/ss-standard.woff +0 -0
- data/vendor/assets/boletia_ui/stylesheets/jquery-ui/jquery-ui.min.css +7 -0
- data/vendor/assets/boletia_ui/stylesheets/jquery-ui/jquery-ui.structure.min.css +5 -0
- data/vendor/assets/boletia_ui/stylesheets/jquery-ui/jquery-ui.theme.css +410 -0
- data/vendor/assets/boletia_ui/stylesheets/layouts/_event_details.scss +100 -0
- data/vendor/assets/boletia_ui/stylesheets/layouts/_refund-wizard.scss +290 -0
- data/vendor/assets/boletia_ui/stylesheets/layouts/_sales.scss +17 -0
- data/vendor/assets/boletia_ui/stylesheets/layouts/_style_guide.scss +216 -0
- data/vendor/assets/boletia_ui/stylesheets/menu/_footer.scss +117 -0
- data/vendor/assets/boletia_ui/stylesheets/menu/_header.scss +314 -0
- data/vendor/assets/boletia_ui/stylesheets/menu/_new_front_footer.scss +117 -0
- data/vendor/assets/boletia_ui/stylesheets/menu/_new_front_header.scss +314 -0
- data/vendor/assets/boletia_ui/stylesheets/partials/_alerts.scss +183 -0
- data/vendor/assets/boletia_ui/stylesheets/partials/_base.scss +376 -0
- data/vendor/assets/boletia_ui/stylesheets/partials/_boletia-cards.scss +401 -0
- data/vendor/assets/boletia_ui/stylesheets/partials/_buttons.scss +200 -0
- data/vendor/assets/boletia_ui/stylesheets/partials/_dashboard.scss +192 -0
- data/vendor/assets/boletia_ui/stylesheets/partials/_forms.scss +395 -0
- data/vendor/assets/boletia_ui/stylesheets/partials/_grid.scss +85 -0
- data/vendor/assets/boletia_ui/stylesheets/partials/_tables.scss +139 -0
- data/vendor/assets/boletia_ui/stylesheets/partials/_wizard.scss +125 -0
- data/vendor/assets/boletia_ui/stylesheets/vendor/_select.scss +109 -0
- data/vendor/assets/boletia_ui/stylesheets/vendor/magnific-popup/_magnific.scss +642 -0
- data/vendor/assets/boletia_ui/stylesheets/vendor/magnific-popup/_settings.scss +45 -0
- data/vendor/assets/boletia_ui/stylesheets/vendor/tooltipster.css +274 -0
- metadata +174 -0
@@ -0,0 +1,250 @@
|
|
1
|
+
(function(){
|
2
|
+
"use strict";
|
3
|
+
|
4
|
+
var root = this,
|
5
|
+
Chart = root.Chart,
|
6
|
+
//Cache a local reference to Chart.helpers
|
7
|
+
helpers = Chart.helpers;
|
8
|
+
|
9
|
+
var defaultConfig = {
|
10
|
+
//Boolean - Show a backdrop to the scale label
|
11
|
+
scaleShowLabelBackdrop : true,
|
12
|
+
|
13
|
+
//String - The colour of the label backdrop
|
14
|
+
scaleBackdropColor : "rgba(255,255,255,0.75)",
|
15
|
+
|
16
|
+
// Boolean - Whether the scale should begin at zero
|
17
|
+
scaleBeginAtZero : true,
|
18
|
+
|
19
|
+
//Number - The backdrop padding above & below the label in pixels
|
20
|
+
scaleBackdropPaddingY : 2,
|
21
|
+
|
22
|
+
//Number - The backdrop padding to the side of the label in pixels
|
23
|
+
scaleBackdropPaddingX : 2,
|
24
|
+
|
25
|
+
//Boolean - Show line for each value in the scale
|
26
|
+
scaleShowLine : true,
|
27
|
+
|
28
|
+
//Boolean - Stroke a line around each segment in the chart
|
29
|
+
segmentShowStroke : true,
|
30
|
+
|
31
|
+
//String - The colour of the stroke on each segement.
|
32
|
+
segmentStrokeColor : "#fff",
|
33
|
+
|
34
|
+
//Number - The width of the stroke value in pixels
|
35
|
+
segmentStrokeWidth : 2,
|
36
|
+
|
37
|
+
//Number - Amount of animation steps
|
38
|
+
animationSteps : 100,
|
39
|
+
|
40
|
+
//String - Animation easing effect.
|
41
|
+
animationEasing : "easeOutBounce",
|
42
|
+
|
43
|
+
//Boolean - Whether to animate the rotation of the chart
|
44
|
+
animateRotate : true,
|
45
|
+
|
46
|
+
//Boolean - Whether to animate scaling the chart from the centre
|
47
|
+
animateScale : false,
|
48
|
+
|
49
|
+
//String - A legend template
|
50
|
+
legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"
|
51
|
+
};
|
52
|
+
|
53
|
+
|
54
|
+
Chart.Type.extend({
|
55
|
+
//Passing in a name registers this chart in the Chart namespace
|
56
|
+
name: "PolarArea",
|
57
|
+
//Providing a defaults will also register the deafults in the chart namespace
|
58
|
+
defaults : defaultConfig,
|
59
|
+
//Initialize is fired when the chart is initialized - Data is passed in as a parameter
|
60
|
+
//Config is automatically merged by the core of Chart.js, and is available at this.options
|
61
|
+
initialize: function(data){
|
62
|
+
this.segments = [];
|
63
|
+
//Declare segment class as a chart instance specific class, so it can share props for this instance
|
64
|
+
this.SegmentArc = Chart.Arc.extend({
|
65
|
+
showStroke : this.options.segmentShowStroke,
|
66
|
+
strokeWidth : this.options.segmentStrokeWidth,
|
67
|
+
strokeColor : this.options.segmentStrokeColor,
|
68
|
+
ctx : this.chart.ctx,
|
69
|
+
innerRadius : 0,
|
70
|
+
x : this.chart.width/2,
|
71
|
+
y : this.chart.height/2
|
72
|
+
});
|
73
|
+
this.scale = new Chart.RadialScale({
|
74
|
+
display: this.options.showScale,
|
75
|
+
fontStyle: this.options.scaleFontStyle,
|
76
|
+
fontSize: this.options.scaleFontSize,
|
77
|
+
fontFamily: this.options.scaleFontFamily,
|
78
|
+
fontColor: this.options.scaleFontColor,
|
79
|
+
showLabels: this.options.scaleShowLabels,
|
80
|
+
showLabelBackdrop: this.options.scaleShowLabelBackdrop,
|
81
|
+
backdropColor: this.options.scaleBackdropColor,
|
82
|
+
backdropPaddingY : this.options.scaleBackdropPaddingY,
|
83
|
+
backdropPaddingX: this.options.scaleBackdropPaddingX,
|
84
|
+
lineWidth: (this.options.scaleShowLine) ? this.options.scaleLineWidth : 0,
|
85
|
+
lineColor: this.options.scaleLineColor,
|
86
|
+
lineArc: true,
|
87
|
+
width: this.chart.width,
|
88
|
+
height: this.chart.height,
|
89
|
+
xCenter: this.chart.width/2,
|
90
|
+
yCenter: this.chart.height/2,
|
91
|
+
ctx : this.chart.ctx,
|
92
|
+
templateString: this.options.scaleLabel,
|
93
|
+
valuesCount: data.length
|
94
|
+
});
|
95
|
+
|
96
|
+
this.updateScaleRange(data);
|
97
|
+
|
98
|
+
this.scale.update();
|
99
|
+
|
100
|
+
helpers.each(data,function(segment,index){
|
101
|
+
this.addData(segment,index,true);
|
102
|
+
},this);
|
103
|
+
|
104
|
+
//Set up tooltip events on the chart
|
105
|
+
if (this.options.showTooltips){
|
106
|
+
helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
|
107
|
+
var activeSegments = (evt.type !== 'mouseout') ? this.getSegmentsAtEvent(evt) : [];
|
108
|
+
helpers.each(this.segments,function(segment){
|
109
|
+
segment.restore(["fillColor"]);
|
110
|
+
});
|
111
|
+
helpers.each(activeSegments,function(activeSegment){
|
112
|
+
activeSegment.fillColor = activeSegment.highlightColor;
|
113
|
+
});
|
114
|
+
this.showTooltip(activeSegments);
|
115
|
+
});
|
116
|
+
}
|
117
|
+
|
118
|
+
this.render();
|
119
|
+
},
|
120
|
+
getSegmentsAtEvent : function(e){
|
121
|
+
var segmentsArray = [];
|
122
|
+
|
123
|
+
var location = helpers.getRelativePosition(e);
|
124
|
+
|
125
|
+
helpers.each(this.segments,function(segment){
|
126
|
+
if (segment.inRange(location.x,location.y)) segmentsArray.push(segment);
|
127
|
+
},this);
|
128
|
+
return segmentsArray;
|
129
|
+
},
|
130
|
+
addData : function(segment, atIndex, silent){
|
131
|
+
var index = atIndex || this.segments.length;
|
132
|
+
|
133
|
+
this.segments.splice(index, 0, new this.SegmentArc({
|
134
|
+
fillColor: segment.color,
|
135
|
+
highlightColor: segment.highlight || segment.color,
|
136
|
+
label: segment.label,
|
137
|
+
value: segment.value,
|
138
|
+
outerRadius: (this.options.animateScale) ? 0 : this.scale.calculateCenterOffset(segment.value),
|
139
|
+
circumference: (this.options.animateRotate) ? 0 : this.scale.getCircumference(),
|
140
|
+
startAngle: Math.PI * 1.5
|
141
|
+
}));
|
142
|
+
if (!silent){
|
143
|
+
this.reflow();
|
144
|
+
this.update();
|
145
|
+
}
|
146
|
+
},
|
147
|
+
removeData: function(atIndex){
|
148
|
+
var indexToDelete = (helpers.isNumber(atIndex)) ? atIndex : this.segments.length-1;
|
149
|
+
this.segments.splice(indexToDelete, 1);
|
150
|
+
this.reflow();
|
151
|
+
this.update();
|
152
|
+
},
|
153
|
+
calculateTotal: function(data){
|
154
|
+
this.total = 0;
|
155
|
+
helpers.each(data,function(segment){
|
156
|
+
this.total += segment.value;
|
157
|
+
},this);
|
158
|
+
this.scale.valuesCount = this.segments.length;
|
159
|
+
},
|
160
|
+
updateScaleRange: function(datapoints){
|
161
|
+
var valuesArray = [];
|
162
|
+
helpers.each(datapoints,function(segment){
|
163
|
+
valuesArray.push(segment.value);
|
164
|
+
});
|
165
|
+
|
166
|
+
var scaleSizes = (this.options.scaleOverride) ?
|
167
|
+
{
|
168
|
+
steps: this.options.scaleSteps,
|
169
|
+
stepValue: this.options.scaleStepWidth,
|
170
|
+
min: this.options.scaleStartValue,
|
171
|
+
max: this.options.scaleStartValue + (this.options.scaleSteps * this.options.scaleStepWidth)
|
172
|
+
} :
|
173
|
+
helpers.calculateScaleRange(
|
174
|
+
valuesArray,
|
175
|
+
helpers.min([this.chart.width, this.chart.height])/2,
|
176
|
+
this.options.scaleFontSize,
|
177
|
+
this.options.scaleBeginAtZero,
|
178
|
+
this.options.scaleIntegersOnly
|
179
|
+
);
|
180
|
+
|
181
|
+
helpers.extend(
|
182
|
+
this.scale,
|
183
|
+
scaleSizes,
|
184
|
+
{
|
185
|
+
size: helpers.min([this.chart.width, this.chart.height]),
|
186
|
+
xCenter: this.chart.width/2,
|
187
|
+
yCenter: this.chart.height/2
|
188
|
+
}
|
189
|
+
);
|
190
|
+
|
191
|
+
},
|
192
|
+
update : function(){
|
193
|
+
this.calculateTotal(this.segments);
|
194
|
+
|
195
|
+
helpers.each(this.segments,function(segment){
|
196
|
+
segment.save();
|
197
|
+
});
|
198
|
+
|
199
|
+
this.reflow();
|
200
|
+
this.render();
|
201
|
+
},
|
202
|
+
reflow : function(){
|
203
|
+
helpers.extend(this.SegmentArc.prototype,{
|
204
|
+
x : this.chart.width/2,
|
205
|
+
y : this.chart.height/2
|
206
|
+
});
|
207
|
+
this.updateScaleRange(this.segments);
|
208
|
+
this.scale.update();
|
209
|
+
|
210
|
+
helpers.extend(this.scale,{
|
211
|
+
xCenter: this.chart.width/2,
|
212
|
+
yCenter: this.chart.height/2
|
213
|
+
});
|
214
|
+
|
215
|
+
helpers.each(this.segments, function(segment){
|
216
|
+
segment.update({
|
217
|
+
outerRadius : this.scale.calculateCenterOffset(segment.value)
|
218
|
+
});
|
219
|
+
}, this);
|
220
|
+
|
221
|
+
},
|
222
|
+
draw : function(ease){
|
223
|
+
var easingDecimal = ease || 1;
|
224
|
+
//Clear & draw the canvas
|
225
|
+
this.clear();
|
226
|
+
helpers.each(this.segments,function(segment, index){
|
227
|
+
segment.transition({
|
228
|
+
circumference : this.scale.getCircumference(),
|
229
|
+
outerRadius : this.scale.calculateCenterOffset(segment.value)
|
230
|
+
},easingDecimal);
|
231
|
+
|
232
|
+
segment.endAngle = segment.startAngle + segment.circumference;
|
233
|
+
|
234
|
+
// If we've removed the first segment we need to set the first one to
|
235
|
+
// start at the top.
|
236
|
+
if (index === 0){
|
237
|
+
segment.startAngle = Math.PI * 1.5;
|
238
|
+
}
|
239
|
+
|
240
|
+
//Check to see if it's the last segment, if not get the next and update the start angle
|
241
|
+
if (index < this.segments.length - 1){
|
242
|
+
this.segments[index+1].startAngle = segment.endAngle;
|
243
|
+
}
|
244
|
+
segment.draw();
|
245
|
+
}, this);
|
246
|
+
this.scale.draw();
|
247
|
+
}
|
248
|
+
});
|
249
|
+
|
250
|
+
}).call(this);
|
@@ -0,0 +1,343 @@
|
|
1
|
+
(function(){
|
2
|
+
"use strict";
|
3
|
+
|
4
|
+
var root = this,
|
5
|
+
Chart = root.Chart,
|
6
|
+
helpers = Chart.helpers;
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
Chart.Type.extend({
|
11
|
+
name: "Radar",
|
12
|
+
defaults:{
|
13
|
+
//Boolean - Whether to show lines for each scale point
|
14
|
+
scaleShowLine : true,
|
15
|
+
|
16
|
+
//Boolean - Whether we show the angle lines out of the radar
|
17
|
+
angleShowLineOut : true,
|
18
|
+
|
19
|
+
//Boolean - Whether to show labels on the scale
|
20
|
+
scaleShowLabels : false,
|
21
|
+
|
22
|
+
// Boolean - Whether the scale should begin at zero
|
23
|
+
scaleBeginAtZero : true,
|
24
|
+
|
25
|
+
//String - Colour of the angle line
|
26
|
+
angleLineColor : "rgba(0,0,0,.1)",
|
27
|
+
|
28
|
+
//Number - Pixel width of the angle line
|
29
|
+
angleLineWidth : 1,
|
30
|
+
|
31
|
+
//String - Point label font declaration
|
32
|
+
pointLabelFontFamily : "'Arial'",
|
33
|
+
|
34
|
+
//String - Point label font weight
|
35
|
+
pointLabelFontStyle : "normal",
|
36
|
+
|
37
|
+
//Number - Point label font size in pixels
|
38
|
+
pointLabelFontSize : 10,
|
39
|
+
|
40
|
+
//String - Point label font colour
|
41
|
+
pointLabelFontColor : "#666",
|
42
|
+
|
43
|
+
//Boolean - Whether to show a dot for each point
|
44
|
+
pointDot : true,
|
45
|
+
|
46
|
+
//Number - Radius of each point dot in pixels
|
47
|
+
pointDotRadius : 3,
|
48
|
+
|
49
|
+
//Number - Pixel width of point dot stroke
|
50
|
+
pointDotStrokeWidth : 1,
|
51
|
+
|
52
|
+
//Number - amount extra to add to the radius to cater for hit detection outside the drawn point
|
53
|
+
pointHitDetectionRadius : 20,
|
54
|
+
|
55
|
+
//Boolean - Whether to show a stroke for datasets
|
56
|
+
datasetStroke : true,
|
57
|
+
|
58
|
+
//Number - Pixel width of dataset stroke
|
59
|
+
datasetStrokeWidth : 2,
|
60
|
+
|
61
|
+
//Boolean - Whether to fill the dataset with a colour
|
62
|
+
datasetFill : true,
|
63
|
+
|
64
|
+
//String - A legend template
|
65
|
+
legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].strokeColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"
|
66
|
+
|
67
|
+
},
|
68
|
+
|
69
|
+
initialize: function(data){
|
70
|
+
this.PointClass = Chart.Point.extend({
|
71
|
+
strokeWidth : this.options.pointDotStrokeWidth,
|
72
|
+
radius : this.options.pointDotRadius,
|
73
|
+
display: this.options.pointDot,
|
74
|
+
hitDetectionRadius : this.options.pointHitDetectionRadius,
|
75
|
+
ctx : this.chart.ctx
|
76
|
+
});
|
77
|
+
|
78
|
+
this.datasets = [];
|
79
|
+
|
80
|
+
this.buildScale(data);
|
81
|
+
|
82
|
+
//Set up tooltip events on the chart
|
83
|
+
if (this.options.showTooltips){
|
84
|
+
helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
|
85
|
+
var activePointsCollection = (evt.type !== 'mouseout') ? this.getPointsAtEvent(evt) : [];
|
86
|
+
|
87
|
+
this.eachPoints(function(point){
|
88
|
+
point.restore(['fillColor', 'strokeColor']);
|
89
|
+
});
|
90
|
+
helpers.each(activePointsCollection, function(activePoint){
|
91
|
+
activePoint.fillColor = activePoint.highlightFill;
|
92
|
+
activePoint.strokeColor = activePoint.highlightStroke;
|
93
|
+
});
|
94
|
+
|
95
|
+
this.showTooltip(activePointsCollection);
|
96
|
+
});
|
97
|
+
}
|
98
|
+
|
99
|
+
//Iterate through each of the datasets, and build this into a property of the chart
|
100
|
+
helpers.each(data.datasets,function(dataset){
|
101
|
+
|
102
|
+
var datasetObject = {
|
103
|
+
label: dataset.label || null,
|
104
|
+
fillColor : dataset.fillColor,
|
105
|
+
strokeColor : dataset.strokeColor,
|
106
|
+
pointColor : dataset.pointColor,
|
107
|
+
pointStrokeColor : dataset.pointStrokeColor,
|
108
|
+
points : []
|
109
|
+
};
|
110
|
+
|
111
|
+
this.datasets.push(datasetObject);
|
112
|
+
|
113
|
+
helpers.each(dataset.data,function(dataPoint,index){
|
114
|
+
//Add a new point for each piece of data, passing any required data to draw.
|
115
|
+
var pointPosition;
|
116
|
+
if (!this.scale.animation){
|
117
|
+
pointPosition = this.scale.getPointPosition(index, this.scale.calculateCenterOffset(dataPoint));
|
118
|
+
}
|
119
|
+
datasetObject.points.push(new this.PointClass({
|
120
|
+
value : dataPoint,
|
121
|
+
label : data.labels[index],
|
122
|
+
datasetLabel: dataset.label,
|
123
|
+
x: (this.options.animation) ? this.scale.xCenter : pointPosition.x,
|
124
|
+
y: (this.options.animation) ? this.scale.yCenter : pointPosition.y,
|
125
|
+
strokeColor : dataset.pointStrokeColor,
|
126
|
+
fillColor : dataset.pointColor,
|
127
|
+
highlightFill : dataset.pointHighlightFill || dataset.pointColor,
|
128
|
+
highlightStroke : dataset.pointHighlightStroke || dataset.pointStrokeColor
|
129
|
+
}));
|
130
|
+
},this);
|
131
|
+
|
132
|
+
},this);
|
133
|
+
|
134
|
+
this.render();
|
135
|
+
},
|
136
|
+
eachPoints : function(callback){
|
137
|
+
helpers.each(this.datasets,function(dataset){
|
138
|
+
helpers.each(dataset.points,callback,this);
|
139
|
+
},this);
|
140
|
+
},
|
141
|
+
|
142
|
+
getPointsAtEvent : function(evt){
|
143
|
+
var mousePosition = helpers.getRelativePosition(evt),
|
144
|
+
fromCenter = helpers.getAngleFromPoint({
|
145
|
+
x: this.scale.xCenter,
|
146
|
+
y: this.scale.yCenter
|
147
|
+
}, mousePosition);
|
148
|
+
|
149
|
+
var anglePerIndex = (Math.PI * 2) /this.scale.valuesCount,
|
150
|
+
pointIndex = Math.round((fromCenter.angle - Math.PI * 1.5) / anglePerIndex),
|
151
|
+
activePointsCollection = [];
|
152
|
+
|
153
|
+
// If we're at the top, make the pointIndex 0 to get the first of the array.
|
154
|
+
if (pointIndex >= this.scale.valuesCount || pointIndex < 0){
|
155
|
+
pointIndex = 0;
|
156
|
+
}
|
157
|
+
|
158
|
+
if (fromCenter.distance <= this.scale.drawingArea){
|
159
|
+
helpers.each(this.datasets, function(dataset){
|
160
|
+
activePointsCollection.push(dataset.points[pointIndex]);
|
161
|
+
});
|
162
|
+
}
|
163
|
+
|
164
|
+
return activePointsCollection;
|
165
|
+
},
|
166
|
+
|
167
|
+
buildScale : function(data){
|
168
|
+
this.scale = new Chart.RadialScale({
|
169
|
+
display: this.options.showScale,
|
170
|
+
fontStyle: this.options.scaleFontStyle,
|
171
|
+
fontSize: this.options.scaleFontSize,
|
172
|
+
fontFamily: this.options.scaleFontFamily,
|
173
|
+
fontColor: this.options.scaleFontColor,
|
174
|
+
showLabels: this.options.scaleShowLabels,
|
175
|
+
showLabelBackdrop: this.options.scaleShowLabelBackdrop,
|
176
|
+
backdropColor: this.options.scaleBackdropColor,
|
177
|
+
backdropPaddingY : this.options.scaleBackdropPaddingY,
|
178
|
+
backdropPaddingX: this.options.scaleBackdropPaddingX,
|
179
|
+
lineWidth: (this.options.scaleShowLine) ? this.options.scaleLineWidth : 0,
|
180
|
+
lineColor: this.options.scaleLineColor,
|
181
|
+
angleLineColor : this.options.angleLineColor,
|
182
|
+
angleLineWidth : (this.options.angleShowLineOut) ? this.options.angleLineWidth : 0,
|
183
|
+
// Point labels at the edge of each line
|
184
|
+
pointLabelFontColor : this.options.pointLabelFontColor,
|
185
|
+
pointLabelFontSize : this.options.pointLabelFontSize,
|
186
|
+
pointLabelFontFamily : this.options.pointLabelFontFamily,
|
187
|
+
pointLabelFontStyle : this.options.pointLabelFontStyle,
|
188
|
+
height : this.chart.height,
|
189
|
+
width: this.chart.width,
|
190
|
+
xCenter: this.chart.width/2,
|
191
|
+
yCenter: this.chart.height/2,
|
192
|
+
ctx : this.chart.ctx,
|
193
|
+
templateString: this.options.scaleLabel,
|
194
|
+
labels: data.labels,
|
195
|
+
valuesCount: data.datasets[0].data.length
|
196
|
+
});
|
197
|
+
|
198
|
+
this.scale.setScaleSize();
|
199
|
+
this.updateScaleRange(data.datasets);
|
200
|
+
this.scale.buildYLabels();
|
201
|
+
},
|
202
|
+
updateScaleRange: function(datasets){
|
203
|
+
var valuesArray = (function(){
|
204
|
+
var totalDataArray = [];
|
205
|
+
helpers.each(datasets,function(dataset){
|
206
|
+
if (dataset.data){
|
207
|
+
totalDataArray = totalDataArray.concat(dataset.data);
|
208
|
+
}
|
209
|
+
else {
|
210
|
+
helpers.each(dataset.points, function(point){
|
211
|
+
totalDataArray.push(point.value);
|
212
|
+
});
|
213
|
+
}
|
214
|
+
});
|
215
|
+
return totalDataArray;
|
216
|
+
})();
|
217
|
+
|
218
|
+
|
219
|
+
var scaleSizes = (this.options.scaleOverride) ?
|
220
|
+
{
|
221
|
+
steps: this.options.scaleSteps,
|
222
|
+
stepValue: this.options.scaleStepWidth,
|
223
|
+
min: this.options.scaleStartValue,
|
224
|
+
max: this.options.scaleStartValue + (this.options.scaleSteps * this.options.scaleStepWidth)
|
225
|
+
} :
|
226
|
+
helpers.calculateScaleRange(
|
227
|
+
valuesArray,
|
228
|
+
helpers.min([this.chart.width, this.chart.height])/2,
|
229
|
+
this.options.scaleFontSize,
|
230
|
+
this.options.scaleBeginAtZero,
|
231
|
+
this.options.scaleIntegersOnly
|
232
|
+
);
|
233
|
+
|
234
|
+
helpers.extend(
|
235
|
+
this.scale,
|
236
|
+
scaleSizes
|
237
|
+
);
|
238
|
+
|
239
|
+
},
|
240
|
+
addData : function(valuesArray,label){
|
241
|
+
//Map the values array for each of the datasets
|
242
|
+
this.scale.valuesCount++;
|
243
|
+
helpers.each(valuesArray,function(value,datasetIndex){
|
244
|
+
var pointPosition = this.scale.getPointPosition(this.scale.valuesCount, this.scale.calculateCenterOffset(value));
|
245
|
+
this.datasets[datasetIndex].points.push(new this.PointClass({
|
246
|
+
value : value,
|
247
|
+
label : label,
|
248
|
+
x: pointPosition.x,
|
249
|
+
y: pointPosition.y,
|
250
|
+
strokeColor : this.datasets[datasetIndex].pointStrokeColor,
|
251
|
+
fillColor : this.datasets[datasetIndex].pointColor
|
252
|
+
}));
|
253
|
+
},this);
|
254
|
+
|
255
|
+
this.scale.labels.push(label);
|
256
|
+
|
257
|
+
this.reflow();
|
258
|
+
|
259
|
+
this.update();
|
260
|
+
},
|
261
|
+
removeData : function(){
|
262
|
+
this.scale.valuesCount--;
|
263
|
+
this.scale.labels.shift();
|
264
|
+
helpers.each(this.datasets,function(dataset){
|
265
|
+
dataset.points.shift();
|
266
|
+
},this);
|
267
|
+
this.reflow();
|
268
|
+
this.update();
|
269
|
+
},
|
270
|
+
update : function(){
|
271
|
+
this.eachPoints(function(point){
|
272
|
+
point.save();
|
273
|
+
});
|
274
|
+
this.reflow();
|
275
|
+
this.render();
|
276
|
+
},
|
277
|
+
reflow: function(){
|
278
|
+
helpers.extend(this.scale, {
|
279
|
+
width : this.chart.width,
|
280
|
+
height: this.chart.height,
|
281
|
+
size : helpers.min([this.chart.width, this.chart.height]),
|
282
|
+
xCenter: this.chart.width/2,
|
283
|
+
yCenter: this.chart.height/2
|
284
|
+
});
|
285
|
+
this.updateScaleRange(this.datasets);
|
286
|
+
this.scale.setScaleSize();
|
287
|
+
this.scale.buildYLabels();
|
288
|
+
},
|
289
|
+
draw : function(ease){
|
290
|
+
var easeDecimal = ease || 1,
|
291
|
+
ctx = this.chart.ctx;
|
292
|
+
this.clear();
|
293
|
+
this.scale.draw();
|
294
|
+
|
295
|
+
helpers.each(this.datasets,function(dataset){
|
296
|
+
|
297
|
+
//Transition each point first so that the line and point drawing isn't out of sync
|
298
|
+
helpers.each(dataset.points,function(point,index){
|
299
|
+
if (point.hasValue()){
|
300
|
+
point.transition(this.scale.getPointPosition(index, this.scale.calculateCenterOffset(point.value)), easeDecimal);
|
301
|
+
}
|
302
|
+
},this);
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
//Draw the line between all the points
|
307
|
+
ctx.lineWidth = this.options.datasetStrokeWidth;
|
308
|
+
ctx.strokeStyle = dataset.strokeColor;
|
309
|
+
ctx.beginPath();
|
310
|
+
helpers.each(dataset.points,function(point,index){
|
311
|
+
if (index === 0){
|
312
|
+
ctx.moveTo(point.x,point.y);
|
313
|
+
}
|
314
|
+
else{
|
315
|
+
ctx.lineTo(point.x,point.y);
|
316
|
+
}
|
317
|
+
},this);
|
318
|
+
ctx.closePath();
|
319
|
+
ctx.stroke();
|
320
|
+
|
321
|
+
ctx.fillStyle = dataset.fillColor;
|
322
|
+
ctx.fill();
|
323
|
+
|
324
|
+
//Now draw the points over the line
|
325
|
+
//A little inefficient double looping, but better than the line
|
326
|
+
//lagging behind the point positions
|
327
|
+
helpers.each(dataset.points,function(point){
|
328
|
+
if (point.hasValue()){
|
329
|
+
point.draw();
|
330
|
+
}
|
331
|
+
});
|
332
|
+
|
333
|
+
},this);
|
334
|
+
|
335
|
+
}
|
336
|
+
|
337
|
+
});
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
}).call(this);
|
@@ -0,0 +1,12 @@
|
|
1
|
+
$(document).ready(function() {
|
2
|
+
$('.js-counter').each(function () {
|
3
|
+
var $this = $(this);
|
4
|
+
jQuery({ Counter: 0 }).animate({ Counter: $this.text() }, {
|
5
|
+
duration: 1000,
|
6
|
+
easing: 'swing',
|
7
|
+
step: function () {
|
8
|
+
$this.text(Math.ceil(this.Counter));
|
9
|
+
}
|
10
|
+
});
|
11
|
+
});
|
12
|
+
});
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-bg_highlight-soft_100_f6f6f6_1x100.png
ADDED
Binary file
|
data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-bg_highlight-soft_25_0073ea_1x100.png
ADDED
Binary file
|
data/vendor/assets/boletia_ui/javascripts/jquery-ui/images/ui-bg_highlight-soft_50_dddddd_1x100.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|