@@ -14,6 +14,43 @@ import { Render2d } from './render2d.js';
14
14
* @import { GraphicsDevice } from '../../platform/graphics/graphics-device.js'
15
15
*/
16
16
17
+ /**
18
+ * @typedef {object } MiniStatsSizeOptions
19
+ * @property {number } width - Width of the graph area.
20
+ * @property {number } height - Height of the graph area.
21
+ * @property {number } spacing - Spacing between graphs.
22
+ * @property {boolean } graphs - Whether to show graphs.
23
+ */
24
+
25
+ /**
26
+ * @typedef {object } MiniStatsProcessorOptions
27
+ * @property {boolean } enabled - Whether to show the graph.
28
+ * @property {number } watermark - Watermark - shown as a line on the graph, useful for displaying a
29
+ * budget.
30
+ */
31
+
32
+ /**
33
+ * @typedef {object } MiniStatsGraphOptions
34
+ * @property {string } name - Display name.
35
+ * @property {string[] } stats - Path to data inside Application.stats.
36
+ * @property {number } [decimalPlaces] - Number of decimal places (defaults to none).
37
+ * @property {string } [unitsName] - Units (defaults to "").
38
+ * @property {number } [watermark] - Watermark - shown as a line on the graph, useful for displaying
39
+ * a budget.
40
+ */
41
+
42
+ /**
43
+ * @typedef {object } MiniStatsOptions
44
+ * @property {MiniStatsSizeOptions[] } sizes - Sizes of area to render individual graphs in and
45
+ * spacing between individual graphs.
46
+ * @property {number } startSizeIndex - Index into sizes array for initial setting.
47
+ * @property {number } textRefreshRate - Refresh rate of text stats in ms.
48
+ * @property {MiniStatsProcessorOptions } cpu - CPU graph options.
49
+ * @property {MiniStatsProcessorOptions } gpu - GPU graph options.
50
+ * @property {MiniStatsGraphOptions[] } stats - Array of options to render additional graphs based
51
+ * on stats collected into Application.stats.
52
+ */
53
+
17
54
/**
18
55
* MiniStats is a small graphical overlay that displays realtime performance metrics. By default,
19
56
* it shows CPU and GPU utilization, frame timings and draw call count. It can also be configured
@@ -24,31 +61,7 @@ class MiniStats {
24
61
* Create a new MiniStats instance.
25
62
*
26
63
* @param {AppBase } app - The application.
27
- * @param {object } [options] - Options for the MiniStats instance.
28
- * @param {object[] } [options.sizes] - Sizes of area to render individual graphs in and spacing
29
- * between individual graphs.
30
- * @param {number } [options.sizes[].width] - Width of the graph area.
31
- * @param {number } [options.sizes[].height] - Height of the graph area.
32
- * @param {number } [options.sizes[].spacing] - Spacing between graphs.
33
- * @param {boolean } [options.sizes[].graphs] - Whether to show graphs.
34
- * @param {number } [options.startSizeIndex] - Index into sizes array for initial setting.
35
- * @param {number } [options.textRefreshRate] - Refresh rate of text stats in ms.
36
- * @param {object } [options.cpu] - CPU graph options.
37
- * @param {boolean } [options.cpu.enabled] - Whether to show the CPU graph.
38
- * @param {number } [options.cpu.watermark] - Watermark - shown as a line on the graph, useful for
39
- * displaying a budget.
40
- * @param {object } [options.gpu] - GPU graph options.
41
- * @param {boolean } [options.gpu.enabled] - Whether to show the GPU graph.
42
- * @param {number } [options.gpu.watermark] - Watermark - shown as a line on the graph, useful for
43
- * displaying a budget.
44
- * @param {object[] } [options.stats] - Array of options to render additional graphs based on
45
- * stats collected into {@link AppBase#stats}.
46
- * @param {string } [options.stats[].name] - Display name.
47
- * @param {string[] } options.stats[].stats - Path to data inside {@link AppBase#stats}.
48
- * @param {number } [options.stats[].decimalPlaces] - Number of decimal places (defaults to none).
49
- * @param {string } [options.stats[].unitsName] - Units (defaults to "").
50
- * @param {number } [options.stats[].watermark] - Watermark - shown as a line on the graph, useful
51
- * for displaying a budget.
64
+ * @param {MiniStatsOptions } [options] - Options for the MiniStats instance.
52
65
* @example
53
66
* // create a new MiniStats instance using default options
54
67
* const miniStats = new pc.MiniStats(app);
0 commit comments