@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.
- package/dist/cdn/js/kendo-charts.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/barcode/barcode.js +1 -4
- package/dist/es/barcode/encodings/code128.js +1 -3
- package/dist/es/barcode/encodings/encoding.js +1 -3
- package/dist/es/chart/aggregates/aggregates.js +3 -3
- package/dist/es/chart/aggregates/default-aggregates.js +1 -5
- package/dist/es/chart/aggregates/series-aggregator.js +12 -10
- package/dist/es/chart/api-elements/chart-axis.js +1 -5
- package/dist/es/chart/api-elements/chart-plotarea.js +1 -5
- package/dist/es/chart/axis-group-range-tracker.js +1 -4
- package/dist/es/chart/categorical-chart.js +8 -8
- package/dist/es/chart/chart.js +9 -8
- package/dist/es/chart/error-bars/error-range-calculator.js +2 -4
- package/dist/es/chart/highlight.js +1 -5
- package/dist/es/chart/line-chart/line-chart.js +2 -2
- package/dist/es/chart/line-chart/line-point.js +19 -19
- package/dist/es/chart/mixins/accessibility-attributes-mixin.js +3 -4
- package/dist/es/chart/mixins/clip-animation-mixin.js +6 -5
- package/dist/es/chart/mixins/line-chart-mixin.js +1 -2
- package/dist/es/chart/mixins/note-mixin.js +1 -2
- package/dist/es/chart/pan-and-zoom/mousewheel-zoom.js +2 -4
- package/dist/es/chart/pan-and-zoom/pannable.js +2 -4
- package/dist/es/chart/pan-and-zoom/zoom-selection.js +2 -4
- package/dist/es/chart/plotarea/categorical-plotarea.js +2 -2
- package/dist/es/chart/plotarea/plotarea-factory.js +1 -5
- package/dist/es/chart/selection.js +2 -4
- package/dist/es/chart/series-binder.js +4 -8
- package/dist/es/chart/tooltip/base-tooltip.js +2 -4
- package/dist/es/common/getter.js +1 -3
- package/dist/es/common/grep.js +2 -11
- package/dist/es/common/in-array.js +1 -1
- package/dist/es/common/observable.js +1 -4
- package/dist/es/common/user-events.js +2 -6
- package/dist/es/core/box.js +38 -20
- package/dist/es/core/category-axis.js +5 -12
- package/dist/es/core/chart-element.js +8 -6
- package/dist/es/core/curve-processor.js +2 -5
- package/dist/es/core/point.js +2 -4
- package/dist/es/core/ring.js +2 -5
- package/dist/es/core/shape-builder.js +1 -2
- package/dist/es/core/utils/element-id.js +5 -0
- package/dist/es/core/utils/guid.js +4 -16
- package/dist/es/drawing-utils.js +0 -2
- package/dist/es/gauges/gauge.js +2 -5
- package/dist/es/gauges/pointer.js +2 -4
- package/dist/es/map/crs.js +5 -10
- package/dist/es/map/extent.js +1 -3
- package/dist/es/map/layers/bubble.js +1 -4
- package/dist/es/map/layers/layer.js +1 -4
- package/dist/es/map/layers/marker.js +1 -3
- package/dist/es/map/layers/shape.js +1 -3
- package/dist/es/map/layers/tile.js +3 -7
- package/dist/es/map/location.js +1 -4
- package/dist/es/map/scroller/draggable.js +1 -4
- package/dist/es/map/scroller/fx.js +1 -3
- package/dist/es/map/scroller/scroller.js +1 -4
- package/dist/es/map/tooltip/tooltip.js +2 -4
- package/dist/es/qrcode/encodings/data-modes/qr-data-mode.js +1 -4
- package/dist/es/qrcode/encodings/encoders/iso-encoder.js +1 -2
- package/dist/es/qrcode/encodings/encoders/utf8-encoder.js +1 -4
- package/dist/es/qrcode/encodings/encoding-result.js +1 -5
- package/dist/es/qrcode/encodings/free-cell-visitor.js +1 -5
- package/dist/es/qrcode/qrcode.js +1 -4
- package/dist/es/sankey/element.js +1 -3
- package/dist/es/stock/navigator-hint.js +2 -4
- package/dist/es/stock/navigator.js +2 -4
- package/dist/es2015/barcode/barcode.js +1 -4
- package/dist/es2015/barcode/encodings/code128.js +1 -3
- package/dist/es2015/barcode/encodings/encoding.js +1 -3
- package/dist/es2015/chart/aggregates/aggregates.js +3 -3
- package/dist/es2015/chart/aggregates/default-aggregates.js +1 -5
- package/dist/es2015/chart/aggregates/series-aggregator.js +12 -10
- package/dist/es2015/chart/api-elements/chart-axis.js +1 -5
- package/dist/es2015/chart/api-elements/chart-plotarea.js +1 -5
- package/dist/es2015/chart/axis-group-range-tracker.js +1 -4
- package/dist/es2015/chart/categorical-chart.js +8 -8
- package/dist/es2015/chart/chart.js +9 -8
- package/dist/es2015/chart/error-bars/error-range-calculator.js +2 -4
- package/dist/es2015/chart/highlight.js +1 -5
- package/dist/es2015/chart/line-chart/line-chart.js +2 -2
- package/dist/es2015/chart/line-chart/line-point.js +19 -19
- package/dist/es2015/chart/mixins/accessibility-attributes-mixin.js +3 -4
- package/dist/es2015/chart/mixins/clip-animation-mixin.js +6 -5
- package/dist/es2015/chart/mixins/line-chart-mixin.js +1 -2
- package/dist/es2015/chart/mixins/note-mixin.js +1 -2
- package/dist/es2015/chart/pan-and-zoom/mousewheel-zoom.js +2 -4
- package/dist/es2015/chart/pan-and-zoom/pannable.js +2 -4
- package/dist/es2015/chart/pan-and-zoom/zoom-selection.js +2 -4
- package/dist/es2015/chart/plotarea/categorical-plotarea.js +2 -2
- package/dist/es2015/chart/plotarea/plotarea-factory.js +1 -5
- package/dist/es2015/chart/selection.js +2 -4
- package/dist/es2015/chart/series-binder.js +4 -8
- package/dist/es2015/chart/tooltip/base-tooltip.js +2 -4
- package/dist/es2015/common/getter.js +1 -3
- package/dist/es2015/common/grep.js +2 -11
- package/dist/es2015/common/in-array.js +1 -1
- package/dist/es2015/common/observable.js +1 -4
- package/dist/es2015/common/user-events.js +2 -6
- package/dist/es2015/core/box.js +38 -20
- package/dist/es2015/core/category-axis.js +5 -12
- package/dist/es2015/core/chart-element.js +8 -6
- package/dist/es2015/core/curve-processor.js +2 -5
- package/dist/es2015/core/point.js +2 -4
- package/dist/es2015/core/ring.js +2 -5
- package/dist/es2015/core/shape-builder.js +1 -2
- package/dist/es2015/core/utils/element-id.js +5 -0
- package/dist/es2015/core/utils/guid.js +4 -16
- package/dist/es2015/drawing-utils.js +0 -2
- package/dist/es2015/gauges/gauge.js +2 -5
- package/dist/es2015/gauges/pointer.js +2 -4
- package/dist/es2015/map/crs.js +5 -10
- package/dist/es2015/map/extent.js +1 -3
- package/dist/es2015/map/layers/bubble.js +1 -4
- package/dist/es2015/map/layers/layer.js +1 -4
- package/dist/es2015/map/layers/marker.js +1 -3
- package/dist/es2015/map/layers/shape.js +1 -3
- package/dist/es2015/map/layers/tile.js +3 -7
- package/dist/es2015/map/location.js +1 -4
- package/dist/es2015/map/scroller/draggable.js +1 -4
- package/dist/es2015/map/scroller/fx.js +1 -3
- package/dist/es2015/map/scroller/scroller.js +1 -4
- package/dist/es2015/map/tooltip/tooltip.js +2 -4
- package/dist/es2015/qrcode/encodings/data-modes/qr-data-mode.js +1 -4
- package/dist/es2015/qrcode/encodings/encoders/iso-encoder.js +1 -2
- package/dist/es2015/qrcode/encodings/encoders/utf8-encoder.js +1 -4
- package/dist/es2015/qrcode/encodings/encoding-result.js +1 -5
- package/dist/es2015/qrcode/encodings/free-cell-visitor.js +1 -5
- package/dist/es2015/qrcode/qrcode.js +1 -4
- package/dist/es2015/sankey/element.js +1 -3
- package/dist/es2015/stock/navigator-hint.js +2 -4
- package/dist/es2015/stock/navigator.js +2 -4
- package/dist/npm/main.js +6378 -6892
- package/dist/systemjs/kendo-charts.js +1 -1
- package/package.json +1 -1
|
@@ -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,
|
|
11
|
-
import
|
|
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 =
|
|
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
|
-
|
|
60
|
-
align: CENTER,
|
|
62
|
+
Object.assign({}, {align: CENTER,
|
|
61
63
|
vAlign: CENTER,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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 =
|
|
99
|
+
const border = Object.assign({}, {color: this.color}, options.border);
|
|
99
100
|
|
|
100
|
-
if (
|
|
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:
|
|
124
|
-
|
|
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
|
|
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 {
|
|
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 =
|
|
10
|
-
|
|
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
|
-
|
|
11
|
-
|
|
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
|
-
|
|
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 &&
|
|
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 &&
|
|
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 {
|
|
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
|
|
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 {
|
|
5
|
+
import { deepExtend } from '../../common';
|
|
6
6
|
|
|
7
|
-
class Pannable
|
|
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 {
|
|
5
|
+
import { deepExtend, elementStyles, elementOffset, defined } from '../../common';
|
|
6
6
|
|
|
7
|
-
class ZoomSelection
|
|
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 (
|
|
291
|
+
if (category === undefined) {
|
|
292
292
|
category = srcCategories[idx];
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
if (
|
|
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
|
|
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,
|
|
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
|
|
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);
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import getField from './utils/get-field';
|
|
2
2
|
import { VALUE } from '../common/constants';
|
|
3
|
-
import { Class, defined } from '../common';
|
|
4
|
-
|
|
5
|
-
class SeriesBinder extends Class {
|
|
6
3
|
|
|
4
|
+
class SeriesBinder {
|
|
7
5
|
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
|
|
10
6
|
this._valueFields = {};
|
|
11
7
|
this._otherFields = {};
|
|
12
8
|
this._nullValue = {};
|
|
@@ -39,7 +35,7 @@ class SeriesBinder extends Class {
|
|
|
39
35
|
|
|
40
36
|
bindPoint(series, pointIx, item) {
|
|
41
37
|
const data = series.data;
|
|
42
|
-
const pointData =
|
|
38
|
+
const pointData = item !== undefined ? item : data[pointIx];
|
|
43
39
|
const result = { valueFields: { value: pointData } };
|
|
44
40
|
const valueFields = this.valueFields(series);
|
|
45
41
|
const otherFields = this._otherFields[series.type];
|
|
@@ -47,7 +43,7 @@ class SeriesBinder extends Class {
|
|
|
47
43
|
|
|
48
44
|
if (pointData === null) {
|
|
49
45
|
value = this._nullValue[series.type];
|
|
50
|
-
} else if (
|
|
46
|
+
} else if (pointData === undefined) {
|
|
51
47
|
value = this._undefinedValue[series.type];
|
|
52
48
|
} else if (Array.isArray(pointData)) {
|
|
53
49
|
const fieldData = pointData.slice(valueFields.length);
|
|
@@ -61,7 +57,7 @@ class SeriesBinder extends Class {
|
|
|
61
57
|
fields = this._bindFromObject(pointData, otherFields, srcPointFields);
|
|
62
58
|
}
|
|
63
59
|
|
|
64
|
-
if (
|
|
60
|
+
if (value !== undefined) {
|
|
65
61
|
if (valueFields.length === 1) {
|
|
66
62
|
result.valueFields.value = value[valueFields[0]];
|
|
67
63
|
} else {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Color } from '@progress/kendo-drawing';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { defined, deepExtend, setDefaultOptions, valueOrDefault, getSpacing, styleValue } from '../../common';
|
|
4
4
|
import { SHOW_TOOLTIP, HIDE_TOOLTIP } from '../constants';
|
|
5
5
|
|
|
6
|
-
class BaseTooltip
|
|
6
|
+
class BaseTooltip {
|
|
7
7
|
constructor(chartService, options) {
|
|
8
|
-
super();
|
|
9
|
-
|
|
10
8
|
this.chartService = chartService;
|
|
11
9
|
this.options = deepExtend({}, this.options, options);
|
|
12
10
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { drawing } from '@progress/kendo-drawing';
|
|
2
|
-
|
|
3
1
|
const FIELD_REGEX = /\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g;
|
|
4
2
|
const getterCache = {};
|
|
5
3
|
|
|
@@ -14,7 +12,7 @@ export default function getter(field) {
|
|
|
14
12
|
|
|
15
13
|
const fields = [];
|
|
16
14
|
field.replace(FIELD_REGEX, function(match, index, indexAccessor, field) {
|
|
17
|
-
fields.push(
|
|
15
|
+
fields.push(index !== undefined ? index : (indexAccessor || field));
|
|
18
16
|
});
|
|
19
17
|
|
|
20
18
|
getterCache[field] = function(obj) {
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const result = [];
|
|
4
|
-
for (let idx = 0; idx < length; idx++) {
|
|
5
|
-
if (callback(array[idx])) {
|
|
6
|
-
result .push(array[idx]);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
return result;
|
|
11
|
-
}
|
|
1
|
+
const grep = (array, callback) => array.filter(callback);
|
|
2
|
+
export default grep;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Class } from '../drawing-utils';
|
|
2
|
-
|
|
3
1
|
const STRING = "string";
|
|
4
2
|
const FUNCTION = "function";
|
|
5
3
|
|
|
@@ -11,9 +9,8 @@ let isDefaultPrevented = function() {
|
|
|
11
9
|
return this._defaultPrevented === true;
|
|
12
10
|
};
|
|
13
11
|
|
|
14
|
-
export default class Observable
|
|
12
|
+
export default class Observable {
|
|
15
13
|
constructor() {
|
|
16
|
-
super();
|
|
17
14
|
this._events = {};
|
|
18
15
|
}
|
|
19
16
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Class } from '../drawing-utils';
|
|
2
1
|
import { applyEventMap, eventMap } from './event-map';
|
|
3
2
|
import { on, off } from './event-utils';
|
|
4
3
|
import getSupportedFeatures from './get-supported-features';
|
|
@@ -83,9 +82,8 @@ function getTouches(e) {
|
|
|
83
82
|
|
|
84
83
|
return touches;
|
|
85
84
|
}
|
|
86
|
-
class TouchAxis
|
|
85
|
+
class TouchAxis {
|
|
87
86
|
constructor(axis, location) {
|
|
88
|
-
super();
|
|
89
87
|
let that = this;
|
|
90
88
|
|
|
91
89
|
that.support = getSupportedFeatures();
|
|
@@ -124,10 +122,8 @@ class TouchAxis extends Class {
|
|
|
124
122
|
}
|
|
125
123
|
}
|
|
126
124
|
|
|
127
|
-
class Touch
|
|
125
|
+
class Touch {
|
|
128
126
|
constructor(userEvents, target, touchInfo) {
|
|
129
|
-
super();
|
|
130
|
-
|
|
131
127
|
extend(this, {
|
|
132
128
|
x: new TouchAxis('X', touchInfo.location),
|
|
133
129
|
y: new TouchAxis('Y', touchInfo.location),
|
package/dist/es2015/core/box.js
CHANGED
|
@@ -2,13 +2,11 @@ import { geometry as geom } from '@progress/kendo-drawing';
|
|
|
2
2
|
|
|
3
3
|
import Point from './point';
|
|
4
4
|
|
|
5
|
-
import { X, Y, TOP, BOTTOM, LEFT, RIGHT, CENTER
|
|
6
|
-
import {
|
|
5
|
+
import { X, Y, TOP, BOTTOM, LEFT, RIGHT, CENTER } from '../common/constants';
|
|
6
|
+
import { getSpacing, isArray, rad } from '../common';
|
|
7
7
|
|
|
8
|
-
class Box
|
|
8
|
+
class Box {
|
|
9
9
|
constructor(x1, y1, x2, y2) {
|
|
10
|
-
super();
|
|
11
|
-
|
|
12
10
|
this.x1 = x1 || 0;
|
|
13
11
|
this.y1 = y1 || 0;
|
|
14
12
|
this.x2 = x2 || 0;
|
|
@@ -41,12 +39,12 @@ class Box extends Class {
|
|
|
41
39
|
const height = this.height();
|
|
42
40
|
const width = this.width();
|
|
43
41
|
|
|
44
|
-
if (
|
|
42
|
+
if (x !== undefined) {
|
|
45
43
|
this.x1 = x;
|
|
46
44
|
this.x2 = this.x1 + width;
|
|
47
45
|
}
|
|
48
46
|
|
|
49
|
-
if (
|
|
47
|
+
if (y !== undefined) {
|
|
50
48
|
this.y1 = y;
|
|
51
49
|
this.y2 = this.y1 + height;
|
|
52
50
|
}
|
|
@@ -217,20 +215,40 @@ class Box extends Class {
|
|
|
217
215
|
}
|
|
218
216
|
|
|
219
217
|
align(targetBox, axis, alignment) {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
218
|
+
if (axis === X) {
|
|
219
|
+
this.alignX(targetBox, alignment);
|
|
220
|
+
} else {
|
|
221
|
+
this.alignY(targetBox, alignment);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return this;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
alignX(targetBox, alignment) {
|
|
228
|
+
const width = this.width();
|
|
229
|
+
if (alignment === LEFT) {
|
|
230
|
+
this.x1 = targetBox.x1;
|
|
231
|
+
this.x2 = this.x1 + width;
|
|
232
|
+
} else if (alignment === RIGHT) {
|
|
233
|
+
this.x2 = targetBox.x2;
|
|
234
|
+
this.x1 = this.x2 - width;
|
|
231
235
|
} else if (alignment === CENTER) {
|
|
232
|
-
this
|
|
233
|
-
this
|
|
236
|
+
this.x1 = targetBox.x1 + (targetBox.width() - width) / 2;
|
|
237
|
+
this.x2 = this.x1 + width;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
alignY(targetBox, alignment) {
|
|
242
|
+
const height = this.height();
|
|
243
|
+
if (alignment === TOP) {
|
|
244
|
+
this.y1 = targetBox.y1;
|
|
245
|
+
this.y2 = this.y1 + height;
|
|
246
|
+
} else if (alignment === BOTTOM) {
|
|
247
|
+
this.y2 = targetBox.y2;
|
|
248
|
+
this.y1 = this.y2 - height;
|
|
249
|
+
} else if (alignment === CENTER) {
|
|
250
|
+
this.y1 = targetBox.y1 + (targetBox.height() - height) / 2;
|
|
251
|
+
this.y2 = this.y1 + height;
|
|
234
252
|
}
|
|
235
253
|
}
|
|
236
254
|
}
|
|
@@ -2,7 +2,7 @@ import Axis from './axis';
|
|
|
2
2
|
import AxisLabel from './axis-label';
|
|
3
3
|
|
|
4
4
|
import { BLACK, COORD_PRECISION, DEFAULT_PRECISION, X, Y } from '../common/constants';
|
|
5
|
-
import {
|
|
5
|
+
import { isNumber, last, limitValue, round, setDefaultOptions, valueOrDefault, HashMap } from '../common';
|
|
6
6
|
import { dateEquals } from '../date-utils';
|
|
7
7
|
|
|
8
8
|
const MIN_CATEGORY_POINTS_RANGE = 0.01;
|
|
@@ -10,14 +10,7 @@ const MIN_CATEGORY_RANGE = 0.1;
|
|
|
10
10
|
|
|
11
11
|
function indexOf(value, arr) {
|
|
12
12
|
if (value instanceof Date) {
|
|
13
|
-
|
|
14
|
-
for (let idx = 0; idx < length; idx++) {
|
|
15
|
-
if (dateEquals(arr[idx], value)) {
|
|
16
|
-
return idx;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return -1;
|
|
13
|
+
return arr.findIndex((item) => dateEquals(item, value));
|
|
21
14
|
}
|
|
22
15
|
|
|
23
16
|
return arr.indexOf(value);
|
|
@@ -43,8 +36,8 @@ class CategoryAxis extends Axis {
|
|
|
43
36
|
|
|
44
37
|
initUserOptions(options) {
|
|
45
38
|
const categories = options.categories || [];
|
|
46
|
-
const definedMin =
|
|
47
|
-
const definedMax =
|
|
39
|
+
const definedMin = options.min !== undefined;
|
|
40
|
+
const definedMax = options.max !== undefined;
|
|
48
41
|
options.srcCategories = options.categories = categories;
|
|
49
42
|
|
|
50
43
|
if ((definedMin || definedMax) && categories.length) {
|
|
@@ -259,7 +252,7 @@ class CategoryAxis extends Axis {
|
|
|
259
252
|
const { axis: valueAxis, lineStart } = this.lineInfo();
|
|
260
253
|
|
|
261
254
|
const slotBox = box.clone();
|
|
262
|
-
const singleSlot =
|
|
255
|
+
const singleSlot = to === undefined;
|
|
263
256
|
|
|
264
257
|
const start = valueOrDefault(from, 0);
|
|
265
258
|
let end = valueOrDefault(to, start);
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { drawing as draw } from '@progress/kendo-drawing';
|
|
2
2
|
|
|
3
3
|
import { WHITE } from '../common/constants';
|
|
4
|
-
import {
|
|
4
|
+
import { deepExtend, valueOrDefault, autoTextColor } from '../common';
|
|
5
5
|
|
|
6
|
-
class ChartElement
|
|
6
|
+
class ChartElement {
|
|
7
7
|
constructor(options) {
|
|
8
|
-
super();
|
|
9
|
-
|
|
10
8
|
this.children = [];
|
|
11
9
|
|
|
10
|
+
this.initOptions(options);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
initOptions(options) {
|
|
12
14
|
this.options = deepExtend({}, this.options, this.initUserOptions(options));
|
|
13
15
|
}
|
|
14
16
|
|
|
@@ -137,7 +139,7 @@ class ChartElement extends Class {
|
|
|
137
139
|
|
|
138
140
|
if (childVisual.options.noclip) {
|
|
139
141
|
this.clipRoot().visual.append(childVisual);
|
|
140
|
-
} else if (
|
|
142
|
+
} else if (childVisual.options.zIndex !== undefined) {
|
|
141
143
|
this.stackRoot().stackVisual(childVisual);
|
|
142
144
|
} else if (this.isStackRoot) {
|
|
143
145
|
this.stackVisual(childVisual);
|
|
@@ -261,7 +263,7 @@ class ChartElement extends Class {
|
|
|
261
263
|
highlight = this._highlight = this.createHighlight(highlightOptions);
|
|
262
264
|
}
|
|
263
265
|
|
|
264
|
-
if (
|
|
266
|
+
if (highlight.options.zIndex === undefined) {
|
|
265
267
|
highlight.options.zIndex = valueOrDefault(options.zIndex, this.options.zIndex);
|
|
266
268
|
}
|
|
267
269
|
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { geometry as geom } from '@progress/kendo-drawing';
|
|
2
2
|
|
|
3
3
|
import { X, Y } from '../common/constants';
|
|
4
|
-
import {
|
|
4
|
+
import { last, round } from '../common';
|
|
5
5
|
|
|
6
6
|
const WEIGHT = 0.333;
|
|
7
7
|
const EXTREMUM_ALLOWED_DEVIATION = 0.01;
|
|
8
8
|
|
|
9
|
-
class CurveProcessor
|
|
10
|
-
|
|
9
|
+
class CurveProcessor {
|
|
11
10
|
constructor(closed) {
|
|
12
|
-
super();
|
|
13
|
-
|
|
14
11
|
this.closed = closed;
|
|
15
12
|
}
|
|
16
13
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { COORD_PRECISION } from '../common/constants';
|
|
2
|
-
import {
|
|
2
|
+
import { rad, round } from '../common';
|
|
3
3
|
|
|
4
|
-
class Point
|
|
4
|
+
class Point {
|
|
5
5
|
constructor(x, y) {
|
|
6
|
-
super();
|
|
7
|
-
|
|
8
6
|
this.x = x || 0;
|
|
9
7
|
this.y = y || 0;
|
|
10
8
|
}
|
package/dist/es2015/core/ring.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import Box from './box';
|
|
2
2
|
import Point from './point';
|
|
3
3
|
import { COORD_PRECISION, MAX_VALUE, MIN_VALUE } from '../common/constants';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
class Ring extends Class {
|
|
4
|
+
import { clockwise, rad, round } from '../common';
|
|
7
5
|
|
|
6
|
+
class Ring {
|
|
8
7
|
constructor(center, innerRadius, radius, startAngle, angle) {
|
|
9
|
-
super();
|
|
10
|
-
|
|
11
8
|
this.center = center;
|
|
12
9
|
this.innerRadius = innerRadius;
|
|
13
10
|
this.radius = radius;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { geometry as geom, drawing as draw } from '@progress/kendo-drawing';
|
|
2
|
-
import { Class } from '../common';
|
|
3
2
|
|
|
4
3
|
const DIRECTION_ANGLE = 0.001; //any value that will make the endAngle bigger than the start angle will work here.
|
|
5
4
|
|
|
6
|
-
class ShapeBuilder
|
|
5
|
+
class ShapeBuilder {
|
|
7
6
|
createRing(sector, options) {
|
|
8
7
|
const startAngle = sector.startAngle + 180;
|
|
9
8
|
let endAngle = sector.angle + startAngle;
|