clearml-docs/docs/guides/reporting/html_reporting.md

80 lines
2.8 KiB
Markdown
Raw Normal View History

2021-05-13 23:48:51 +00:00
---
title: HTML Reporting
---
The [html_reporting.py](https://github.com/allegroai/clearml/blob/master/examples/reporting/html_reporting.py) example
demonstrates reporting local HTML files and HTML by URL, using the [Logger.report_media](../../references/sdk/logger.md#report_media)
method.
2022-05-22 07:27:30 +00:00
ClearML reports these HTML debug samples in the **ClearML Web UI** **>** experiment details **>**
**DEBUG SAMPLES** tab.
2021-05-13 23:48:51 +00:00
2023-09-04 12:40:42 +00:00
When the script runs, it creates an experiment named `html samples reporting` in the `examples` project.
2021-05-13 23:48:51 +00:00
![image](../../img/examples_reporting_05.png)
## Reporting HTML URLs
2021-12-27 08:41:43 +00:00
Report HTML by URL, using the [Logger.report_media](../../references/sdk/logger.md#report_media) method's `url` parameter.
2021-05-13 23:48:51 +00:00
See the example script's [report_html_url](https://github.com/allegroai/clearml/blob/master/examples/reporting/html_reporting.py#L16)
2022-01-19 12:26:14 +00:00
function, which reports the ClearML documentation's home page.
2021-05-13 23:48:51 +00:00
2021-12-27 08:41:43 +00:00
```python
2022-01-23 07:50:24 +00:00
Logger.current_logger().report_media(
"html",
"url_html",
iteration=iteration,
url="https://clear.ml/docs/latest/docs/index.html"
)
2021-12-27 08:41:43 +00:00
```
2021-05-13 23:48:51 +00:00
2021-09-09 10:17:46 +00:00
## Reporting HTML Local Files
2021-05-13 23:48:51 +00:00
Report the following using the `Logger.report_media` parameter method `local_path` parameter:
* [Interactive HTML](#interactive-html)
* [Bokeh GroupBy HTML](#bokeh-groupby-html)
* [Bokeh Graph HTML](#bokeh-graph-html)
* [Bokeh Image HTML](#bokeh-image-html)
### Interactive HTML
See the example script's [report_html_periodic_table](https://github.com/allegroai/clearml/blob/master/examples/reporting/html_reporting.py#L26) function, which reports a file created from Bokeh sample data.
2021-12-14 13:12:30 +00:00
```python
Logger.current_logger().report_media(
"html", "periodic_html", iteration=iteration, local_path="periodic.html"
)
```
2021-05-13 23:48:51 +00:00
### Bokeh GroupBy HTML
See the example script's [report_html_groupby](https://github.com/allegroai/clearml/blob/master/examples/reporting/html_reporting.py#L117) function, which reports a Pandas GroupBy with nested HTML, created from Bokeh sample data.
2021-12-14 13:12:30 +00:00
```python
Logger.current_logger().report_media(
"html",
"pandas_groupby_nested_html",
iteration=iteration,
local_path="bar_pandas_groupby_nested.html",
)
```
2021-05-13 23:48:51 +00:00
### Bokeh Graph HTML
See the example script's [report_html_graph](https://github.com/allegroai/clearml/blob/master/examples/reporting/html_reporting.py#L162) function, which reports a Bokeh plot created from Bokeh sample data.
2021-12-14 13:12:30 +00:00
```python
Logger.current_logger().report_media(
"html", "Graph_html", iteration=iteration, local_path="graph.html"
)
```
2021-05-13 23:48:51 +00:00
### Bokeh Image HTML
See the example script's [report_html_image](https://github.com/allegroai/clearml/blob/master/examples/reporting/html_reporting.py#L195) function, which reports an image created from Bokeh sample data.
2021-12-14 13:12:30 +00:00
```python
Logger.current_logger().report_media(
"html", "Spectral_html", iteration=iteration, local_path="image.html"
)
```