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

5.0的漏斗图无效 #4868

Closed
shield2018 opened this issue Apr 6, 2023 · 1 comment
Closed

5.0的漏斗图无效 #4868

shield2018 opened this issue Apr 6, 2023 · 1 comment

Comments

@shield2018
Copy link
Contributor

https://g2.antv.antgroup.com/spec/mark/interval
文档关于interval的shape可以设定为funnel,但是无效。

看源码发现只有Funnel的坐标计算

if (!isPolar(coordinate) && !isHelix(coordinate)) {
const tpShape = !!isTranspose(coordinate);
const [p0, , p2] = tpShape ? reorder(points) : points;
const [x, y] = p0;
const [width, height] = sub(p2, p0);
// Deal with width or height is negative.
const absX = width > 0 ? x : x + width;
const absY = height > 0 ? y : y + height;
const absWidth = Math.abs(width);
const absHeight = Math.abs(height);
const finalX = absX + insetLeft;
const finalY = absY + insetTop;
const finalWidth = absWidth - (insetLeft + insetRight);
const finalHeight = absHeight - (insetTop + insetBottom);
return select(new Rect({}))
.style('x', finalX)
.style('y', finalY)
.style('width', finalWidth)
.style('height', finalHeight)
.style('radius', [
radiusTopLeft,
radiusTopRight,
radiusBottomRight,
radiusBottomLeft,
])
.call(applyStyle, rest)
.node();

color.tx 中却使用了Rect 绘制。funnel类型绘制什么可以支持?

@pearmini
Copy link
Member

pearmini commented Apr 6, 2023

嗯嗯,这里应该是一个 bug,color 没有消费 funnelPoints 这个参数,这里应该由 path 绘制才对。

@pearmini pearmini added this to G2 Apr 6, 2023
shield2018 pushed a commit to shield2018/G2 that referenced this issue Apr 7, 2023
shield2018 pushed a commit to shield2018/G2 that referenced this issue Apr 7, 2023
shield2018 pushed a commit to shield2018/G2 that referenced this issue Apr 10, 2023
hustcc pushed a commit that referenced this issue Apr 11, 2023
* fix(interval): fix interval render funnel (#4868)

* fix(interval): fix funnel and pyramid props

* fix(interval): update funnel snapshot

---------

Co-authored-by: shield2018 <>
@hustcc hustcc closed this as completed Apr 14, 2023
@github-project-automation github-project-automation bot moved this to Done in G2 Apr 14, 2023
hustcc pushed a commit that referenced this issue May 16, 2023
* fix(interval): fix interval render funnel (#4868)

* fix(interval): fix funnel and pyramid props

* fix(interval): update funnel snapshot

---------

Co-authored-by: shield2018 <>
hustcc pushed a commit that referenced this issue May 16, 2023
* fix(interval): fix interval render funnel (#4868)

* fix(interval): fix funnel and pyramid props

* fix(interval): update funnel snapshot

---------

Co-authored-by: shield2018 <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants