@progress/kendo-charts 2.10.0-develop.2 → 2.10.0-develop.4
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/chart/animations/bar-chart-animation.js +5 -12
- package/dist/es/chart/animations/bubble-animation.js +5 -6
- package/dist/es/chart/animations/clip-animation.js +7 -12
- package/dist/es/chart/animations/fade-in-animation.js +5 -7
- package/dist/es/chart/animations/pie-animation.js +6 -7
- package/dist/es/chart/bubble-chart/bubble-chart.js +6 -4
- package/dist/es/chart/chart.js +98 -10
- package/dist/es/chart/mixins/clip-animation-mixin.js +3 -3
- package/dist/es/chart/plotarea/categorical-plotarea.js +15 -0
- package/dist/es/chart/theme/load-theme.js +15 -24
- package/dist/es2015/chart/animations/bar-chart-animation.js +5 -12
- package/dist/es2015/chart/animations/bubble-animation.js +5 -6
- package/dist/es2015/chart/animations/clip-animation.js +7 -12
- package/dist/es2015/chart/animations/fade-in-animation.js +5 -7
- package/dist/es2015/chart/animations/pie-animation.js +6 -7
- package/dist/es2015/chart/bubble-chart/bubble-chart.js +6 -4
- package/dist/es2015/chart/chart.js +98 -10
- package/dist/es2015/chart/mixins/clip-animation-mixin.js +3 -3
- package/dist/es2015/chart/plotarea/categorical-plotarea.js +15 -0
- package/dist/es2015/chart/theme/load-theme.js +15 -24
- package/dist/npm/main.js +164 -82
- package/dist/systemjs/kendo-charts.js +1 -1
- package/package.json +3 -3
- package/dist/es/chart/animations/easingMap.js +0 -8
- package/dist/es2015/chart/animations/easingMap.js +0 -8
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import { drawing as draw, geometry as geom } from '@progress/kendo-drawing';
|
|
2
|
-
|
|
3
|
-
import { INITIAL_ANIMATION_DURATION, BAR, START_SCALE } from '../constants';
|
|
4
|
-
|
|
2
|
+
import { BAR, START_SCALE } from '../constants';
|
|
5
3
|
import { X, Y } from '../../common/constants';
|
|
6
4
|
import { interpolateValue, setDefaultOptions } from '../../common';
|
|
7
|
-
import { easingMap } from './easingMap';
|
|
8
5
|
|
|
9
6
|
class BarChartAnimation extends draw.Animation {
|
|
10
|
-
|
|
11
7
|
setup() {
|
|
12
8
|
const { element, options } = this;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
options.motion.easing = easingMap[options.easing];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
9
|
+
|
|
10
|
+
options.duration = options.duration === undefined ? options.motionConfig.steady : options.duration;
|
|
11
|
+
options.easing = options.motionConfig[options.easing] || [];
|
|
19
12
|
|
|
20
13
|
const bbox = element.bbox();
|
|
21
14
|
|
|
@@ -50,7 +43,7 @@ class BarChartAnimation extends draw.Animation {
|
|
|
50
43
|
}
|
|
51
44
|
|
|
52
45
|
setDefaultOptions(BarChartAnimation, {
|
|
53
|
-
|
|
46
|
+
motionConfig: {}
|
|
54
47
|
});
|
|
55
48
|
|
|
56
49
|
draw.AnimationFactory.current.register(BAR, BarChartAnimation);
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { drawing as draw, geometry as geom } from '@progress/kendo-drawing';
|
|
2
|
-
|
|
3
2
|
import { START_SCALE, BUBBLE } from '../constants';
|
|
4
3
|
|
|
5
4
|
import { setDefaultOptions } from '../../common';
|
|
6
5
|
|
|
7
6
|
class BubbleAnimation extends draw.Animation {
|
|
8
7
|
setup() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const options = this.options;
|
|
9
|
+
options.duration = options.duration === undefined ? options.motionConfig.steady : options.duration;
|
|
10
|
+
options.easing = options.motionConfig.easeOutElastic || [];
|
|
11
|
+
|
|
13
12
|
const center = this.center = this.element.bbox().center();
|
|
14
13
|
this.element.transform(geom.transform()
|
|
15
14
|
.scale(START_SCALE, START_SCALE, center)
|
|
@@ -24,7 +23,7 @@ class BubbleAnimation extends draw.Animation {
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
setDefaultOptions(BubbleAnimation, {
|
|
27
|
-
|
|
26
|
+
motionConfig: {}
|
|
28
27
|
});
|
|
29
28
|
|
|
30
29
|
draw.AnimationFactory.current.register(BUBBLE, BubbleAnimation);
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { drawing as draw } from '@progress/kendo-drawing';
|
|
2
|
-
|
|
3
|
-
import { INITIAL_ANIMATION_DURATION } from '../constants';
|
|
4
|
-
|
|
5
2
|
import { interpolateValue, setDefaultOptions } from '../../common';
|
|
6
|
-
import { easingMap } from './easingMap';
|
|
7
3
|
|
|
8
4
|
class ClipAnimation extends draw.Animation {
|
|
9
5
|
setup() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this._setEnd(this.options.box.x1);
|
|
6
|
+
const options = this.options;
|
|
7
|
+
|
|
8
|
+
options.duration = options.duration === undefined ? options.motionConfig.steady : options.duration;
|
|
9
|
+
options.easing = options.motionConfig[options.easing] || [];
|
|
10
|
+
|
|
11
|
+
this._setEnd(options.box.x1);
|
|
17
12
|
}
|
|
18
13
|
|
|
19
14
|
step(pos) {
|
|
@@ -35,7 +30,7 @@ class ClipAnimation extends draw.Animation {
|
|
|
35
30
|
}
|
|
36
31
|
|
|
37
32
|
setDefaultOptions(ClipAnimation, {
|
|
38
|
-
|
|
33
|
+
motionConfig: {}
|
|
39
34
|
});
|
|
40
35
|
|
|
41
36
|
draw.AnimationFactory.current.register("clip", ClipAnimation);
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { drawing as draw } from '@progress/kendo-drawing';
|
|
2
|
-
|
|
3
2
|
import { FADEIN } from '../constants';
|
|
4
3
|
|
|
5
4
|
import { setDefaultOptions } from '../../common';
|
|
6
5
|
|
|
7
6
|
class FadeInAnimation extends draw.Animation {
|
|
8
7
|
setup() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const options = this.options;
|
|
9
|
+
options.duration = options.duration === undefined ? options.motionConfig.rapid : options.duration;
|
|
10
|
+
options.easing = options.motionConfig.linear || [];
|
|
11
|
+
|
|
13
12
|
this.fadeTo = this.element.opacity();
|
|
14
13
|
this.element.opacity(0);
|
|
15
14
|
}
|
|
@@ -20,8 +19,7 @@ class FadeInAnimation extends draw.Animation {
|
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
setDefaultOptions(FadeInAnimation, {
|
|
23
|
-
|
|
24
|
-
easing: "linear"
|
|
22
|
+
motionConfig: {}
|
|
25
23
|
});
|
|
26
24
|
|
|
27
25
|
draw.AnimationFactory.current.register(FADEIN, FadeInAnimation);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { drawing as draw, geometry as geom } from '@progress/kendo-drawing';
|
|
2
2
|
|
|
3
|
-
import { START_SCALE,
|
|
3
|
+
import { START_SCALE, PIE } from '../constants';
|
|
4
4
|
|
|
5
5
|
import { setDefaultOptions } from '../../common';
|
|
6
6
|
|
|
7
7
|
class PieAnimation extends draw.Animation {
|
|
8
8
|
setup() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const options = this.options;
|
|
10
|
+
options.duration = options.duration === undefined ? options.motionConfig.steady : options.duration;
|
|
11
|
+
options.easing = options.motionConfig.easeOutElastic || [];
|
|
12
|
+
|
|
13
13
|
this.element.transform(geom.transform()
|
|
14
14
|
.scale(START_SCALE, START_SCALE, this.options.center)
|
|
15
15
|
);
|
|
@@ -23,8 +23,7 @@ class PieAnimation extends draw.Animation {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
setDefaultOptions(PieAnimation, {
|
|
26
|
-
|
|
27
|
-
duration: INITIAL_ANIMATION_DURATION
|
|
26
|
+
motionConfig: {}
|
|
28
27
|
});
|
|
29
28
|
|
|
30
29
|
draw.AnimationFactory.current.register(PIE, PieAnimation);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ScatterChart from '../scatter-charts/scatter-chart';
|
|
2
2
|
import Bubble from './bubble';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { BUBBLE, INITIAL_ANIMATION_DURATION } from '../constants';
|
|
5
5
|
|
|
6
6
|
import { MIN_VALUE, CIRCLE } from '../../common/constants';
|
|
7
7
|
import { deepExtend, isFunction, setDefaultOptions, valueOrDefault } from '../../common';
|
|
@@ -34,10 +34,12 @@ class BubbleChart extends ScatterChart {
|
|
|
34
34
|
createPoint(value, fields) {
|
|
35
35
|
const series = fields.series;
|
|
36
36
|
const pointsCount = series.data.length;
|
|
37
|
-
const
|
|
37
|
+
const motion = this.chartService.chart ? this.chartService.chart.options.motion : { steady: INITIAL_ANIMATION_DURATION };
|
|
38
|
+
const initialDuration = motion.steady;
|
|
39
|
+
const delay = fields.pointIx * (initialDuration / pointsCount);
|
|
38
40
|
const animationOptions = {
|
|
39
41
|
delay: delay,
|
|
40
|
-
duration:
|
|
42
|
+
duration: initialDuration - delay,
|
|
41
43
|
type: BUBBLE
|
|
42
44
|
};
|
|
43
45
|
|
|
@@ -52,7 +54,7 @@ class BubbleChart extends ScatterChart {
|
|
|
52
54
|
labels: {
|
|
53
55
|
animation: {
|
|
54
56
|
delay: delay,
|
|
55
|
-
duration:
|
|
57
|
+
duration: initialDuration - delay
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
}, this.pointOptions(series, fields.seriesIx), {
|
package/dist/es/chart/chart.js
CHANGED
|
@@ -367,14 +367,12 @@ class Chart {
|
|
|
367
367
|
|
|
368
368
|
const transitions = this.options.transitions;
|
|
369
369
|
const motionConfig = this.options.motion || {};
|
|
370
|
-
const motion = {
|
|
371
|
-
enabled: motionConfig.enabled
|
|
372
|
-
};
|
|
373
370
|
if (transitions !== false) {
|
|
374
371
|
model.traverse(function(element) {
|
|
375
372
|
if (element.animation) {
|
|
376
|
-
|
|
377
|
-
|
|
373
|
+
element.animation.options = Object.assign({}, element.animation.options,
|
|
374
|
+
{duration: undefined,
|
|
375
|
+
motionConfig: Object.assign({}, motionConfig)});
|
|
378
376
|
element.animation.setup();
|
|
379
377
|
}
|
|
380
378
|
});
|
|
@@ -481,6 +479,75 @@ class Chart {
|
|
|
481
479
|
return visual;
|
|
482
480
|
}
|
|
483
481
|
|
|
482
|
+
_toggleCategoryHighlight(index, axis) {
|
|
483
|
+
const plotArea = this._plotArea;
|
|
484
|
+
const categoryAxis = axis || plotArea.categoryAxis;
|
|
485
|
+
|
|
486
|
+
if (this._categoryHighlightIndex === index && this._categoryHighlightAxis === categoryAxis) {
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
this._categoryHighlightIndex = index;
|
|
491
|
+
this._categoryHighlightAxis = categoryAxis;
|
|
492
|
+
|
|
493
|
+
const highlightOptions = (categoryAxis.options || {}).highlight;
|
|
494
|
+
|
|
495
|
+
if (!highlightOptions || !highlightOptions.visible || index === null) {
|
|
496
|
+
if (this._categoryHighlight) {
|
|
497
|
+
this._categoryHighlight.visible(false);
|
|
498
|
+
}
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
if (!this._categoryHighlight) {
|
|
503
|
+
this._categoryHighlight = new draw.Path({
|
|
504
|
+
fill: {
|
|
505
|
+
color: highlightOptions.color,
|
|
506
|
+
opacity: highlightOptions.opacity
|
|
507
|
+
},
|
|
508
|
+
stroke: highlightOptions.border || null,
|
|
509
|
+
closed: true
|
|
510
|
+
});
|
|
511
|
+
|
|
512
|
+
this.surface.draw(this._categoryHighlight);
|
|
513
|
+
} else {
|
|
514
|
+
const options = this._categoryHighlight.options;
|
|
515
|
+
options.set("fill", {
|
|
516
|
+
color: highlightOptions.color,
|
|
517
|
+
opacity: highlightOptions.opacity
|
|
518
|
+
});
|
|
519
|
+
options.set("stroke", highlightOptions.border);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
const slot = categoryAxis.getSlot(index);
|
|
523
|
+
const rect = slot.toRect();
|
|
524
|
+
let plotBox = plotArea.box;
|
|
525
|
+
|
|
526
|
+
if (categoryAxis.pane) {
|
|
527
|
+
plotBox = categoryAxis.pane.chartsBox();
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
if (categoryAxis.options.vertical) {
|
|
531
|
+
rect.origin.x = plotBox.x1;
|
|
532
|
+
rect.size.width = plotBox.width();
|
|
533
|
+
} else {
|
|
534
|
+
rect.origin.y = plotBox.y1;
|
|
535
|
+
rect.size.height = plotBox.height();
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
const newPath = draw.Path.fromRect(rect);
|
|
539
|
+
this._categoryHighlight.segments.elements(newPath.segments.elements());
|
|
540
|
+
this._categoryHighlight.visible(true);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
_categoryHighlightEnabled() {
|
|
544
|
+
const plotArea = this._plotArea;
|
|
545
|
+
const categoryAxis = plotArea.categoryAxis || {};
|
|
546
|
+
const highlightOptions = (categoryAxis.options || {}).highlight;
|
|
547
|
+
|
|
548
|
+
return plotArea instanceof CategoricalPlotArea && highlightOptions && highlightOptions.visible;
|
|
549
|
+
}
|
|
550
|
+
|
|
484
551
|
_sharedTooltip() {
|
|
485
552
|
return this._plotArea instanceof CategoricalPlotArea && this.options.tooltip && this.options.tooltip.shared;
|
|
486
553
|
}
|
|
@@ -1796,6 +1863,22 @@ class Chart {
|
|
|
1796
1863
|
if (this._sharedTooltip()) {
|
|
1797
1864
|
this._trackSharedTooltip(coords, e);
|
|
1798
1865
|
}
|
|
1866
|
+
|
|
1867
|
+
if (this._categoryHighlightEnabled()) {
|
|
1868
|
+
this._trackCategoryHighlight(coords);
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
_trackCategoryHighlight(coords) {
|
|
1873
|
+
const { _plotArea: plotArea } = this;
|
|
1874
|
+
const categoryAxis = plotArea.categoryAxisByPoint(coords) || plotArea.categoryAxis;
|
|
1875
|
+
|
|
1876
|
+
if (plotArea.backgroundContainsPoint(coords)) {
|
|
1877
|
+
const index = categoryAxis.pointCategoryIndex(coords);
|
|
1878
|
+
this._toggleCategoryHighlight(index, categoryAxis);
|
|
1879
|
+
} else {
|
|
1880
|
+
this._toggleCategoryHighlight(null);
|
|
1881
|
+
}
|
|
1799
1882
|
}
|
|
1800
1883
|
|
|
1801
1884
|
_trackCrosshairs(coords) {
|
|
@@ -1862,6 +1945,8 @@ class Chart {
|
|
|
1862
1945
|
plotArea.hideCrosshairs();
|
|
1863
1946
|
|
|
1864
1947
|
this._unsetActivePoint(options);
|
|
1948
|
+
|
|
1949
|
+
this._toggleCategoryHighlight(null);
|
|
1865
1950
|
}
|
|
1866
1951
|
|
|
1867
1952
|
_unsetActivePoint(options) {
|
|
@@ -2001,7 +2086,7 @@ class Chart {
|
|
|
2001
2086
|
}
|
|
2002
2087
|
|
|
2003
2088
|
_shouldAttachMouseMove() {
|
|
2004
|
-
return this._plotArea.crosshairs.length || (this._tooltip && this._sharedTooltip()) || this.requiresHandlers([ PLOT_AREA_HOVER, PLOT_AREA_LEAVE ]);
|
|
2089
|
+
return this._plotArea.crosshairs.length || (this._tooltip && this._sharedTooltip()) || this._categoryHighlightEnabled() || this.requiresHandlers([ PLOT_AREA_HOVER, PLOT_AREA_LEAVE ]);
|
|
2005
2090
|
}
|
|
2006
2091
|
|
|
2007
2092
|
updateMouseMoveHandler() {
|
|
@@ -2315,9 +2400,7 @@ function triggerPaneRender(panes) {
|
|
|
2315
2400
|
|
|
2316
2401
|
setDefaultOptions(Chart, {
|
|
2317
2402
|
renderAs: "",
|
|
2318
|
-
motion: {
|
|
2319
|
-
enabled: false,
|
|
2320
|
-
},
|
|
2403
|
+
motion: {},
|
|
2321
2404
|
chartArea: {},
|
|
2322
2405
|
legend: {
|
|
2323
2406
|
visible: true,
|
|
@@ -2331,7 +2414,12 @@ setDefaultOptions(Chart, {
|
|
|
2331
2414
|
}
|
|
2332
2415
|
}
|
|
2333
2416
|
},
|
|
2334
|
-
categoryAxis: {
|
|
2417
|
+
categoryAxis: {
|
|
2418
|
+
highlight: {
|
|
2419
|
+
visible: false,
|
|
2420
|
+
border: null
|
|
2421
|
+
}
|
|
2422
|
+
},
|
|
2335
2423
|
seriesDefaults: {
|
|
2336
2424
|
type: COLUMN,
|
|
2337
2425
|
data: [],
|
|
@@ -11,10 +11,10 @@ const ClipAnimationMixin = {
|
|
|
11
11
|
if (root && transitions !== false) {
|
|
12
12
|
const box = (this.parent && this.parent.clipBox) || root.size();
|
|
13
13
|
const clipPath = draw.Path.fromRect(box.toRect());
|
|
14
|
-
const loading = (transitions && transitions !== true) ? transitions.loading : transitions;
|
|
15
14
|
this.visual.clip(clipPath);
|
|
16
|
-
this.animation = new ClipAnimation(clipPath,
|
|
17
|
-
|
|
15
|
+
this.animation = new ClipAnimation(clipPath, {
|
|
16
|
+
box: box
|
|
17
|
+
});
|
|
18
18
|
if (anyHasZIndex(this.options.series)) {
|
|
19
19
|
this._setChildrenAnimation(clipPath);
|
|
20
20
|
}
|
|
@@ -883,6 +883,21 @@ class CategoricalPlotArea extends PlotAreaBase {
|
|
|
883
883
|
|
|
884
884
|
return sortableSeries || stackableSeries && point.options.isStacked;
|
|
885
885
|
}
|
|
886
|
+
|
|
887
|
+
categoryAxisByPoint(point) {
|
|
888
|
+
const axes = this.axes;
|
|
889
|
+
let axis;
|
|
890
|
+
|
|
891
|
+
for (let i = 0; i < axes.length; i++) {
|
|
892
|
+
const current = axes[i];
|
|
893
|
+
if (current instanceof CategoryAxis && current.pane.chartsBox().containsPoint(point)) {
|
|
894
|
+
axis = current;
|
|
895
|
+
break;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
return axis;
|
|
900
|
+
}
|
|
886
901
|
}
|
|
887
902
|
|
|
888
903
|
function updateAxisOptions(targetOptions, axis, options) {
|
|
@@ -62,29 +62,12 @@ const parseToMS = (value) => {
|
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
function parseCubicBezier(input) {
|
|
65
|
-
const s = input.trim();
|
|
65
|
+
const s = (input || "").trim();
|
|
66
66
|
const m = s.match(
|
|
67
67
|
/cubic-bezier\s*\(\s*([+-]?\d*\.?\d+)\s*,\s*([+-]?\d*\.?\d+)\s*,\s*([+-]?\d*\.?\d+)\s*,\s*([+-]?\d*\.?\d+)\s*\)\s*/i
|
|
68
68
|
);
|
|
69
69
|
|
|
70
|
-
return m ? [Number(m[1]), Number(m[2]), Number(m[3]), Number(m[4])] :
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function parseEasing(input) {
|
|
74
|
-
switch (input) {
|
|
75
|
-
case "linear":
|
|
76
|
-
return [0, 0, 1, 1];
|
|
77
|
-
case "ease":
|
|
78
|
-
return [0.25, 0.1, 0.25, 1];
|
|
79
|
-
case "ease-in":
|
|
80
|
-
return [0.42, 0, 1, 1];
|
|
81
|
-
case "ease-out":
|
|
82
|
-
return [0, 0, 0.58, 1];
|
|
83
|
-
case "ease-in-out":
|
|
84
|
-
return [0.42, 0, 0.58, 1];
|
|
85
|
-
default:
|
|
86
|
-
return input ? parseCubicBezier(input) : [0, 0, 1, 1];
|
|
87
|
-
}
|
|
70
|
+
return m ? [Number(m[1]), Number(m[2]), Number(m[3]), Number(m[4])] : null;
|
|
88
71
|
}
|
|
89
72
|
|
|
90
73
|
// -----------------------------------------------------------------------------
|
|
@@ -123,8 +106,9 @@ const chartVariables = {
|
|
|
123
106
|
inactive: "--kendo-chart-inactive",
|
|
124
107
|
initialAnimationDuration: '--kendo-duration-steady',
|
|
125
108
|
fadeInAnimationDuration: '--kendo-duration-rapid',
|
|
126
|
-
elasticEasing: '--kendo-easing-
|
|
109
|
+
elasticEasing: '--kendo-easing-stretchy',
|
|
127
110
|
linearEasing: '--kendo-easing-linear',
|
|
111
|
+
swingEasing: '--kendo-easing-standard',
|
|
128
112
|
};
|
|
129
113
|
|
|
130
114
|
// Sankey-specific variables (in addition to shared)
|
|
@@ -293,10 +277,11 @@ export const chartTheme = (element) => {
|
|
|
293
277
|
});
|
|
294
278
|
|
|
295
279
|
const motion = {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
280
|
+
steady: parseToMS(getProp(element, vars.initialAnimationDuration)) || 600,
|
|
281
|
+
rapid: parseToMS(getProp(element, vars.fadeInAnimationDuration)) || 200,
|
|
282
|
+
easeOutElastic: parseCubicBezier(getProp(element, vars.elasticEasing)) || [0.07, 1.81, 0.3, 0.81],
|
|
283
|
+
linear: parseCubicBezier(getProp(element, vars.linearEasing)) || [0, 0, 1, 1],
|
|
284
|
+
swing: parseCubicBezier(getProp(element, vars.swingEasing)) || [0.42, 0, 0.58, 1]
|
|
300
285
|
};
|
|
301
286
|
|
|
302
287
|
return {
|
|
@@ -323,6 +308,12 @@ export const chartTheme = (element) => {
|
|
|
323
308
|
font: defaultFont(element),
|
|
324
309
|
}
|
|
325
310
|
},
|
|
311
|
+
categoryAxis: {
|
|
312
|
+
highlight: {
|
|
313
|
+
color: "#8C9FD9",
|
|
314
|
+
opacity: 0.15
|
|
315
|
+
}
|
|
316
|
+
},
|
|
326
317
|
chartArea: {
|
|
327
318
|
background: chartBg,
|
|
328
319
|
},
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import { drawing as draw, geometry as geom } from '@progress/kendo-drawing';
|
|
2
|
-
|
|
3
|
-
import { INITIAL_ANIMATION_DURATION, BAR, START_SCALE } from '../constants';
|
|
4
|
-
|
|
2
|
+
import { BAR, START_SCALE } from '../constants';
|
|
5
3
|
import { X, Y } from '../../common/constants';
|
|
6
4
|
import { interpolateValue, setDefaultOptions } from '../../common';
|
|
7
|
-
import { easingMap } from './easingMap';
|
|
8
5
|
|
|
9
6
|
class BarChartAnimation extends draw.Animation {
|
|
10
|
-
|
|
11
7
|
setup() {
|
|
12
8
|
const { element, options } = this;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
options.motion.easing = easingMap[options.easing];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
9
|
+
|
|
10
|
+
options.duration = options.duration === undefined ? options.motionConfig.steady : options.duration;
|
|
11
|
+
options.easing = options.motionConfig[options.easing] || [];
|
|
19
12
|
|
|
20
13
|
const bbox = element.bbox();
|
|
21
14
|
|
|
@@ -50,7 +43,7 @@ class BarChartAnimation extends draw.Animation {
|
|
|
50
43
|
}
|
|
51
44
|
|
|
52
45
|
setDefaultOptions(BarChartAnimation, {
|
|
53
|
-
|
|
46
|
+
motionConfig: {}
|
|
54
47
|
});
|
|
55
48
|
|
|
56
49
|
draw.AnimationFactory.current.register(BAR, BarChartAnimation);
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { drawing as draw, geometry as geom } from '@progress/kendo-drawing';
|
|
2
|
-
|
|
3
2
|
import { START_SCALE, BUBBLE } from '../constants';
|
|
4
3
|
|
|
5
4
|
import { setDefaultOptions } from '../../common';
|
|
6
5
|
|
|
7
6
|
class BubbleAnimation extends draw.Animation {
|
|
8
7
|
setup() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const options = this.options;
|
|
9
|
+
options.duration = options.duration === undefined ? options.motionConfig.steady : options.duration;
|
|
10
|
+
options.easing = options.motionConfig.easeOutElastic || [];
|
|
11
|
+
|
|
13
12
|
const center = this.center = this.element.bbox().center();
|
|
14
13
|
this.element.transform(geom.transform()
|
|
15
14
|
.scale(START_SCALE, START_SCALE, center)
|
|
@@ -24,7 +23,7 @@ class BubbleAnimation extends draw.Animation {
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
setDefaultOptions(BubbleAnimation, {
|
|
27
|
-
|
|
26
|
+
motionConfig: {}
|
|
28
27
|
});
|
|
29
28
|
|
|
30
29
|
draw.AnimationFactory.current.register(BUBBLE, BubbleAnimation);
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { drawing as draw } from '@progress/kendo-drawing';
|
|
2
|
-
|
|
3
|
-
import { INITIAL_ANIMATION_DURATION } from '../constants';
|
|
4
|
-
|
|
5
2
|
import { interpolateValue, setDefaultOptions } from '../../common';
|
|
6
|
-
import { easingMap } from './easingMap';
|
|
7
3
|
|
|
8
4
|
class ClipAnimation extends draw.Animation {
|
|
9
5
|
setup() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this._setEnd(this.options.box.x1);
|
|
6
|
+
const options = this.options;
|
|
7
|
+
|
|
8
|
+
options.duration = options.duration === undefined ? options.motionConfig.steady : options.duration;
|
|
9
|
+
options.easing = options.motionConfig[options.easing] || [];
|
|
10
|
+
|
|
11
|
+
this._setEnd(options.box.x1);
|
|
17
12
|
}
|
|
18
13
|
|
|
19
14
|
step(pos) {
|
|
@@ -35,7 +30,7 @@ class ClipAnimation extends draw.Animation {
|
|
|
35
30
|
}
|
|
36
31
|
|
|
37
32
|
setDefaultOptions(ClipAnimation, {
|
|
38
|
-
|
|
33
|
+
motionConfig: {}
|
|
39
34
|
});
|
|
40
35
|
|
|
41
36
|
draw.AnimationFactory.current.register("clip", ClipAnimation);
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { drawing as draw } from '@progress/kendo-drawing';
|
|
2
|
-
|
|
3
2
|
import { FADEIN } from '../constants';
|
|
4
3
|
|
|
5
4
|
import { setDefaultOptions } from '../../common';
|
|
6
5
|
|
|
7
6
|
class FadeInAnimation extends draw.Animation {
|
|
8
7
|
setup() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const options = this.options;
|
|
9
|
+
options.duration = options.duration === undefined ? options.motionConfig.rapid : options.duration;
|
|
10
|
+
options.easing = options.motionConfig.linear || [];
|
|
11
|
+
|
|
13
12
|
this.fadeTo = this.element.opacity();
|
|
14
13
|
this.element.opacity(0);
|
|
15
14
|
}
|
|
@@ -20,8 +19,7 @@ class FadeInAnimation extends draw.Animation {
|
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
setDefaultOptions(FadeInAnimation, {
|
|
23
|
-
|
|
24
|
-
easing: "linear"
|
|
22
|
+
motionConfig: {}
|
|
25
23
|
});
|
|
26
24
|
|
|
27
25
|
draw.AnimationFactory.current.register(FADEIN, FadeInAnimation);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { drawing as draw, geometry as geom } from '@progress/kendo-drawing';
|
|
2
2
|
|
|
3
|
-
import { START_SCALE,
|
|
3
|
+
import { START_SCALE, PIE } from '../constants';
|
|
4
4
|
|
|
5
5
|
import { setDefaultOptions } from '../../common';
|
|
6
6
|
|
|
7
7
|
class PieAnimation extends draw.Animation {
|
|
8
8
|
setup() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const options = this.options;
|
|
10
|
+
options.duration = options.duration === undefined ? options.motionConfig.steady : options.duration;
|
|
11
|
+
options.easing = options.motionConfig.easeOutElastic || [];
|
|
12
|
+
|
|
13
13
|
this.element.transform(geom.transform()
|
|
14
14
|
.scale(START_SCALE, START_SCALE, this.options.center)
|
|
15
15
|
);
|
|
@@ -23,8 +23,7 @@ class PieAnimation extends draw.Animation {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
setDefaultOptions(PieAnimation, {
|
|
26
|
-
|
|
27
|
-
duration: INITIAL_ANIMATION_DURATION
|
|
26
|
+
motionConfig: {}
|
|
28
27
|
});
|
|
29
28
|
|
|
30
29
|
draw.AnimationFactory.current.register(PIE, PieAnimation);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ScatterChart from '../scatter-charts/scatter-chart';
|
|
2
2
|
import Bubble from './bubble';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { BUBBLE, INITIAL_ANIMATION_DURATION } from '../constants';
|
|
5
5
|
|
|
6
6
|
import { MIN_VALUE, CIRCLE } from '../../common/constants';
|
|
7
7
|
import { deepExtend, isFunction, setDefaultOptions, valueOrDefault } from '../../common';
|
|
@@ -34,10 +34,12 @@ class BubbleChart extends ScatterChart {
|
|
|
34
34
|
createPoint(value, fields) {
|
|
35
35
|
const series = fields.series;
|
|
36
36
|
const pointsCount = series.data.length;
|
|
37
|
-
const
|
|
37
|
+
const motion = this.chartService.chart ? this.chartService.chart.options.motion : { steady: INITIAL_ANIMATION_DURATION };
|
|
38
|
+
const initialDuration = motion.steady;
|
|
39
|
+
const delay = fields.pointIx * (initialDuration / pointsCount);
|
|
38
40
|
const animationOptions = {
|
|
39
41
|
delay: delay,
|
|
40
|
-
duration:
|
|
42
|
+
duration: initialDuration - delay,
|
|
41
43
|
type: BUBBLE
|
|
42
44
|
};
|
|
43
45
|
|
|
@@ -52,7 +54,7 @@ class BubbleChart extends ScatterChart {
|
|
|
52
54
|
labels: {
|
|
53
55
|
animation: {
|
|
54
56
|
delay: delay,
|
|
55
|
-
duration:
|
|
57
|
+
duration: initialDuration - delay
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
}, this.pointOptions(series, fields.seriesIx), {
|