-
Notifications
You must be signed in to change notification settings - Fork 605
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
feat(v2/pie): 饼图字段配置错误处理 #1321
feat(v2/pie): 饼图字段配置错误处理 #1321
Conversation
visiky
commented
Jul 22, 2020
- 饼图、环图字段配置错误 可正常绘制,不触发 out-of-memory
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.
Could you please add tests to make sure this change works as expected?
测试一下饼图中,如果 value 中有字母的情况下,不要出现 oom,报错都是 ok 的。 |
看了下,是 G2 冒出来的 |
dc8e717
to
18bb397
Compare
那就提到 G2 需求中。 |
a40865d
to
a64ae03
Compare
src/plots/pie/adaptor.ts
Outdated
chart.data(data); | ||
// 处理不合法的数据 | ||
const processData = filter(data, (d) => typeof d[angleField] === 'number' || isNil(d[angleField])); | ||
invariant(processData.length === data.length, 'Please check whether there exists illegal data'); |
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.
nit: 这个是会直接 throw 哦,单测应该会挂掉~
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.
那我还是先用 console 把,哈哈哈
097f35d
to
f763e8d
Compare
angleField 对应的数据为number类型或为空时,正常显示,其他进行筛选过滤,从而避免触发 out of memory