Extension:JSWikiGantt
This extension is incompatible with MediaWiki 1.39 or any later release! You are advised against using this extension on a live site.
|
This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. |
JSWikiGantt Release status: unmaintained |
|
---|---|
Implementation | Tag |
Description | Draws Gantt charts inside wiki articles. |
Author(s) | • Extension code and fixes by Maciej "Nux" Jaros, • JSGantt by Shlomy Gantz, |
Latest version | 0.7.0 (2023-04-16) |
MediaWiki | |
License | BSD 2-clause "Simplified" License |
Download | GitHub: Note: |
"$wgJSGanttConfig" (see "JSWikiGantt.config.php" for details) |
|
<jsgantt> |
|
The JSWikiGantt extension aims to allow adding Gantt charts (diagrams) to wiki pages without exporting diagrams to PNG.
This is achieved by allowing users to add simple XML definitions of diagrams in <jsgantt>
tag. Currently, only one diagram per page is allowed (which is due to the limitations of the original JSGantt).
Usage
editTo add a diagram to a page, add a <jsgantt>
tag with <task>
tags inside it (described below).
The <jsgantt>
tag can have only one attribute:
- autolink
- if set to 1, your tasks will be automatically linked based on the task ID (useful if you use task IDs from your bug tracking software). Remember to set
$wgJSGanttConfig['TasksAutoLink']
inJSWikiGantt.config.php
if you use this. The default state of auto-linking is set with the$wgJSGanttConfig['AutoLinks']
variable.
Tasks tags
editTags that can be used inside the <task>
tag are described below.
Tag name | required? | example value | description |
---|---|---|---|
pID | yes | 10 | a task id |
pName | yes | Heal the world | a task name/title |
pStart | yes/no | 2011-01-01 | ISO style date when this task should be started; not required for groups |
pEnd | yes/no | 2011-12-31 | ISO style date when this task should end; not required for groups |
pColor | yes | 00FF00 | a color of this task on a diagram (the color of a bar that is on the right side of a diagram) |
pLink | no | http://world.peace/for-dummies | URL that can e.g., point to a description of a task (omit if you use auto links to e.g. point to your bugzilla/flyspray or whatever bug killer you use) |
pMile | no | 0 | milestone number |
pRes | no | Mr. Healer | resource name (e.g., developer that is assigned to this task) |
pComp | yes/no | 0 | task completeness percentage (0-100); not required for groups |
pGroup | no | 0 | if set to 1, this is a grouping task (use this task id as other tasks' parent to make them grouped by this task) |
pParent | no | 0 | id of a grouping task that is a parent of this task |
pOpen | no | 1 | this is only meaningful for groups - if set to 1, this group will be closed by default (subtasks will be hidden) |
pDepend | no | 11 | id of a task that this task depends on (will be indicated by an arrow) |
Note. You might skip some required values if you put tags directly in your article (loading a diagram from an external article is not advised anyway - left for backward compatibility).
Example
editExample code:
<jsgantt>
<task>
<pID>10</pID>
<pName>WCF Changes</pName>
<pColor>0000ff</pColor>
<pLink></pLink>
<pMile>0</pMile>
<pRes></pRes>
<pComp>0</pComp>
<pGroup>1</pGroup>
<pParent>0</pParent>
<pOpen>1</pOpen>
<pDepend></pDepend>
</task>
<task>
<pID>20</pID>
<pName>Move to WCF from remoting</pName>
<pStart>2010-07-11</pStart>
<pEnd>2010-07-15</pEnd>
<pColor>0000ff</pColor>
<pLink></pLink>
<pMile>0</pMile>
<pRes>Rich</pRes>
<pComp>10</pComp>
<pGroup>0</pGroup>
<pParent>10</pParent>
<pOpen>1</pOpen>
<pDepend></pDepend>
</task>
<task>
<pID>30</pID>
<pName>add Auditing</pName>
<pStart>2010-07-19</pStart>
<pEnd>2010-07-21</pEnd>
<pColor>0000ff</pColor>
<pLink></pLink>
<pMile>0</pMile>
<pRes>Mal</pRes>
<pComp>50</pComp>
<pGroup>0</pGroup>
<pParent>10</pParent>
<pOpen>1</pOpen>
<pDepend>20</pDepend>
</task>
</jsgantt>
Diagram options
editAs of 0.6.0, you can set some extra Gantt options from the MediaWiki code, e.g.:
<jsgantt option-caption-type="Complete" option-show-resource="1" option-show-duration="1">
...
</jsgantt>
Those options allow you to enable features for specific Gantt diagrams without changing the extension configuration.
Available options
editAll of the available options are:
option-show-responsible
- show responsible column (defaults to 0 - hidden)option-show-duration
- show duration column (defaults to 0 - hidden)option-show-precent-complete
- show percent complete column (defaults to 0 - hidden)option-show-start-date
- show start date column (defaults to 0 - hidden)option-show-end-date
- show end date column (defaults to 0 - hidden)option-caption-type
- task caption (right side annotation) type. Available types: None, Caption, Resource (default), Duration, Complete.
Using options in MediaWiki 1.16
editNote! Those options will NOT work in MediaWiki 1.16 or lower. You need to patch includes/Sanitizer.php
by changing:
$attrib = '[A-Za-z0-9]';
to:
$attrib = '[A-Za-z0-9\-]';
Installation
edit- Download, extract and place the files them under
$IP /extensions/JSWikiGantt
- At the end of LocalSettings.php , add:
require_once "$IP/extensions/JSWikiGantt/JSWikiGantt.php";
- Installation can now be verified through
Special:Version
on your wiki - If you use Apache's mod_rewrite to beautify your wiki's URLs, add a RewriteCond to Apache's config to exclude the path to your JSWikiGantt installation from rewriting. Example:
RewriteCond %{REQUEST_URI} !^/YOUR_WIKI_PATH/extensions/(JSWikiGantt|MORE_EXTENSIONS_THAT_NEED_TO_LOAD_JS-FILES_FROM_THEIR_PATH)/
See also
edit- Extension:JSWikiGanttFrontEnd - Front-end interface for editing the Gantt chart
- Extension:JobSchEd - interface for editing one of the types of Gantt diagrams
- Extension:EasyTimeline - other timeline drawing extension