提交 800ba5b8 编写于 作者: P pissang

Merge branch 'next' into label-enhancement

此差异已折叠。
......@@ -95,7 +95,7 @@ class Symbol extends graphic.Group {
* @param {boolean} toLastFrame
*/
stopSymbolAnimation(toLastFrame: boolean) {
this.childAt(0).stopAnimation('', toLastFrame);
this.childAt(0).stopAnimation(null, toLastFrame);
}
/**
......
......@@ -501,7 +501,7 @@ class LineView extends ChartView {
// Stop symbol animation and sync with line points
// FIXME performance?
data.eachItemGraphicEl(function (el) {
el.stopAnimation('', true);
el.stopAnimation(null, true);
});
// In the case data zoom triggerred refreshing frequently
......
......@@ -795,7 +795,7 @@ function pointerMoveTo(
pointer.y = 0;
}
else {
pointer.stopAnimation('', true);
pointer.stopAnimation(null, true);
pointer.animateTo({
x: toCoord,
y: 0
......
......@@ -554,7 +554,7 @@ class ECharts extends Eventful {
const list = zr.storage.getDisplayList();
// Stop animations
zrUtil.each(list, function (el: Element) {
el.stopAnimation('', true);
el.stopAnimation(null, true);
});
return (zr.painter as SVGPainter).toDataURL();
......
......@@ -74,6 +74,7 @@ const GRAPHIC_KEYS = [
'Image',
'Text',
'Circle',
'Ellipse',
'Sector',
'Ring',
'Polygon',
......
......@@ -27,6 +27,7 @@ import ZRImage, { ImageStyleProps } from 'zrender/src/graphic/Image';
import Group from 'zrender/src/graphic/Group';
import ZRText, { TextStyleProps } from 'zrender/src/graphic/Text';
import Circle from 'zrender/src/graphic/shape/Circle';
import Ellipse from 'zrender/src/graphic/shape/Ellipse';
import Sector from 'zrender/src/graphic/shape/Sector';
import Ring from 'zrender/src/graphic/shape/Ring';
import Polygon from 'zrender/src/graphic/shape/Polygon';
......@@ -1664,6 +1665,7 @@ export const getECData = makeInner<ECData, Element>();
// Register built-in shapes. These shapes might be overwirtten
// by users, although we do not recommend that.
registerShape('circle', Circle);
registerShape('ellipse', Ellipse);
registerShape('sector', Sector);
registerShape('ring', Ring);
registerShape('polygon', Polygon);
......@@ -1678,6 +1680,7 @@ export {
ZRImage as Image,
ZRText as Text,
Circle,
Ellipse,
Sector,
Ring,
Polygon,
......
......@@ -177,9 +177,11 @@ under the License.
children.push({
type: 'polygon',
shape: {
points: makeShapePoints(api, valOnRadius, valOnAngle),
points: makeShapePoints(api, valOnRadius, valOnAngle)
},
extra: {
valOnAngle: valOnAngle,
$transition: 'valOnAngle'
transition: 'valOnAngle'
},
style: {
lineWidth: 1,
......@@ -188,7 +190,7 @@ under the License.
},
during: function (apiDuring) {
apiDuring.setShape('points', makeShapePoints(
api, valOnRadius, apiDuring.getShape('valOnAngle')
api, valOnRadius, apiDuring.getExtra('valOnAngle')
));
}
});
......@@ -217,9 +219,10 @@ under the License.
type: 'text',
x: point[0],
y: point[1],
shape: {
transition: [],
extra: {
valOnAngle: valOnAngle,
$transition: 'valOnAngle'
transition: 'valOnAngle'
},
style: {
text: getText(valOnAngle),
......@@ -232,7 +235,7 @@ under the License.
},
z2: 50,
during: function (apiDuring) {
var iValOnAngle = apiDuring.getShape('valOnAngle');
var iValOnAngle = apiDuring.getExtra('valOnAngle');
var point = makeLabelPosition(api, valOnRadius, iValOnAngle);
apiDuring.setTransform('x', point[0]).setTransform('y', point[1]);
apiDuring.setStyle('text', getText(iValOnAngle));
......@@ -403,11 +406,13 @@ under the License.
children.push({
type: 'polygon',
shape: {
points: makeShapePoints(params, widthRadius, startRadius, endRadian),
points: makeShapePoints(params, widthRadius, startRadius, endRadian)
},
extra: {
widthRadius: widthRadius,
startRadius: startRadius,
endRadian: endRadian,
$transition: ['widthRadius', 'startRadius', 'endRadian']
transition: ['widthRadius', 'startRadius', 'endRadian']
},
style: {
lineWidth: 1,
......@@ -417,9 +422,9 @@ under the License.
during: function (apiDuring) {
apiDuring.setShape('points', makeShapePoints(
params,
apiDuring.getShape('widthRadius'),
apiDuring.getShape('startRadius'),
apiDuring.getShape('endRadian')
apiDuring.getExtra('widthRadius'),
apiDuring.getExtra('startRadius'),
apiDuring.getExtra('endRadian')
));
}
});
......@@ -460,11 +465,12 @@ under the License.
type: 'text',
x: point[0],
y: point[1],
shape: {
transition: [],
extra: {
startRadius: startRadius,
endRadian: endRadian,
widthRadius: widthRadius,
$transition: ['startRadius', 'endRadian', 'widthRadius']
transition: ['startRadius', 'endRadian', 'widthRadius']
},
style: {
text: makeText(endRadian),
......@@ -481,11 +487,11 @@ under the License.
},
z2: 50,
during: function (apiDuring) {
var endRadian = apiDuring.getShape('endRadian');
var endRadian = apiDuring.getExtra('endRadian');
var point = makeLabelPosition(
params,
apiDuring.getShape('widthRadius'),
apiDuring.getShape('startRadius'),
apiDuring.getExtra('widthRadius'),
apiDuring.getExtra('startRadius'),
endRadian
);
apiDuring.setTransform('x', point[0]).setTransform('y', point[1]);
......@@ -652,8 +658,8 @@ under the License.
// polor: anticlockwise-positive radian
// sector: clockwise-positive radian
endAngle: -polarEndRadian,
$transition: 'endAngle',
$enterFrom: { endAngle: 0 }
transition: 'endAngle',
enterFrom: { endAngle: 0 }
}
}
}, {
......@@ -663,14 +669,16 @@ under the License.
type: 'polygon',
shape: {
points: makePionterPoints(params, polarEndRadian),
},
extra: {
polarEndRadian: polarEndRadian,
$transition: 'polarEndRadian',
$enterFrom: { polarEndRadian: 0 }
transition: 'polarEndRadian',
enterFrom: { polarEndRadian: 0 }
},
during: function (apiDuring) {
apiDuring.setShape(
'points',
makePionterPoints(params, apiDuring.getShape('polarEndRadian'))
makePionterPoints(params, apiDuring.getExtra('polarEndRadian'))
);
}
},
......@@ -690,10 +698,10 @@ under the License.
}
}, {
type: 'text',
shape: {
extra: {
valOnRadian: valOnRadian,
$transition: 'valOnRadian',
$enterFrom: { valOnRadian: 0 }
transition: 'valOnRadian',
enterFrom: { valOnRadian: 0 }
},
style: {
text: makeText(valOnRadian),
......@@ -703,10 +711,10 @@ under the License.
fill: 'rgb(0,50,190)',
align: 'center',
verticalAlign: 'middle',
$enterFrom: { opacity: 0 }
enterFrom: { opacity: 0 }
},
during: function (apiDuring) {
apiDuring.setStyle('text', makeText(apiDuring.getShape('valOnRadian')));
apiDuring.setStyle('text', makeText(apiDuring.getExtra('valOnRadian')));
}
}]
};
......@@ -961,7 +969,7 @@ under the License.
},
style: {
fill: 'blue',
// $enterFrom: { opacity: 0 }
// enterFrom: { opacity: 0 }
}
}, {
type: 'circle',
......@@ -972,7 +980,7 @@ under the License.
},
style: {
fill: 'green',
// $enterFrom: { opacity: 0 }
// enterFrom: { opacity: 0 }
},
textConfig: {
position: 'bottom'
......@@ -981,7 +989,7 @@ under the License.
style: {
text: 'xxxx',
fill: 'black',
// $enterFrom: { opacity: 0 }
// enterFrom: { opacity: 0 }
}
}
}]
......@@ -1078,7 +1086,7 @@ under the License.
type: 'group',
x: pos[0],
y: pos[1],
$enterFrom: {
enterFrom: {
y: 0
},
children: [{
......@@ -1164,7 +1172,7 @@ under the License.
y: params.coordSys.y,
width: params.coordSys.width,
height: params.coordSys.height,
$enterFrom: {width: 0}
enterFrom: {width: 0}
}
}
};
......@@ -1225,7 +1233,7 @@ under the License.
style: {
image: weatherIcons.Showers,
width: width,
$transition: 'width'
transition: 'width'
}
};
},
......@@ -1277,7 +1285,7 @@ under the License.
x: pos[0],
y: pos[1],
rotation: pos[0] / 500 * Math.PI,
$transition: ['rotation'],
transition: ['rotation'],
originX: -50,
originY: 50,
children: [{
......@@ -1291,7 +1299,7 @@ under the License.
},
style: {
fill: 'green',
$enterFrom: { opacity: 0 }
enterFrom: { opacity: 0 }
}
}, {
type: 'circle',
......@@ -1302,7 +1310,7 @@ under the License.
},
style: {
fill: 'blue',
$enterFrom: { opacity: 0 }
enterFrom: { opacity: 0 }
},
textConfig: {
position: 'bottom'
......@@ -1311,7 +1319,7 @@ under the License.
style: {
text: 'xxxx',
fill: 'black',
$enterFrom: { opacity: 0 }
enterFrom: { opacity: 0 }
}
}
}]
......@@ -1363,7 +1371,7 @@ under the License.
return {
type: 'rect',
position: pos,
$transition: [],
transition: [],
shape: {
x: -50,
y: 50,
......@@ -1373,7 +1381,7 @@ under the License.
},
style: {
fill: 'green',
$enterFrom: { opacity: 0 }
enterFrom: { opacity: 0 }
}
};
},
......@@ -1426,10 +1434,10 @@ under the License.
x: pos[0],
y: pos[1],
rotation: pos[0] / 500 * Math.PI,
$transition: ['x', 'y', 'rotation'],
transition: ['x', 'y', 'rotation'],
originX: -50,
originY: 50,
$leaveTo: {scaleX: 0, scaleY: 0},
leaveTo: {scaleX: 0, scaleY: 0},
children: [{
type: 'rect',
shape: {
......@@ -1441,7 +1449,7 @@ under the License.
},
style: {
fill: 'green',
$enterFrom: { opacity: 0 }
enterFrom: { opacity: 0 }
}
}, {
type: 'circle',
......@@ -1452,7 +1460,7 @@ under the License.
},
style: {
fill: 'blue',
$enterFrom: { opacity: 0 }
enterFrom: { opacity: 0 }
},
textConfig: {
position: 'bottom'
......@@ -1461,7 +1469,7 @@ under the License.
style: {
text: 'xxxx',
fill: 'black',
$enterFrom: { opacity: 0 }
enterFrom: { opacity: 0 }
}
}
}]
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册