Help:Ploticus format

Jump to: navigation, search

This page contains outdated information and is thus OBSOLETE!
This documentation page applies to all SMW versions from 1.4.2 to 1.4.2.

Help:Ploticus format en 1.4.2 1.4.2

Ploticus format
Creates various plots and charts
Further Information
Provided by: Semantic Result Formats
Added: 1.4.2
Removed: 1.4.2
Requirements: none
Format name: ploticus
Enabled by default: 
Indicates whether the result format is enabled by default upon installation of the respective extension.
Authors: Joel Natividad
Categories: charts
Table of Contents

↓ INFO ↓

Note: This format was disabled, due to a security hole.

The result format ploticus, part of the Semantic Result Formats extension, creates various plots, charts, and graphics based on property values, using the Ploticus Data Display Engine.



Example 1 (Simple)

    [[Category:City]] [[located in::Germany]]
    |ploticusparams= -prefab vbars x=1 y=2 delim=comma

This query will display a rudimentary PNG bar chart showing the population of each German City.

Taking it further:

Example 2 (Imagemap-enabled)

    [[Category:City]] [[located in::Germany]]
    |ploticusparams= -prefab vbars x=1 y=2 delim=comma vals=yes labels=1
            clickmapurl=[target=new]"" clickmaplabel="@1" -csmap 
            title="Population of Cities in Germany" titledet="size=24" 

Building on Example 1, this query adds a title, with each bar labeled with its assigned value, and imagemap support (i.e. clicking on a bar opens the associated wiki article in a new window).

Taking it further still:

Example 3 (The Works!)

    [[Category:City]] [[located in::Germany]]
    |ploticusparams= -font FreeSans -prefab vbars x=1 y=2 delim=comma vals=yes labels=1 autow=yes stubvert=yes color=blue
            clickmapurl="" clickmaplabel="@1" -csmap 
            title="Population of Cities in Germany"  titledet="size=24"
            ylbl="In thousands"

In addition to what we added in Example 2, we now have a 400x600 SVG bar chart, auto-width bar sizing, labels oriented vertically, blue bars, using the more eye-pleasing FreeSans TTF font instead of "jagged" ploticus built-in fonts.

It also exposes several action icons - one to download the query result used to create the chart in CSV format, another to open the image in a new window, and the last one to refresh the whole page. A timestamp is also displayed since SRF-Ploticus uses a cache that will redraw plots only if the query result set has changed.

And using Ploticus' scripting facilities, the user can go even further and apply some simple data processing before rendering the chart (e.g. create computed values, compute totals, compute percents, do pivots, count instances, etc.)

The exhaustive README details all the available SRF-Ploticus parameters.