highcharts-rails 4.2.3 → 4.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Highcharts JS v4.2.3 (2016-02-08)
2
+ * Highcharts JS v4.2.4 (2016-04-14)
3
3
  * Highcharts Broken Axis module
4
4
  *
5
5
  * License: www.highcharts.com/license
@@ -289,21 +289,19 @@
289
289
 
290
290
  function drawPointsWrapped(proceed) {
291
291
  proceed.apply(this);
292
- this.drawBreaks();
292
+ this.drawBreaks(this.xAxis, ['x']);
293
+ this.drawBreaks(this.yAxis, pick(this.pointArrayMap, ['y']));
293
294
  }
294
295
 
295
- H.Series.prototype.drawBreaks = function () {
296
+ H.Series.prototype.drawBreaks = function (axis, keys) {
296
297
  var series = this,
297
298
  points = series.points,
298
- axis,
299
299
  breaks,
300
300
  threshold,
301
- axisName = 'Axis',
302
301
  eventName,
303
302
  y;
304
303
 
305
- each(['y', 'x'], function (key) {
306
- axis = series[key + axisName];
304
+ each(keys, function (key) {
307
305
  breaks = axis.breakArray || [];
308
306
  threshold = axis.isXAxis ? axis.min : pick(series.options.threshold, axis.min);
309
307
  each(points, function (point) {
@@ -2908,7 +2908,7 @@ if (CanvasRenderingContext2D) {
2908
2908
  });
2909
2909
  }
2910
2910
  }/**
2911
- * @license Highcharts JS v4.2.3 (2016-02-08)
2911
+ * @license Highcharts JS v4.2.4 (2016-04-14)
2912
2912
  * CanVGRenderer Extension module
2913
2913
  *
2914
2914
  * (c) 2011-2016 Torstein Honsi, Erik Olsson
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.2.3 (2016-02-08)
2
+ * @license Highcharts JS v4.2.4 (2016-04-14)
3
3
  * Data module
4
4
  *
5
5
  * (c) 2012-2016 Torstein Honsi
@@ -350,6 +350,9 @@
350
350
  }
351
351
  }
352
352
 
353
+ // Fire a once-off event after all series have been drilled up (#5158)
354
+ fireEvent(chart, 'drillupall');
355
+
353
356
  this.redraw();
354
357
 
355
358
  if (this.drilldownLevels.length === 0) {
@@ -526,7 +529,7 @@
526
529
  });
527
530
  }
528
531
 
529
- H.Point.prototype.doDrilldown = function (_holdRedraw, category) {
532
+ H.Point.prototype.doDrilldown = function (_holdRedraw, category, originalEvent) {
530
533
  var series = this.series,
531
534
  chart = series.chart,
532
535
  drilldown = chart.options.drilldown,
@@ -550,29 +553,34 @@
550
553
  point: this,
551
554
  seriesOptions: seriesOptions,
552
555
  category: category,
556
+ originalEvent: originalEvent,
553
557
  points: category !== undefined && this.series.xAxis.ddPoints[category].slice(0)
558
+ }, function (e) {
559
+ var chart = e.point.series && e.point.series.chart,
560
+ seriesOptions = e.seriesOptions;
561
+ if (chart && seriesOptions) {
562
+ if (_holdRedraw) {
563
+ chart.addSingleSeriesAsDrilldown(e.point, seriesOptions);
564
+ } else {
565
+ chart.addSeriesAsDrilldown(e.point, seriesOptions);
566
+ }
567
+ }
554
568
  });
555
569
 
556
- if (seriesOptions) {
557
- if (_holdRedraw) {
558
- chart.addSingleSeriesAsDrilldown(this, seriesOptions);
559
- } else {
560
- chart.addSeriesAsDrilldown(this, seriesOptions);
561
- }
562
- }
570
+
563
571
  };
564
572
 
565
573
  /**
566
574
  * Drill down to a given category. This is the same as clicking on an axis label.
567
575
  */
568
- H.Axis.prototype.drilldownCategory = function (x) {
576
+ H.Axis.prototype.drilldownCategory = function (x, e) {
569
577
  var key,
570
578
  point,
571
579
  ddPointsX = this.ddPoints[x];
572
580
  for (key in ddPointsX) {
573
581
  point = ddPointsX[key];
574
582
  if (point && point.series && point.series.visible && point.doDrilldown) { // #3197
575
- point.doDrilldown(true, x);
583
+ point.doDrilldown(true, x, e);
576
584
  }
577
585
  }
578
586
  this.chart.applyDrilldown();
@@ -612,8 +620,8 @@
612
620
  label
613
621
  .addClass('highcharts-drilldown-axis-label')
614
622
  .css(axis.chart.options.drilldown.activeAxisLabelStyle)
615
- .on('click', function () {
616
- axis.drilldownCategory(pos);
623
+ .on('click', function (e) {
624
+ axis.drilldownCategory(pos, e);
617
625
  });
618
626
 
619
627
  } else if (label && label.basicStyles) {
@@ -645,11 +653,11 @@
645
653
  if (point.drilldown) {
646
654
 
647
655
  // Add the click event to the point
648
- H.addEvent(point, 'click', function () {
656
+ H.addEvent(point, 'click', function (e) {
649
657
  if (series.xAxis && series.chart.options.drilldown.allowPointDrilldown === false) {
650
- series.xAxis.drilldownCategory(x);
658
+ series.xAxis.drilldownCategory(x, e);
651
659
  } else {
652
- point.doDrilldown();
660
+ point.doDrilldown(undefined, undefined, e);
653
661
  }
654
662
  });
655
663
  /*wrap(point, 'importEvents', function (proceed) { // wrapping importEvents makes point.click event work
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.2.3 (2016-02-08)
2
+ * @license Highcharts JS v4.2.4 (2016-04-14)
3
3
  * Exporting module
4
4
  *
5
5
  * (c) 2010-2016 Torstein Honsi
@@ -23,8 +23,7 @@ var defaultOptions = Highcharts.getOptions(),
23
23
  seriesTypes = Highcharts.seriesTypes,
24
24
  merge = Highcharts.merge,
25
25
  noop = function () {},
26
- each = Highcharts.each,
27
- pick = Highcharts.pick;
26
+ each = Highcharts.each;
28
27
 
29
28
  // set default options
30
29
  defaultPlotOptions.funnel = merge(defaultPlotOptions.pie, {
@@ -229,24 +228,17 @@ seriesTypes.funnel = Highcharts.extendClass(seriesTypes.pie, {
229
228
  */
230
229
  drawPoints: function () {
231
230
  var series = this,
232
- options = series.options,
233
231
  chart = series.chart,
234
232
  renderer = chart.renderer,
235
- pointOptions,
236
233
  pointAttr,
237
234
  shapeArgs,
238
235
  graphic;
239
236
 
240
237
  each(series.data, function (point) {
241
- pointOptions = point.options;
242
238
  graphic = point.graphic;
243
239
  shapeArgs = point.shapeArgs;
244
240
 
245
- pointAttr = {
246
- fill: point.color,
247
- stroke: pick(pointOptions.borderColor, options.borderColor),
248
- 'stroke-width': pick(pointOptions.borderWidth, options.borderWidth)
249
- };
241
+ pointAttr = point.pointAttr[point.selected ? 'select' : ''];
250
242
 
251
243
  if (!graphic) { // Create the shapes
252
244
  point.graphic = renderer.path(shapeArgs)
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.2.3 (2016-02-08)
2
+ * @license Highcharts JS v4.2.4 (2016-04-14)
3
3
  *
4
4
  * (c) 2011-2016 Torstein Honsi
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.2.3 (2016-02-08)
2
+ * @license Highcharts JS v4.2.4 (2016-04-14)
3
3
  * Plugin for displaying a message when there is no data visible in chart.
4
4
  *
5
5
  * (c) 2010-2016 Highsoft AS
@@ -52,7 +52,7 @@
52
52
  return !!this.points.length; /* != 0 */
53
53
  }
54
54
 
55
- each(['pie', 'gauge', 'waterfall', 'bubble'], function (type) {
55
+ each(['pie', 'gauge', 'waterfall', 'bubble', 'treemap'], function (type) {
56
56
  if (seriesTypes[type]) {
57
57
  seriesTypes[type].prototype.hasData = hasDataPie;
58
58
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.2.3 (2016-02-08)
2
+ * @license Highcharts JS v4.2.4 (2016-04-14)
3
3
  * Client side exporting module
4
4
  *
5
5
  * (c) 2015 Torstein Honsi / Oystein Moseng
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.2.3 (2016-02-08)
2
+ * @license Highcharts JS v4.2.4 (2016-04-14)
3
3
  * Solid angular gauge module
4
4
  *
5
5
  * (c) 2010-2016 Torstein Honsi
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.2.3 (2016-02-08)
2
+ * @license Highcharts JS v4.2.4 (2016-04-14)
3
3
  *
4
4
  * (c) 2014 Highsoft AS
5
5
  * Authors: Jon Arild Nygard / Oystein Moseng
@@ -47,6 +47,7 @@
47
47
  return previous;
48
48
  },
49
49
  // @todo find correct name for this function.
50
+ // @todo Similar to reduce, this function is likely redundant
50
51
  recursive = function (item, func, context) {
51
52
  var next;
52
53
  context = context || this;
@@ -79,10 +80,12 @@
79
80
  layoutStartingDirection: 'vertical',
80
81
  alternateStartingDirection: false,
81
82
  levelIsConstant: true,
83
+ opacity: 0.15,
82
84
  states: {
83
85
  hover: {
84
86
  borderColor: '#A0A0A0',
85
87
  brightness: seriesTypes.heatmap ? 0 : 0.1,
88
+ opacity: 0.75,
86
89
  shadow: false
87
90
  }
88
91
  },
@@ -156,6 +159,7 @@
156
159
 
157
160
  series.nodeMap = [];
158
161
  tree = series.buildNode('', -1, 0, parentList, null);
162
+ // Parents of the root node is by default visible
159
163
  recursive(this.nodeMap[this.rootNode], function (node) {
160
164
  var next = false,
161
165
  p = node.parent;
@@ -165,6 +169,7 @@
165
169
  }
166
170
  return next;
167
171
  });
172
+ // Children of the root node is by default visible
168
173
  recursive(this.nodeMap[this.rootNode].children, function (children) {
169
174
  var next = false;
170
175
  each(children, function (child) {
@@ -314,7 +319,7 @@
314
319
  y1,
315
320
  y2;
316
321
  // Points which is ignored, have no values.
317
- if (values) {
322
+ if (values && node.visible) {
318
323
  x1 = Math.round(xAxis.translate(values.x, 0, 0, 0, 1));
319
324
  x2 = Math.round(xAxis.translate(values.x + values.width, 0, 0, 0, 1));
320
325
  y1 = Math.round(yAxis.translate(values.y, 0, 0, 0, 1));
@@ -587,11 +592,13 @@
587
592
  }
588
593
 
589
594
  // Update axis extremes according to the root node.
590
- val = this.nodeMap[this.rootNode].pointValues;
591
- this.xAxis.setExtremes(val.x, val.x + val.width, false);
592
- this.yAxis.setExtremes(val.y, val.y + val.height, false);
593
- this.xAxis.setScale();
594
- this.yAxis.setScale();
595
+ if (this.options.allowDrillToNode) {
596
+ val = this.nodeMap[this.rootNode].pointValues;
597
+ this.xAxis.setExtremes(val.x, val.x + val.width, false);
598
+ this.yAxis.setExtremes(val.y, val.y + val.height, false);
599
+ this.xAxis.setScale();
600
+ this.yAxis.setScale();
601
+ }
595
602
 
596
603
  // Assign values to points.
597
604
  this.setPointValues();
@@ -628,6 +635,9 @@
628
635
  // Set dataLabel width to the width of the point shape.
629
636
  if (point.shapeArgs) {
630
637
  options.style.width = point.shapeArgs.width;
638
+ if (point.dataLabel) {
639
+ point.dataLabel.css({ width: point.shapeArgs.width + 'px' });
640
+ }
631
641
  }
632
642
 
633
643
  // Merge custom options with point options
@@ -644,7 +654,8 @@
644
654
  var level = this.levelMap[point.node.levelDynamic] || {},
645
655
  options = this.options,
646
656
  attr,
647
- stateOptions = (state && options.states[state]) || {};
657
+ stateOptions = (state && options.states[state]) || {},
658
+ opacity;
648
659
 
649
660
  // Set attributes by precedence. Point trumps level trumps series. Stroke width uses pick
650
661
  // because it can be 0.
@@ -661,14 +672,17 @@
661
672
  attr.fill = 'none';
662
673
  attr['stroke-width'] = 0;
663
674
  } else if (!point.node.isLeaf) {
664
- // If not a leaf, then remove fill
665
- // @todo let users set the opacity
666
- attr.fill = pick(options.interactByLeaf, !options.allowDrillToNode) ? 'none' : Color(attr.fill).setOpacity(state === 'hover' ? 0.75 : 0.15).get();
675
+ // If not a leaf, either set opacity or remove fill
676
+ if (pick(options.interactByLeaf, !options.allowDrillToNode)) {
677
+ attr.fill = 'none';
678
+ } else {
679
+ opacity = pick(stateOptions.opacity, options.opacity);
680
+ attr.fill = Color(attr.fill).setOpacity(opacity).get();
681
+ }
667
682
  } else if (state) {
668
683
  // Brighten and hoist the hover nodes
669
684
  attr.fill = Color(attr.fill).brighten(stateOptions.brightness).get();
670
685
  }
671
-
672
686
  return attr;
673
687
  },
674
688
 
@@ -1,3 +1,3 @@
1
1
  module Highcharts
2
- VERSION = "4.2.3"
2
+ VERSION = "4.2.4"
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.2.3
4
+ version: 4.2.4
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: 2016-04-09 00:00:00.000000000 Z
11
+ date: 2016-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties