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
支持 Lottie 播放能力 #4221
Labels
Comments
嗯嗯,这是一个天然支持的方案。更好的方案如下(可以之后支持): const options = {
children: [
{
type: 'lottie',
encode: {
x: '',
y: '',
src: data: lottie_json,
},
loop: true,
autoplay: true,
style: {
transform: 'scale(0.5) translate(100, 100)',
},
},
],
}; |
两种方式优缺点如下:
两者并不冲突,可以都提供。 |
嗯嗯,都可以提供 |
以不侵入的方式加到官网吧,做成 mark 后面做! |
xiaoiver
added a commit
that referenced
this issue
Nov 10, 2022
hustcc
pushed a commit
that referenced
this issue
Nov 14, 2022
转入到讨论,这里关闭。 |
hustcc
pushed a commit
that referenced
this issue
May 16, 2023
hustcc
pushed a commit
that referenced
this issue
May 16, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题背景
除了使用 Web Animations API 描述动画,我们还支持播放 Lottie 格式,为此我们提供了一个类似 lottie-web 的播放器。配合图表中已有元素也可以增强动画表现力。
ECharts 中的用法如下:https://github.com/pissang/lottie-parser#basic-usage
经由 Lottie Parser 解析后得到的
elements
可以加入group
中渲染:我们提供的
g-lottie-player
使用方式如下。同时提供简单的动画控制方法例如播放、暂停以及跳转到指定时刻或帧,加入到画布后就可以像基础图形一样任意操作它们。Chart API
由于
g-lottie-player
返回的是一个解析后的容器Group
,随后的变换、动画控制都交由用户自由操作。因此只需要拿到画布即可:这样也不用 G2 设计额外的 API 了。
The text was updated successfully, but these errors were encountered: