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: add auto mark #5585

Merged
merged 5 commits into from
Sep 28, 2023
Merged

feat: add auto mark #5585

merged 5 commits into from
Sep 28, 2023

Conversation

ixuxinyue
Copy link
Member

@ixuxinyue ixuxinyue commented Sep 22, 2023

Auto Mark

Relate: #5449 (comment)

添加 auto lib,主要包含 auto mark,通过 AVA 能力提供图表spec的智能推荐。此 pr 包含 code test

AVA能支持推荐的图表类型:

  • pie_chart & donut_chart
  • line_chart & step_line_chart
  • area_chart & stack_area_chart & percent_stacked_area_chart
  • bar_chart & group_bar_chart & stack_bar_chart & percent_stacked_bar_chart
  • column_chart & grouped_column_chart & stacked_column_chart & percent_stacked_column_chart
  • scatter_plot
  • bubble_chart
  • histogram
  • heatmap

案例

export function AutoMark(): G2Spec {
  return {
    type: 'auto',
    data: {
      type: 'fetch',
      value: 'data/alphabet.csv',
    },
  };
}

image

TODO

  • code
  • test (待补充更丰富的test cases)
  • docs
  • demos

Copy link
Member

@pearmini pearmini left a comment

Choose a reason for hiding this comment

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

代码的 CI 挂了,可以运行 tnpm run ci,解决一下 ci 问题:

  • 需要新增 __tests__/unit/lib/auto.spec.ts ,添加对 auto lib 的测试

package.json Outdated Show resolved Hide resolved
src/spec/mark.ts Outdated Show resolved Hide resolved
src/mark/auto.ts Outdated Show resolved Hide resolved
@pearmini
Copy link
Member

打包有点问题,可能需要排查一下:

image

@pearmini
Copy link
Member

因为能力不完整,autolib 先不同 src/index.ts 暴露出去,不过这个 PR 可以正常合并。

@pearmini pearmini linked an issue Sep 28, 2023 that may be closed by this pull request
4 tasks
@coveralls
Copy link

Pull Request Test Coverage Report for Build 6334666174

  • 12 of 12 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.009%) to 88.208%

Totals Coverage Status
Change from base Build 6321008636: 0.009%
Covered Lines: 10034
Relevant Lines: 11016

💛 - Coveralls

@pearmini pearmini merged commit 01c52a6 into v5 Sep 28, 2023
2 checks passed
@pearmini pearmini deleted the feat-auto branch September 28, 2023 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add auto lib
3 participants