Skip to content
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(scatter): 散点图支持color和shape同时映射图例字段 & 添加单测 #2406

Merged
merged 7 commits into from
Mar 23, 2021

Conversation

visiky
Copy link
Member

@visiky visiky commented Mar 9, 2021

PR includes

  • fixed #0
  • add / modify test cases
  • documents, demos

Screenshot

Before After

@visiky visiky requested a review from hustcc March 9, 2021 07:12
src/plots/scatter/adaptor.ts Outdated Show resolved Hide resolved
@visiky visiky changed the title feat(scatter): 散点图支持color和shape同时映射图例字段 & 添加单测 wip: feat(scatter): 散点图支持color和shape同时映射图例字段 & 添加单测 Mar 10, 2021
@visiky visiky force-pushed the scatter-legend branch 2 times, most recently from 02b7604 to f47bf6a Compare March 22, 2021 11:25
visiky and others added 5 commits March 22, 2021 21:19
* feat(scatter): 散点图支持配置 shapeLegend & sizeLegend

* test(scatter-legend): 增加散点图图例用例(shapeLegend、sizeLegend)

Co-authored-by: visiky <736929286@qq.com>
Co-authored-by: elvira.zy <elvira.zy@alibaba-inc.com>
默认配置 legend 时,展示 color 图例和 shape 图例
当 shapeLegend 为 false,强制关闭 shape 图例
shape 为 undefined 时,默认不会展示 shape 图例
@visiky
Copy link
Member Author

visiky commented Mar 22, 2021

本地 CI 已过

if (shapeLegend) {
chart.legend(shapeField, shapeLegend);
} else {
chart.legend(shapeField, shapeLegend === false ? false : legend);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shapeLegend 为 undefined 的时候,showShapeLegend 为不显示,但这边却进到了 chart.legend(shapeField, legend); 的逻辑里。

  1. 其实不考虑兼容的话 chart.legend(shapeField, options.hasOwnProperty('shapeLegend') ? shapeLegend : legend) 就好了;
  2. 现在 colorField = undefined, legend = {} 的话,chart.legend() 没有一个函数能进,不确定对不对,感觉至少要触发 chart.legend(false)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

考虑兼容

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“现在 colorField = undefined, legend = {} 的话,chart.legend() 没有一个函数能进” 不是的,可以看下使用文档

@hustcc hustcc changed the title wip: feat(scatter): 散点图支持color和shape同时映射图例字段 & 添加单测 feat(scatter): 散点图支持color和shape同时映射图例字段 & 添加单测 Mar 23, 2021
@hustcc hustcc merged commit c7b7724 into master Mar 23, 2021
@hustcc hustcc deleted the scatter-legend branch March 23, 2021 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants