Skip to content

Commit fe36000

Browse files
authored
Consistent API docs, #PG-5079 (#83)
* docs: updated API documentation to be more consistent * Updated changelog
1 parent b9b5d03 commit fe36000

3 files changed

Lines changed: 24 additions & 21 deletions

File tree

API.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,34 @@
2020
use Piwik\Plugins\TreemapVisualization\Visualizations\Treemap;
2121

2222
/**
23-
* Provides public API methods for treemap visualization data.
23+
* Exposes report data formatted for the Treemap visualization.
2424
*
2525
* @method static \Piwik\Plugins\TreemapVisualization\API getInstance()
2626
*/
2727
class API extends \Piwik\Plugin\API
2828
{
2929
/**
30-
* Gets report data and converts it into data that can be used with the JavaScript Infovis
31-
* Toolkit's treemap visualization.
30+
* Returns report data formatted for the Treemap visualization.
3231
*
33-
* @param string $apiMethod The API module and action to call. The result of this method is
34-
* converted to data usable by the treemap visualization. Example:
35-
* 'Actions.getPageUrls'.
36-
* @param string $column The metric column to generate treemap data for. If more than one
37-
* column is supplied, only the first is used.
38-
* @param string $period The period to process, processes data for the period containing the
39-
* specified date. Allowed values: "day", "week", "month", "year",
40-
* "range".
41-
* @param string $date The date or date range to process.
42-
* 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth,
43-
* lastYear), or date range ('YYYY-MM-DD,YYYY-MM-DD', lastX, previousX).
44-
* @param int|false $availableWidth Available screen width in pixels.
45-
* @param int|false $availableHeight Available screen height in pixels.
46-
* @param int|bool $show_evolution_values Whether to calculate evolution values for each row.
32+
* @param string $apiMethod The API module and action to call. Must reference a supported `get*`
33+
* action, for example `Actions.getPageUrls`.
34+
* @param string $column The metric column to generate treemap data for. If multiple columns are
35+
* provided, only the first one is used.
36+
* @param 'day'|'week'|'month'|'year'|'range' $period The period to process, processes data for
37+
* the period containing the specified date.
38+
* @param string $date The date or date range to process.
39+
* 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth,
40+
* lastYear), or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX).
41+
* @param int|false $availableWidth Available screen width in pixels used to truncate the
42+
* treemap to the visible area.
43+
* @param int|false $availableHeight Available screen height in pixels used to truncate the
44+
* treemap to the visible area.
45+
* @param bool|int $show_evolution_values Whether to include evolution values for each row.
46+
* This is ignored for range periods and subtable
47+
* requests.
4748
*
48-
* @return array<string, mixed> Treemap root node data. Returns an empty array when no DataTable is available.
49-
*
50-
* @throws BadRequestException If the requested API action is not a supported get* method.
49+
* @return array<string, mixed> The treemap root node data, or an empty array when the
50+
* request does not produce a DataTable.
5151
*/
5252
public function getTreemapData(
5353
$apiMethod,

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Changelog
22

3+
# 5.0.7 - 2026-04-27
4+
- Updated API documentation
5+
36
# 5.0.6 - 2026-03-02
47
- Updated API documentation
58

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "TreemapVisualization",
3-
"version": "5.0.6",
3+
"version": "5.0.7",
44
"description": "Visualise any report in Matomo as a Treemap. Click on the Treemap icon in each report to load the visualisation.",
55
"keywords": ["treemap", "graph", "visualization", "infovis", "jit"],
66
"license": "GPL v3+",

0 commit comments

Comments
 (0)