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: 增加 pattern 贴图 #2777

Merged
merged 37 commits into from
Aug 24, 2021
Merged

feat: 增加 pattern 贴图 #2777

merged 37 commits into from
Aug 24, 2021

Conversation

visiky
Copy link
Member

@visiky visiky commented Aug 9, 2021

PR includes

  • add / modify test cases
  • documents, demos

待办事项

文档和单测:

  • 旭日图
  • 玫瑰图
  • 迷你面积图
  • 水波图
  • 双轴图

其他:

  • waterfall 由于自定义 shape,需要额外处理下(后续再增加)

Screenshot

Before After

@visiky visiky changed the title feat: 增加 pattern 贴图 wip: feat: 增加 pattern 贴图 Aug 9, 2021
@pr-triage pr-triage bot removed the PR: unreviewed label Aug 9, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2021

🎊 PR Preview 3e71f47 has been successfully built and deployed to https://antvis-G2Plot-preview-pr-2777.surge.sh?type=diff&date=2021-08-23

🕐 Build time: 110.144s

🤖 By surge-preview

@coveralls
Copy link

coveralls commented Aug 9, 2021

Pull Request Test Coverage Report for Build 1158085907

  • 203 of 204 (99.51%) changed or added relevant lines in 19 files are covered.
  • 6 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.03%) to 95.605%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/adaptor/pattern.ts 32 33 96.97%
Files with Coverage Reduction New Missed Lines %
src/plots/circle-packing/adaptor.ts 3 91.49%
src/plots/heatmap/adaptor.ts 3 91.92%
Totals Coverage Status
Change from base Build 1141813207: -0.03%
Covered Lines: 6491
Relevant Lines: 6611

💛 - Coveralls

Copy link
Member

@pearmini pearmini left a comment

Choose a reason for hiding this comment

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

感觉可以写的更加简洁一点 🤣

src/adaptor/pattern.ts Outdated Show resolved Hide resolved
src/plugin/pattern/dot.ts Outdated Show resolved Hide resolved
src/plugin/pattern/dot.ts Outdated Show resolved Hide resolved
src/plugin/pattern/line.ts Outdated Show resolved Hide resolved
src/utils/pattern/dot.ts Outdated Show resolved Hide resolved
src/utils/pattern/index.ts Outdated Show resolved Hide resolved
@visiky visiky force-pushed the pattern branch 5 times, most recently from ebea51b to 6c939bd Compare August 15, 2021 02:57
@visiky visiky changed the title wip: feat: 增加 pattern 贴图 feat: 增加 pattern 贴图 Aug 15, 2021
Angelii and others added 12 commits August 19, 2021 17:33
Co-authored-by: 酥云 <lisuwen.lsw@antgroup.com>
* feat: 初始化pattern

* feat: 增加可配置的dot贴图,并将patternAdptor用于饼图

* refactor: 将pattern统一赋给color,不用style

Co-authored-by: 酥云 <lisuwen.lsw@antgroup.com>
* feat(pattern): pattern 填充作用在 style 上

* feat(pattern): pattern 通道 & 接入柱条形图、玉珏图

* docs(pattern-demo): 增加若干 demo

* refactor: 优化下代码

* docs: 增加 demos 上新标识

* refactor(pattern): 修改 cr 内容 & 优化 demo
* feat: 初始化pattern

* feat: 增加可配置的dot贴图,并将patternAdptor用于饼图

* feat: 初始化pattern (#2763)

Co-authored-by: 酥云 <lisuwen.lsw@antgroup.com>

* refactor: 将pattern统一赋给color,不用style

* fix: 修改pattern文件引入路径

Co-authored-by: 酥云 <lisuwen.lsw@antgroup.com>
* feat(square-pattern): 添加square样式贴图

* fix: 修复square形状stroke的rotate问题

Co-authored-by: 酥云 <lisuwen.lsw@antgroup.com>
* feat(dot-pattern): 优化 dot pattern, 修复 stagger 展示

* feat(square-pattern): 优化 square pattern, 修复 stagger 展示

* refactor(pattern): 优化 line pattern & 删除无用代码

* refactor: 一些代码上的优化 & 删除无用的代码

* refactor(pattern): 初始化 canvas 的逻辑,抽取为一个 util 函数
* feat(square-pattern): 添加square样式贴图

* fix: 修复square形状stroke的rotate问题

* refactor(pattern): 对代码进行一点整理,含类型定义

* refactor(types): 重新定义下 pattern 的属性定义

* chore: 升级官网

* refactor(pattern): 内置 pattern 的属性设计 & 优化下创建逻辑 (#2785)

* feat(dot-pattern): 优化 dot pattern, 修复 stagger 展示

* feat(square-pattern): 优化 square pattern, 修复 stagger 展示

* refactor(pattern): 优化 line pattern & 删除无用代码

* refactor: 一些代码上的优化 & 删除无用的代码

* refactor(pattern): 初始化 canvas 的逻辑,抽取为一个 util 函数

* test: 修复dot的stagger呈现问题,初步添加util中getCanvasPattern的单测

* 修复:   [BUG] 双轴图图例legend使用symbol的时候,颜色不能自动调整 (#2776)

* fix: 修复 [BUG] 双轴图图例legend使用symbol的时候,颜色不能自动调整

* fix: 修复 [BUG] 双轴图图例legend使用symbol的时候,颜色不能自动调整  -2

Co-authored-by: ai-qing-hai <wb-xcf804241@antgroup.com>

* test: 修复dot的stagger呈现问题,初步添加util中getCanvasPattern的单测

* refactor: 修改pattern单测中的写法

Co-authored-by: 酥云 <lisuwen.lsw@antgroup.com>
Co-authored-by: visiky <736929286@qq.com>
Co-authored-by: ai-qing-hai <65594180+ai-qing-hai@users.noreply.github.com>
Co-authored-by: ai-qing-hai <wb-xcf804241@antgroup.com>
* refactor(pattern): 优化代码写法

* refactor(pattern): 优化pattern的写法,抽出一些方法

* refactor(pattern): 抽出util文件

Co-authored-by: 酥云 <lisuwen.lsw@antgroup.com>
visiky and others added 13 commits August 19, 2021 17:33
* test(pattern-in-plot): 逐个给每个plot添加pattern的单测,并添加对应的pattern文档

* docs: 修改部分pattern的文档说明以及默认值等

* fix: 修复pattern回调问题,对应的图形如果没有pattern,默认为主题色

* test: 添加column引入pattern的单测,并添加文档

* test: 添加bar引入pattern的单测,并添加文档

* test: 给pie添加pattern的单测,添加文档

* fix(pattern-util): 处理color为数组导致pie的图形变黑情况,统一返回字符串

* test: 给直方图添加pattern的单测,增加文档

* test: 给treemap添加pattern的单测,增加文档

* test: 给heatmap添加pattern的单测和文档,并给patternAttr的类型增加布尔值

* test: 给radial-bar添加pattern的单测,增加文档

* test: 给tiny-column添加pattern的单测,增加文档

* test: 给circle-packing添加pattern的单测,增加文档

* docs: 修改接入文档方式,把标题抽出来

* fix: 给patternAdaptor补充stackFields映射字段,修复stack模式的直方图添加pattern变黑问题

Co-authored-by: 酥云 <lisuwen.lsw@antgroup.com>
src/types/attr.ts Outdated Show resolved Hide resolved
visiky and others added 6 commits August 19, 2021 19:27
@visiky visiky changed the title feat: 增加 pattern 贴图 wip: feat: 增加 pattern 贴图 Aug 23, 2021
@visiky visiky changed the title wip: feat: 增加 pattern 贴图 feat: 增加 pattern 贴图 Aug 24, 2021
@visiky visiky merged commit b517666 into master Aug 24, 2021
@visiky visiky deleted the pattern branch August 24, 2021 01:52
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.

4 participants