highcharts-rails 4.1.9 → 4.1.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.1.9 (2015-10-07)
2
+ * @license Highcharts JS v4.1.10 (2015-12-07)
3
3
  * Solid angular gauge module
4
4
  *
5
5
  * (c) 2010-2014 Torstein Honsi
@@ -7,9 +7,14 @@
7
7
  * License: www.highcharts.com/license
8
8
  */
9
9
 
10
- /*global Highcharts, HighchartsAdapter*/
11
- (function (H) {
12
- "use strict";
10
+ (function (factory) {
11
+ if (typeof module === 'object' && module.exports) {
12
+ module.exports = factory;
13
+ } else {
14
+ factory(Highcharts);
15
+ }
16
+ }(function (H) {
17
+ 'use strict';
13
18
 
14
19
  var defaultPlotOptions = H.getOptions().plotOptions,
15
20
  pInt = H.pInt,
@@ -132,7 +137,7 @@
132
137
 
133
138
  // Unsupported color, return to-color (#3920)
134
139
  if (!to.rgba.length || !from.rgba.length) {
135
- ret = to.raw || 'none';
140
+ ret = to.input || 'none';
136
141
 
137
142
  // Interpolate
138
143
  } else {
@@ -153,7 +158,7 @@
153
158
  * Handle animation of the color attributes directly
154
159
  */
155
160
  each(['fill', 'stroke'], function (prop) {
156
- HighchartsAdapter.addAnimSetter(prop, function (fx) {
161
+ H.addAnimSetter(prop, function (fx) {
157
162
  fx.elem.attr(prop, colorAxisMethods.tweenColors(H.Color(fx.start), H.Color(fx.end), fx.pos));
158
163
  });
159
164
  });
@@ -196,7 +201,6 @@
196
201
  shapeArgs,
197
202
  d,
198
203
  toColor = yAxis.toColor(point.y, point),
199
- fromColor,
200
204
  axisMinAngle = Math.min(yAxis.startAngleRad, yAxis.endAngleRad),
201
205
  axisMaxAngle = Math.max(yAxis.startAngleRad, yAxis.endAngleRad),
202
206
  minAngle,
@@ -206,7 +210,6 @@
206
210
  toColor = point.color || series.color || 'none';
207
211
  }
208
212
  if (toColor !== 'none') {
209
- fromColor = point.color;
210
213
  point.color = toColor;
211
214
  }
212
215
 
@@ -267,4 +270,4 @@
267
270
  }
268
271
  });
269
272
 
270
- }(Highcharts));
273
+ }));
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.1.9 (2015-10-07)
2
+ * @license Highcharts JS v4.1.10 (2015-12-07)
3
3
  *
4
4
  * (c) 2014 Highsoft AS
5
5
  * Authors: Jon Arild Nygard / Oystein Moseng
@@ -7,8 +7,13 @@
7
7
  * License: www.highcharts.com/license
8
8
  */
9
9
 
