在 JavaScript 工具 InfoVis 中隐藏画布元素外部的 HTML

发布于 2024-12-23 05:15:08 字数 487 浏览 7 评论 0原文

我目前正在项目中创建一些对象的可视化,并使用 InfoVis 工具包 来处理图表可视化部分。到目前为止,我已经正确绘制了节点并正确地相互关联,但有一个图形错误困扰着我。当节点部分脱离画布时,该节点的背景会被隐藏(理应如此),因为它本身就是一个画布元素。但是,内容(HTML)会完整显示,并且它们悬挂在画布元素上。

您可以在此处查看可视化效果:链接

在图形周围拖动,直到其中一个节点部分离开屏幕你会看到的。在右侧/底部更明显。

这是问题的图片: 黑色边框是画布边框。

我怎样才能阻止这种情况发生?

黑色边框是画布边框

I'm currently creating a visualization of some objects on my project and I'm using the InfoVis toolkit to handle the graph visualization part. So far I have the nodes plotted correctly and relating to each other correctly, but there is a graphical error that is bothering me. When a node is partly off of the canvas, the background of the node is hidden (as it should be) because it is a canvas element itself. However, the contents (which are HTML) are shown completely and they hang off of the canvas element.

You can see the visualization here: Link

Drag around the graph until one of the nodes is partly off the screen and you'll see it. It is more obvious on the right/bottom sides.

Here is a picture of the problem: The black border is the canvas border.

How can I stop this from happening?

The black border is the canvas border

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

错爱 2024-12-30 05:15:08

尝试在 ID 为 infovis-canvaswidget 的 div 上设置 overflow:hidden。看起来 Canvas 元素被注入其中。

在此处输入图像描述

Try setting overflow: hidden on the div with the ID infovis-canvaswidget. It looks like the Canvas element is injected into it.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文