MediaWiki扩展:图示功能
天下维客,你可以修改的网络知识库
本文取自元维基,欢迎共同翻译、整理与大家共享,促进中文wiki发展^_^
Overview
The graph-extension takes a textual graph description between <graph> </graph> tags, and turns it into a pretty flowchart diagram.
It works much like the GraphViz extension, except that it outputs ASCII, HTML, SVG or Graphviz code. The latter then allows rendering of PNG files.
The advantage of textual, SVG or HTML output over an image is that it makes it possible to easily include mouse-over titles and links in the graph, as well as make the graph scalable and zoomable. In addtion, copy & paste is possible, and search engines will index the text in the graph like the node names and edge labels.
Examples
Here is an example, as HTML rendered by Firefix (shown as screenshot due to Meta not allowing <style> </style>)
node { fill: #ffdead; }
[ Berlin ] { fill: #f06060; color: white; }
-> [ Rostock ], [ Dresden ], [ Magdeburg ], [ Frankfurt (Oder) ]
[ Magdeburg ] .. train ..> [ Aschaffenburg ] { fill: #e0e0ff; border: bold; }
Since it is not yet possible to upload SVG files to Meta, please see this SVG example.
Much more details, documentation, the actual code, examples and testcases can be found at my site.
Details & Feedback
The extension uses a Perl module called Graph::Easy to parse the input and render the output.
This is work in progress - but feedback is very much welcome.
原文参见: Graph extension



