Graph Extension

From S23Wiki
Jump to: navigation, search

A mediawiki extension to create graphs in wiki pages, written by Tels. It needs a few perl modules to be installed via cpan, esp. it uses Graph:Easy and can output graphs as ASCII, HTML or SVG.


  • Graph::Easy is up to date (0.53).
  • Installed wikimedia-graph 0.21

Looks a lot better now, thanks Tels.

You can create graphs like this:


Contents

  • 1 source examples
  • 2 result examples
    • 2.1 3 nodes
    • 2.2 4 nodes
    • 2.3 5 nodes
    • 2.4 Nodes with links
  • 3 New: SVG output
  • 4 colored SVG output
  • 5 Links

[edit] source examples

<graph>
 [ S23 ] -> [ Neighbor1 ]
 [ S23 ] -> [ Neighbor2 ]
 [ S23 ] -> [ Neighbor3 ]
</graph>

[edit] result examples

check source to see how they workd

[edit] 3 nodes

<graph>

[ S23 ] -> [ Neighbor1 ]
[ S23 ] -> [ Neighbor2 ]
[ S23 ] -> [ Neighbor3 ]

</graph>

[edit] 4 nodes

<graph>

[ S23 ] -> [ Neighbor1 ]
[ S23 ] -> [ Neighbor2 ]
[ S23 ] -> [ Neighbor3 ]
[ S23 ] -> [ Neighbor4 ]

</graph>


[edit] 5 nodes

<graph>

[ S23 ] -> [ Neighbor1 ]
[ S23 ] -> [ Neighbor2 ]
[ S23 ] -> [ Neighbor3 ]
[ S23 ] -> [ Neighbor4 ]
[ S23 ] -> [ Neighbor5 ]

</graph>

[edit] Nodes with links

Graph:Easy:

<graph> node { linkbase: www.bloodgate.com/perl/; } [ Graph ] { link: graph/; } --> [ Manual ] { link: graph/manual/; } </graph>

S23: <graph> node { linkbase: /wiki/; } [ WikiNode ] { link: WikiNode; } --> [ Sandbox ] { link: Sandbox; } [ WikiNode ] --> [ RecentChanges ] { link: RecentChanges; } [ WikiNode ] --> [ Fnord ] { link: Fnord; } </graph>

InterWiki:

<graph> [ S23 ] {link: s23.org/wiki/;} --> [ StarTrek ] { link: www.memory-alpha.org/en/index.php/Main_Page; } [ S23 ] --> [ Brasil ] { link: rio.ifi.unizh.ch/brasilienwiki/index.php/Hauptseite; } [ S23 ] --> [ Gentoo ] { link: gentoo-wiki.com/; } [ S23 ] --> [ Python ] { link: www.pythonwiki.de/; } [ S23 ] --> [ ZZZ ] { link: wiki.zzz.ee/index.php/; } </graph>


[edit] New: SVG output

"Dazu braucht man noch einen modernen Browser (Firefox 1.5, oder Opera 9.0,oder Konqueror 3.5)."


<graph> graph { output: svg; } [ S23 ] {link: s23.org/wiki/;} --> [ StarTrek ] { link: www.memory-alpha.org/en/index.php/Main_Page; } [ S23 ] --> [ Brasil ] { link: rio.ifi.unizh.ch/brasilienwiki/index.php/Hauptseite; } [ S23 ] --> [ Gentoo ] { link: gentoo-wiki.com/; } [ S23 ] --> [ Python ] { link: www.pythonwiki.de/; } [ S23 ] --> [ ZZZ ] { link: wiki.zzz.ee/index.php/; } [ S23 ] --> [AbbeNormal] { link: www.ourpla.net/cgi-bin/pikie.cgi?; } [ S23 ] --> [AcadWiki] { link: xarch.tu-graz.ac.at/autocad/wiki/; } [ S23 ] --> [Advogato] { link: www.advogato.org/; } [ S23 ] --> [AIWiki] { link: www.ifi.unizh.ch/ailab/aiwiki/aiw.cgi?; } [ S23 ] --> [ALife] { link: news.alife.org/wiki/index.php?; } [ S23 ] --> [AndStuff] { link: andstuff.org/wiki.php?; } [ S23 ] --> [Annotation] { link: bayle.stanford.edu/crit/nph-med.cgi/; } [ S23 ] --> [AwarenessWiki] { link: taoriver.net/aware/; } [ S23 ] --> [BenefitsWiki] { link: www.benefitslink.com/cgi-bin/wiki.cgi?; } [ S23 ] --> [Fnord] { link: fnord.org; } </graph>

[edit] colored SVG output

<graph> node { fill: #ffdead; }

[ S23 ] {link: s23.org/wiki/; fill: #f06060; color: white; }

 -> [ Fnord ], [ Blargh ], [ Foobar ], [ Gazong ] {link: s23.org/wiki/Fnord; fill: #f060F0; color: white; } 

[ human ] .. evolve ..> [ ape ] { fill: #e0e0ff; border: bold; } </graph>

Broken link fixed (or not, weird "br-like2 behaviour. how come? it wasnt intended to open like in a frame. Mutante 03:54, 11 December 2005 (CET).

Fixed. Mutante 15:38, 15 June 2006 (CEST)

Fixed buggy output ("br"-effect) caused by missing/wrong redirect rule in Apache config for /wiki/images to /w/images. Mutante 21:39, 12 March 2007 (CET)

[edit] Links

  • meta.wikimedia.org/wiki/Graph_extension
  • bloodgate.com/perl/graph/
  • Manual to Graph:Easy
  • Links in graphs
Retrieved from "www.s23.org/w/index.php?title=Graph_Extension&oldid=45502"
Views
  • Page
  • Discussion
  • Edit
  • History
Personal tools
  • Log in / create account
Navigation
  • Main Page
  • Recent changes
  • Current events
  • Forum
  • Calendar
  • Wiki Node
  • Wikinet changes
  • Help
  • Donate
  • Guestbook
Categories
  • All Categories
  • Top Categories
  • Uncategorized
Specials
  • Page of the Day
  • Random page
  • Wanted pages
  • Popular pages
  • Interwiki
  • Edit sidebar
  • Statistics
  • Wikistats
  • Blacklisted domains
ToDo
  • Tasks (To Do)
  • To Do
Toolbox
  • What links here
  • Related changes
  • Special pages
  • Printable version
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.