antvis/G2





The issue has been closed
Breaking Change (5.0.0-beta.10) #4657
pearmini posted onGitHub
Breaking Change (5.0.0-beta.10)
There are some breaking changes for 5.0.0-beta.10.
node.interaction
Change Interaction from array prop to object prop.(https://github.com/antvis/G2/pull/4628)
// Before
chart.interaction({ type: 'tooltip', series: true });
// After
chart.interaction('tooltip', { series: true });
node.coordinate
Change coordinate from array prop to object prop. (https://github.com/antvis/G2/pull/4637)
// Before
chart.coordinate({ type: 'polar' }).coordinate({ type: 'transpose' });
// After
chart.coordinate({ type: 'polar', transform: [{ type: 'transpose' }] });
node.state
Specify the state of elements by mark.state
API rather than in the chart.interaction
.(https://github.com/antvis/G2/pull/4649)
// Before
chart.interaction({ type: 'elementHighlight', highlightedFill: 'red' });
// After
chart.interval().state('active', { fill: 'red' }).interaction('elementHighlight', true);
mark.label.style
Specify style props supported by G element through label.style
.(https://github.com/antvis/G2/pull/4639)
// Before
chart.interval().data(data).label({
text: 'hello',
formatter: '~s',
fill: 'red',
stroke: 'blue',
});
// After
chart
.interval()
.data(data)
.label({
text: 'hello',
formatter: '~s',
style: {
// Style props supported by G.
fill: 'red',
stroke: 'blue',
},
});