-
Notifications
You must be signed in to change notification settings - Fork 19.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: #8962 闭合多边形时,如果第一个值为NaN,导致最后值也为NaN,渲染不出连接线。 #9162
Conversation
src/chart/radar/radarLayout.js
Outdated
@@ -38,7 +38,12 @@ export default function (ecModel) { | |||
|
|||
data.each(function (idx) { | |||
// Close polygon | |||
points[idx][0] && points[idx].push(points[idx][0].slice()); | |||
|
|||
let index = points[idx].findIndex(([x, y]) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要用 ES6 的语法,跟 ECharts 项目保持一致吧。所以 let、findIndex、箭头表达式就不要用了。
src/chart/radar/radarLayout.js
Outdated
return !isNaN(x) && !isNaN(y) | ||
}) | ||
|
||
index >= 0 && points[idx].push(points[idx][index].slice()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
增加些英文注释,这个修改什么意思?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very close now! 😄
Please undo the changes under dist
.
You may write some meaningful comments for each commit, instead of the same one.
src/chart/radar/radarLayout.js
Outdated
@@ -38,8 +39,19 @@ export default function (ecModel) { | |||
|
|||
data.each(function (idx) { | |||
// Close polygon | |||
points[idx][0] && points[idx].push(points[idx][0].slice()); | |||
|
|||
var _idx = findFirstNotNaNPoint() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ECharts use camel cases, and it's better to name it something meaningful, like firstId
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add ;
at the end of each line. Also note other places.
src/chart/radar/radarLayout.js
Outdated
data.setItemLayout(idx, points[idx]); | ||
|
||
function findFirstNotNaNPoint(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be function findFirstNotNaNPoint() {
src/chart/radar/radarLayout.js
Outdated
data.setItemLayout(idx, points[idx]); | ||
|
||
function findFirstNotNaNPoint(){ | ||
var _value = zrUtil.find(points[idx], function (point) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value
instead of _value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank for your very nice teach! I'm really new for git collaboration. I rebased my commits.
but maybe we need some contributing guidelines?
I didn't actually thing, if I pass NaN value to render, connect line often disappear when I move mouse or hover point. i dont know what cause the bug yet. I will try to do it
ps: very like your video , i can't wait for next.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but should we pass a NaN value to render when we not need a value (such as type "-")?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more change needed, and it will be merged! 😄
src/chart/radar/radarLayout.js
Outdated
function findFirstActualPoint() { | ||
return zrUtil.find(points[idx], function (point) { | ||
return !isNaN(point[0]) && !isNaN(point[1]); | ||
}) || ["NaN", "NaN"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"
shoud be '
.
Thanks for your contribution! Now you are one of the ECharts contributors. Since we joined Apache group, you need to assign ICLA for your first PR. And are you interested in being an ECharts committer? This has more restrict rules than contributors. Committers are those who contribute more frequently and play more important roles on ECharts project. After being a committer:
If you are interested, here's what you can do:
And you will be invited to be a committer when we think your contribution and knowledge of ECharts project is enough. We are looking forward to this! 😃 |
…… mange -> manage? ok.It's so cool ! I will send recently. but I don't understand the meaning of optional blank filling . What is it used for ? Thanks for very nice teach! |
What is blank filling? |
sorry... 😭 |
Never mind. You will get informed if anything goes wrong. |
另外:如果data中包含非Number类型,animation 过程中移动鼠标,导致连接线消失