在 JavaScript 工具 InfoVis 中隐藏画布元素外部的 HTML
我目前正在项目中创建一些对象的可视化,并使用 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在 ID 为
infovis-canvaswidget
的 div 上设置overflow:hidden
。看起来 Canvas 元素被注入其中。Try setting
overflow: hidden
on the div with the IDinfovis-canvaswidget
. It looks like the Canvas element is injected into it.