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

More options on pack transform #5875

Closed
YiSiWang opened this issue Dec 4, 2023 · 6 comments · Fixed by #5964
Closed

More options on pack transform #5875

YiSiWang opened this issue Dec 4, 2023 · 6 comments · Fixed by #5964
Assignees

Comments

@YiSiWang
Copy link
Contributor

YiSiWang commented Dec 4, 2023

问题描述

image
  1. 希望 pack 能支持更多的参数,如从左向右进行堆叠,而非固定的从下到上;支持指定 pack 的间距等。
  2. facetRect 等分面 Mark 似乎不支持 .tooltip 等交互相关的能力?

重现链接

No response

重现步骤

No response

预期行为

No response

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@YiSiWang
Copy link
Contributor Author

YiSiWang commented Dec 4, 2023

PS facetRect 的 padding margin inset 好像都不起作用:
https://g2.antv.antgroup.com/zh/examples/composition/facet/#rect-bar

@pearmini
Copy link
Member

pearmini commented Dec 5, 2023

PS facetRect 的 padding margin inset 好像都不起作用

@YiSiWang 分面的 padding margin inset 在 API 里面是在 new Chart 的时候指定:

const chart = new Chart({
  container: 'container',
  width: 928,
  height: 320,
  paddingLeft: 60,
  paddingBottom: 60,
});

在 Spec 里面可以可以在 facet 指定:

({
  type: "facetRect",
  width: 928,
  height: 320,
  paddingLeft: 60,
  paddingBottom: 60,
  data: {
    type: "fetch",
    value: "https://assets.antv.antgroup.com/g2/anscombe.json",
  },
  encode: { x: "series" },
  children: [
    {
      type: "point",
      inset: 10,
      encode: { x: "x", y: "y" },
      style: { stroke: "#000" },
    },
  ],
});

@pearmini
Copy link
Member

pearmini commented Dec 5, 2023

希望 pack 能支持更多的参数,如从左向右进行堆叠,而非固定的从下到上;支持指定 pack 的间距等。

这个目前确实不支持,可以考虑给 pack 增加如下参数:

  • direction
  • padding
  • paddingX
  • paddingY

相关代码在这里:https://github.com/antvis/G2/blob/v5/src/transform/pack.ts

@YiSiWang 要不要搞搞!

@YiSiWang
Copy link
Contributor Author

希望 pack 能支持更多的参数,如从左向右进行堆叠,而非固定的从下到上;支持指定 pack 的间距等。

这个目前确实不支持,可以考虑给 pack 增加如下参数:

  • direction
  • padding
  • paddingX
  • paddingY

相关代码在这里:https://github.com/antvis/G2/blob/v5/src/transform/pack.ts

@YiSiWang 要不要搞搞!

这个有点太难了/狗头

@pearmini pearmini changed the title Request for more feature on "pack" transform and facet in interaction More options on pack transform Dec 19, 2023
@Runtus
Copy link
Contributor

Runtus commented Dec 19, 2023

【Runtus】认领

@Runtus
Copy link
Contributor

Runtus commented Dec 21, 2023

fix: #5964

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants