diff --git a/API.php b/API.php index 24da02f..ead1a53 100644 --- a/API.php +++ b/API.php @@ -20,7 +20,8 @@ use Piwik\Plugins\TreemapVisualization\Visualizations\Treemap; /** - * Class API + * Provides public API methods for treemap visualization data. + * * @method static \Piwik\Plugins\TreemapVisualization\API getInstance() */ class API extends \Piwik\Plugin\API @@ -29,18 +30,24 @@ class API extends \Piwik\Plugin\API * Gets report data and converts it into data that can be used with the JavaScript Infovis * Toolkit's treemap visualization. * - * @param string $apiMethod The API module & action to call. The result of this method is converted - * to data usable by the treemap visualization. E.g. + * @param string $apiMethod The API module and action to call. The result of this method is + * converted to data usable by the treemap visualization. Example: * 'Actions.getPageUrls'. - * @param string $column The column to generate metric data for. If more than one column is - * supplied, the first is used and the rest discarded. - * @param string $period - * @param string $date - * @param bool $availableWidth Available screen width in pixels. - * @param bool $availableHeight Available screen height in pixels. - * @param int|bool $show_evolution_values Whether to calculate evolution values for each row or not. + * @param string $column The metric column to generate treemap data for. If more than one + * column is supplied, only the first is used. + * @param string $period The period to process, processes data for the period containing the + * specified date. Allowed values: "day", "week", "month", "year", + * "range". + * @param string $date The date or date range to process. + * 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, + * lastYear), or date range ('YYYY-MM-DD,YYYY-MM-DD', lastX, previousX). + * @param int|false $availableWidth Available screen width in pixels. + * @param int|false $availableHeight Available screen height in pixels. + * @param int|bool $show_evolution_values Whether to calculate evolution values for each row. + * + * @return array Treemap root node data. Returns an empty array when no DataTable is available. * - * @return array + * @throws BadRequestException If the requested API action is not a supported get* method. */ public function getTreemapData( $apiMethod, diff --git a/CHANGELOG.md b/CHANGELOG.md index 72af7eb..5453ba9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## Changelog +# 5.0.6 - 2026-03-02 +- Updated API documentation + # 5.0.5 - 2026-02-16 - Added validation rules for ApiAction diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..6479285 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,18 @@ +parameters: + level: 1 + phpVersion: 70200 + tmpDir: /tmp/phpstan/TreemapVisualization/main + paths: + - . + excludePaths: + - tests/* + - vendor/ + - github-action-tests/ + bootstrapFiles: + - ../../bootstrap-phpstan.php + universalObjectCratesClasses: + - Piwik\Config + - Piwik\View + - Piwik\ViewDataTable\Config + scanDirectories: + - ../../ diff --git a/plugin.json b/plugin.json index ed87f26..dac8f59 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "TreemapVisualization", - "version": "5.0.5", + "version": "5.0.6", "description": "Visualise any report in Matomo as a Treemap. Click on the Treemap icon in each report to load the visualisation.", "keywords": ["treemap", "graph", "visualization", "infovis", "jit"], "license": "GPL v3+",