rgraph-rails 1.0.4 → 1.0.5
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 +8 -8
- data/.travis.yml +1 -0
- data/README.md +2 -2
- data/lib/rgraph-rails/version.rb +1 -1
- data/vendor/assets/images/bullet.png +0 -0
- data/vendor/assets/images/facebook-large.png +0 -0
- data/vendor/assets/images/google-plus-large.png +0 -0
- data/vendor/assets/images/logo.png +0 -0
- data/vendor/assets/images/rgraph.jpg +0 -0
- data/vendor/assets/javascripts/RGraph.bar.js +533 -242
- data/vendor/assets/javascripts/RGraph.bipolar.js +152 -169
- data/vendor/assets/javascripts/RGraph.common.annotate.js +2 -2
- data/vendor/assets/javascripts/RGraph.common.context.js +2 -2
- data/vendor/assets/javascripts/RGraph.common.core.js +688 -373
- data/vendor/assets/javascripts/RGraph.common.csv.js +2 -2
- data/vendor/assets/javascripts/RGraph.common.deprecated.js +2 -2
- data/vendor/assets/javascripts/RGraph.common.dynamic.js +188 -193
- data/vendor/assets/javascripts/RGraph.common.effects.js +62 -38
- data/vendor/assets/javascripts/RGraph.common.key.js +35 -15
- data/vendor/assets/javascripts/RGraph.common.resizing.js +38 -21
- data/vendor/assets/javascripts/RGraph.common.sheets.js +2 -2
- data/vendor/assets/javascripts/RGraph.common.tooltips.js +48 -40
- data/vendor/assets/javascripts/RGraph.common.zoom.js +2 -2
- data/vendor/assets/javascripts/RGraph.drawing.background.js +33 -49
- data/vendor/assets/javascripts/RGraph.drawing.circle.js +27 -30
- data/vendor/assets/javascripts/RGraph.drawing.image.js +23 -26
- data/vendor/assets/javascripts/RGraph.drawing.marker1.js +47 -40
- data/vendor/assets/javascripts/RGraph.drawing.marker2.js +38 -42
- data/vendor/assets/javascripts/RGraph.drawing.marker3.js +24 -28
- data/vendor/assets/javascripts/RGraph.drawing.poly.js +25 -39
- data/vendor/assets/javascripts/RGraph.drawing.rect.js +27 -32
- data/vendor/assets/javascripts/RGraph.drawing.text.js +53 -58
- data/vendor/assets/javascripts/RGraph.drawing.xaxis.js +24 -29
- data/vendor/assets/javascripts/RGraph.drawing.yaxis.js +45 -51
- data/vendor/assets/javascripts/RGraph.fuel.js +11 -9
- data/vendor/assets/javascripts/RGraph.funnel.js +40 -43
- data/vendor/assets/javascripts/RGraph.gantt.js +34 -34
- data/vendor/assets/javascripts/RGraph.gauge.js +64 -55
- data/vendor/assets/javascripts/RGraph.hbar.js +194 -137
- data/vendor/assets/javascripts/RGraph.hprogress.js +261 -167
- data/vendor/assets/javascripts/RGraph.line.js +520 -512
- data/vendor/assets/javascripts/RGraph.meter.js +11 -10
- data/vendor/assets/javascripts/RGraph.modaldialog.js +11 -2
- data/vendor/assets/javascripts/RGraph.odo.js +11 -9
- data/vendor/assets/javascripts/RGraph.pie.js +385 -100
- data/vendor/assets/javascripts/RGraph.radar.js +36 -29
- data/vendor/assets/javascripts/RGraph.rose.js +58 -41
- data/vendor/assets/javascripts/RGraph.rscatter.js +40 -36
- data/vendor/assets/javascripts/RGraph.scatter.js +441 -499
- data/vendor/assets/javascripts/RGraph.semicircularprogress.js +1015 -0
- data/vendor/assets/javascripts/RGraph.thermometer.js +37 -37
- data/vendor/assets/javascripts/RGraph.vprogress.js +285 -157
- data/vendor/assets/javascripts/RGraph.waterfall.js +62 -62
- data/vendor/assets/stylesheets/website.css +30 -16
- metadata +3 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
// version: 2016-
|
1
|
+
// version: 2016-06-04
|
2
2
|
/**
|
3
3
|
* o--------------------------------------------------------------------------------o
|
4
4
|
* | This file is part of the RGraph package - you can learn more at: |
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* | |
|
8
8
|
* | RGraph is dual licensed under the Open Source GPL (General Public License) |
|
9
9
|
* | v2.0 license and a commercial license which means that you're not bound by |
|
10
|
-
* | the terms of the GPL. The commercial license is just
|
10
|
+
* | the terms of the GPL. The commercial license is just 99 GBP and you can |
|
11
11
|
* | read about it here: |
|
12
12
|
* | http://www.rgraph.net/license |
|
13
13
|
* o--------------------------------------------------------------------------------o
|
@@ -38,9 +38,9 @@
|
|
38
38
|
} else {
|
39
39
|
|
40
40
|
var conf = {
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
id: conf,
|
42
|
+
data: arguments[1]
|
43
|
+
};
|
44
44
|
}
|
45
45
|
|
46
46
|
|
@@ -96,11 +96,18 @@
|
|
96
96
|
'chart.gutter.bottom': 25,
|
97
97
|
'chart.labels': [],
|
98
98
|
'chart.labels.bold': false,
|
99
|
+
'chart.labels.offsetx': 0,
|
100
|
+
'chart.labels.offsety': 0,
|
101
|
+
'chart.ylabels.offsetx': 0,
|
102
|
+
'chart.ylabels.offsety': 0,
|
99
103
|
'chart.ylabels': true,
|
100
104
|
'chart.text.color': 'black',
|
101
105
|
'chart.text.size': 12,
|
102
106
|
'chart.text.angle': 0,
|
103
|
-
'chart.text.font': 'Arial',
|
107
|
+
'chart.text.font': 'Segoe UI, Arial, Verdana, sans-serif',
|
108
|
+
'chart.text.accessible': true,
|
109
|
+
'chart.text.accessible.overflow': 'visible',
|
110
|
+
'chart.text.accessible.pointerevents': false,
|
104
111
|
'chart.ymax': null,
|
105
112
|
'chart.title': '',
|
106
113
|
'chart.title.color': 'black',
|
@@ -176,7 +183,8 @@
|
|
176
183
|
'chart.multiplier.w': 1,
|
177
184
|
'chart.events.click': null,
|
178
185
|
'chart.events.mousemove': null,
|
179
|
-
'chart.ylabels.count': 5
|
186
|
+
'chart.ylabels.count': 5,
|
187
|
+
'chart.clearto': 'rgba(0,0,0,0)'
|
180
188
|
}
|
181
189
|
|
182
190
|
// Check for support
|
@@ -187,9 +195,19 @@
|
|
187
195
|
|
188
196
|
/**
|
189
197
|
* Create the $ objects
|
198
|
+
*
|
199
|
+
* 2/5/016: Now also use this loop to go through the dat conerting
|
200
|
+
* strings to floats
|
190
201
|
*/
|
191
|
-
for (var i=0
|
202
|
+
for (var i=0,len=this.data.length; i<=len; ++i) {
|
203
|
+
|
204
|
+
// Create the object for adding event listeners
|
192
205
|
this['$' + i] = {}
|
206
|
+
|
207
|
+
// Ensure that the data point is numeric
|
208
|
+
if (typeof this.data[i] === 'string') {
|
209
|
+
this.data[i] = parseFloat(this.data[i]);
|
210
|
+
}
|
193
211
|
}
|
194
212
|
|
195
213
|
|
@@ -211,7 +229,6 @@
|
|
211
229
|
ca = this.canvas,
|
212
230
|
co = ca.getContext('2d'),
|
213
231
|
prop = this.properties,
|
214
|
-
pa = RG.Path,
|
215
232
|
pa2 = RG.path2,
|
216
233
|
win = window,
|
217
234
|
doc = document,
|
@@ -262,11 +279,9 @@
|
|
262
279
|
|
263
280
|
|
264
281
|
// Convert uppercase letters to dot+lower case letter
|
265
|
-
name
|
266
|
-
|
267
|
-
|
268
|
-
});
|
269
|
-
|
282
|
+
while(name.match(/([A-Z])/)) {
|
283
|
+
name = name.replace(/([A-Z])/, '.' + RegExp.$1.toLowerCase());
|
284
|
+
}
|
270
285
|
|
271
286
|
|
272
287
|
|
@@ -566,14 +581,16 @@
|
|
566
581
|
this.drawLabels =
|
567
582
|
this.DrawLabels = function ()
|
568
583
|
{
|
569
|
-
var context = co
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
584
|
+
var context = co,
|
585
|
+
numYLabels = 5, // TODO Make this configurable
|
586
|
+
interval = this.grapharea / numYLabels,
|
587
|
+
font = prop['chart.text.font'],
|
588
|
+
size = prop['chart.text.size'],
|
589
|
+
color = prop['chart.text.color'],
|
590
|
+
units_pre = prop['chart.units.pre'],
|
591
|
+
units_post = prop['chart.units.post'],
|
592
|
+
offsetx = prop['chart.ylabels.offsetx'],
|
593
|
+
offsety = prop['chart.ylabels.offsety'];
|
577
594
|
|
578
595
|
co.beginPath();
|
579
596
|
co.fillStyle = color;
|
@@ -591,8 +608,8 @@
|
|
591
608
|
RG.text2(this, {
|
592
609
|
'font':font,
|
593
610
|
'size':size,
|
594
|
-
'x':this.gutterLeft - 5,
|
595
|
-
'y': this.gutterTop + (((this.grapharea/2) / len) * i),
|
611
|
+
'x':this.gutterLeft - 5 + offsetx,
|
612
|
+
'y': this.gutterTop + (((this.grapharea/2) / len) * i) + offsety,
|
596
613
|
'text':this.scale2.labels[len - i - 1],
|
597
614
|
'valign':'center',
|
598
615
|
'halign':'right',
|
@@ -602,8 +619,8 @@
|
|
602
619
|
RG.Text2(this, {
|
603
620
|
'font':font,
|
604
621
|
'size':size,
|
605
|
-
'x':this.gutterLeft - 5,
|
606
|
-
'y': halfWay + (((this.grapharea/2) / len) * (i + 1)),
|
622
|
+
'x':this.gutterLeft - 5 + offsetx,
|
623
|
+
'y': halfWay + (((this.grapharea/2) / len) * (i + 1)) + offsety,
|
607
624
|
'text':this.scale2.labels[i],
|
608
625
|
'valign':'center',
|
609
626
|
'halign':'right',
|
@@ -617,8 +634,8 @@
|
|
617
634
|
RG.text2(this, {
|
618
635
|
'font':font,
|
619
636
|
'size':size,
|
620
|
-
'x':this.gutterLeft - 5,
|
621
|
-
'y': ca.height - this.gutterBottom - ((this.grapharea / len) * (i + 1)),
|
637
|
+
'x':this.gutterLeft - 5 + offsetx,
|
638
|
+
'y': ca.height - this.gutterBottom - ((this.grapharea / len) * (i + 1)) + offsety,
|
622
639
|
'text':this.scale2.labels[i],
|
623
640
|
'valign':'center',
|
624
641
|
'halign':'right',
|
@@ -648,7 +665,9 @@
|
|
648
665
|
|
649
666
|
var labels = prop['chart.labels'],
|
650
667
|
labelsColor = prop['chart.labels.color'],
|
651
|
-
bold = prop['chart.labels.bold']
|
668
|
+
bold = prop['chart.labels.bold'],
|
669
|
+
offsetx = prop['chart.labels.offsetx'],
|
670
|
+
offsety = prop['chart.labels.offsety']
|
652
671
|
|
653
672
|
for (var i=0,len=labels.length; i<len; i+=1) {
|
654
673
|
RG.text2(this, {
|
@@ -656,8 +675,8 @@
|
|
656
675
|
'font':font,
|
657
676
|
'size':size,
|
658
677
|
'bold': bold,
|
659
|
-
'x':this.gutterLeft + (i * interval) + (interval / 2),
|
660
|
-
'y':ca.height - this.gutterBottom + 5 + this.halfTextHeight,
|
678
|
+
'x':this.gutterLeft + (i * interval) + (interval / 2) + offsetx,
|
679
|
+
'y':ca.height - this.gutterBottom + 5 + this.halfTextHeight + offsety,
|
661
680
|
'text':labels[i],
|
662
681
|
'valign':'center',
|
663
682
|
'halign':halign,
|
@@ -888,8 +907,11 @@
|
|
888
907
|
this.highlight =
|
889
908
|
this.Highlight = function (shape)
|
890
909
|
{
|
891
|
-
|
892
|
-
|
910
|
+
if (typeof prop['chart.highlight.style'] === 'function') {
|
911
|
+
(prop['chart.highlight.style'])(shape);
|
912
|
+
} else {
|
913
|
+
RG.Highlight.Rect(this, shape);
|
914
|
+
}
|
893
915
|
};
|
894
916
|
|
895
917
|
|
@@ -935,6 +957,7 @@
|
|
935
957
|
var coordW = obj.coords[tooltip.__index__][2];
|
936
958
|
var coordH = obj.coords[tooltip.__index__][3];
|
937
959
|
var canvasXY = RG.getCanvasXY(obj.canvas);
|
960
|
+
var mouseXY = RG.getMouseXY(window.event);
|
938
961
|
var gutterLeft = obj.gutterLeft;
|
939
962
|
var gutterTop = obj.gutterTop;
|
940
963
|
var width = tooltip.offsetWidth;
|
@@ -950,49 +973,26 @@
|
|
950
973
|
|
951
974
|
// Set the top position
|
952
975
|
tooltip.style.left = 0;
|
953
|
-
tooltip.style.top =
|
954
|
-
|
955
|
-
|
956
|
-
/**
|
957
|
-
* If the tooltip is for a negative value - position it underneath the bar
|
958
|
-
*/
|
959
|
-
if (value < 0) {
|
960
|
-
tooltip.style.top = canvasXY[1] + coordY + coordH + 7 + 'px';
|
961
|
-
}
|
976
|
+
tooltip.style.top = window.event.pageY - height - 5 + 'px';
|
962
977
|
|
963
978
|
|
964
979
|
// By default any overflow is hidden
|
965
980
|
tooltip.style.overflow = '';
|
966
981
|
|
967
|
-
// The arrow
|
968
|
-
var img = new Image();
|
969
|
-
img.id = '__rgraph_tooltip_pointer__';
|
970
|
-
img.style.position = 'absolute';
|
971
|
-
if (value >= 0) {
|
972
|
-
img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAFCAYAAACjKgd3AAAARUlEQVQYV2NkQAN79+797+RkhC4M5+/bd47B2dmZEVkBCgcmgcsgbAaA9GA1BCSBbhAuA/AagmwQPgMIGgIzCD0M0AMMAEFVIAa6UQgcAAAAAElFTkSuQmCC';
|
973
|
-
img.style.top = (tooltip.offsetHeight - 2) + 'px';
|
974
|
-
} else {
|
975
|
-
img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAFCAMAAACkeOZkAAAAK3RFWHRDcmVhdGlvbiBUaW1lAFNhdCA2IE9jdCAyMDEyIDEyOjQ5OjMyIC0wMDAw2S1RlgAAAAd0SU1FB9wKBgszM4Ed2k4AAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAEZ0FNQQAAsY8L/GEFAAAACVBMVEX/AAC9vb3//+92Pom0AAAAAXRSTlMAQObYZgAAAB1JREFUeNpjYAABRgY4YGRiRDCZYBwQE8qBMEEcAANCACqByy1sAAAAAElFTkSuQmCC';
|
976
|
-
img.style.top = '-5px';
|
977
|
-
}
|
978
|
-
tooltip.appendChild(img);
|
979
982
|
|
980
983
|
// Reposition the tooltip if at the edges:
|
981
984
|
|
982
985
|
// LEFT edge
|
983
|
-
if (
|
984
|
-
tooltip.style.left =
|
985
|
-
img.style.left = ((width * 0.1) - 8.5) + 'px';
|
986
|
+
if (canvasXY[0] + mouseXY[0] - (width / 2) < 0) {
|
987
|
+
tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.1) + 'px';
|
986
988
|
|
987
989
|
// RIGHT edge
|
988
|
-
} else if (
|
989
|
-
tooltip.style.left = canvasXY[0] +
|
990
|
-
img.style.left = ((width * 0.9) - 8.5) + 'px';
|
990
|
+
} else if (canvasXY[0] + mouseXY[0] + (width / 2) > doc.body.offsetWidth) {
|
991
|
+
tooltip.style.left = canvasXY[0] + mouseXY[0] - (width * 0.9) + 'px';
|
991
992
|
|
992
993
|
// Default positioning - CENTERED
|
993
994
|
} else {
|
994
|
-
tooltip.style.left =
|
995
|
-
img.style.left = ((width * 0.5) - 8.5) + 'px';
|
995
|
+
tooltip.style.left = canvasXY[0] + mouseXY[0] - (width / 2) + 'px';
|
996
996
|
}
|
997
997
|
};
|
998
998
|
|
@@ -16,15 +16,13 @@
|
|
16
16
|
body {
|
17
17
|
margin-left: 90px;
|
18
18
|
font-family: "Segoe UI Light", "Segoe UI", "Verdana";
|
19
|
-
font-
|
19
|
+
font-family: Arial, Verdana, sans-serif;
|
20
|
+
font-family: Helmet, Freesans, Helvetica, Arial, sans-serif;
|
21
|
+
font-size: 1em;
|
20
22
|
overflow-x: hidden;
|
21
23
|
color: #666;
|
22
|
-
padding: 2%;
|
23
|
-
padding-top: 1%;
|
24
24
|
margin-top: 0;
|
25
25
|
text-align: center;
|
26
|
-
background-color: #ccc;
|
27
|
-
background-image: linear-gradient(135deg, white, #ccc 500px);
|
28
26
|
height: 100%;
|
29
27
|
}
|
30
28
|
|
@@ -46,6 +44,7 @@
|
|
46
44
|
opacity: .75;
|
47
45
|
border-bottom-left-radius: 15px;
|
48
46
|
border-bottom-right-radius: 15px;
|
47
|
+
z-index: 5;
|
49
48
|
}
|
50
49
|
|
51
50
|
|
@@ -56,7 +55,6 @@
|
|
56
55
|
|
57
56
|
|
58
57
|
div#main-body-container {
|
59
|
-
box-shadow: 0 0 10px gray;
|
60
58
|
background-color: white;
|
61
59
|
padding: 20px;
|
62
60
|
padding-bottom: 5px;
|
@@ -188,19 +186,12 @@
|
|
188
186
|
}
|
189
187
|
|
190
188
|
div.warning {
|
191
|
-
border: 1px solid black;
|
192
|
-
_text-align: center;
|
193
189
|
background-color: #ffa;
|
194
|
-
padding:
|
190
|
+
padding: 10px;
|
195
191
|
margin-top: 5px;
|
196
192
|
border-radius: 15px;
|
197
|
-
|
198
|
-
-
|
199
|
-
webkit-box-shadow: #aaa 1px 1px 15px;
|
200
|
-
-moz-box-shadow: #aaa 1px 1px 15px;
|
201
|
-
box-shadow: #aaa 1px 1px 15px;
|
202
|
-
filter: progid:DXImageTransform.Microsoft.Shadow(color=#666666,direction=135); z-index: 98;
|
203
|
-
opacity: 0.9;
|
193
|
+
opacity: 1;
|
194
|
+
box-shadow: 2px 2px 2px #ccc;
|
204
195
|
}
|
205
196
|
|
206
197
|
|
@@ -429,4 +420,27 @@
|
|
429
420
|
|
430
421
|
ul#news img:hover {
|
431
422
|
transform: scale(1.1);
|
423
|
+
}
|
424
|
+
|
425
|
+
|
426
|
+
div#navigation-top-bar-text-menu {
|
427
|
+
display: none;
|
428
|
+
}
|
429
|
+
|
430
|
+
p#summary {
|
431
|
+
background-color: rgba(240,240,240,0.75);
|
432
|
+
padding: 15px;
|
433
|
+
}
|
434
|
+
|
435
|
+
div.example-chart-thumbnails img {
|
436
|
+
box-shadow: 0 0 15px #ddd;
|
437
|
+
transition: transform .25s;
|
438
|
+
padding: 5px;
|
439
|
+
margin: 15px;
|
440
|
+
width: 200px;
|
441
|
+
height: 150px;
|
442
|
+
}
|
443
|
+
|
444
|
+
div.example-chart-thumbnails img:hover {
|
445
|
+
transform: scale(1.1);
|
432
446
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgraph-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Griffin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -140,6 +140,7 @@ files:
|
|
140
140
|
- vendor/assets/javascripts/RGraph.rose.js
|
141
141
|
- vendor/assets/javascripts/RGraph.rscatter.js
|
142
142
|
- vendor/assets/javascripts/RGraph.scatter.js
|
143
|
+
- vendor/assets/javascripts/RGraph.semicircularprogress.js
|
143
144
|
- vendor/assets/javascripts/RGraph.thermometer.js
|
144
145
|
- vendor/assets/javascripts/RGraph.vprogress.js
|
145
146
|
- vendor/assets/javascripts/RGraph.waterfall.js
|