提交 63dfb28b 编写于 作者: 1 100pah

fix: rename 'shapeMorphing' to 'morph' in option.

上级 5ae6bded
......@@ -125,7 +125,7 @@ type ShapeMorphingOption = {
* If do shape morphing animation when type is changed.
* Only available on path.
*/
shapeMorphing?: boolean
morph?: boolean
};
interface CustomBaseElementOption extends Partial<Pick<
......@@ -1564,7 +1564,7 @@ function createOrUpdateItem(
function applyShapeMorphingAnimation(oldEl: Element, el: Element, seriesModel: SeriesModel, dataIndex: number) {
if (!((oldEl instanceof graphicUtil.Path) && (el instanceof graphicUtil.Path))) {
if (__DEV__) {
logError('shapeMorphing can only be applied on two paths.');
logError('`morph` can only be applied on two paths.');
}
return;
}
......@@ -1620,9 +1620,9 @@ function doCreateOrUpdateEl(
}
// Do shape morphing
if ((elOption as CustomZRPathOption).shapeMorphing && el && oldEl && (el !== oldEl)) {
if ((elOption as CustomZRPathOption).morph && el && oldEl && (el !== oldEl)) {
needsMorphing = true;
// Use update animation when shapeMorphing is enabled.
// Use update animation when morph is enabled.
isInit = false;
}
......
......@@ -188,7 +188,7 @@ under the License.
type: 'group',
children: [{
type,
shapeMorphing: true,
morph: true,
shape: type === 'polygon' ? {
points: points
} : {
......@@ -204,7 +204,7 @@ under the License.
}
}, {
type,
shapeMorphing: true,
morph: true,
shape: type === 'polygon' ? {
points: pointsBG
} : {
......
......@@ -159,7 +159,7 @@ under the License.
}
return {
type: 'polygon',
shapeMorphing: true,
morph: true,
shape: {
points: newPoints
},
......@@ -181,7 +181,7 @@ under the License.
const width = 20;
return {
type: 'rect',
shapeMorphing: true,
morph: true,
shape: {
x: start[0] - width / 2,
y: start[1],
......@@ -202,7 +202,7 @@ under the License.
const center = api.coord([params.dataIndex, api.value(1)]);
return {
type: 'circle',
shapeMorphing: true,
morph: true,
shape: {
cx: center[0],
cy: center[1],
......@@ -256,7 +256,7 @@ under the License.
const height = myChart.getHeight();
return {
type: 'sector',
shapeMorphing: true,
morph: true,
shape: {
cx: width / 2,
cy: height / 2,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册