[5.0] [Feature] Bring shape morphing ability in custom series #13271
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Brief Information
This pull request is in the type of:
What does this PR do?
In the previous custom series. We can't do transition across different types of shapes. For example, we can't animate from a sector to a rectangle.
In this PR, we bring the ability to do smooth shape morphing across different shapes. It's heavily based on the new add function in zrender https://github.com/ecomfe/zrender/blob/next/src/tool/morphPath.ts
An example of the transition between

map
,bar
,bubble
andpie
(These are all implemented by custom series.)The transition between hexagon and circle in hexbin example.
The transition between different SVG paths.
Usage
Are there any API changes?
We add a boolean property called
morph
in the returned element option inrenderItem
. With it enabled, the shape will be morphed from the previous shape smoothly when the type is changed.For example: