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

[Bug] progress mark not support padding in select config #2038

Closed
skie1997 opened this issue Jan 15, 2024 · 1 comment
Closed

[Bug] progress mark not support padding in select config #2038

skie1997 opened this issue Jan 15, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@skie1997
Copy link
Contributor

skie1997 commented Jan 15, 2024

关联 issue:VisActor/VRender#897

Version

1.8.7

Link to Minimal Reproduction

vscreen

Steps to Reproduce

const bgSize = 0.25
const fgSize = 0.2
const spec = {
    "type": "circularProgress",
    "valueField": "current",
    "radiusField": "current",
    "padding": {
        "left": 6,
        "right": 6,
        "top": 6,
        "bottom": 6
    },
    "outerRadius": 1,
    "innerRadius": 0.75,
    "cornerRadius": 20,
    "track": {
        "style": {
            "fill": "#eb1414",
            "fillOpacity": 1
        }
    },
    "categoryField": "name",
    "roundCap": true,
    "data": [
        {
            "id": "data",
            "values": [
                {
                    "current": 361,
                    "name": "Profit",
                    "emptyName": "",
                    "progress": 1,
                    "detail": "",
                    "goalProgress": 1
                }
            ]
        }
    ],
    "axes": [
        {
            "type": "linear",
            "orient": "angle",
            "min": 0,
            "max": 361,
            "grid": {
                "visible": false
            },
            "label": {
                "visible": false
            },
            "ticks": false,
            "rangeType": "rough"
        }
    ],
    "indicator": {
        "visible": true,
        "title": {
            "visible": true,
            "autoLimit": true,
            "space": 10,
            "style": {
                "text": "Profit",
                "fontSize": 14,
                "fill": "#FFF",
                "fontWeight": "normal",
                "fontFamily": "D-DIN"
            }
        },
        "content": {
            "visible": true,
            "autoLimit": true,
            "style": {
                "text": "361.00",
                "fontSize": 32,
                "fill": "#FFF",
                "fontWeight": "normal",
                "fontFamily": "D-DIN"
            }
        },
        "titleStyle": {
            "fontWeight": "normal"
        },
        "valueStyle": {
            "fontWeight": "normal"
        },
        "fixed": true,
        "gap": 10,
        "titleField": "name",
        "valueField": "current"
    },
    "extensionMark": [
        {
            "type": "text",
            "dataId": "data",
            "visible": false,
            "style": {
                "text": "",
                "fontWeight": 500,
                "fontSize": 16,
                "fill": "#666666",
                "textAlign": "center",
                "textBaseline": "top",
                "dy": 12
            }
        }
    ],
    "region": [
        {
            "clip": true
        }
    ],
    "background": "rgba(0, 0, 0, 1)",
    "animation": false,
    "tooltip": {
        "renderMode": "canvas",
        "mark": {
            "visible": false
        },
        "style": {
            "panel": {
                "padding": {
                    "top": 5,
                    "bottom": 10,
                    "left": 10,
                    "right": 10
                },
                "backgroundColor": "rgba(47, 59, 82, 0.9)",
                "border": {
                    "color": "#fff",
                    "width": 0,
                    "radius": 4
                },
                "shadow": {
                    "x": 0,
                    "y": 4,
                    "blur": 12,
                    "spread": 0,
                    "color": "rgba(0, 0, 0, 0.2)"
                }
            },
            "titleLabel": {
                "fontSize": 14,
                "fontColor": "#fff",
                "align": "left",
                "lineHeight": 18
            },
            "keyLabel": {
                "fontSize": 12,
                "fontColor": "#fff",
                "align": "left",
                "lineHeight": 18
            },
            "valueLabel": {
                "fontSize": 12,
                "fontColor": "#fff",
                "align": "right",
                "lineHeight": 18
            },
            "shape": {
                "size": 10,
                "spacing": 10
            },
            "spaceRow": 10
        },
        "dimension": {
            "visible": false
        }
    },
    "crosshair": {
        "xField": {
            "line": {
                "style": {
                    "fillOpacity": 0.2
                }
            }
        },
        "yField": {
            "line": {
                "style": {
                    "fillOpacity": 0.2
                }
            }
        }
    },
    "morph": {
        "enable": false
    },
    "plotLayout": {
        "clip": false
    },
    "select": {
        "enable": true
    },
    "progress": {
      state: {
        selected: {
          outerPadding: -10
        }
      },
        "style": {
            "fill": "#006EFF",
            "fillOpacity": 1,
            "cornerRadius": 20,
            innerPadding: (datum, context) => Math.max(0, bgSize - fgSize) / 2 * context.getLayoutRadius(),
            outerPadding: (datum, context) => Math.max(0, bgSize - fgSize) / 2 * context.getLayoutRadius(),
        }
    },
    "hash": "155aa69b0190f00c7b568a904f18a75b"
}

const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderAsync();

// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;

Current Behavior

image

Expected Behavior

点击时,progress 图元padding会有变化

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@skie1997 skie1997 added the bug Something isn't working label Jan 15, 2024
@skie1997
Copy link
Contributor Author

vrender底层需要支持arc图元的padding属性 @zamhown @neuqzxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants