-
Notifications
You must be signed in to change notification settings - Fork 601
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
Conversation
Pull Request Test Coverage Report for Build 465392983
💛 - Coveralls |
src/utils/getTinyData.ts
Outdated
|
||
export function getTinyData(data: number[]) { | ||
return map(data || [], (y: number, x: number) => { | ||
return { 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.
x:
${x}
变成字符串。这个方法直接放到 plots/line 里面的 util 吧,其他图从 line 里面引入即可。
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.
已修改
src/plots/tiny-column/index.ts
Outdated
*/ | ||
public changeData(data: TinyColumnOptions['data']) { | ||
this.updateOption({ data }); | ||
const newData = map(data, (y: number, x: number) => { |
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.
getTinyData,同理 column 的 adaptor 中也用 getTinyData
const inValidData_2 = getTinyData(null); | ||
expect(inValidData_2).toEqual([]); | ||
}); | ||
}); |
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.
单测写的很赞 👍
This pull request introduces 1 alert when merging 11db37d into b46e6b3 - view on LGTM.com new alerts:
|
PR includes
override the changeData method of tiny-line