Difference between revisions of "Ploticus extension"
(→Example 2 (dynamic version)) |
|||
| (5 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| + | === Ploticus Tool === | ||
[http://ploticus.sourceforge.net/doc/welcome.html PLOTICUS] is a free softwarere package for creating plots and charts. | [http://ploticus.sourceforge.net/doc/welcome.html PLOTICUS] is a free softwarere package for creating plots and charts. | ||
| − | The [http://mediawiki.org/Extension:Ploticus Mediawiki Extension:Ploticus] allows to embed Ploticus into a Mediawiki installation. | + | === Ploticus Extension === |
| + | The [http://www.mediawiki.org/wiki/Extension:Ploticus Mediawiki Extension:Ploticus] allows to embed Ploticus into a Mediawiki installation. When using the ''Ploticus Extension'' you have to deliver a script which contains the data on which the chart shall be based. | ||
| − | + | This is where DPL comes into the game: DPL can be used to extract that data from information contained in the articles of your wiki. For that purpose we made a small modification to the ''Ploticus Extension'': Our modified version can take data not only from a hand-written script but also from the output of a DPL script. | |
| − | + | Our version of the ''MediaWiki Ploticus Extension'' is contained in the [[Download|Download Archive of DPL]]. | |
| + | |||
| + | == Example 1 (static version) == | ||
| + | |||
| + | {| | ||
| + | | | ||
| + | <pre> | ||
| + | {{#ploticus: | ||
| + | |||
| + | # get data from DPL query | ||
| + | #proc getdata | ||
| + | data: | ||
| + | "Jack" 151 | ||
| + | "Jim" 23 | ||
| + | "Susan" 123 | ||
| + | |||
| + | // render pie graph | ||
| + | #proc pie | ||
| + | datafield: 2 | ||
| + | labelfmtstring: @@1\n@@2\n@@PCT% | ||
| + | labelmode: line+label | ||
| + | center: 3 3 | ||
| + | radius: 1.1 | ||
| + | colors: dullyellow drabgreen pink | ||
| + | labelfarout: 1.2 | ||
| + | explode: 0 0.2 0 0 | ||
| + | |||
| + | }} | ||
| + | </pre> | ||
| + | | | ||
| + | {{#ploticus: | ||
| + | |||
| + | # get data from DPL query | ||
| + | #proc getdata | ||
| + | data: | ||
| + | "Jack" 151 | ||
| + | "Jim" 23 | ||
| + | "Susan" 123 | ||
| + | |||
| + | // render pie graph | ||
| + | #proc pie | ||
| + | datafield: 2 | ||
| + | labelfmtstring: @@1\n@@2\n@@PCT% | ||
| + | labelmode: line+label | ||
| + | outlinedetails: color=blue | ||
| + | center: 3 3 | ||
| + | radius: 1.1 | ||
| + | colors: dullyellow drabgreen pink powderblue lavender | ||
| + | labelfarout: 1.2 | ||
| + | explode: 0 0.2 0 0 | ||
| + | |||
| + | }} | ||
| + | |} | ||
| + | |||
| + | == Example 2 (dynamic version) == | ||
| − | + | The chart shows the usage count of some articles. | |
| + | You can visit an article and see how the chart reflects the changed count. | ||
| + | |||
| + | {| | ||
| + | | | ||
| + | <pre><nowiki> | ||
| + | {{#ploticus: | ||
| + | |||
| + | # get data from DPL query | ||
| + | #proc getdata | ||
| + | data: | ||
| + | {{UsageCount|African Union member states}} | ||
| + | |||
| + | // render pie graph | ||
| + | #proc pie | ||
| + | datafield: 2 | ||
| + | labelfmtstring: @@1\n@@2\n@@PCT% | ||
| + | labelmode: line+label | ||
| + | center: 3 3 | ||
| + | radius: 1.1 | ||
| + | colors: dullyellow drabgreen pink | ||
| + | labelfarout: 1.2 | ||
| + | explode: 0 0.2 0 0 | ||
| + | |||
| + | }} | ||
| + | </nowiki></pre> | ||
| + | | | ||
| + | {{#ploticus: | ||
| + | |||
| + | # get data from DPL query | ||
| + | #proc getdata | ||
| + | data: | ||
| + | {{UsageCount|African Union member states}} | ||
| + | |||
| + | // render pie graph | ||
| + | #proc pie | ||
| + | datafield: 2 | ||
| + | labelfmtstring: @@1\n@@2\n@@PCT% | ||
| + | labelmode: line+label | ||
| + | outlinedetails: color=blue | ||
| + | center: 3 3 | ||
| + | radius: 1.1 | ||
| + | colors: dullyellow drabgreen pink powderblue lavender | ||
| + | labelfarout: 1.2 | ||
| + | explode: 0 0.2 0 0 | ||
| + | |||
| + | }} | ||
| + | |} | ||
Latest revision as of 09:38, 20 August 2012
Contents
Ploticus Tool
PLOTICUS is a free softwarere package for creating plots and charts.
Ploticus Extension
The Mediawiki Extension:Ploticus allows to embed Ploticus into a Mediawiki installation. When using the Ploticus Extension you have to deliver a script which contains the data on which the chart shall be based.
This is where DPL comes into the game: DPL can be used to extract that data from information contained in the articles of your wiki. For that purpose we made a small modification to the Ploticus Extension: Our modified version can take data not only from a hand-written script but also from the output of a DPL script.
Our version of the MediaWiki Ploticus Extension is contained in the Download Archive of DPL.
Example 1 (static version)
{{#ploticus:
# get data from DPL query
#proc getdata
data:
"Jack" 151
"Jim" 23
"Susan" 123
// render pie graph
#proc pie
datafield: 2
labelfmtstring: @@1\n@@2\n@@PCT%
labelmode: line+label
center: 3 3
radius: 1.1
colors: dullyellow drabgreen pink
labelfarout: 1.2
explode: 0 0.2 0 0
}}
|
{{#ploticus:
data: "Jack" 151 "Jim" 23 "Susan" 123 // render pie graph
datafield: 2 labelfmtstring: @@1\n@@2\n@@PCT% labelmode: line+label outlinedetails: color=blue center: 3 3 radius: 1.1 colors: dullyellow drabgreen pink powderblue lavender labelfarout: 1.2 explode: 0 0.2 0 0 }} |
Example 2 (dynamic version)
The chart shows the usage count of some articles. You can visit an article and see how the chart reflects the changed count.
{{#ploticus:
# get data from DPL query
#proc getdata
data:
{{UsageCount|African Union member states}}
// render pie graph
#proc pie
datafield: 2
labelfmtstring: @@1\n@@2\n@@PCT%
labelmode: line+label
center: 3 3
radius: 1.1
colors: dullyellow drabgreen pink
labelfarout: 1.2
explode: 0 0.2 0 0
}}
|
{{#ploticus:
data: category = African Union member states"Cameroon" %COUNT% "Nigeria" %COUNT% "Somalia" %COUNT% "Sudan" %COUNT%
datafield: 2 labelfmtstring: @@1\n@@2\n@@PCT% labelmode: line+label outlinedetails: color=blue center: 3 3 radius: 1.1 colors: dullyellow drabgreen pink powderblue lavender labelfarout: 1.2 explode: 0 0.2 0 0 }} |