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

fix(chart): new Chart() do not set default view key #4925

Merged
merged 1 commit into from
Apr 28, 2023
Merged

Conversation

pearmini
Copy link
Member

@pearmini pearmini commented Apr 28, 2023

  • new Chart() 不将默认 key 设置到 options 上去,而是设置到单独 chart._key 这个变量上。防止改变用户传入的 options。
const chart = new Chart();

// ...

chart.render();

expect(chart.options().key).toBeUndefined();
expect(chart._key).toBe('G2_CHART_KEY');
  • chart 的私有方法加上前缀 _
// Before
chart.bindAutoFit();

// After
chart._bindAutoFit();

@pearmini pearmini changed the title fix(chart): new Chart() do not set defualt view key [WIP] fix(chart): new Chart() do not set default view key Apr 28, 2023
@pearmini pearmini changed the title [WIP] fix(chart): new Chart() do not set default view key fix(chart): new Chart() do not set default view key Apr 28, 2023
@pearmini pearmini requested a review from pepper-nice April 28, 2023 02:32
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.

2 participants