Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Breaking Change (5.0.0-beta.12) #4713

Closed
pearmini opened this issue Feb 28, 2023 · 0 comments
Closed

Breaking Change (5.0.0-beta.12) #4713

pearmini opened this issue Feb 28, 2023 · 0 comments

Comments

@pearmini
Copy link
Member

Breaking Change (5.0.0-beta.12)

There are some breaking changes for 5.0.0-beta.12.

Chart API

#4690

  • chart.node() -> chart.getNode()
  • chart.context() -> chart.getContext()
  • chart.root() -> chart.getContainer()

mark.animate

#4695

// Before
chart.interval().animate('enterType', 'waveIn').animate('enterDuration', 1000);

// After
chart.interval().animate('enter', { type: 'waveIn', duration: 1000 });

mark.tooltip

#4691

// Before
chart
  .interval()
  .encode('title', 'fieldA')
  .encode('tooltip', 'fieldB')
  .encode('tooltip1', 'fieldC');

// After
chart.interval().tooltip({
  title: 'fieldA',
  items: ['fieldB', 'fieldC'],
});
// Before
const names = {
  tooltip: 'min',
  tooltip1: 'q1',
  tooltip2: 'q2',
  tooltip3: 'q3',
  tooltip4: 'max',
};

chart
  .boxplot()
  .data({
    type: 'fetch',
    value: 'https://assets.antv.antgroup.com/g2/morley.json',
  })
  .encode('x', 'Expt')
  .encode('y', 'Speed');

chart.interaction('tooltip', {
  item: ({ channel, value }) => ({
    name: names[channel],
    color: channel === 'tooltip4' ? 'red' : undefined,
    value,
  }),
});

// After
chart
  .boxplot()
  .data({
    type: 'fetch',
    value: 'https://assets.antv.antgroup.com/g2/morley.json',
  })
  .encode('x', 'Expt')
  .encode('y', 'Speed')
  .tooltip({ name: 'min', channel: 'y' })
  .tooltip({ name: 'q1', channel: 'y1' })
  .tooltip({ name: 'q2', channel: 'y2' })
  .tooltip({ name: 'q3', channel: 'y3' })
  .tooltip({ name: 'max', color: 'red', channel: 'y4' });

chart.interaction('tooltip', true);
@pearmini pearmini pinned this issue Feb 28, 2023
@hustcc hustcc unpinned this issue May 5, 2023
@antvis antvis locked and limited conversation to collaborators May 10, 2023
@hustcc hustcc converted this issue into discussion #4978 May 10, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant