G2 icon indicating copy to clipboard operation
G2 copied to clipboard

docs: 迁移 4.0 简单色块图

Open bingling-sama opened this issue 8 months ago • 3 comments

Checklist
  • [ ] npm test passes
  • [ ] benchmarks are included
  • [ ] commit message follows commit guidelines
  • [ ] documents are updated
Description of change

按照 https://github.com/antvis/G2/issues/5904 的要求迁移官网4.0的样例

原 Issue 中的「色块图」和 v5 文档中的 「华夫饼图」 好像是一样的,故不再重复实现。

新增了 4.0 中的 「日历色块图」和「水平日历色块图」 图标样式上还没有完全还原,待后续优化

截图(样式还需修改,先不用上传图床):

「日历色块图」 image

「水平热力色块图」 image

bingling-sama avatar Apr 15 '25 14:04 bingling-sama

有三个疑问:

  • 原 Issue 中提到的 v4 文档中的「极坐标下的色块图」是否还需要再实现?
  • 「日历色块图」使用到的 facetRect 如何设置换行?
  • 「水平日历色块图」中月末周的分割线如何使用 v5 api 实现?

恳请指教 @hustcc

bingling-sama avatar Apr 18 '25 11:04 bingling-sama

原 Issue 中提到的 v4 文档中的「极坐标下的色块图」是否还需要再实现?

是需要迁移的~

「日历色块图」使用到的 facetRect 如何设置换行?

可以给月份横坐标分成三类,纵坐标分成四类,然后 facetRectencode x 绑定横坐标分类,比如 分类一,分类二, 分类三encode y 绑定纵坐标分类。

可以参考 https://g2.antv.antgroup.com/examples/composition/facet/#rect-bar

「水平日历色块图」中月末周的分割线如何使用 v5 api 实现?

cell 底层是 rect 图形,无法单独设置某条边的颜色,还是需要自定义形状,覆盖类似 line 的图形才能实现 参考 https://github.com/antvis/G2/blob/master/examples/heatmap/calendar/demo/calendar-horizontal.ts

interstellarmt avatar Apr 28 '25 09:04 interstellarmt

Pull Request Test Coverage Report for Build 14818772077

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 43 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.08%) to 86.669%

Files with Coverage Reduction New Missed Lines %
src/interaction/elementSelect.ts 3 89.3%
src/interaction/tooltip.ts 5 91.3%
src/interaction/elementHighlight.ts 7 84.42%
src/interaction/treemapDrillDown.ts 10 31.25%
src/interaction/utils.ts 18 89.93%
<!-- Total: 43
Totals Coverage Status
Change from base Build 14463832267: -0.08%
Covered Lines: 10762
Relevant Lines: 12025

💛 - Coveralls

coveralls avatar May 04 '25 07:05 coveralls