Help:Tagcloud format

From semantic-mediawiki.org
(Redirected from Help:Tagcloud format)
Help:Tagcloud format标签云格式
Tagcloud format
Displays queried data in a tagcloud
Collection
Further Information
Provided by: Extension "Semantic Result Formats"
Added: 1.5.3
Removed: still supported
Requirements: none
Format name: tagcloud
Enabled? Indicates whether the result format is enabled by default upon installation of the respective extension. yes
Authors: Jeroen De Dauw , James Hong Kong
Categories: misc
Keywords
Table of Contents

The result format tagcloud, part of the Extension "Semantic Result Formats" extension, can be used to display result values in a tag cloud. It has been written by Jeroen De Dauw for WikiWorks and is partly based on code from the FolkTagCloud extension.

Parameters[edit]

Parameter Type Default Description
template text empty The name of a template with which to display the printouts
userparam text empty A value passed into each template call, if a template is used
excludetags text empty Exclude tags (delimiter: ";")
includesubject yes/no no ⧼srf-paramdesc-includesubject⧽
tagorder text alphabetical The order of the tags
increase text log How to increase the size of tags
widget text empty Available widget
class text empty An additional CSS class to set for the list
font text impact ⧼srf-paramdesc-font⧽
height whole number 400 Height
width whole number 400 Width
mincount whole number 1 The minimum amount of times a value needs to occur to be listed
minsize whole number 77 The size of the smallest tags in percent
maxsize whole number 242 The size of the biggest tags in percent
maxtags whole number 1000 The maximum amount of tags in the cloud

With the deployment of SRF 1.8 the tagcloud format will support template inclusion,a sphere widget, class parameter, and wordcloud widget.

Usage[edit]

A simple example - displaying a tag cloud of authors of books:

{{#ask:
 [[Category:Books]]
 |?Has author
 |format=tagcloud
}}

Displaying a tag cloud of things with the most related items. The pages themselves are also listed, as they are related to themselves. Depending on the cloud order, the biggest tags are shown first (tagorder=desc) and limited by the parameter limit=.

Styling support[edit]

Assigning cascading style sheet classes (classs=) to a tagcloud query will influence its positioning, width/height etc.. The width= and height= parameters are only recognized by a widget type output.

.demo-30-percent-width {
    width:30%;
    clear:both;
}
.demo-float-right {
    clear:both;
    float:right;
    margin-left:10px;
    margin-bottom:10px;
}
{{#ask:
 [[Category:Books]]
 |?Has author
 |format=tagcloud
 |class=demo-30-percent-width demo-float-right
}}

Template support[edit]

In a scenario where a page title is represented by a unique ID rather than a human readable title a inclusion template can be used to retrieve and replace a tag with a human readable name (stored as property-value pair). (See example Template:tagcloud.tag.title)

Wordcloud widget[edit]

The widget shows tags as word cloud map using d3.cloud.js plug-in. (see here)

Sphere widget[edit]

The sphere output implements some basic settings but for a more elaborate option set, please adjust the JavaScript accordingly. (See available options).

The plugin that is used to create the sphere output requires that tags are a link type entity therefore normal text (of type string etc.) entities need to be converted into a link type using a template (see above) that creates a wiki link (such as [[{{{1}}}]]). The class parameter can be used to position the tagcloud easily within a page.

Examples[edit]