Changeset 3376


Ignore:
Timestamp:
04/05/09 21:08:42 (4 years ago)
Author:
GeorgeClark
Message:

Item1411: DirectedGraphPlugin generates new revs on view

  • Added documentation to better describe the behavior of attachments, and point out the direct I/O option.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DirectedGraphPlugin/data/System/DirectedGraphPlugin.txt

    r3372 r3376  
    1 %META:TOPICINFO{author="Main.ProjectContributor" date="1237950808" format="1.1" reprev="1.6" version="1.6"}% 
     1%META:TOPICINFO{author="ProjectContributor" date="1238965436" format="1.1" reprev="1.7" version="1.7"}% 
    22---+!! Directed Graph Plugin 
    33 
    4  
    5  
    6  
    74%TOC% 
    8  
    95---++ Introduction 
    106 
     
    139This plugin uses [[http://www.graphviz.org/][Graphviz's]] applications to create an image of a directed graph. The directed graph is described using a simple text markup called "The DOT Language". This markup is written between =<dot>= and =</dot>= tags. By default, a png image attachment is created and displayed inline, replacing the =<dot>= markup. Any other requested formats are saved as attachments. 
    1410 
    15 | %X% By default, this version of the plugin uses the Foswiki API to manipulate the attached graphs. The first user to view a topic containing a directed graph will be denied access if they do not have update permission. If defaults or DOT parameters have changed, viewing the topic may modify attachments, which will require update permission. | 
     11Visit the [[http://www.graphviz.org/Gallery.php][Graphviz gallery]] to see some examples on what can be achieved with this plugin and Graphviz. Full documentation is available at http://graphviz.org/Documentation.php. 
     12 
     13| %X% *Caution* =<dot>= syntax is not currently compatible with the WYSIWYG editor. Raw editing is recommended, or use <sticky> tags to protect the dot tags. | 
     14---+++ Attachment Handling 
     15| %X% *By default, this version of the plugin uses the Foswiki API to manipulate the attached graphs. The first user to view a topic containing a directed graph will be denied access if they do not have update permission. If defaults or DOT parameters have changed, viewing the topic may modify attachments, which will require update permission.* | 
     16 
     17Each generated file is attached to the topic using the Foswiki attachment API. This results in revision control of the attached files, and updates to the topic for each generated file. If Foswiki is configured to increment a new revision for each update (See <a target="_top" href="http://foswiki.org/System/ForceNewRevision">http://foswiki.org/System/ForceNewRevision</a> and config parameter =$Foswiki::cfg{ReplaceIfEditedAgainWithin} = 0= ), then every updated attachment will result in a new topic revision. The alternative to this behavior is to use the expert parameter attachPath - set in bin/configure - to configure the plugin to do direct file I/O and bypass the attach API. 
     18 
     19Direct file I/O results in a considerable performance improvement.  Initial rendering of this topic on a test system resulted in a reduction of time to generate the attachments and initially display from 60 seconds down to approximately 8 seconds. 
    1620 
    1721| %X% *Caution* The plugin will also update attached files during __Preview__. if the edit is subsequently canceled, the attachments will be regenerated again. | 
    1822 
    19 A MD5 hash is calculated for each dot command input and the results saved in the Foswiki work_area directory. The hash file is named with the Web name, the Topic name, and the suffix ==-filehash== If the calculated hash matches on subsequent page visits, the attached graphics files are used without rerunning Graphviz. If the hash doesn't match, the attachments are regenerated. 
     23The output of the &lt;dot&gt; command is cached as attachments to the topic. Any change to the &lt;dot&gt; input will result in the attachments being updated. 
     24 
     25A MD5 hash is calculated for each dot command input and the hash is saved in the Foswiki work_area directory. The hash file is named with the Web name, the Topic name, and the suffix ==-filehash== If the calculated hash matches on subsequent page visits, the attached graphics files are used without rerunning Graphviz. If the hash doesn't match, the attachments are regenerated. 
    2026 
    2127Default behavior is to leave any previously generated attachments even if the =&lt;dot&gt;= tags are removed from the file. If the configuration setting DELETEATTACHMENTS is enabled, then the plugin will remove any old attachments that are not needed. However if the final =&lt;dot&gt;= tag is removed, the plugin is not invoked, and the attachments will not be deleted. 
    22  
    2328<blockquote> 
    2429 
     
    2833If a topic is renamed, the ==-filehash== file in the workarea directory will be renamed as well and regeneration of attachment files will be avoided. 
    2934 
    30 | %X% *Caution* =&lt;dot&gt;= syntax is not currently compatible with the WYSIWYG editor. Raw editing is recommended, or use &lt;sticky&gt; tags to protect the dot tags. | 
    31  
    3235Also note that after changes that modify the order of generated image names, it may be necessary to refresh the browser cache with shift-reload. 
    33  
    34 Visit the [[http://www.graphviz.org/Gallery.php][Graphviz gallery]] to see some examples on what can be achieved with this plugin and Graphviz. Full documentation is available at http://graphviz.org/Documentation.php. 
     36---+++ The !GraphViz Engine 
    3537 
    3638<nop>DirectedGraphPlugin supports the following engines: 
     
    4042   * =twopi= - radial layout, after Graham Wills 97. 
    4143   * =circo= - circular layout, after Six and Tollis 99, Kauffman and Wiese 02. Suitable for certain diagrams of multiple cyclic structures. 
    42  
     44The markup is always entered between &lt;dot&gt; tags however regardless of the chosen engine. 
    4345---++ Syntax Rules 
    4446 
     
    6668 
    6769HowtoDirectedGraphs has a basic howto on creating directed graphs using dot. 
    68  
    6970---++ Examples 
    7071 
     
    475476|  Support: | http://foswiki.org/Support/%TOPIC% | 
    476477|  Change History: | <!-- versions below in reverse order --> | 
     478|  5 Apr 2009: | Foswikitask:Item8102 - Improve defaults, configure settings now optional --Foswiki:Main.GeorgeClar | 
    477479|  25 Mar 2009: | Foswikitask:Item1201, Foswikitask:Item1360 - Configure script fails on perl 5.10. %BR% Foswikitask:Item8086 - Direct File I/O failis. -- Foswiki:Main.GeorgeClark | 
    478480|  8 Jan 2009: | Foswikitask:Item8035: Uninitialized variables reported in server Error log.-- Foswiki:Main.GeorgeClark | 
     
    503505%META:FIELD{name="ExtensionClassification" attributes="" title="ExtensionClassification" value=""}% 
    504506%META:FIELD{name="ExtensionType" attributes="" title="ExtensionType" value="PluginPackage"}% 
    505 %META:FIELD{name="Compatibility" attributes="" title="[[Compatibility]]" value=""}% 
     507%META:FIELD{name="Compatibility" attributes="" title="[[Compatibility]]" value="Tested on Linux and Windows.  Windows version tested with !ActiveState perl and Strawberry perl, versions 5.8 and 5.10."}% 
    506508%META:FIELD{name="DemoUrl" attributes="" title="DemoUrl" value="http://"}% 
    507509%META:FIELD{name="DevelopedInSVN" attributes="" title="DevelopedInSVN" value="Yes"}% 
Note: See TracChangeset for help on using the changeset viewer.