-
Notifications
You must be signed in to change notification settings - Fork 605
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
feat(word-cloud): imageMask选项支持url字符串格式 #1617
Conversation
this.options = { | ||
...this.options, | ||
imageMask: img || null, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个可以在 adaptor 中处理吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1,现在adaptor
中的代码都是同步运行的,而图片资源加载需要时间。
2,也可以这样,一开始就正常运行render
,等到图片加载完成后,再更新配置选项,重新渲染。但我觉得这种效果不是很好。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
效果主要取决于图表的加载时间,我觉得目前的方式也可以,但文档里面给个建议,URL 方式不要使用过大的图片。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
目前来看,用base64效果最好。
增加一个 base64 的 demo。 |
OK |
2a682c1
to
9a0f11b
Compare
height: 400, | ||
wordField: 'name', | ||
weightField: 'value', | ||
imageMask: 'https://gw.alipayobjects.com/mdn/rms_2274c3/afts/img/A*07tdTIOmvlYAAAAAAAAAAABkARQnAQ', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里赞
合并了,下一个分支,可以把单测覆盖率提升一下,然后学习一下写有效的单元测试。一般:
|
明白了👍 |
#1571
#1536