Ovilia commented on code in PR #21081:
URL: https://github.com/apache/echarts/pull/21081#discussion_r2218533938
##########
src/chart/radar/RadarView.ts:
##########
@@ -215,53 +215,79 @@ class RadarView extends ChartView {
polygon.useStyle(
zrUtil.defaults(
- areaStyleModel.getAreaStyle(),
+ itemModel.getModel('areaStyle').getAreaStyle(),
{
fill: color,
- opacity: 0.7,
Review Comment:
This doesn't seem should be removed.
##########
src/chart/radar/RadarView.ts:
##########
@@ -215,53 +215,79 @@ class RadarView extends ChartView {
polygon.useStyle(
zrUtil.defaults(
- areaStyleModel.getAreaStyle(),
+ itemModel.getModel('areaStyle').getAreaStyle(),
{
fill: color,
- opacity: 0.7,
decal: itemStyle.decal
}
)
);
- const emphasisModel = itemModel.getModel('emphasis');
- const itemHoverStyle =
emphasisModel.getModel('itemStyle').getItemStyle();
- symbolGroup.eachChild(function (symbolPath: RadarSymbol) {
+ symbolGroup.eachChild(function(symbolPath: RadarSymbol) {
if (symbolPath instanceof ZRImage) {
- const pathStyle = symbolPath.style;
- symbolPath.useStyle(zrUtil.extend({
- // TODO other properties like x, y ?
- image: pathStyle.image,
- x: pathStyle.x, y: pathStyle.y,
- width: pathStyle.width, height: pathStyle.height
- }, itemStyle));
+ const ps = symbolPath.style
+ symbolPath.useStyle(
+ zrUtil.extend(
+ {
+ image: ps.image,
+ x: ps.x,
+ y: ps.y,
+ width: ps.width,
+ height: ps.height,
+ },
+ itemStyle,
+ ),
+ )
+ } else {
+ symbolPath.useStyle(itemStyle)
+ symbolPath.setColor(color)
+ symbolPath.style.strokeNoScale = true
}
- else {
- symbolPath.useStyle(itemStyle);
- symbolPath.setColor(color);
- symbolPath.style.strokeNoScale = true;
+ const emphasisModel = itemModel.getModel('emphasis')
+ const hoverStyle =
emphasisModel.getModel('itemStyle').getItemStyle()
+ symbolPath.ensureState('emphasis').style =
zrUtil.clone(hoverStyle)
+ let txt =
data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx)
+ if (txt == null || isNaN(txt as number)) {
+ txt = ''
Review Comment:
Please explain why these code changed from outside `if-else` into `else`
clause?
##########
src/chart/radar/RadarView.ts:
##########
@@ -215,53 +215,79 @@ class RadarView extends ChartView {
polygon.useStyle(
zrUtil.defaults(
- areaStyleModel.getAreaStyle(),
+ itemModel.getModel('areaStyle').getAreaStyle(),
{
fill: color,
- opacity: 0.7,
decal: itemStyle.decal
}
)
);
- const emphasisModel = itemModel.getModel('emphasis');
- const itemHoverStyle =
emphasisModel.getModel('itemStyle').getItemStyle();
- symbolGroup.eachChild(function (symbolPath: RadarSymbol) {
+ symbolGroup.eachChild(function(symbolPath: RadarSymbol) {
if (symbolPath instanceof ZRImage) {
- const pathStyle = symbolPath.style;
- symbolPath.useStyle(zrUtil.extend({
- // TODO other properties like x, y ?
- image: pathStyle.image,
- x: pathStyle.x, y: pathStyle.y,
- width: pathStyle.width, height: pathStyle.height
- }, itemStyle));
+ const ps = symbolPath.style
+ symbolPath.useStyle(
+ zrUtil.extend(
+ {
+ image: ps.image,
+ x: ps.x,
+ y: ps.y,
+ width: ps.width,
+ height: ps.height,
+ },
+ itemStyle,
+ ),
+ )
+ } else {
+ symbolPath.useStyle(itemStyle)
+ symbolPath.setColor(color)
+ symbolPath.style.strokeNoScale = true
}
- else {
- symbolPath.useStyle(itemStyle);
- symbolPath.setColor(color);
- symbolPath.style.strokeNoScale = true;
+ const emphasisModel = itemModel.getModel('emphasis')
+ const hoverStyle =
emphasisModel.getModel('itemStyle').getItemStyle()
+ symbolPath.ensureState('emphasis').style =
zrUtil.clone(hoverStyle)
+ let txt =
data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx)
+ if (txt == null || isNaN(txt as number)) {
+ txt = ''
}
-
- const pathEmphasisState = symbolPath.ensureState('emphasis');
- pathEmphasisState.style = zrUtil.clone(itemHoverStyle);
- let defaultText =
data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx);
- (defaultText == null || isNaN(defaultText as number)) &&
(defaultText = '');
-
setLabelStyle(
symbolPath, getLabelStatesModels(itemModel),
{
labelFetcher: data.hostModel,
labelDataIndex: idx,
labelDimIndex: symbolPath.__dimIdx,
- defaultText: defaultText as string,
- inheritColor: color as ColorString,
- defaultOpacity: itemStyle.opacity
+ defaultText: txt as string,
+ inheritColor: color,
+ defaultOpacity: itemStyle.opacity,
Review Comment:
Revert the changes if they are not related to this PR.
##########
src/chart/radar/RadarView.ts:
##########
@@ -215,53 +215,79 @@ class RadarView extends ChartView {
Review Comment:
Can we move the logic of `bindStateStyles` here in the loop of
`zrUtil.each(['emphasis', 'select', 'blur'] `?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]