@progress/kendo-charts 2.7.3-develop.2 → 2.8.0-develop.2

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.
Files changed (135) hide show
  1. package/dist/cdn/js/kendo-charts.js +1 -1
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/barcode/barcode.js +1 -4
  4. package/dist/es/barcode/encodings/code128.js +1 -3
  5. package/dist/es/barcode/encodings/encoding.js +1 -3
  6. package/dist/es/chart/aggregates/aggregates.js +3 -3
  7. package/dist/es/chart/aggregates/default-aggregates.js +1 -5
  8. package/dist/es/chart/aggregates/series-aggregator.js +12 -10
  9. package/dist/es/chart/api-elements/chart-axis.js +1 -5
  10. package/dist/es/chart/api-elements/chart-plotarea.js +1 -5
  11. package/dist/es/chart/axis-group-range-tracker.js +1 -4
  12. package/dist/es/chart/categorical-chart.js +8 -8
  13. package/dist/es/chart/chart.js +9 -8
  14. package/dist/es/chart/error-bars/error-range-calculator.js +2 -4
  15. package/dist/es/chart/highlight.js +1 -5
  16. package/dist/es/chart/line-chart/line-chart.js +2 -2
  17. package/dist/es/chart/line-chart/line-point.js +19 -19
  18. package/dist/es/chart/mixins/accessibility-attributes-mixin.js +3 -4
  19. package/dist/es/chart/mixins/clip-animation-mixin.js +6 -5
  20. package/dist/es/chart/mixins/line-chart-mixin.js +1 -2
  21. package/dist/es/chart/mixins/note-mixin.js +1 -2
  22. package/dist/es/chart/pan-and-zoom/mousewheel-zoom.js +2 -4
  23. package/dist/es/chart/pan-and-zoom/pannable.js +2 -4
  24. package/dist/es/chart/pan-and-zoom/zoom-selection.js +2 -4
  25. package/dist/es/chart/plotarea/categorical-plotarea.js +2 -2
  26. package/dist/es/chart/plotarea/plotarea-factory.js +1 -5
  27. package/dist/es/chart/selection.js +2 -4
  28. package/dist/es/chart/series-binder.js +4 -8
  29. package/dist/es/chart/tooltip/base-tooltip.js +2 -4
  30. package/dist/es/common/getter.js +1 -3
  31. package/dist/es/common/grep.js +2 -11
  32. package/dist/es/common/in-array.js +1 -1
  33. package/dist/es/common/observable.js +1 -4
  34. package/dist/es/common/user-events.js +2 -6
  35. package/dist/es/core/box.js +38 -20
  36. package/dist/es/core/category-axis.js +5 -12
  37. package/dist/es/core/chart-element.js +8 -6
  38. package/dist/es/core/curve-processor.js +2 -5
  39. package/dist/es/core/point.js +2 -4
  40. package/dist/es/core/ring.js +2 -5
  41. package/dist/es/core/shape-builder.js +1 -2
  42. package/dist/es/core/utils/element-id.js +5 -0
  43. package/dist/es/core/utils/guid.js +4 -16
  44. package/dist/es/drawing-utils.js +0 -2
  45. package/dist/es/gauges/gauge.js +2 -5
  46. package/dist/es/gauges/pointer.js +2 -4
  47. package/dist/es/map/crs.js +5 -10
  48. package/dist/es/map/extent.js +1 -3
  49. package/dist/es/map/layers/bubble.js +1 -4
  50. package/dist/es/map/layers/layer.js +1 -4
  51. package/dist/es/map/layers/marker.js +1 -3
  52. package/dist/es/map/layers/shape.js +1 -3
  53. package/dist/es/map/layers/tile.js +3 -7
  54. package/dist/es/map/location.js +1 -4
  55. package/dist/es/map/scroller/draggable.js +1 -4
  56. package/dist/es/map/scroller/fx.js +1 -3
  57. package/dist/es/map/scroller/scroller.js +1 -4
  58. package/dist/es/map/tooltip/tooltip.js +2 -4
  59. package/dist/es/qrcode/encodings/data-modes/qr-data-mode.js +1 -4
  60. package/dist/es/qrcode/encodings/encoders/iso-encoder.js +1 -2
  61. package/dist/es/qrcode/encodings/encoders/utf8-encoder.js +1 -4
  62. package/dist/es/qrcode/encodings/encoding-result.js +1 -5
  63. package/dist/es/qrcode/encodings/free-cell-visitor.js +1 -5
  64. package/dist/es/qrcode/qrcode.js +1 -4
  65. package/dist/es/sankey/element.js +1 -3
  66. package/dist/es/stock/navigator-hint.js +2 -4
  67. package/dist/es/stock/navigator.js +2 -4
  68. package/dist/es2015/barcode/barcode.js +1 -4
  69. package/dist/es2015/barcode/encodings/code128.js +1 -3
  70. package/dist/es2015/barcode/encodings/encoding.js +1 -3
  71. package/dist/es2015/chart/aggregates/aggregates.js +3 -3
  72. package/dist/es2015/chart/aggregates/default-aggregates.js +1 -5
  73. package/dist/es2015/chart/aggregates/series-aggregator.js +12 -10
  74. package/dist/es2015/chart/api-elements/chart-axis.js +1 -5
  75. package/dist/es2015/chart/api-elements/chart-plotarea.js +1 -5
  76. package/dist/es2015/chart/axis-group-range-tracker.js +1 -4
  77. package/dist/es2015/chart/categorical-chart.js +8 -8
  78. package/dist/es2015/chart/chart.js +9 -8
  79. package/dist/es2015/chart/error-bars/error-range-calculator.js +2 -4
  80. package/dist/es2015/chart/highlight.js +1 -5
  81. package/dist/es2015/chart/line-chart/line-chart.js +2 -2
  82. package/dist/es2015/chart/line-chart/line-point.js +19 -19
  83. package/dist/es2015/chart/mixins/accessibility-attributes-mixin.js +3 -4
  84. package/dist/es2015/chart/mixins/clip-animation-mixin.js +6 -5
  85. package/dist/es2015/chart/mixins/line-chart-mixin.js +1 -2
  86. package/dist/es2015/chart/mixins/note-mixin.js +1 -2
  87. package/dist/es2015/chart/pan-and-zoom/mousewheel-zoom.js +2 -4
  88. package/dist/es2015/chart/pan-and-zoom/pannable.js +2 -4
  89. package/dist/es2015/chart/pan-and-zoom/zoom-selection.js +2 -4
  90. package/dist/es2015/chart/plotarea/categorical-plotarea.js +2 -2
  91. package/dist/es2015/chart/plotarea/plotarea-factory.js +1 -5
  92. package/dist/es2015/chart/selection.js +2 -4
  93. package/dist/es2015/chart/series-binder.js +4 -8
  94. package/dist/es2015/chart/tooltip/base-tooltip.js +2 -4
  95. package/dist/es2015/common/getter.js +1 -3
  96. package/dist/es2015/common/grep.js +2 -11
  97. package/dist/es2015/common/in-array.js +1 -1
  98. package/dist/es2015/common/observable.js +1 -4
  99. package/dist/es2015/common/user-events.js +2 -6
  100. package/dist/es2015/core/box.js +38 -20
  101. package/dist/es2015/core/category-axis.js +5 -12
  102. package/dist/es2015/core/chart-element.js +8 -6
  103. package/dist/es2015/core/curve-processor.js +2 -5
  104. package/dist/es2015/core/point.js +2 -4
  105. package/dist/es2015/core/ring.js +2 -5
  106. package/dist/es2015/core/shape-builder.js +1 -2
  107. package/dist/es2015/core/utils/element-id.js +5 -0
  108. package/dist/es2015/core/utils/guid.js +4 -16
  109. package/dist/es2015/drawing-utils.js +0 -2
  110. package/dist/es2015/gauges/gauge.js +2 -5
  111. package/dist/es2015/gauges/pointer.js +2 -4
  112. package/dist/es2015/map/crs.js +5 -10
  113. package/dist/es2015/map/extent.js +1 -3
  114. package/dist/es2015/map/layers/bubble.js +1 -4
  115. package/dist/es2015/map/layers/layer.js +1 -4
  116. package/dist/es2015/map/layers/marker.js +1 -3
  117. package/dist/es2015/map/layers/shape.js +1 -3
  118. package/dist/es2015/map/layers/tile.js +3 -7
  119. package/dist/es2015/map/location.js +1 -4
  120. package/dist/es2015/map/scroller/draggable.js +1 -4
  121. package/dist/es2015/map/scroller/fx.js +1 -3
  122. package/dist/es2015/map/scroller/scroller.js +1 -4
  123. package/dist/es2015/map/tooltip/tooltip.js +2 -4
  124. package/dist/es2015/qrcode/encodings/data-modes/qr-data-mode.js +1 -4
  125. package/dist/es2015/qrcode/encodings/encoders/iso-encoder.js +1 -2
  126. package/dist/es2015/qrcode/encodings/encoders/utf8-encoder.js +1 -4
  127. package/dist/es2015/qrcode/encodings/encoding-result.js +1 -5
  128. package/dist/es2015/qrcode/encodings/free-cell-visitor.js +1 -5
  129. package/dist/es2015/qrcode/qrcode.js +1 -4
  130. package/dist/es2015/sankey/element.js +1 -3
  131. package/dist/es2015/stock/navigator-hint.js +2 -4
  132. package/dist/es2015/stock/navigator.js +2 -4
  133. package/dist/npm/main.js +6378 -6892
  134. package/dist/systemjs/kendo-charts.js +1 -1
  135. package/package.json +1 -1
