Skip to content

Commit 9241da3

Browse files
committed
Updated API documentation
1 parent 5dd974e commit 9241da3

4 files changed

Lines changed: 40 additions & 12 deletions

File tree

API.php

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

2222
/**
23-
* Class API
23+
* Provides public API methods for treemap visualization data.
24+
*
2425
* @method static \Piwik\Plugins\TreemapVisualization\API getInstance()
2526
*/
2627
class API extends \Piwik\Plugin\API
@@ -29,18 +30,24 @@ class API extends \Piwik\Plugin\API
2930
* Gets report data and converts it into data that can be used with the JavaScript Infovis
3031
* Toolkit's treemap visualization.
3132
*
32-
* @param string $apiMethod The API module & action to call. The result of this method is converted
33-
* to data usable by the treemap visualization. E.g.
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:
3435
* 'Actions.getPageUrls'.
35-
* @param string $column The column to generate metric data for. If more than one column is
36-
* supplied, the first is used and the rest discarded.
37-
* @param string $period
38-
* @param string $date
39-
* @param bool $availableWidth Available screen width in pixels.
40-
* @param bool $availableHeight Available screen height in pixels.
41-
* @param int|bool $show_evolution_values Whether to calculate evolution values for each row or not.
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.
47+
*
48+
* @return array<string, mixed> Treemap root node data. Returns an empty array when no DataTable is available.
4249
*
43-
* @return array
50+
* @throws BadRequestException If the requested API action is not a supported get* method.
4451
*/
4552
public function getTreemapData(
4653
$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.6 - 2026-03-02
4+
- Updated API documentation
5+
36
# 5.0.5 - 2026-02-16
47
- Added validation rules for ApiAction
58

phpstan.neon

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
parameters:
2+
level: 1
3+
phpVersion: 70200
4+
tmpDir: /tmp/phpstan/TreemapVisualization/main
5+
paths:
6+
- .
7+
excludePaths:
8+
- tests/*
9+
- vendor/
10+
- github-action-tests/
11+
bootstrapFiles:
12+
- ../../bootstrap-phpstan.php
13+
universalObjectCratesClasses:
14+
- Piwik\Config
15+
- Piwik\View
16+
- Piwik\ViewDataTable\Config
17+
scanDirectories:
18+
- ../../

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.5",
3+
"version": "5.0.6",
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)