可嵌入的可定制图形编辑器(Java、Flash、HTML+Javascript)
我有一个使用复杂的图形结构作为配置的应用程序。该应用程序本身类似于 NetGraph- 或 netfilter 防火墙,因此图节点具有类型和属性(对应于操作),并且它们与有向边互连。
我希望为我的应用程序提供一个易于用户使用的配置编辑器,以图形形式提供配置的可视化和编辑。
在我的梦想场景中,应用程序将以流行图形格式之一的文件形式接收此配置(例如, TGF< /a>, DOT, GraphML 等),解析并使用。
一些要求(不是很严格,我愿意考虑各种选项) - 图形编辑器应该:
- 可嵌入到 Web UI 中 - 即以 Javascript/HTML、Flash 或作为
- 能够加载 TGF 样式的 Java 小程序实现图形(即没有布局指令,节点将没有坐标)并以某种适当的方式自动布局它,
- 能够自动保存该图形,
- 能够使用对 HTTP 服务器的请求加载/保存,而不是直接可定制的文件
- 以使其与严格的工作一起使用节点类型集(以便用户不能只为给定节点创建任意节点类型或任意属性)
- 开源
到目前为止我发现 yEd 及其 Flash 版本,Graphity - 两者看起来都很酷,但它们都不可定制(将它们剥离为基本功能,即创建几种节点类型之一)并且不是开源的,因此将它们嵌入到任何地方肯定会有些痛苦。
我正在考虑的另一个选择是放弃整个“可视化编辑器”的想法,让用户只需在纯文本文件中写下裸露的 TGF 或 DOT 样式的定义并将它们可视化以供以后使用类似 < a href="http://www.graphviz.org/" rel="nofollow">GraphViz。这是一条可行的路吗?
I have an application that uses intricate graph-like structure as a configuration. The application itself resembles a NetGraph- or netfilter firewall, thus graph nodes have types and properties (which correspond to operations) and they're interconnected with directed edges.
I'd like to have an easy-to-user configuration editor for my application that provides visualization and editing for configuration as a graph.
In my dream scenario, application would receive this configuration as a file in one of popular graph formats (for example, TGF, DOT, GraphML, etc), parse it and use.
A few requirements (not really strict, I'm open to consider various options) - graph editor should be:
- available to be embedded in web UI - i.e. implemented in Javascript/HTML, Flash or as a Java applet
- able to load TGF-style graph (i.e. without layouting instructions, nodes would be without coordinates) and lay it out in a somewhat decent automatically
- able to save this graph back
- able to load/save using requests to HTTP server, not a file directly
- customizable to make it work with strict set of node types (so that user can't just create arbitrary node type or arbitrary properties for a given node)
- open-source
So far I've found yEd and it's Flash version, Graphity - both look cool, but they aren't customizable (to strip them to bare-bones functionality, i.e. creation of one a few node types) and not open source, so embedding them anywhere pledges to be somewhat painful.
Another option I'm considering is trashing the whole "visual editor" idea and make user just write down bare TGF or DOT-style definitions in a plain text file and visualize them for later checking using something like GraphViz. Is it a viable way to go?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您看过 InfoVis 吗?特别是,强制导向布局和编辑可能适用。图源数据类似于 DOT,尽管是 json 格式。但源数据中没有布局信息。
编辑:还有类似的 ProtoVis 。
嗯。
Have you looked at InfoVis? In particular, the force-directed layout and editing may be applicable. Graph source data is analogous to DOT, albeit in json format. No layout info in the source data though.
EDIT: There's also ProtoVis which is similar.
hth.