提交 5a1bced3 编写于 作者: O Ovilia

refactor(sunburst): remove normal

上级 e7888ee4
......@@ -25,7 +25,7 @@ function SunburstPiece(node, seriesModel, ecModel) {
});
var text = new graphic.Text({
z2: DEFAULT_TEXT_Z,
silent: node.getModel('label.normal').get('silent')
silent: node.getModel('label').get('silent')
});
this.add(sector);
this.add(text);
......@@ -71,7 +71,7 @@ SunburstPieceProto.updateData = function (
var itemStyleModel = itemModel.getModel('itemStyle');
var visualColor = getNodeColor(node, seriesModel, ecModel);
var normalStyle = itemStyleModel.getModel('normal').getItemStyle();
var normalStyle = itemStyleModel.getItemStyle();
var style;
if (state === 'normal') {
style = normalStyle;
......@@ -161,7 +161,7 @@ SunburstPieceProto.onDownplay = function () {
SunburstPieceProto._updateLabel = function (seriesModel, ecModel, visualColor) {
var itemModel = this.node.getModel();
var labelModel = itemModel.getModel('label.normal');
var labelModel = itemModel.getModel('label');
var labelHoverModel = itemModel.getModel('label.emphasis');
var text = zrUtil.retrieve(
......@@ -307,7 +307,7 @@ function getNodeColor(node, seriesModel, ecModel) {
}
// Self color or level color
var color = node.getModel('itemStyle.normal').get('color');
var color = node.getModel('itemStyle').get('color');
if (color) {
return color;
}
......
......@@ -79,24 +79,20 @@ export default SeriesModel.extend({
renderLabelForZeroData: false,
label: {
normal: {
// could be: 'radial', 'tangential', or 'none'
rotate: 'radial',
show: true,
// could be 'inner', 'outside', 'left' or 'right'
// 'left' is for inner side of inside, and 'right' is for outter
// side for inside
position: 'inner',
padding: 5,
silent: true
},
// could be: 'radial', 'tangential', or 'none'
rotate: 'radial',
show: true,
// could be 'inner', 'outside', 'left' or 'right'
// 'left' is for inner side of inside, and 'right' is for outter
// side for inside
position: 'inner',
padding: 5,
silent: true,
emphasis: {}
},
itemStyle: {
normal: {
borderWidth: 1,
borderColor: 'white'
},
borderWidth: 1,
borderColor: 'white',
emphasis: {},
highlight: {
opacity: 1
......
......@@ -26,24 +26,16 @@
var itemStyle = {
star5: {
normal: {
color: colors[0]
}
color: colors[0]
},
star4: {
normal: {
color: colors[1]
}
color: colors[1]
},
star3: {
normal: {
color: colors[2]
}
color: colors[2]
},
star2: {
normal: {
color: colors[3]
}
color: colors[3]
}
};
......@@ -104,9 +96,7 @@
}, {
name: '非虚构',
itemStyle: {
normal: {
color: colors[2]
}
color: colors[2]
},
children: [{
name: '设计',
......@@ -253,9 +243,7 @@
})(block[star].name);
block[star].label = {
normal: {
color: style.normal.color
},
color: style.color,
downplay: {
opacity: 0.5
}
......@@ -263,19 +251,15 @@
if (block[star].children) {
style = {
normal: {
opacity: 1,
color: style.normal.color
}
opacity: 1,
color: style.color
};
block[star].children.forEach(function (book) {
book.value = 1;
book.itemStyle = style;
book.label = {
normal: {
color: style.normal.color
}
color: style.color
};
var value = 1;
......@@ -297,9 +281,7 @@
}
level1[i].itemStyle = {
normal: {
color: data[j].itemStyle.normal.color
}
color: data[j].itemStyle.color
};
}
}
......@@ -327,24 +309,18 @@
}
},
label: {
normal: {
rotate: 'radial',
color: bgColor
}
rotate: 'radial',
color: bgColor
},
itemStyle: {
normal: {
borderColor: bgColor,
borderWidth: 2
}
borderColor: bgColor,
borderWidth: 2
},
levels: [{}, {
r0: 0,
r: 40,
label: {
normal: {
rotate: 'none'
}
rotate: 'none'
}
}, {
r0: 40,
......@@ -353,34 +329,26 @@
r0: 115,
r: 140,
itemStyle: {
normal: {
shadowBlur: 2,
shadowColor: colors[2],
color: 'transparent'
}
shadowBlur: 2,
shadowColor: colors[2],
color: 'transparent'
},
label: {
normal: {
rotate: 'tangential',
fontSize: 10,
color: colors[0]
}
rotate: 'tangential',
fontSize: 10,
color: colors[0]
}
}, {
r0: 140,
r: 145,
itemStyle: {
normal: {
shadowBlur: 80,
shadowColor: colors[0]
}
shadowBlur: 80,
shadowColor: colors[0]
},
label: {
normal: {
position: 'outside',
textShadowBlur: 5,
textShadowColor: '#333'
},
position: 'outside',
textShadowBlur: 5,
textShadowColor: '#333',
downplay: {
opacity: 0.5
}
......
此差异已折叠。
......@@ -25,19 +25,13 @@
});
var item1 = {
normal: {
color: '#F54F4A'
}
color: '#F54F4A'
};
var item2 = {
normal: {
color: '#FF8C75'
}
color: '#FF8C75'
};
var item3 = {
normal: {
color: '#FFB499'
}
color: '#FFB499'
};
var data = [{
......
......@@ -56,9 +56,7 @@
name: 'Me',
value: 5,
itemStyle: {
normal: {
color: 'red'
}
color: 'red'
}
}, {
name: 'Brother Peter',
......@@ -109,9 +107,7 @@
data: data,
radius: [0, '90%'],
label: {
normal: {
rotate: 'radial'
}
rotate: 'radial'
}
}
});
......
......@@ -36,9 +36,7 @@
name: 'Cousin Mary',
value: 5,
itemStyle: {
normal: {
opacity: 0.2
}
opacity: 0.2
},
children: [{
name: 'Jackson',
......@@ -49,9 +47,7 @@
value: 4
}],
itemStyle: {
normal: {
color: '#660'
}
color: '#660'
}
}, {
name: 'Aunt Jane',
......@@ -59,9 +55,7 @@
name: 'Cousin Kate',
value: 4,
itemStyle: {
normal: {
color: 'blue'
}
color: '#660'
}
}]
}, {
......@@ -122,47 +116,33 @@
data: data,
radius: [0, '90%'],
label: {
normal: {
rotate: 'radial'
}
rotate: 'radial'
},
levels: [{
itemStyle: {
normal: {
opacity: 1,
color: '#70d'
}
opacity: 1,
color: '#70d'
}
}, {
itemStyle: {
normal: {
opacity: 0.8,
color: '#f0f'
}
opacity: 0.8,
color: '#f0f'
},
label: {
normal: {
opacity: 0.8,
formatter: '{a}: {b}'
}
opacity: 0.8,
formatter: '{a}: {b}'
}
}, {
itemStyle: {
normal: {
opacity: 0.6,
color: '#00f'
}
opacity: 0.6,
color: '#00f'
},
label: {
normal: {
opacity: 0.6
}
opacity: 0.6
}
}, {
itemStyle: {
normal: {
opacity: 0.4
}
opacity: 0.4
}
}]
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册