Tags:
create new tag
, view all tags

FlowchartPlugin

Create a flowchart from topic text

Example

Fuxograma de Exemplo
Stop the mouse above each item and see the tag with the name in a bigger size.
Each item is a link for the text block what was created it and where can exist more information about this step.

The Based SVG

The example above was generated by the content of the topic FlowchartPluginExample

The items of the flowchart are defined in the following way:

---++ Item of the Flowchart
   * Id: unique_name
   * Type: Question
   * Yes: item_A
   * No: item_B

A more complete example is available at FlowchartPlugin Example, once the plugin is installed.

Syntax Rules

To create and display the flowchart, use the variable %FLOWCHART% or %FLOWCHART{...}%.

This plugin uses the content of the topic and considers that each level two heading (---++) indicate the beginning of the definition of a new item of the flowchart.

To specify the item and the derived action is expected a list of the type * Attribute: Value

Attribute Description
Type Type of the flowchart's item. Default: Action. See the valid types in the table below
Id Identification for the Goto. It needs to validate with /[_a-zA-Z0-9]*/
Color Color differentiated for the item
Goto Indicates so that item it must follow. Default: Next
Yes The same as Goto, but is required for Type: Question
No The same as Goto, but is required for Type: Question

The valid types are:

Type Description
Start Indicates the beginning of a flowchart. This must be the first item
Action The standard type. It indicates an action
Question Opens a fork in the flow. It requires the definition of attributes Yes and No
End Indicates the end of the flowchart (or part of it)
End-Error End for the error case

To control the beginning and end of of valid headings for the construction of the Flowchart use %FLOWCHART_START% and %FLOWCHART_STOP%.

If a name is excessively big for the space of the item a line break can be made with %FLOWCHART_BR%. This will not intervene with the text of the page, only in the flowchart.

You can changes the appearance of the flowchart by adding the following parameters to the variable:

Parameter Description
item-w Width for the flowchart's itens area
item-h Height for the flowchart's itens
area-w Width of the area of the flowchart's itens
area-h Height of the area of the flowchart's itens
percent Percentage of the PNG size presented in relation to the standard of the generated SVG
text-size Size in pixels of the font text
tag-style Style for the img tag

Tips

IDEA! Web bowsers normally make a cache of the web page and images. It is possible that after a change to the flowchart you do not see the image update. If this happens click "Reload" in your web browser to clear the cache.

IDEA! Some flowcharts can become so complex and will be difficult to follow its lines. In this case, increase the area of items, giving a bigger space between them. eg: %FLOWCHART{ area-w="220" area-h="100" }%

Construction of the Flowchart

  1. The blocks initialized by a heading level two ---++ are read as definition of item of the Flowchart (in the same way as the TWiki:Plugins.SlideShowPlugin).
  2. An SVG is created with this information and is attached to the topic. This SVG file can be accessed by %ATTACHURL%/flowchart_%TOPIC%.svg.
  3. A PNG is generated by ImageMagick and reduced, so that the image has a good anti-aliasing, that it is not obtained in the direct conversion. The PNG is attached to the topic and can be accessed by %ATTACHURL%/flowchart_%TOPIC%.png (use this to separate the flowchart's image of the definition topic when it is rendered).
  4. A map for the image is created linking the items of the flowchart with the origin of its information, which can contain more information for the implementation. %ATTACHURL%/flowchartMapImg_%TOPIC%.txt (use to map the image out of the topic where the flowchart was generated)
    %INCLUDE{"%PUBURL%/Web/FlowchartTopic/flowchartMapImg_FlowchartTopic.txt"}%
    <img src="%PUBURL%/Web/FlowchartTopic/flowchart_FlowchartTopic.png" usemap="flowchart_FlowchartTopic" alt="Flowchart" border="0" />
  5. The content of the map file and one image tag presenting the PNG are placed in the place of variable %FLOWCHART%.

The files (SVG, PNG and Map) are generated when the topic contend %FLOWCHART% is saved.

Plugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %FLOWCHARTPLUGIN_ITEM_WIDTH%

To override the default settings, add them to Public.TWikiPreferences.

  • Default width for the flowchart's itens
    • Set ITEM_WIDTH = 140
  • Default height for the flowchart's itens
    • Set ITEM_HEIGHT = 40
  • Default width for the area of the flowchart's itens
    • Set ITEM_AREA_W = 180
  • Default height of the area of the flowchart's itens
    • Set ITEM_AREA_H = 70
  • Default size in pixels of the font text
    • Set TEXT_SIZE = 17
  • Default percentage of the PNG size presented in relation to the standard of the generated SVG
    • Set PERCENT_IMG = 70
  • Default style for the img tag
    • Set TAG_STYLE = border:1px dotted #505050;


  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Create a flowchart from topic text

Plugin Installation Instructions

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server where TWiki is running.

Like many other TWiki extensions, this module is shipped with a fully automatic installer script written using the BuildContrib.

  • If you have TWiki 4.2 or later, you can install from the configure interface (Go to Plugins->Find More Extensions)
  • If you have any problems, then you can still install manually from the command-line:
    1. Download one of the .zip or .tgz archives
    2. Unpack the archive in the root directory of your TWiki installation.
    3. Run the installer script ( perl <module>_installer )
    4. Run configure and enable the module, if it is a plugin.
    5. Repeat for any missing dependencies.
  • If you are still having problems, then instead of running the installer script:
    1. Make sure that the file permissions allow the webserver user to access all files.
    2. Check in any installed files that have existing ,v files in your existing install (take care not to lock the files when you check in)
    3. Manually edit LocalSite.cfg to set any configuration variables.

Plugin Info

Plugin Author: TWiki:Main.AurelioAHeckert
Copyright: © 2005 TWiki:Main.AurelioAHeckert
© 2007-2011 TWiki:TWiki.TWikiContributor
License: GPL (GNU General Public License)
Plugin Version: 2011-06-16
Change History:  
2011-06-16: TWikibug:Item6756: Fix for anchors not working if title is longer than 32 characters -- TWiki:Main.TimmoVerlaan
2011-01-17: TWikibug:Item6530: Back-porting from related project - thanks GPL; doc improvements
16 Jul 2010 Set the path to ImageMagick in configure -- TWiki:Main.AndrewRJones
05 Jan 2010 Invalid META header in VarFLOWCHART gives wrong revision and can make the core code crash if a search finds this topic; plugin lacks its attachments for the example topic
09 Sep 2009 Improve docs; do not read preferences from the plugin topic -- TWiki:Main.AndrewRJones
05 May 2009 Removed what seems to be forgotten debug code that floods the tmp dir with files named web_topic.txt with the content ini -- TWiki:Main.KennethLavrsen
13786 TWikibug:Item4090 - Failed if topics attachment directory did not exist -- TWiki:Main.AndrewRJones
13779 TWikibug:Item4085 - Fixed problem with subwebs. -- patch by TWiki:Main.JohnWorsley
27 Jun 2005: Initial public version 0.8
Dependencies:
NameVersionDescription
ImageMagick>0The ImageMagick library. Can be downloaded from http://www.imagemagick.org/.
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/FlowchartPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/FlowchartPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/FlowchartPluginAppraisal

Related Topics: VarFLOWCHART, TWikiPreferences, TWikiPreferences, TWikiPlugins

Physics WebpagesRHUL WebpagesCampus Connect • Royal Holloway, University of London, Egham, Surrey TW20 0EX; Tel/Fax +44 (0)1784 434455/437520

Topic revision: r2 - 01 Oct 2012 - TWikiAdminUser

 
This site is powered by the TWiki collaboration platformCopyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.FlowchartPlugin.