[英]Bordered group of nodes in a network graph?
I am attempting to implement a network graph using Vis JS library and would like to implement a group of nodes that are inside a logical group (box). 我正在尝试使用Vis JS库实现网络图,并希望实现逻辑组(框)内的一组节点。 VisJS allows grouping of nodes but is not implemented in a visual way that I am looking for.
VisJS允许对节点进行分组,但未以我正在寻找的可视方式实现。
Another library that executes this perfectly is GoJS: http://gojs.net/latest/samples/basic.html Another example from VisJS that shows network graph I would like to implement, but no example in documentation: http://visjs.org/docs/img/vis_overview.png 另一个可以完美执行此操作的库是GoJS: http ://gojs.net/latest/samples/basic.html VisJS的另一个示例,它显示了我想实现的网络图,但文档中没有示例: http:// visjs。 org / docs / img / vis_overview.png
I would like to have nodes placed into larger boxes to represent the group of nodes. 我希望将节点放置在较大的框中以表示节点组。
Any ideas or suggestions for implementing this? 有什么想法或建议来实现这一目标?
I'm the developer of the network module of vis. 我是vis网络模块的开发人员。 Our apologies for not seeing this issue sooner, but most of our communication is done through GitHub.
很抱歉没有尽快看到这个问题,但是我们的大部分沟通都是通过GitHub完成的。
On the upside, since the release of v4 we support render events. 从好的方面来看,自v4发行以来,我们支持渲染事件。 You can use these to draw whatever you want on the canvas, including borders behind groups of nodes.
您可以使用它们在画布上绘制任何想要的东西,包括节点组后面的边框。 Take a look at the example:
看一下示例:
http://visjs.org/examples/network/events/renderEvents.html http://visjs.org/examples/network/events/renderEvents.html
Keep in mind that this is aesthetic only. 请记住,这仅是美观。 The physics engine will not compartmentalise these boundaries so the nodes may interact with the others.
物理引擎不会分隔这些边界,因此节点可以与其他节点交互。
We often hear this request from people who want to use vis network as a flow editor. 我们经常听到想要使用vis network作为流编辑器的人的请求。 Even though this is not your issue Id like to point out that this is not what we designed the network for.
即使这不是您的问题,我也想指出这不是我们为网络设计的目的。 We may have a module for this in the future though.
不过,将来我们可能会为此提供一个模块。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.