@progress/kendo-charts 2.10.0-develop.3 → 2.10.0
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 +4 -8
- package/dist/es/chart/mixins/clip-animation-mixin.js +3 -3
- package/dist/es/chart/theme/load-theme.js +9 -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 +4 -8
- package/dist/es2015/chart/mixins/clip-animation-mixin.js +3 -3
- package/dist/es2015/chart/theme/load-theme.js +9 -24
- package/dist/npm/main.js +48 -80
- 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
|
});
|
|
@@ -2402,9 +2400,7 @@ function triggerPaneRender(panes) {
|
|
|
2402
2400
|
|
|
2403
2401
|
setDefaultOptions(Chart, {
|
|
2404
2402
|
renderAs: "",
|
|
2405
|
-
motion: {
|
|
2406
|
-
enabled: false,
|
|
2407
|
-
},
|
|
2403
|
+
motion: {},
|
|
2408
2404
|
chartArea: {},
|
|
2409
2405
|
legend: {
|
|
2410
2406
|
visible: true,
|
|
@@ -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
|
}
|
|
@@ -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 {
|
|
@@ -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), {
|
|
@@ -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
|
});
|
|
@@ -2402,9 +2400,7 @@ function triggerPaneRender(panes) {
|
|
|
2402
2400
|
|
|
2403
2401
|
setDefaultOptions(Chart, {
|
|
2404
2402
|
renderAs: "",
|
|
2405
|
-
motion: {
|
|
2406
|
-
enabled: false,
|
|
2407
|
-
},
|
|
2403
|
+
motion: {},
|
|
2408
2404
|
chartArea: {},
|
|
2409
2405
|
legend: {
|
|
2410
2406
|
visible: true,
|
|
@@ -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
|
}
|
|
@@ -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 {
|