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: changedata #2142

Merged
merged 10 commits into from
Dec 28, 2020
Merged

feat: changedata #2142

merged 10 commits into from
Dec 28, 2020

Conversation

visiky
Copy link
Member

@visiky visiky commented Dec 24, 2020

Descriptions

  • 使用 g2 的 changeData api 来更新数据,每个 plot 复写 core 的 changeData 方法(后续全面迁移完成后,设置为抽象方法
  • core/plot 提供 updateOption 方法
  • 图表大致可以分为两类:数据为正常 Data 类型(无需转换) & 单数据、组合数据或 多view(数据转换),关于组合的,可以把数据获取抽取为通用纯函数,在 chagneData 的时候,也可以对数据进行相应转换,但存在问题是:逻辑会存在在 adpator 和 changeData 处,比较分散;
  • 另外,为此提供两个示例验证下:折线图 和 仪表盘
    • line
    • 仪表盘(annotation): 需要更新两个 view 的数据,同时重新执行 annotation adaptor
    • 其他...

Screenshot

Before After

@github-actions
Copy link
Contributor

github-actions bot commented Dec 24, 2020

😭 Deploy PR Preview b7f29b5 failed. Build logs

🤖 By surge-preview

@visiky visiky changed the title feat: changedata wip: feat: changedata Dec 24, 2020
@visiky visiky changed the title wip: feat: changedata wip: feat: changedata Dec 24, 2020
@coveralls
Copy link

coveralls commented Dec 25, 2020

Pull Request Test Coverage Report for Build 448693133

  • 36 of 36 (100.0%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 96.749%

Totals Coverage Status
Change from base Build 448192098: -0.02%
Covered Lines: 4398
Relevant Lines: 4436

💛 - Coveralls

@visiky visiky changed the title wip: feat: changedata feat: changedata Dec 28, 2020
@visiky visiky force-pushed the feat-changedata branch 3 times, most recently from 55df449 to 7dd1a12 Compare December 28, 2020 08:38
@@ -3,3 +3,7 @@ export const RANGE_TYPE = 'type';
export const PERCENT = 'percent';

export const DEFAULT_COLOR = '#f0f0f0';

/** 仪表盘由 指针和表盘 组成 */
export const INDICATEOR_VIEW_ID = 'indicator_view';
Copy link
Member

Choose a reason for hiding this comment

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

indicator-view

直接用中划线吧,其他的这种常量命名都是这个规则。

@visiky visiky merged commit ac17235 into master Dec 28, 2020
@visiky visiky deleted the feat-changedata branch December 28, 2020 12:01
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.

3 participants