javascript 寻找家谱
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15944146/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Looking for a Family Tree
提问by Irwan
I am creating Family Tree feature for my web app with HTML5 requirements. I already searched and found some JS samples, but I haven't find any that fit with my requirements. I already tried JIT, Rafael, GoJS, etc.
我正在为我的具有 HTML5 要求的网络应用程序创建家庭树功能。我已经搜索并找到了一些 JS 示例,但没有找到符合我要求的示例。我已经尝试过 JIT、Rafael、GoJS 等。
I found this to be the closest one is from GoJS:
我发现这是最接近 GoJS 的:
But this not enough. I need to connect one member with another member with drag and drop function.
但这还不够。我需要使用拖放功能将一个成员与另一个成员连接起来。
Is there some JS that may fit with the requirements or at least operate like GoJS? Since I need to pay a license for GoJS AND THEN customize it, the budget is tight. Thank you very much.
是否有一些 JS 可能符合要求或至少像 GoJS 一样运行?由于我需要为 GoJS 支付许可证,然后对其进行自定义,因此预算很紧。非常感谢你。
回答by Irwan
回答by Simon Sarris
The functionality you're looking for is built in to GoJS. For instance have a look at the
Org Chart Editor Sample.
您正在寻找的功能内置于 GoJS。例如,看看
Org Chart Editor Sample。
You can double click on nodes in order to add a new person, drag a node onto another in order to change relationships, and draw links (with a click drag operation) from a node's background to other nodes that have no "boss".
您可以双击节点以添加新人,将节点拖到另一个节点上以更改关系,并绘制从节点背景到其他没有“老板”的节点的链接(通过单击拖动操作)。
(If you want a node to have no Boss in this simple sample, you can select and delete links)
(如果你想让一个节点在这个简单的例子中没有Boss,你可以选择和删除链接)