Section¶
The section component is identical to the
Component Generator.
Use it to nest other components within a report and to partition the data frame.
Options¶
- title:
Type(s):
[string, null], Default:NULLTitle for generated report
- description:
Type(s):
[string, null], Default:NULLDescription for generated report
- partition:
Type(s):
string[], Default:[]Partition the data using these column names - components will be rendered for each partition
- filter:
Type(s):
[string, null], Default:NULLIf provided, filter our rows which do not match this expression
- components:
Type(s):
array[], Default:[]List of component configuration objects, each component must feature a
componentkey (e.g.table_aggregate)- tabbed:
Type(s):
bool, Default:falseRender components in tabs when supported in the output renderer (e.g. HTML)
- tab_labels:
Type(s):
string[], Default:[]List of labels for tabs, will replace the default labels from left to right.
Example¶
Given the following configuration:
{
"runner.path": "NothingBench.php",
"runner.executor": "debug",
"runner.env_enabled_providers": ["test"],
"report.generators": {
"nested": {
"generator": "component",
"title": "Outer Section",
"components": [
{
"component": "section",
"title": "Inner Section",
"components": [
{
"component": "text",
"text": "Hello World"
}
]
}
]
}
}
}
When we run PHPBench with the configured report above:
phpbench run --report=nested
Then it generates the following with the console renderer:
Outer Section
=============
Inner Section
=============
Hello World