|
20 | 20 | use Piwik\Plugins\TreemapVisualization\Visualizations\Treemap; |
21 | 21 |
|
22 | 22 | /** |
23 | | - * Provides public API methods for treemap visualization data. |
| 23 | + * Exposes report data formatted for the Treemap visualization. |
24 | 24 | * |
25 | 25 | * @method static \Piwik\Plugins\TreemapVisualization\API getInstance() |
26 | 26 | */ |
27 | 27 | class API extends \Piwik\Plugin\API |
28 | 28 | { |
29 | 29 | /** |
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. |
32 | 31 | * |
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. |
47 | 48 | * |
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. |
51 | 51 | */ |
52 | 52 | public function getTreemapData( |
53 | 53 | $apiMethod, |
|
0 commit comments