10
- /*global HighchartsAdapter */
11
- (function (H) {
10
+ (function (factory) {
11
+ if (typeof module === 'object' && module.exports) {
12
+ module.exports = factory;
13
+ } else {
14
+ factory(Highcharts);
15
+ }
16
+ }(function (H) {
12
17
  var seriesTypes = H.seriesTypes,
13
18
  map = H.map,
14
19
  merge = H.merge,
@@ -16,11 +21,13 @@
16
21
  extendClass = H.extendClass,
17
22
  defaultOptions = H.getOptions(),
18
23
  plotOptions = defaultOptions.plotOptions,
19
- noop = function () { return; },
24
+ noop = function () {
25
+ },
20
26
  each = H.each,
21
- grep = HighchartsAdapter.grep,
27
+ grep = H.grep,
22
28
  pick = H.pick,
23
29
  Series = H.Series,
30
+ stableSort = H.stableSort,
24
31
  Color = H.Color,
25
32
  eachObject = function (list, func, context) {
26
33
  var key;
@@ -81,9 +88,9 @@
81
88
  },
82
89
  drillUpButton: {
83
90
  position: {
84
- align: 'left',
85
- x: 10,
86
- y: -50
91
+ align: 'right',
92
+ x: -10,
93
+ y: 10
87
94
  }
88
95
  }
89
96
  });
@@ -117,7 +124,7 @@
117
124
  */
118
125
  getListOfParents: function (data, ids) {
119
126
  var listOfParents = reduce(data, function (prev, curr, i) {
120
- var parent = pick(curr.parent, "");
127
+ var parent = pick(curr.parent, '');
121
128
  if (prev[parent] === undefined) {
122
129
  prev[parent] = [];
123
130
  }
@@ -127,9 +134,9 @@
127
134
 
128
135
  // If parent does not exist, hoist parent to root of tree.
129
136
  eachObject(listOfParents, function (children, parent, list) {
130
- if ((parent !== "") && (HighchartsAdapter.inArray(parent, ids) === -1)) {
137
+ if ((parent !== '') && (H.inArray(parent, ids) === -1)) {
131
138
  each(children, function (child) {
132
- list[""].push(child);
139
+ list[''].push(child);
133
140
  });
134
141
  delete list[parent];
135
142
  }
@@ -148,12 +155,12 @@
148
155
  parentList = series.getListOfParents(this.data, allIds);
149
156
 
150
157
  series.nodeMap = [];
151
- tree = series.buildNode("", -1, 0, parentList, null);
158
+ tree = series.buildNode('', -1, 0, parentList, null);
152
159
  recursive(this.nodeMap[this.rootNode], function (node) {
153
160
  var next = false,
154
161
  p = node.parent;
155
162
  node.visible = true;
156
- if (p || p === "") {
163
+ if (p || p === '') {
157
164
  next = series.nodeMap[p];
158
165
  }
159
166
  return next;
@@ -208,16 +215,14 @@
208
215
  var series = this,
209
216
  options = series.options,
210
217
  childrenTotal = 0,
211
- sorted = [],
218
+ children = [],
212
219
  val,
213
220
  point = series.points[tree.i];
214
221
 
215
222
  // First give the children some values
216
223
  each(tree.children, function (child) {
217
224
  child = series.setTreeValues(child);
218
- series.insertElementSorted(sorted, child, function (el, el2) {
219
- return el.val > el2.val;
220
- });
225
+ children.push(child);
221
226
 
222
227
  if (!child.ignore) {
223
228
  childrenTotal += child.val;
@@ -239,17 +244,21 @@
239
244
  });
240
245
  }
241
246
  });
242
-
247
+ // Sort the children
248
+ stableSort(children, function (a, b) {
249
+ return a.sortIndex - b.sortIndex;
250
+ });
243
251
  // Set the values
244
252
  val = pick(point && point.value, childrenTotal);
245
253
  extend(tree, {
246
- children: sorted,
254
+ children: children,
247
255
  childrenTotal: childrenTotal,
248
256
  // Ignore this node if point is not visible
249
257
  ignore: !(pick(point && point.visible, true) && (val > 0)),
250
258
  isLeaf: tree.visible && !childrenTotal,
251
259
  levelDynamic: (options.levelIsConstant ? tree.level : (tree.level - series.nodeMap[series.rootNode].level)),
252
- name: pick(point && point.name, ""),
260
+ name: pick(point && point.name, ''),
261
+ sortIndex: pick(point && point.sortIndex, -val),
253
262
  val: val
254
263
  });
255
264
  return tree;
@@ -347,7 +356,7 @@
347
356
  }
348
357
  }
349
358
  },
350
- alg_func_group: function (h, w, d, p) {
359
+ algorithmGroup: function (h, w, d, p) {
351
360
  this.height = h;
352
361
  this.width = w;
353
362
  this.plot = p;
@@ -402,7 +411,7 @@
402
411
  this.total = 0;
403
412
  };
404
413
  },
405
- alg_func_calcPoints: function (directionChange, last, group, childrenArea) {
414
+ algorithmCalcPoints: function (directionChange, last, group, childrenArea) {
406
415
  var pX,
407
416
  pY,
408
417
  pW,
@@ -463,7 +472,7 @@
463
472
  group.addElement(keep);
464
473
  }
465
474
  },
466
- alg_func_lowAspectRatio: function (directionChange, parent, children) {
475
+ algorithmLowAspectRatio: function (directionChange, parent, children) {
467
476
  var childrenArea = [],
468
477
  series = this,
469
478
  pTot,
@@ -475,23 +484,23 @@
475
484
  direction = parent.direction,
476
485
  i = 0,
477
486
  end = children.length - 1,
478
- group = new this.alg_func_group(parent.height, parent.width, direction, plot);
487
+ group = new this.algorithmGroup(parent.height, parent.width, direction, plot);
479
488
  // Loop through and calculate all areas
480
489
  each(children, function (child) {
481
490
  pTot = (parent.width * parent.height) * (child.val / parent.val);
482
491
  group.addElement(pTot);
483
492
  if (group.lP.nR > group.lP.lR) {
484
- series.alg_func_calcPoints(directionChange, false, group, childrenArea, plot);
493
+ series.algorithmCalcPoints(directionChange, false, group, childrenArea, plot);
485
494
  }
486
495
  // If last child, then calculate all remaining areas
487
496
  if (i === end) {
488
- series.alg_func_calcPoints(directionChange, true, group, childrenArea, plot);
497
+ series.algorithmCalcPoints(directionChange, true, group, childrenArea, plot);
489
498
  }
490
499
  i = i + 1;
491
500
  });
492
501
  return childrenArea;
493
502
  },
494
- alg_func_fill: function (directionChange, parent, children) {
503
+ algorithmFill: function (directionChange, parent, children) {
495
504
  var childrenArea = [],
496
505
  pTot,
497
506
  direction = parent.direction,
@@ -531,16 +540,16 @@
531
540
  return childrenArea;
532
541
  },
533
542
  strip: function (parent, children) {
534
- return this.alg_func_lowAspectRatio(false, parent, children);
543
+ return this.algorithmLowAspectRatio(false, parent, children);
535
544
  },
536
545
  squarified: function (parent, children) {
537
- return this.alg_func_lowAspectRatio(true, parent, children);
546
+ return this.algorithmLowAspectRatio(true, parent, children);
538
547
  },
539
548
  sliceAndDice: function (parent, children) {
540
- return this.alg_func_fill(true, parent, children);
549
+ return this.algorithmFill(true, parent, children);
541
550
  },
542
551
  stripes: function (parent, children) {
543
- return this.alg_func_fill(false, parent, children);
552
+ return this.algorithmFill(false, parent, children);
544
553
  },
545
554
  translate: function () {
546
555
  var pointValues,
@@ -551,26 +560,24 @@
551
560
  // Call prototype function
552
561
  Series.prototype.translate.call(this);
553
562
 
554
- if (this.points.length) {
555
- // Assign variables
556
- this.rootNode = pick(this.options.rootId, "");
557
- // Create a object map from level to options
558
- this.levelMap = reduce(this.options.levels, function (arr, item) {
559
- arr[item.level] = item;
560
- return arr;
561
- }, {});
562
- tree = this.tree = this.getTree(); // @todo Only if series.isDirtyData is true
563
-
564
- // Calculate plotting values.
565
- this.axisRatio = (this.xAxis.len / this.yAxis.len);
566
- this.nodeMap[""].pointValues = pointValues = {x: 0, y: 0, width: 100, height: 100 };
567
- this.nodeMap[""].values = seriesArea = merge(pointValues, {
568
- width: (pointValues.width * this.axisRatio),
569
- direction: (this.options.layoutStartingDirection === 'vertical' ? 0 : 1),
570
- val: tree.val
571
- });
572
- this.calculateChildrenAreas(tree, seriesArea);
573
- }
563
+ // Assign variables
564
+ this.rootNode = pick(this.options.rootId, '');
565
+ // Create a object map from level to options
566
+ this.levelMap = reduce(this.options.levels, function (arr, item) {
567
+ arr[item.level] = item;
568
+ return arr;
569
+ }, {});
570
+ tree = this.tree = this.getTree(); // @todo Only if series.isDirtyData is true
571
+
572
+ // Calculate plotting values.
573
+ this.axisRatio = (this.xAxis.len / this.yAxis.len);
574
+ this.nodeMap[''].pointValues = pointValues = { x: 0, y: 0, width: 100, height: 100 };
575
+ this.nodeMap[''].values = seriesArea = merge(pointValues, {
576
+ width: (pointValues.width * this.axisRatio),
577
+ direction: (this.options.layoutStartingDirection === 'vertical' ? 0 : 1),
578
+ val: tree.val
579
+ });
580
+ this.calculateChildrenAreas(tree, seriesArea);
574
581
 
575
582
  // Logic for point colors
576
583
  if (this.colorAxis) {
@@ -605,7 +612,7 @@
605
612
  each(points, function (point) {
606
613
  level = series.levelMap[point.node.levelDynamic];
607
614
  // Set options to new object to avoid problems with scope
608
- options = {style: {}};
615
+ options = { style: {} };
609
616
 
610
617
  // If not a leaf, then label should be disabled as default
611
618
  if (!point.node.isLeaf) {
@@ -645,17 +652,14 @@
645
652
  'stroke': point.borderColor || level.borderColor || stateOptions.borderColor || options.borderColor,
646
653
  'stroke-width': pick(point.borderWidth, level.borderWidth, stateOptions.borderWidth, options.borderWidth),
647
654
  'dashstyle': point.borderDashStyle || level.borderDashStyle || stateOptions.borderDashStyle || options.borderDashStyle,
648
- 'fill': point.color || this.color
655
+ 'fill': point.color || this.color,
656
+ 'zIndex': state === 'hover' ? 1 : 0
649
657
  };
650
658
 
651
- if (state === 'hover') {
652
- attr.zIndex = 1;
653
- }
654
-
655
659
  if (point.node.level <= this.nodeMap[this.rootNode].level) {
656
660
  // Hide levels above the current view
657
661
  attr.fill = 'none';
658
- attr["stroke-width"] = 0;
662
+ attr['stroke-width'] = 0;
659
663
  } else if (!point.node.isLeaf) {
660
664
  // If not a leaf, then remove fill
661
665
  // @todo let users set the opacity
@@ -678,7 +682,7 @@
678
682
  });
679
683
 
680
684
  each(points, function (point) {
681
- var groupKey = "levelGroup-" + point.node.levelDynamic;
685
+ var groupKey = 'levelGroup-' + point.node.levelDynamic;
682
686
  if (!series[groupKey]) {
683
687
  series[groupKey] = series.chart.renderer.g(groupKey)
684
688
  .attr({
@@ -704,35 +708,12 @@
704
708
  drillId;
705
709
  if (point.graphic) {
706
710
  drillId = point.drillId = series.options.interactByLeaf ? series.drillToByLeaf(point) : series.drillToByGroup(point);
707
- cursor = drillId ? "pointer" : "default";
711
+ cursor = drillId ? 'pointer' : 'default';
708
712
  point.graphic.css({ cursor: cursor });
709
713
  }
710
714
  });
711
715
  }
712
716
  },
713
- /**
714
- * Inserts an element into an array, sorted by a condition.
715
- * Modifies the referenced array
716
- * @param {*[]} arr The array which the element is inserted into.
717
- * @param {*} el The element to insert.
718
- * @param {function} cond The condition to sort on. First parameter is el, second parameter is array element
719
- */
720
- insertElementSorted: function (arr, el, cond) {
721
- var i = 0,
722
- inserted = false;
723
- if (arr.length !== 0) {
724
- each(arr, function (arrayElement) {
725
- if (cond(el, arrayElement) && !inserted) {
726
- arr.splice(i, 0, el);
727
- inserted = true;
728
- }
729
- i = i + 1;
730
- });
731
- }
732
- if (!inserted) {
733
- arr.push(el);
734
- }
735
- },
736
717
  /**
737
718
  * Add drilling on the suitable points
738
719
  */
@@ -795,13 +776,13 @@
795
776
  if (node.parent !== null) {
796
777
  drillPoint = this.nodeMap[node.parent];
797
778
  } else {
798
- drillPoint = this.nodeMap[""];
779
+ drillPoint = this.nodeMap[''];
799
780
  }
800
781
  }
801
782
 
802
783
  if (drillPoint !== null) {
803
784
  this.drillToNode(drillPoint.id);
804
- if (drillPoint.id === "") {
785
+ if (drillPoint.id === '') {
805
786
  this.drillUpButton = this.drillUpButton.destroy();
806
787
  } else {
807
788
  parent = this.nodeMap[drillPoint.parent];
@@ -884,4 +865,4 @@
884
865
  H.extend(this.xAxis.options, treeAxis);
885
866
  }
886
867
  }));
887
- }(Highcharts));
868
+ }));
@@ -67,7 +67,7 @@ Highcharts.theme = {
67
67
 
68
68
  // General
69
69
  background2: '#F0F0EA'
70
-
70
+
71
71
  };
72
72
 
73
73
  // Apply the theme
@@ -97,7 +97,7 @@ Highcharts.theme = {
97
97
 
98
98
  // General
99
99
  background2: '#E0E0E8'
100
-
100
+
101
101
  };
102
102
 
103
103
  // Apply the theme
@@ -1,3 +1,3 @@
1
1
  module Highcharts
2
- VERSION = "4.1.9"
2
+ VERSION = "4.1.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: highcharts-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.9
4
+ version: 4.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Per Christian B. Viken
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-04 00:00:00.000000000 Z
11
+ date: 2016-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -67,6 +67,7 @@ files:
67
67
  - README.markdown
68
68
  - Rakefile
69
69
  - app/assets/images/highcharts/meteogram-symbols-30px.png
70
+ - app/assets/images/highcharts/search.png
70
71
  - app/assets/images/highcharts/skies.jpg
71
72
  - app/assets/images/highcharts/snow.png
72
73
  - app/assets/images/highcharts/sun.png