Skip to content

feat: 迷你折线图和迷你柱形图重写changeData && 添加单测 #2177

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

Merged
merged 12 commits into from
Jan 6, 2021

Conversation

yp0413150120
Copy link
Contributor

PR includes

override the changeData method of tiny-line

  • add / modify test cases

@coveralls
Copy link

coveralls commented Jan 5, 2021

Pull Request Test Coverage Report for Build 465392983

  • 22 of 22 (100.0%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.008%) to 96.822%

Totals Coverage Status
Change from base Build 463240521: 0.008%
Covered Lines: 4496
Relevant Lines: 4534

💛 - Coveralls

@yp0413150120 yp0413150120 marked this pull request as draft January 6, 2021 03:22
@yp0413150120 yp0413150120 marked this pull request as ready for review January 6, 2021 03:45

export function getTinyData(data: number[]) {
return map(data || [], (y: number, x: number) => {
return { x, y };
Copy link
Member

@hustcc hustcc Jan 6, 2021

Choose a reason for hiding this comment

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

x: ${x}

变成字符串。这个方法直接放到 plots/line 里面的 util 吧,其他图从 line 里面引入即可。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

*/
public changeData(data: TinyColumnOptions['data']) {
this.updateOption({ data });
const newData = map(data, (y: number, x: number) => {
Copy link
Member

@hustcc hustcc Jan 6, 2021

Choose a reason for hiding this comment

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

getTinyData,同理 column 的 adaptor 中也用 getTinyData

const inValidData_2 = getTinyData(null);
expect(inValidData_2).toEqual([]);
});
});
Copy link
Member

Choose a reason for hiding this comment

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

单测写的很赞 👍

@yp0413150120 yp0413150120 changed the title feat: 迷你折线图重写changeData && 添加单测 feat: 迷你折线图和迷你柱形图重写changeData && 添加单测 Jan 6, 2021
@lgtm-com
Copy link

lgtm-com bot commented Jan 6, 2021

This pull request introduces 1 alert when merging 11db37d into b46e6b3 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@hustcc hustcc merged commit 921deb6 into antvis:master Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants