Skip to content
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

Merged
merged 3 commits into from
Jul 27, 2020
Merged

feat(v2/pie): 饼图字段配置错误处理 #1321

merged 3 commits into from
Jul 27, 2020

Conversation

visiky
Copy link
Member

@visiky visiky commented Jul 22, 2020

  • 饼图、环图字段配置错误 可正常绘制,不触发 out-of-memory

@auto-add-label auto-add-label bot added the enhancement New feature or request label Jul 22, 2020
Copy link

@tests-checker tests-checker bot left a 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?

@visiky visiky marked this pull request as draft July 22, 2020 06:56
@visiky visiky linked an issue Jul 22, 2020 that may be closed by this pull request
@visiky visiky added this to the v2 milestone Jul 22, 2020
@hustcc
Copy link
Member

hustcc commented Jul 22, 2020

测试一下饼图中,如果 value 中有字母的情况下,不要出现 oom,报错都是 ok 的。

@visiky
Copy link
Member Author

visiky commented Jul 22, 2020

测试一下饼图中,如果 value 中有字母的情况下,不要出现 oom,报错都是 ok 的。

看了下,是 G2 冒出来的

@hustcc
Copy link
Member

hustcc commented Jul 22, 2020

测试一下饼图中,如果 value 中有字母的情况下,不要出现 oom,报错都是 ok 的。

看了下,是 G2 冒出来的

那就提到 G2 需求中。

@visiky visiky changed the title feat(v2/pie): 饼图增强 feat(v2/pie): 饼图字段配置错误处理 Jul 26, 2020
@visiky visiky marked this pull request as ready for review July 26, 2020 12:59
@visiky visiky requested a review from hustcc July 26, 2020 13:00
src/plots/pie/adaptor.ts Outdated Show resolved Hide resolved
src/plots/pie/adaptor.ts Outdated Show resolved Hide resolved
src/plots/pie/adaptor.ts Outdated Show resolved Hide resolved
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');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 这个是会直接 throw 哦,单测应该会挂掉~

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那我还是先用 console 把,哈哈哈

@visiky visiky force-pushed the v2-pie-enhance branch 2 times, most recently from 097f35d to f763e8d Compare July 27, 2020 03:02
angleField 对应的数据为number类型或为空时,正常显示,其他进行筛选过滤,从而避免触发 out of memory
@hustcc hustcc self-requested a review July 27, 2020 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR: merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Donut的Out of Memory问题
2 participants