@@ -4,7 +4,6 @@ import {
4
4
  } from '@progress/kendo-drawing';
5
5
 
6
6
  import {
7
- Class,
8
7
  defined,
9
8
  addClass,
10
9
  setDefaultOptions,
@@ -25,10 +24,8 @@ import { surfaceSize } from './surface-size';
25
24
  const DEFAULT_BARCODE_WIDTH = 300;
26
25
  const DEFAULT_BARCODE_HEIGHT = 100;
27
26
 
28
- class Barcode extends Class {
27
+ class Barcode {
29
28
  constructor(element, options, errorHandler = defaultErrorHandler) {
30
- super();
31
-
32
29
  this.options = deepExtend({}, this.options, options);
33
30
  this.element = element;
34
31
  this.onError = errorHandler;
@@ -1,4 +1,3 @@
1
- import { Class } from '../../common';
2
1
  import { Encoding } from './encoding';
3
2
  import deepExtend from '../../common/deep-extend';
4
3
  import inArray from '../../common/in-array';
@@ -7,9 +6,8 @@ const numberRegex = /^\d+$/;
7
6
  const alphanumericRegex = /^[a-z0-9]+$/i;
8
7
  const extend = Object.assign;
9
8
 
10
- export class State128 extends Class {
9
+ export class State128 {
11
10
  constructor(encoding) {
12
- super();
13
11
  this.encoding = encoding;
14
12
  this.initProperties();
15
13
  }
@@ -1,14 +1,12 @@
1
1
  import {
2
- Class,
3
2
  defined,
4
3
  setDefaultOptions
5
4
  } from '../../common';
6
5
 
7
6
  const DEFAULT_QUIET_ZONE_LENGTH = 10;
8
7
 
9
- export class Encoding extends Class {
8
+ export class Encoding {
10
9
  constructor(options) {
11
- super();
12
10
  this.setOptions(options);
13
11
  this.initProperties();
14
12
  }
@@ -1,5 +1,5 @@
1
1
  import { MIN_VALUE, MAX_VALUE } from '../../common/constants';
2
- import { defined, isNumber } from '../../common';
2
+ import { isNumber } from '../../common';
3
3
 
4
4
  import countNumbers from '../utils/count-numbers';
5
5
 
@@ -62,7 +62,7 @@ const Aggregates = {
62
62
 
63
63
  for (let i = 0; i < length; i++) {
64
64
  const value = values[i];
65
- if (value !== null && defined(value)) {
65
+ if (value !== null && value !== undefined) {
66
66
  count++;
67
67
  }
68
68
  }
@@ -86,7 +86,7 @@ const Aggregates = {
86
86
 
87
87
  for (let i = 0; i < length; i++) {
88
88
  const value = values[i];
89
- if (value !== null && defined(value)) {
89
+ if (value !== null && value !== undefined) {
90
90
  return value;
91
91
  }
92
92
  }
@@ -1,9 +1,5 @@
1
- import { Class } from '../../common';
2
-
3
- class DefaultAggregates extends Class {
1
+ class DefaultAggregates {
4
2
  constructor() {
5
- super();
6
-
7
3
  this._defaults = {};
8
4
  }
9
5
 
@@ -1,11 +1,9 @@
1
1
  import Aggregates from './aggregates';
2
2
 
3
- import { Class, defined, inArray, isArray, isFunction, isNumber, isObject } from '../../common';
3
+ import { inArray, isArray, isFunction, isNumber, isObject } from '../../common';
4
4
 
5
- class SeriesAggregator extends Class {
5
+ class SeriesAggregator {
6
6
  constructor(series, binder, defaultAggregates) {
7
- super();
8
-
9
7
  const canonicalFields = binder.canonicalFields(series);
10
8
  const valueFields = binder.valueFields(series);
11
9
  const sourceFields = binder.sourceFields(series, canonicalFields);
@@ -42,7 +40,7 @@ class SeriesAggregator extends Class {
42
40
  const { _series: series, _seriesFields: seriesFields } = this;
43
41
  const data = this._bindPoints(srcPoints || []);
44
42
  const firstDataItem = data.dataItems[0];
45
- let result = {};
43
+ let result = null;
46
44
 
47
45
  if (firstDataItem && !isNumber(firstDataItem) && !isArray(firstDataItem)) {
48
46
  const fn = function() {};
@@ -55,11 +53,15 @@ class SeriesAggregator extends Class {
55
53
  const srcValues = this._bindField(data.values, field.canonicalName);
56
54
  const value = field.transform(srcValues, series, data.dataItems, group);
57
55
 
58
- if (value !== null && isObject(value) && !defined(value.length) && !(value instanceof Date)) {
56
+ if (value !== null && isObject(value) && value.length === undefined && !(value instanceof Date)) {
59
57
  result = value;
60
58
  break;
61
59
  } else {
62
- if (defined(value)) {
60
+ if (value !== undefined) {
61
+ if (result === null) {
62
+ result = {};
63
+ }
64
+
63
65
  setValue(field.name, result, value);
64
66
  }
65
67
  }
@@ -95,7 +97,7 @@ class SeriesAggregator extends Class {
95
97
  const valueFields = item.valueFields;
96
98
  let value;
97
99
 
98
- if (defined(valueFields[field])) {
100
+ if (valueFields[field] !== undefined) {
99
101
  value = valueFields[field];
100
102
  } else {
101
103
  value = item.fields[field];
@@ -117,7 +119,7 @@ function setValue(fieldName, target, value) {
117
119
 
118
120
  while (parts.length > 1) {
119
121
  field = parts.shift();
120
- if (!defined(parentObj[field])) {
122
+ if (parentObj[field] === undefined) {
121
123
  parentObj[field] = {};
122
124
  }
123
125
  parentObj = parentObj[field];
@@ -128,4 +130,4 @@ function setValue(fieldName, target, value) {
128
130
  parentObj[field] = value;
129
131
  }
130
132
 
131
- export default SeriesAggregator;
133
+ export default SeriesAggregator;
@@ -1,9 +1,5 @@
1
- import { Class } from '../../common';
2
-
3
- class ChartAxis extends Class {
1
+ class ChartAxis {
4
2
  constructor(axis) {
5
- super();
6
-
7
3
  this._axis = axis;
8
4
  this.options = axis.options;
9
5
  }
@@ -1,9 +1,5 @@
1
- import { Class } from '../../common';
2
-
3
- class ChartPlotArea extends Class {
1
+ class ChartPlotArea {
4
2
  constructor(plotArea) {
5
- super();
6
-
7
3
  this._plotArea = plotArea;
8
4
  this.visual = plotArea.visual;
9
5
  this.backgroundVisual = plotArea._bgVisual;
@@ -1,10 +1,7 @@
1
1
  import { MIN_VALUE, MAX_VALUE } from '../common/constants';
2
- import { Class } from '../common';
3
2
 
4
- class AxisGroupRangeTracker extends Class {
3
+ class AxisGroupRangeTracker {
5
4
  constructor() {
6
- super();
7
-
8
5
  this.axisRanges = {};
9
6
  }
10
7
 
@@ -8,7 +8,7 @@ import { evalOptions, categoriesCount } from './utils';
8
8
  import { ChartElement, Box } from '../core';
9
9
 
10
10
  import { VALUE, STRING, MIN_VALUE, MAX_VALUE, OBJECT } from '../common/constants';
11
- import { convertableToNumber, deepExtend, defined, isNumber, last, setDefaultOptions, sparseArrayLimits } from '../common';
11
+ import { convertableToNumber, deepExtend, isNumber, last, setDefaultOptions, sparseArrayLimits } from '../common';
12
12
 
13
13
  class CategoricalChart extends ChartElement {
14
14
  constructor(plotArea, options) {
@@ -91,7 +91,7 @@ class CategoricalChart extends ChartElement {
91
91
  const positive = plotValue >= 0;
92
92
  let prevValue = startValue;
93
93
  let isStackedBar = false;
94
- const stack = defined(point.series.stack) ? point.series.stack : this.options.defaultStack;
94
+ const stack = point.series.stack !== undefined ? point.series.stack : this.options.defaultStack;
95
95
  const isNonGroupStack = (stack) => stack === true || typeof stack === OBJECT && !stack.group;
96
96
 
97
97
  if (stack) {
@@ -102,7 +102,7 @@ class CategoricalChart extends ChartElement {
102
102
  break;
103
103
  }
104
104
 
105
- const otherStack = defined(other.series.stack) ? other.series.stack : this.options.defaultStack;
105
+ const otherStack = other.series.stack !== undefined ? other.series.stack : this.options.defaultStack;
106
106
 
107
107
  if (!otherStack) {
108
108
  continue;
@@ -166,7 +166,7 @@ class CategoricalChart extends ChartElement {
166
166
  if (point) {
167
167
  if (point.series.stack === stackName || point.series.axis === axisName) {
168
168
  const to = this.plotRange(point, 0)[1];
169
- if (defined(to) && isFinite(to)) {
169
+ if (to !== undefined && isFinite(to)) {
170
170
  max = Math.max(max, to);
171
171
  min = Math.min(min, to);
172
172
  }
@@ -225,7 +225,7 @@ class CategoricalChart extends ChartElement {
225
225
 
226
226
  if (isNumber(lowValue) && isNumber(highValue)) {
227
227
  errorRange = { low: lowValue, high: highValue };
228
- } else if (errorBars && defined(errorBars.value)) {
228
+ } else if (errorBars && errorBars.value !== undefined) {
229
229
  this.seriesErrorRanges = this.seriesErrorRanges || [];
230
230
  this.seriesErrorRanges[seriesIx] = this.seriesErrorRanges[seriesIx] ||
231
231
  new ErrorRangeCalculator(errorBars.value, series, VALUE);
@@ -297,7 +297,7 @@ class CategoricalChart extends ChartElement {
297
297
 
298
298
  point.owner = this;
299
299
  point.noteText = data.fields.noteText;
300
- if (!defined(point.dataItem)) {
300
+ if (point.dataItem === undefined) {
301
301
  point.dataItem = series.data[categoryIx];
302
302
  }
303
303
  this.addErrorBar(point, data, categoryIx);
@@ -325,7 +325,7 @@ class CategoricalChart extends ChartElement {
325
325
  };
326
326
 
327
327
  let doEval = this._evalSeries[seriesIx];
328
- if (!defined(doEval)) {
328
+ if (doEval === undefined) {
329
329
  this._evalSeries[seriesIx] = doEval = evalOptions(options, {}, state, true);
330
330
  }
331
331
 
@@ -484,9 +484,9 @@ class CategoricalChart extends ChartElement {
484
484
  }
485
485
 
486
486
  for (let categoryIx = 0; categoryIx < count; categoryIx++) {
487
+ const currentCategory = this.categoryAxis.categoryAt(categoryIx);
487
488
  for (let seriesIx = 0; seriesIx < seriesCount; seriesIx++) {
488
489
  const currentSeries = series[seriesIx];
489
- const currentCategory = this.categoryAxis.categoryAt(categoryIx);
490
490
  const pointData = this.plotArea.bindPoint(currentSeries, categoryIx);
491
491
 
492
492
  callback(pointData, {
@@ -21,7 +21,7 @@ import { ChartPane, ChartPlotArea, findAxisByName } from './api-elements';
21
21
  import { X, Y, VALUE, DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_SERIES_OPACITY,
22
22
  ARROW_DOWN, ARROW_UP, ARROW_LEFT, ARROW_RIGHT, ARIA_ACTIVE_DESCENDANT, TAB, TOP, LEFT, BLACK,
23
23
  ENTER, ESCAPE, BOTTOM } from '../common/constants';
24
- import { addClass, removeClass, Class, setDefaultOptions, deepExtend, defined, find, isObject, isFunction, elementSize, elementOffset,
24
+ import { addClass, removeClass, setDefaultOptions, deepExtend, defined, find, isObject, isFunction, elementSize, elementOffset,
25
25
  elementScale, elementStyles, eventCoordinates, bindEvents, unbindEvents, mousewheelDelta, FontLoader, inArray, round,
26
26
  valueOrDefault, isString, cycleUp, cycleDown, hasOwnProperty, hasClasses } from '../common';
27
27
 
@@ -45,10 +45,8 @@ const BLUR = "blur";
45
45
  const MOUSEMOVE_DELAY = 20;
46
46
  const NO_DATA_OVERLAY_TOP_CLASS = "k-chart-overlay-top";
47
47
 
48
- class Chart extends Class {
48
+ class Chart {
49
49
  constructor(element, userOptions, themeOptions, context = {}) {
50
- super();
51
-
52
50
  this.observers = [];
53
51
  this.addObserver(context.observer);
54
52
  this.chartService = new ChartService(this, context);
@@ -346,9 +344,12 @@ class Chart extends Class {
346
344
 
347
345
  model.renderVisual();
348
346
 
349
- if (this.options.transitions !== false) {
347
+ const transitions = this.options.transitions;
348
+ if (transitions !== false) {
350
349
  model.traverse(function(element) {
351
350
  if (element.animation) {
351
+ const loading = (transitions && transitions !== true) ? transitions.loading : transitions;
352
+ element.animation.options = Object.assign({}, element.animation.options, loading);
352
353
  element.animation.setup();
353
354
  }
354
355
  });
@@ -357,7 +358,7 @@ class Chart extends Class {
357
358
  this._initSurface();
358
359
  this.surface.draw(model.visual);
359
360
 
360
- if (this.options.transitions !== false) {
361
+ if (transitions !== false) {
361
362
  model.traverse(function(element) {
362
363
  if (element.animation) {
363
364
  element.animation.play();
@@ -1926,14 +1927,14 @@ class Chart extends Class {
1926
1927
  let transitionsState;
1927
1928
 
1928
1929
  if (options.transitions !== false) {
1930
+ transitionsState = options.transitions;
1929
1931
  options.transitions = false;
1930
- transitionsState = true;
1931
1932
  }
1932
1933
 
1933
1934
  this._redraw();
1934
1935
 
1935
1936
  if (transitionsState) {
1936
- options.transitions = true;
1937
+ options.transitions = transitionsState;
1937
1938
  }
1938
1939
  }
1939
1940
 
@@ -1,17 +1,15 @@
1
1
  import SeriesBinder from '../series-binder';
2
2
 
3
3
  import { OBJECT } from '../../common/constants';
4
- import { Class, defined, getter, isArray, isNumber } from '../../common';
4
+ import { defined, getter, isArray, isNumber } from '../../common';
5
5
 
6
6
  const STD_ERR = "stderr";
7
7
  const STD_DEV = "stddev";
8
8
  const percentRegex = /percent(?:\w*)\((\d+)\)/;
9
9
  const standardDeviationRegex = new RegExp("^" + STD_DEV + "(?:\\((\\d+(?:\\.\\d+)?)\\))?$");
10
10
 
11
- class ErrorRangeCalculator extends Class {
11
+ class ErrorRangeCalculator {
12
12
  constructor(errorValue, series, field) {
13
- super();
14
-
15
13
  this.initGlobalRanges(errorValue, series, field);
16
14
  }
17
15
 
@@ -1,9 +1,5 @@
1
- import { Class } from '../common';
2
-
3
- class Highlight extends Class {
1
+ class Highlight {
4
2
  constructor() {
5
- super();
6
-
7
3
  this._points = [];
8
4
  }
9
5
 
@@ -8,7 +8,7 @@ import ClipAnimationMixin from '../mixins/clip-animation-mixin';
8
8
 
9
9
  import { ZERO, SMOOTH, STEP } from '../constants';
10
10
 
11
- import { deepExtend, defined, isFunction } from '../../common';
11
+ import { deepExtend, isFunction } from '../../common';
12
12
 
13
13
  class LineChart extends CategoricalChart {
14
14
  render() {
@@ -28,7 +28,7 @@ class LineChart extends CategoricalChart {
28
28
  const missingValues = this.seriesMissingValues(series);
29
29
  let value = data.valueFields.value;
30
30
 
31
- if (!defined(value) || value === null) {
31
+ if (value === undefined || value === null) {
32
32
  if (missingValues === ZERO) {
33
33
  value = 0;
34
34
  } else {
@@ -7,19 +7,22 @@ import NoteMixin from '../mixins/note-mixin';
7
7
  import { LINE_MARKER_SIZE, FADEIN, INITIAL_ANIMATION_DURATION, BORDER_BRIGHTNESS, TOOLTIP_OFFSET, ABOVE, BELOW, CHART_POINT_ROLE, CHART_POINT_CLASSNAME, CHART_POINT_ROLE_DESCRIPTION } from '../constants';
8
8
 
9
9
  import { WHITE, CIRCLE, CENTER, TOP, BOTTOM, LEFT, HIGHLIGHT_ZINDEX } from '../../common/constants';
10
- import { deepExtend, defined, getTemplate, getAriaTemplate, valueOrDefault, getSpacing } from '../../common';
11
- import guid from '../../core/utils/guid';
10
+ import { deepExtend, getTemplate, getAriaTemplate, valueOrDefault, getSpacing } from '../../common';
11
+ import elementId from '../../core/utils/element-id';
12
12
  import unclipBox from '../utils/unclip-box';
13
13
 
14
14
  class LinePoint extends ChartElement {
15
15
  constructor(value, options) {
16
- super();
16
+ super(options);
17
17
 
18
18
  this.value = value;
19
- this.options = Object.assign({}, options);
20
19
  this.aboveAxis = valueOrDefault(this.options.aboveAxis, true);
21
20
  this.tooltipTracking = true;
22
- this._id = guid();
21
+ this._id = elementId();
22
+ }
23
+
24
+ initOptions(options) {
25
+ this.options = Object.assign({}, options);
23
26
  }
24
27
 
25
28
  render() {
@@ -56,15 +59,13 @@ class LinePoint extends ChartElement {
56
59
 
57
60
  createLabelElement(options) {
58
61
  return new TextBox(this.getLabelText(options),
59
- deepExtend({
60
- align: CENTER,
62
+ Object.assign({}, {align: CENTER,
61
63
  vAlign: CENTER,
62
- margin: {
63
- left: 5,
64
- right: 5
65
- },
66
- zIndex: valueOrDefault(options.zIndex, this.series.zIndex)
67
- }, options),
64
+ zIndex: valueOrDefault(options.zIndex, this.series.zIndex)},
65
+ options,
66
+ {margin: Object.assign({}, {left: 5,
67
+ right: 5},
68
+ options.margin)}),
68
69
  this.pointData()
69
70
  );
70
71
  }
@@ -95,9 +96,9 @@ class LinePoint extends ChartElement {
95
96
  markerBorder() {
96
97
  const options = this.options.markers;
97
98
  const background = options.background;
98
- const border = deepExtend({ color: this.color }, options.border);
99
+ const border = Object.assign({}, {color: this.color}, options.border);
99
100
 
100
- if (!defined(border.color)) {
101
+ if (border.color === undefined) {
101
102
  border.color = new Color(background).brightness(BORDER_BRIGHTNESS).toHex();
102
103
  }
103
104
 
@@ -120,9 +121,8 @@ class LinePoint extends ChartElement {
120
121
  zIndex: valueOrDefault(options.zIndex, this.series.zIndex),
121
122
  animation: options.animation,
122
123
  visual: options.visual,
123
- accessibilityOptions: deepExtend({
124
- ariaLabel: this.getAriaLabelText(this.options.labels)
125
- }, this.options.accessibility)
124
+ accessibilityOptions: Object.assign({}, {ariaLabel: this.getAriaLabelText(this.options.labels)},
125
+ this.options.accessibility)
126
126
  }, {
127
127
  dataItem: this.dataItem,
128
128
  value: this.value,
@@ -370,7 +370,7 @@ class LinePoint extends ChartElement {
370
370
  }
371
371
 
372
372
  getIndex() {
373
- return defined(this.categoryIx) ? this.categoryIx : this.pointIx;
373
+ return this.categoryIx !== undefined ? this.categoryIx : this.pointIx;
374
374
  }
375
375
  }
376
376
 
@@ -1,14 +1,13 @@
1
1
  import addAccessibilityAttributesToVisual from "../../core/utils/add-accessibility-attributes-to-visual";
2
- import { deepExtend, getAriaTemplate } from "../../common";
2
+ import { getAriaTemplate } from "../../common";
3
3
  import guid from '../../core/utils/guid';
4
4
 
5
5
  const AccessibilityAttributesMixin = {
6
6
  addAccessibilityAttributesToVisual: function() {
7
7
  this._id = this._id || guid();
8
8
 
9
- const accessibilityOptions = deepExtend({
10
- ariaLabel: this.getAriaLabelText()
11
- }, this.options.accessibility);
9
+ const accessibilityOptions = Object.assign({}, {ariaLabel: this.getAriaLabelText()},
10
+ this.options.accessibility);
12
11
 
13
12
  addAccessibilityAttributesToVisual(this.visual, accessibilityOptions);
14
13
  },
@@ -7,13 +7,14 @@ import { defined } from '../../common';
7
7
  const ClipAnimationMixin = {
8
8
  createAnimation: function() {
9
9
  const root = this.getRoot();
10
- if (root && (root.options || {}).transitions !== false) {
11
- const box = root.size();
10
+ const transitions = ((root && root.options) || {}).transitions;
11
+ if (root && transitions !== false) {
12
+ const box = (this.parent && this.parent.clipBox) || root.size();
12
13
  const clipPath = draw.Path.fromRect(box.toRect());
14
+ const loading = (transitions && transitions !== true) ? transitions.loading : transitions;
13
15
  this.visual.clip(clipPath);
14
- this.animation = new ClipAnimation(clipPath, {
15
- box: box
16
- });
16
+ this.animation = new ClipAnimation(clipPath, Object.assign({}, {box: box},
17
+ loading));
17
18
  if (anyHasZIndex(this.options.series)) {
18
19
  this._setChildrenAnimation(clipPath);
19
20
  }
@@ -2,7 +2,6 @@ import { ZERO, INTERPOLATE } from '../constants';
2
2
 
3
3
  import { Point } from '../../core';
4
4
  import { MAX_VALUE } from '../../common/constants';
5
- import { defined } from '../../common';
6
5
 
7
6
  const LineChartMixin = {
8
7
  renderSegments: function() {
@@ -70,7 +69,7 @@ const LineChartMixin = {
70
69
  for (let i = 0; i < allPoints.length; i++) {
71
70
  const point = allPoints[i];
72
71
 
73
- if (point && defined(point.value) && point.value !== null && point.visible !== false) {
72
+ if (point && point.value !== undefined && point.value !== null && point.visible !== false) {
74
73
  const pointBox = point.box;
75
74
  const pointDistance = pointBox.center().distanceTo(target);
76
75
 
@@ -1,12 +1,11 @@
1
1
  import { Note } from '../../core';
2
- import { defined } from '../../common';
3
2
 
4
3
  const NoteMixin = {
5
4
  createNote: function() {
6
5
  const options = this.options.notes;
7
6
  const text = this.noteText || options.label.text;
8
7
 
9
- if (options.visible !== false && defined(text) && text !== null) {
8
+ if (options.visible !== false && text !== undefined && text !== null) {
10
9
  this.note = new Note({
11
10
  value: this.value,
12
11
  text: text,
@@ -2,7 +2,7 @@
2
2
  import toChartAxisRanges from './to-chart-axis-ranges';
3
3
 
4
4
  import { X, Y } from '../../common/constants';
5
- import { Class, deepExtend } from '../../common';
5
+ import { deepExtend } from '../../common';
6
6
  import { limitValue } from '../../drawing-utils';
7
7
 
8
8
  // Limit the zoom rate between 1% and 90% per mousewheel event.
@@ -11,10 +11,8 @@ const MIN_RATE = 0.01;
11
11
  const MAX_RATE = 0.9;
12
12
  const DEFAULT_RATE = 0.3;
13
13
 
14
- class MousewheelZoom extends Class {
14
+ class MousewheelZoom {
15
15
  constructor(chart, options) {
16
- super();
17
-
18
16
  this.chart = chart;
19
17
  this.options = deepExtend({
20
18
  rate: DEFAULT_RATE
@@ -2,12 +2,10 @@ import acceptKey from './accept-key';
2
2
  import toChartAxisRanges from './to-chart-axis-ranges';
3
3
 
4
4
  import { X, Y } from '../../common/constants';
5
- import { Class, deepExtend } from '../../common';
5
+ import { deepExtend } from '../../common';
6
6
 
7
- class Pannable extends Class {
7
+ class Pannable {
8
8
  constructor(plotArea, options) {
9
- super();
10
-
11
9
  this.plotArea = plotArea;
12
10
  this.options = deepExtend({}, this.options, options);
13
11
  }
@@ -2,12 +2,10 @@ import acceptKey from './accept-key';
2
2
  import toChartAxisRanges from './to-chart-axis-ranges';
3
3
 
4
4
  import { X, Y } from '../../common/constants';
5
- import { Class, deepExtend, elementStyles, elementOffset, defined } from '../../common';
5
+ import { deepExtend, elementStyles, elementOffset, defined } from '../../common';
6
6
 
7
- class ZoomSelection extends Class {
7
+ class ZoomSelection {
8
8
  constructor(chart, options) {
9
- super();
10
-
11
9
  this.chart = chart;
12
10
  this.options = deepExtend({}, this.options, options);
13
11
  this.createElement();
@@ -288,11 +288,11 @@ class CategoricalPlotArea extends PlotAreaBase {
288
288
  category = parseDateCategory(category, srcData[idx], this.chartService.intl);
289
289
  }
290
290
 
291
- if (!defined(category)) {
291
+ if (category === undefined) {
292
292
  category = srcCategories[idx];
293
293
  }
294
294
 
295
- if (defined(category) && category !== null) {
295
+ if (category !== undefined && category !== null) {
296
296
  const categoryIx = categoryAxis.totalIndex(category);
297
297
  result[categoryIx] = result[categoryIx] || { items: [], category: category };
298
298
  result[categoryIx].items.push(idx);
@@ -1,12 +1,8 @@
1
1
  import filterSeriesByType from '../utils/filter-series-by-type';
2
- import { Class } from '../../common';
3
2
  import { TRENDLINE_SERIES } from '../constants';
4
3
 
5
- class PlotAreaFactory extends Class {
6
-
4
+ class PlotAreaFactory {
7
5
  constructor() {
8
- super();
9
-
10
6
  this._registry = [];
11
7
  }
12
8
 
@@ -5,7 +5,7 @@ import { DateCategoryAxis, Point } from '../core';
5
5
  import { MOUSEWHEEL_DELAY, MOUSEWHEEL, SELECT_START, SELECT, SELECT_END } from './constants';
6
6
 
7
7
  import { LEFT, RIGHT, MIN_VALUE, MAX_VALUE, X } from '../common/constants';
8
- import { addClass, Class, removeClass, eventCoordinates, deepExtend, elementStyles, eventElement, setDefaultOptions, limitValue, round, bindEvents, unbindEvents, mousewheelDelta, hasClasses } from '../common';
8
+ import { addClass, removeClass, eventCoordinates, deepExtend, elementStyles, eventElement, setDefaultOptions, limitValue, round, bindEvents, unbindEvents, mousewheelDelta, hasClasses } from '../common';
9
9
  import { parseDate } from '../date-utils';
10
10
 
11
11
  const ZOOM_ACCELERATION = 3;
@@ -29,10 +29,8 @@ function closestHandle(element) {
29
29
  return current;
30
30
  }
31
31
 
32
- class Selection extends Class {
32
+ class Selection {
33
33
  constructor(chart, categoryAxis, options, observer) {
34
- super();
35
-
36
34
  const chartElement = chart.element;
37
35
 
38
36
  this.options = deepExtend({}, this.options, options);