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]: The tooltip plugin can display a single line label when clicking, but it does not display when clicking a multi-line label #6707

Open
1 of 10 tasks
ShichuanZhang opened this issue Jan 8, 2025 · 0 comments
Labels
status: waiting for maintainer These issues have not yet been reviewed by a maintainer

Comments

@ShichuanZhang
Copy link

ShichuanZhang commented Jan 8, 2025

Describe the bug / 问题描述

demo如下

<template>
    <div style="height: 100vh;">
        <div id="mountNode"></div>
    </div>
</template>
<script>
import { Graph } from '@antv/g6';
import { Renderer as SVGRenderer } from '@antv/g-svg';

export default {
    mounted() {
        const graph = new Graph({
            container: document.getElementById('mountNode'),
            width: 1000,
            height: 1000,
            renderer: () => new SVGRenderer(),
            node: {
                style: {
                    labelWordWrap: true,
                    labelWordWrapWidth: 80,
                    labelMaxLines: 4,
                }
            },
            plugins: [
                {
                    type: 'tooltip',
                    trigger: 'click',
                    getContent: (event, items) => {
                        return "123"
                    },
                },
            ],
        });
        graph.addData({
            nodes: [{
                id: "node1",
                style: {
                    x: 100,
                    y: 100,
                    labelText: "这是一个很长的label这是一个很长的label"
                }
            },
            {
                id: "node2",
                style: {
                    x: 200,
                    y: 100,
                    labelText: "这是一个label"
                }
            }]
        })
        graph.render()
    }
}
</script>
<style scoped>
.mountNode {
    height: 100vh;
}
</style>

Reproduction link / 复现链接

No response

Steps to Reproduce the Bug or Issue / 重现步骤

No response

G6 Version / G6 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他
@ShichuanZhang ShichuanZhang added the status: waiting for maintainer These issues have not yet been reviewed by a maintainer label Jan 8, 2025
@github-actions github-actions bot changed the title [Bug]: tooltip插件在点击单行label时可以展示, 但点击多行label不展示 [Bug]: The tooltip plugin can display a single line label when clicking, but it does not display when clicking a multi-line label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for maintainer These issues have not yet been reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

1 participant