2020use 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 */
2627class 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 ,
0 commit comments